Spiga
Showing posts with label HOWTO. Show all posts
Showing posts with label HOWTO. Show all posts

Graphical memory usage map using gmemusage

I am a heavy multitasker. I run a lots of apps at once.. sometimes to the point where this dual screen 22" + 14" setup still feels like I need more screen. However, screen space is not the primary problem, but RAM/Swap utilization instead. Its not unusual for me to have 95%+ RAM 90%+ swap (on a 1.2GB RAM with 1.2GB swap machine) utilization with all the apps I ran and freeing the RAM is kindof a tricky task.

I usually use ps and top to detect apps that consume a lot of RAM and stop them. However, the values shown on the commands are hard to be quickly identified due to the scheme of Virtual, Shared, Resident, Swap does not show the values on how I would expect it to be.

So I went googling and I found out about a very ancient tool ported from SGI IRIX called gmemusage. It shows a graphical representation of the memory consumption by apps running on the system in a quite useful display.



Now I can efficiently find apps that uses lots of memory and free up my RAM without resorting to a reboot.

Yum search gmemusage yielded no result. So, a new package review sent #447080

12 YUM Tips and Tricks

YUM Update Manager is the default package manager used in Fedora and Fedora derivatives. It is written in Python and have tonnes of features which average Joe might not know about. These additional features helps a lot on maintaining your system, improving your experience using the package manager and become more productive. Granted, yum depsolving and querying is quite slow compared with APT, but the flexibility and power yum grant to its users, its worth it.

To my comrade, Surface, here, as you requested.

Tips 1: Fastest Mirror

This is usually the very first yum plugin I install in a new Fedora deployment. What does it do?, well, the name tell it all. The plugin will time all the servers in the replied mirrorlist from mirrors.fedoraproject.org, and pick the one which is the fastest for you. Everything is done automagically, and considering its a YumCore class of plugin, it works with whatever GUI you use for yum.

To install this plugin, use

yum install yum-fastestmirror

Unlike APT which you had to pick the fastest mirror yourself, yum handles this more elegantly

The plugin, after it has checked which server is the fastest, it will store a metadata in /var/cache/yum/timedhosts.txt . That metadata will expire after some time. However, if somehow, the cached timedhosts are no longer fast, you can easily force yum to recheck for fastestmirror by deleting that file.

Tips 2. Security Only Update

This tips helps a lot for users who can't keep up with Fedora updates. Fedora is well known for its very fast updating "updates" repository. Things get old quite fast in Fedora. Some people however, are afraid of updating their system to the latest updates packages, mainly because sometimes, these updates, suddenly break stuff as Fedora updates are not backport of fixes but rather moving forward to a newer version. One way to get around this overly sized and numbered updates is by only updating the system with security updates. Theres a plugin for yum for this purpose, and you can install it through

yum install yum-security

To use this plugin to update your computer to the latest security fixes, just use

yum --security update

I have a detailed post about this plugin here

Tips 3: Presto

If you are on a budget internet connection with very limited bandwidth, yum-presto is for you. The presto plugin will download deltarpms, which are the changes of the current version installed in your computer and the one on the internet. This will drastically reduce your download size and you can get your updates faster.

Work is being done to integrate Presto to Fedora's base repositories, however, the developers are still facing problem trying to integrate Presto with Koji and Bodhi, the buildsystem and the updates pushing system of Fedora. Therefore you will need to configure Presto after installation by following the details at http://fedorahosted.org/presto/

To install this plugin, use:

yum install yum-presto

Tips 4: Do NOT Mix Repositories!

Mixing repositories .. is BAD. There are a lot of repositories out there for you to choose from if you google enough. However, these repositories doesn't necessarily compatible with Fedora base repositories or between each other. I would only recommend users to install only Livna and small repositories which provide a small number of packages like Adobe Linux flash repository or Google's Apps repositories. Livna is the best because of their packages follow closely with Fedora's Packaging Guideline, so, you can expect that their quality of packages are as good as the real thing.

Good news that Livna, Freshrpms and Dribble are merging to form RPMFusion. Until RPMFusion is launched, just stick with Livna.

Tips 5: Broken dependencies? Skip them

Once you start installing 3rd party repositories, broken dependencies is a risk you will need to take on. This usually happens when the base repository and the 3rd party repository's packages are not in sync with each other. There is a yum plugin to help you automatically skip these broken dependencies together with packages which are affected by it. Its called yum-skipbroken. In rawhide F9, skip-broken have been merged with the core yum. I am not sure about F8.

To use it, just use the --skip-broken option parameter on the command line.

yum --skip-broken update

If the option is not available for your Fedora installation, try installing the plugin through

yum install yum-skipbroken

Tips 6: Using proprietary drivers? lock your Xorg and Kernel version!

This plugin is very useful for users who are using proprietary drivers or kernel modules and would like certain packages to remain as it is to avoid breaking the drivers. I found this useful when I installed Fedora in a friend's computer and he/she needed to use a proprietary driver. I would lock his/her kernel and xorg from upgrading (yes, somehow this approach feels ugly, but it helps preventing them away from updating things which might break the driver)

To install, use:

yum install yum-versionlock

Documentation on how to use it is available in /usr/share/doc/yum-versionlock-%{version}/README

Tips 7: Keep the cache for future use

Yum by default does not keep it cached downloads. You can change this behaviour through editing the yum config and change keepcache=1.

The yum cache directory, /var/cache/yum can be useful if you are going to play around a lot to the point that you might need to reinstall you Fedora installation frequently. It helps saving some time to redownload all those packages all over again. Just copy the rpm packages in that directory out, and you can reuse it later. You can also create a repository out of it using createrepo.

Tips 8: For organizations, create local mirrors!

It easy to create local mirrors for YUM repositories. There are several way of doing it - Rsync, or reposync (provided by yum-utils package). In normal situation I would recommend using rsync, but for poor me who in a college that blocks rsync, I uses reposync. Reposync downloads through http, but a bit harder to use to setup a usable repository.

A documentation on how to start contributing as a mirror is available here: http://fedoraproject.org/wiki/Infrastructure/Mirroring.

After you've get your mirror synced, get yourself a Fedora Account, and register yourself with Fedora's MirrorManager. The beauty here is, from the MirrorManager, you can set, for example, any requests for mirrorlist from your organization's public IP, will be replied with the URL to the mirror in your LAN IP. Your users won't know that they are using a LAN mirror! It JustWorks!. This is something APT won't give you :P. You can also set your mirrors to be available to certain range of IP/countries or not.

Tips 9: Detect problems early. Use package-cleanup

Sometimes, you might get your installation interrupted or some crazy happening which your installed package database goes crazy with duplicate packages or broken dependencies. There is one tool which helps a lot in tracing the problem and its called package-cleanup. This tool is provided by the yum-utils package, so to acquire it,

yum install yum-utils

Several common commands I usually use:

package-cleanup --dupes # list out duplicates
package-cleanup --cleandupes # clean up duplicates
package-cleanup --problems # list out packages with broken dependencies


More options? .. invoke the --help parameter

Tips 10: Download packages for usage later, together with dependencies

Sometime, you might want to download packages with its dependencies but without installing it and you want to have it easily copyable to another computer with exactly the same installed package list with your computer. yumdownloader (provided by yum-utils package) tool is great for this. You can use it to, for example, build reusable packs for a bunch of identical computers, and distribute them. You can also use it for grabbing the source rpm of a package, just in case you want to hack some stuff from the package.

My usual use of yumdownloader:


# download source package
yumdownloader --source packagename

# download a package, together with
# dependencies needed on my computer
yumdownloader --resolve packagename

# download a package, together with
# dependencies needed on a different
# chroot/mounted Fedora install
yumdownloader --resolve packagename --root /path/to/chroot


Theres another trick of using the yumdownloader with chroot, by copying /var/lib/rpm folder, you can make use of the rpm profile to download packages for a friend's computer and pass it in a CD. This concept is what being used in opyum (a similar tool like APTonCD) to build what debarashi call as YumPacks. Opyum is cool, but somehow I feel creating the set manually is more comfortable for me. Telling a user to pass me the /var/lib/rpm folder is much easier and quicker rather than telling them to install opyum and guide them through how to create a profile. Though, that is my personal preference, opyum is still a great tool to use for "users" who don't know how to mess with the CLI tricks.

Tips 11: Clean caches first if somehow yum behave weirdly

Sometimes the files cached in your computer might be broken because of some reason or another (I usually getting this problem in my university, with my hackish Fedora repository mirror - so, the metadata tend to be a crazy broken metadata once in a while). Try cleaning the cache first and retry. Chances are the problem is from there. To clean whatever cached files in your yum cache, use:

yum clean all

Tips 12: When yum fails miserably for everything, fear not, APT and Smart are there to save the day

Fedora have APT too!!!. Those from debian roots who can't seem to get away from APT, just install apt-rpm. You'll get your familiar package manager again~ :D. Another available package manager for Fedora is smart.

One beauty about apt-rpm and smart on Fedora, they all uses the generic repository metadata similar to yum. That means, all yum repositories will work with apt-rpm and smart effortlessly!. Nice eh?. hehe

EOTipsList

Thats all the tips that I can recall during the writing of this post. I might have other tricks behind my head somewhere, but could not recall it at this moment. The only next time I might remember it is when I faced a problem which made me recalled it.

Enjoy with yum. Its a fun, yummy package manager once you get the hang of it. A final tips, not useful for "users", but useful for python hackers, Yum plugins are easy to write, and it can make use any python libraries. If you need a particular special-case feature for your own use, you can get more information how to write your own custom plugin here: http://wiki.linux.duke.edu/WritingYumPlugins. I myself wrote one hackish plugin for people in my university to get to my repository. My university network layout and restrictions sucks bigtime, so, I had to write something to automatically create a tunnel to my repository and let users yum through the tunnel - seamlessly. The users doesn't even need to learn how to tunnel, it JustWorks.

Have Fun~ :D

HOWTO: Enabling Bridging for Libvirtd QEMU

I need to implement an SNMP setup for Inigo, and I need a number of virtual machines for understanding SNMP and for testing and exploring possible solutions. Before this, I used Xen through virt-manager for my virtualization needs, but recently it feels like its more pain in the ass when I need to install various distro and OSes on the VM to test. Plus, Xen caused some weird problems which I don't really understand (one of it are the Xen bridging, on random, refused to work after reboot). So, I switched to use the normal kernel with Qemu instead to avoid the headache.

Thanks to Jonathan (daMaestro), I got the Qemu bridge working. The howto I followed from watzmann.net does not work for me because of what I believe some missing details for me understand the setup and set it properly.

Creating a Bridge

Lets assume we want to create a bridge called br0, which will be bridged to eth0. The host will be using a static IP 192.168.0.20 on a /24 network, with a gateway 192.168.0.1.

Edit /etc/sysconfig/network-scripts/ifcfg-br0. Change it to be similar to this.


DEVICE=br0
BOOTPROTO=static
IPADDR=192.168.0.20
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
ONBOOT=yes
TYPE=Bridge


Then, edit /etc/sysconfig/network-scripts/ifcfg-eth0 to this.


DEVICE=eth0
HWADDR=$MACADDRESS
ONBOOT=yes
BRIDGE=br0


(Replace $MACADDRESS with the MAC address of your network card.)

Afterward, restart the network `/sbin/service network restart`

From this point, you should be able to select the bridge when you are creating a new VM through virt-manager.

Firewall

You will need to set br0 as a trusted interface through system-config-firewall before you'll be able to use the network.

Yay, now I feel much more comfortable on Qemu.

HOWTO: Controlling cpu temperature and scaling using cpuspeed

My beloved R51 which I bought almost 3 years ago is suffering of old-age. It processor heats up quite fast to 80/85 Celsius and sometimes triggered shutdown alarm on 90C. The temperature during idle is around 50C, which is pretty hot. Adding external fan and overriding the speed of the internal fan doesn't help much.

Whenever it goes to 80C, I manually scale down the processor to cool it down. Hassle, but at least it works. However, there is an easier way to control this without any manual interaction, and that is through using the cpuspeed daemon. It should have been installed by default in your computer. If it isn't , you can install it through:

yum install cpuspeed

cpuspeed in Fedora by default only turns on the default scaling governor and didn't do anything else. You will need to configure it through /etc/sysconfig/cpuspeed.

Remember to set the Governor to "userspace" or your cpuspeed will not be started through the init script.

In my setup to ensure that I don't burn my processor too much, I set my UP_THRESHOLD=99 DOWN_THRESHOLD=90, and uncommented the lowest line for the temperature check and set the max temperature as 75. Yes, theres no scientific explanation to explain whether the values I selected is good or not. I simply set in so that my processor will only scale up if its being used 100%, scales down as soon as the processor usage reduce to 90%, and forbid scaling up if the temperature is above 75C.

Once you have configured it, restart cpuspeed

/sbin/service cpuspeed restart

After I applied those above, my processor doesn't gets hot easily anymore :D. Yay~.

Automated tar and dump incremental backup script for FBSD

The recent gmirror failure on Gambit caused us to switch to automated dump and tar instead.

Our requirement was like this: Full backup on Mondays (around 3-5am) with daily incremental backups relative to the Monday backup. Whenever a full backup is being performed, the previous backups must not be overwritten until the full backup is done.

And the results::

inigo-tarball-backups.sh - an incremental tar backup script using FreeBSD's Tar

inigo-disk-dumps.sh - an incremental live dump script using FreeBSD's Dump - now, I wish Linux's Dump have live dump support.

gnu-tar-incremental-backup.sh - an incremental tar backup script using GNU's Tar - I wrote this before the FreeBSD's Tar script on my Fedora laptop, but was surprised that FreeBSD's Tar doesn't have --listed-incremental option (-_-)".


For the scheduling, I just use cron.

Do inform me if you have suggestions to improve the scripts or if you found any risky bug it in.

update: Anybody knows how to properly tar a live directory? (eg: /var/log/).

HOWTO: Making QT apps on GNOME less ugly

On Fedora GNOME installation, QT applications by default, look darned fugly. This is because there are no settings that point the QT apps to the correct style and themes. Solving this is easy:

First,
yum install kdebase kdeartwork

Then,
kcontrol

Open ``Appearance and Themes > Style`` and change your KDE style to one with better looks, apply and save it.

Done.

RPM Package Rollback

One of the least known feature in RPM is that it has a rollback feature. This allows you to rollback any updates you have done to your installed packages. Quite useful if a recent update broke your system.

From http://www.oreillynet.com/onlamp/blog/2006/01/rpm_rollback_in_fedora_core_45.html


  1. To configure yum to save rollback information, add the line tsflags=repackage to /etc/yum.conf.

  2. To configure command-line rpm to do the same thing, add the line %_repackage_all_erasures 1 to /etc/rpm/macros.

  3. Install, erase, and update packages to your heart’s content, using pup, pirut, yumex, yum, rpm, and the yum automatic update service.


If/when you want to rollback to a previous state, perform an rpm update with the –rollback option followed by a date/time specification. Some examples: rpm -Uhv –rollback ‘9:00 am’, rpm -Uhv –rollback ‘4 hours ago’, rpm -Uhv –rollback ‘december 25′.


But remember that rollback takes up quiet a lot of space on /var . I won't do this Fedora as Fedora have quite frequent updates. But if you are running an important server on CentOS or RHEL, you might want to turn this feature on. It would be nice if somebody implements deltarpms support for rpm rollback. I believe it gonna save a lot of space.

HOWTO: Making VIM in FreeBSD, Linux-user friendly

The hellish semester have ended, and I just started my 8 month internship with Inigo-Tech. I've also got an access to the company's FreeBSD server. However, one thing annoys me - the VIM acts in a way i'm not familiar with.

A quick hack to resolve this annoyance.

from the linux box
scp /etc/vimrc server.host.com:/path/to/homefolder/.vimrc

done~

HOWTO: Compiz Fusion in Fedora 8 'Werewolf'

Fedora 8 'Werewolf' is just around the corner HERE!!. Lets get this started!

This guide applies for Fedora 9 'Sulphur' too

CCSM should be in the updates repository already. If it havent, take it here ccsm-0.6.0-3.fc8.noarch.rpm


NOTE: This howto assumes that compiz is already able to run on you hardware. If not, you might google for howto for that first. For NVidia users, install the Livna repositories an yum for kmod-nvidia and reboot. For ATI users, if your card is older than Radeon 9600, it should work out-of-the-box, if not, you will need to wait until ATI releases a new driver for kernel 2.6.23 and yum for kmod-fglrx from Livna after it has been released. Intel user (like me) cheer to yourself as it works out-of-the-box.

Compiz & Compiz Fusion in Fedora 8

Fedora 8 includes Compiz 0.6.2 on its release. However, Compiz Fusion packages are not included together in the default installation due to several reasons (one of it was libcompizconfig, ccsm, compizconfig-python packages got approved quite late) . Nevertheless, Compiz Fusion components are all available in the repositories and you can install it easily (though some work had to be done manually if you want to configure compiz using CCSM and start it properly on boot)

Getting the core bits

First, you will need to get the compiz-fusion plugins installed in your computer. The packages can be acquired easily through YUM.

yum install compiz-fusion compiz-fusion-extras

If you are using GNOME and would want to use a desktop-specific tool to configure compiz, you might want to install the GConf schemas from the -gnome packages

yum install compiz-fusion-gnome compiz-fusion-extras-gnome

With those packages installed, you now basically have Compiz Fusion in your computer and you can use the plugins if you know how to enable them. Compiz in Fedora, however, uses 'glib gconf' as its configuration backend, therefore, if you want to enable the plugins, you will had to run gconf-editor and edit the plugins configurations manually there.

Installing & configuring Compiz to use Libcompizconfig

CCSM is an easy to use configurator for Compiz by the Compiz Fusion project. However, if you want to make use of CCSM, you will need to configure compiz to make use of Libcompizconfig configuration backend instead of the desktop-specific GConf backend.

First, install libcompizconfig, ccsm and the launcher for compiz called compiz-manager. Compiz-manager is a launcher for compiz which will load compiz with 'ccp' plugin if libcompizconfig is installed in a computer, and will load 'glib gconf' if its not.

yum install libcompizconfig ccsm compiz-manager

Now, start compiz using compiz-manager
compiz-manager

Compiz is now ready to be use with CCSM. You can launch CCSM at System > Preferences > Look and Feel > CompizConfig Settings Manager.

Setting up compiz to run on startup

Add compiz-manager into your startup applications list. For GNOME users, System > Preferences > Personal > Sessions > Startup Programs.

P/s: Another method for GNOME is below, but i think this way is ugly and will require redo with every update of gnome-session package.

For GNOME users, first, enable compiz through the desktop-effects utility at System > Preferences > Look and Feel > Desktop Effects.

Then, edit /usr/bin/gnome-wm, scroll down until you find a line that looks like this

OPT3=glib
OPT4=gconf


Change those two lines to

OPT3=ccp
OPT4=""


Logout.

After you login back to your session, compiz is now loaded with 'ccp' at startup instead of 'glib gconf'. So you can use Compiz Fusion with ease.

For KDE users, I don't have any KDE installation around so I am not really sure what to do. Anyway, just add compiz-manager in the startup application list, and I believe that is enough to get it working.


Update: Fusion icon is now in Fedora repository,
yum install fusion-icon-gtk
or
yum install fusion-icon-qt
to get it

Update 2008/05/15: Another way to set compiz-fusion to start on boot
Just run this as user.
gconftool-2 --set --type string \
/apps/gnome-session/rh/window_manager \
"compiz --indirect-rendering ccp"


Enjoy!!

USB "Key" based authentication using pam_usb in Fedora

What Is pam_usb?

pam_usb provides hardware authentication for Linux using ordinary USB Flash Drives.
It works with any application supporting PAM (Pluggable Authentication Module), such as su, any login manager (GDM, KDM), etc. The pam_usb package contains:

http://www.pamusb.org/

So? What does it do?

pam_usb enables you to login to your system using a USB "Key" as a physical authentication device. Ever watched some of those movies where user required to key in some sort of card before logging into the computer? Well, pam_usb allows you to do this on Linux, using your USB drive!.

Getting pam_usb

pam_usb 0.3.3 is available in Fedora repository.

yum install pam_usb pam_usb-hotplug


Setting up Your Computer

1 . Setting up console login to use pam_usb
add this entry to the first line in /etc/pam.d/login
auth       sufficient   pam_usb.so


2 . Setting up GDM to use pam_usb
add this entry to the first line in /etc/pam.d/gdm
auth       sufficient   pam_usb.so allow_remote


1 . Setting up su command to use pam_usb
add this entry to the first line in /etc/pam.d/su
auth       sufficient   pam_usb.so


more details about options can be acquired from the quickstart, located at
file:///usr/share/doc/pam_usb-0.3.3/quickstart.html

Creating your DSA key pair

To enable your USB drive as an authentication device, you will need to generate a set of public and private key which one will reside in the USB device and another in your home folder.

To generate the key, first, make sure your USB drive is mounted, then this command:
usbadm keygen /path/to/usb/mountpoint username keybits

eg:
usbadm keygen /media/usbdrive root 1024


Thats it, you're done. Try su-ing to root to test out whether it works or not.

Enabling log for debugging

In case it did not work, you can enable pam_usb logging to find out whats wrong. To enable logging, add log_file=/var/log/pam_usb.log at the end of pam_usb entry in the pam.d files.

eg:
auth       sufficient   pam_usb.so log_file=/var/log/pam_usb.log


then create an empty log file
touch /var/log/pam_usb.log


done.

Ref:
http://forums.gentoo.org/viewtopic-t-305540-highlight-pamusb.html

Compiz Fusion repository for Fedora 7


This post is obsolete ( Its hard to keep this page updated, so I created a wiki page for it :P ). Latest & updated guide can be acquired from my wiki page

http://wiki.kagesenshi.org/moin.fcgi/CategoryPackages/CompizFusion



At last ... I have finished the Compiz Fusion packages for Fedora 7 .. now for the grand announcement :D





Repository Location

Repository URL: http://repo.kagesenshi.org/pub/
http://devel.foss.org.my/~kagesenshi/repo/pub/
Repository YUM Config File: http://repo.kagesenshi.org/pub/kagesenshi.repo
http://devel.foss.org.my/~kagesenshi/repo/pub/kagesenshi.repo

The repository is hosted in a limited bandwidth shared hosting which I have for playing around with Django. Please dont abuse it. I couldnt afford larger hosting because I'm still a (jobless) student and currency exchange between MYR and USD is kindof too high for me.

Provided Packages

compiz
compiz-all
compiz-gnome
compiz-kde
compiz-devel
compiz-fusion-plugins-main
compiz-fusion-plugins-main-devel
compiz-fusion-plugins-extra
fusion-icon
compiz-bcop
compizconfig-python
compizconfig-python-devel
compizconfig-settings-manager
libcompizconfig-devel
libcompizconfig
emerald
emerald-devel

Edit Updated to follow 20070630git packages

The compiz packages are based on Fedora 7's compiz specfiles and added together with bits and pieces from Fedora beryl packages. The package sets are similar to beryl's. I dont have any KDE specific builds mainly because I don't use KDE and not familiar with beryl/compiz's KDE packages.

* NOTE: the compiz packages will obsolete Fedora 7's compiz-0.3.6 packages.
* Other Credits: the naming and description of some of the packages are taken from Trevino's Ubuntu Compiz repository

Some descriptions of common packages

compiz
compiz-all
- a meta package that will install all compiz packages from this repository
compiz-gnome
- a package that provide gtk-window-decorator and install compiz-core, compiz-fusion-plugins-main, emerald, emerald-themes and compizconfig-settings-manager
compiz-kde
- a package that provide kde-window-decorator and install compiz-core, compiz-fusion-plugins-main and compizconfig-settings-manager
compiz-core
compiz
- contains the core compiz files
compiz-fusion-plugins-main
- main plugins for compiz fusion ( cube, animation, expo, negative, opacify, scale, wall , etc)
compiz-fusion-plugins-extras
- extra plugins for compiz fusion ( addhelper, benchmark, cube reflection, firepaint, etc)
emerald
- a themable window decorator for compiz
compizconfig-settings-manager
- a GTK UI for configuring compiz fusion and its plugins

Edit: changed guide to follow GNOME KDE splitted packages
Edit Updated to follow 20070630git packages

Installation Instructions

As root, just follow these simple commands

# Install the repository 
cd /etc/yum.repos.d/
wget http://repo.kagesenshi.org/pub/kagesenshi.repo
wget http://devel.foss.org.my/~kagesenshi/repo/pub/kagesenshi.repo

# all compiz core packages (GNOME and KDE)
yum install compiz
yum install compiz-all

# compiz and GTK window decorator (for GNOME)
yum install compiz-gnome

# compiz and KDE window decorator (for KDE)
yum install compiz-kde


Edit: changed guide to follow GNOME KDE splitted packages
Edit Updated to follow 20070630git packages


After this step, you'll have compiz-core, compiz-fusion-plugins-main, emerald, emerald-themes, and compizconfig-settings-manager the core compiz 0.5 from freedesktop.org installed your computer. For Compiz-Fusion, you will require to also yum these.

yum install compizconfig-settings-manager compiz-fusion-plugins-main compiz-fusion-plugins-extra


and if you want Emerald decorator
 yum install emerald


Launching Compiz Fusion

The most convenient way to launch Compiz Fusion for now is by using its tray icon (similar to beryl-manager), called fusion-icon

yum install fusion-icon
fusion-icon &


* Theres also a launcher for it in the system menu . Located at Applications > System Tools > Fusion Icon

For the time being , there is no exact/convenient way to launch Compiz that I know of (yet).

OpenCompositing.org forum have a post on commands to launch Compiz here -> http://forums.opencompositing.org/viewtopic.php?f=51&t=758#p6439


If you have an Intel or an ATi Radeon card (using AIGLX or the radeon driver):
LIBGL_ALWAYS_INDIRECT=1 compiz --replace --indirect-rendering --sm-disable ccp &

If you are using the FGLRX driver:
LD_PRELOAD=/usr/lib/fglrx/libGL.so.1.2.xlibmesa compiz --replace --sm-disable ccp &

If you are using NVidia:
compiz --replace ccp &


Or, you can try out compiz-icon. compiz-icon is an app similar to beryl-manager. However, it does not work in my computer, but maybe you have better luck than me.
yum install compiz-icon
compiz-icon &


compiz-icon package also provide a script called compiz-manager that will do the if-else for the manual launch above, if compiz-icon doesn't work for you, you might have better luck with compiz-manager. However, compiz-mananager does not have any tray icons etc despite the name. It only launches compiz and provides some useful (to some) commandline tools.

# launching compiz-manager
compiz-manager &


Edit Updated to follow 20070630git packages

Conclusion

For technical support related to compiz itself, please goto OpenCompositing Forum at http://forums.opencompositing.org/ and ask there. I will only attend problems related to my packaging.

If you want a more bleeding edge build, read the tutorial on how to compile from source here -> http://forums.opencompositing.org/viewtopic.php?f=51&t=758

Enjoy~ :D

Using Glade to write GUI applications

A few useful links for people who want to learn on how to write GTK applications using Glade



The video for using Glade with Python is not very clear, so I'll explain a little bit the process below.

1. Build your GUI

2. Open a .py file, and import gtk and gtk.glade
#!/usr/bin/python
import gtk
import gtk.glade


3. define your handlers method
def hander_method(widget):
do_something_here
do_more


4. load the glade XML
xml = gtk.glade.XML("/path/to/glade/file")


5. connect handlers to its methods/functions
dict = { 'handler_name' : handler_method,
'handler_name2' : handler_method2
}

xml.signal_autoconnect(dict)


6. run gtk instance
gtk.main()


I also have written a similar script to the ruby glade template generator in Video 3. It'll generate a very basic Python template for use. ( I couldn't find where to download GladeGen )

pyglade-gentemplate.py

Setting up ADSL connection, the Fedora way

Some users might not notice that Fedora have a very easy to use GUI for setting up ADSL and other network connections. The tool is integrated together with Fedora/RH system-config utility called system-config-network. This howto will show you how to set-up a PPPoE/ADSL connection using it.

Starting Up system-config-network

If you are using GNOME, the menu for it is located at
System > Administration > Network



Okay, the interface is somewhat looks complicated. I was a little bit lost too when I first time using it. But after knowing that the tool support lots of other advanced network capabilities (like multiple IP per device, IPsec, VPN, etc), I accepted the UI is the best that way.

Creating a PPPoE/ADSL connection

To create a new PPPoE connection, click the New button and this window will appear. Select xDSL Connection.



Follow through the instructions and fill the forms. For the Ethernet Device entry, select the device that connected to your ADSL Modem.



Click Apply



Done



Connecting To The Network

To connect to the network, just select the connection click the Activate button.

You can also set it to start on boot by selecting the connection, click the Editbutton , select Activate device when computer start, and click OK.



Thats all~ :D. Btw, If you notice any missing step in this guide, please tell me about it because the last time I'm using ADSL modem to connect to internet was during Fedora Core 3 (which was 2 years ago, nothing much has changed in setting up ADSL using system-config-network since then).Now I'm using a router and doesn't use this anymore.

Synchronizing Sony Ericsson K320i Calendar with Evolution Calendar

Sorry for the long absence, I'm quite busy with my studies and project works .. well its that time of the semester again .. *sigh

As promised , here is a simple howto for synchronizing Sony Ericson K320i with Ximian Evolution

Step 1: Getting the packages

  • multisync

  • libsyncml

  • bluez-utils

  • libopensync-plugin-evolution2

  • libopensync-plugin-syncml


All of these packages can be acquired from Fedora repositories except for libopensync-plugin-syncml which you can follow this guide to install it or until somebody push it into the repositories. If you would like a GUI for multisync, yum for multisync-gui. In this guide, however, I'll cover the console based set-up only.

Step 2: Setting up a multisync group

First, create a multisync group that will contain a member from evolution2 plugin and a member from syncml plugin. In this example I name the group SyncMe

msynctool --addroup SyncMe
msynctool --addmember SyncMe evo2-sync
msynctool --addmember SyncMe syncml-obex-client


Step 3: Configuring the SyncML plugin

Now to configure the SyncML plugin. You will need 2 informations for this.
  • You phone's Bluetooth MAC address

  • The channel where SyncML OBEX Client is listening on you phone


Getting you phone's MAC address

Turn on Bluetooth discovery on your phone. From the PC use hcitool to scan for your phone's MAC.

$ hcitool scan
Scanning ...
xx:xx:xx:xx:xx:xx K320i


The xx:xx:xx:xx:xx:xx is your phone's MAC address. Copy it and paste it somewhere.

Getting the SyncML OBEX Client Channel

$ sdptool browse xx:xx:xx:xx:xx:xx


From the output, find the block that look similar like this

Service Name: OBEX SyncML Client
Service RecHandle: 0x00000
Service Class ID List:
UUID 128: 00000000-0000-0000-0000-0000ee000000
Protocol Descriptor List:
"L2CAP" (0x0000)
"RFCOMM" (0x0000)
Channel: 11
"OBEX" (0x0000)


Take the channel number and remember/paste it somewhere.

Configuring the plugin

Run this to open a Vi session for editing the SyncML plugin config

msynctool --configure SyncMe 2


Edit the config. Put your phone's MAC address into the bluetooth_address tag and the SyncML OBEX Client channel into bluetooth_channel tag.

Set also the wbxml tag to the value 1 and the type tag to 2. For the calendar tag, change the value from calendar to agenda.

You configuration should look somehow like this after editing

<?xml version="1.0"?>
<config>
<!-- (Only for blue) The bluetooth address if the bluetooth mode is selected -->
<bluetooth_address>xx:xx:xx:xx:xx:xx</bluetooth_address>

<!-- (Only for blue) The bluetooth channel to use (usualy the 11) [x] -->
<bluetooth_channel>11</bluetooth_channel>

<!-- (Only for USB) The usb interface number of the SYNCML-SYNC target. use syncml-obex-client -u (as root!) to find it. -->
<interface>0</interface>

<!-- The string that the plugin will use to identify itself. Some devices need a special string here. -->
<identifier></identifier>

<!-- The syncml version to use: 0 for 1.0, 1 for 1.1 and 2 for 1.2 -->
<version>1</version>

<!-- if the plugin should use wbxml -->
<wbxml>1</wbxml>

<!-- The username to use. Leave empty to not require a username -->
<username></username>

<!-- the password for the username -->
<password></password>

<!-- sets the connection type to use. 5 means obex over usb, 2 means obex over bluetooth -->
<type>2</type>

<!-- If wbxml is enabled, defines wether the wbxml should use string tables -->
<usestringtable>0</usestringtable>

<!-- Never send ADD command, but send REPLACE (not needed normally) -->
<onlyreplace>0</onlyreplace>

<!-- Sets the maximum allowed size in bytes of incoming messages (some device need this option set). Example: 10000 -->
<recvLimit>0</recvLimit>

<maxObjSize>0</maxObjSize>

<!-- The name of the contacts db. Must be the same as the phones sends -->
<contact_db>contacts</contact_db>

<!-- The name of the calendar db. Must be the same as the phones sends -->
<calendar_db>agenda</calendar_db>

<!-- The name of the note db. Must be the same as the phones sends -->
<note_db>notes</note_db>
</config>


Synchronizing

Now that the configuration is done, you can sync your phone's calendar with Evolution's calendar by running this command.

msynctool --sync SyncMe


Done~. Your calendars should be synchronized after that.

Btwm there are some problems I'm facing with the sync process. For the contact sync, your contacts might be duplicated a lot of times (which annoys me and made me disable contact syncing altogether). Another problem is that the TODO sync doesnt work, and I get write error sometimes.

If anybody got a workaround for this , please tell me kay :D.

References
http://en.opensuse.org/OpenSync/SyncML-OBEX-Client
http://www.gentoo.org/doc/en/bluetooth-guide.xml
http://www.harald-hoyer.de/linux_and_syncml_multisync_with_nokia_6280
http://blog.dukanovic.com/?p=5

HOWTO: Setting up SVN and DAV in Fedora6

This Howto is based on a similar howto for FC4 by Ferdy Christant HERE


I've been trying to set-up a SVN repository for my university's usergroup to get some kickstart in Opensource development among my batch and friends, and UTP as a whole. With some googling, I managed to find some good guides in helping me to set-up up. (to newbies, just for your information, I'm using root user throughout this guide)

Step 1 : Getting the packages

To set up the repo, you'll need subversion, apache and mod_dav_svn.
yum install subversion mod_dav_svn httpd


Step 2 : Preparing the SVN repository root

After getting the required packages, set up a place for storing the SVN repos in a suitable place. In this howto, lets assume we store it in /var/svn/.
mkdir /var/svn/ 
mkdir /var/svn/permissions/ #where the permission settings will be stored
mkdir /var/svn/repos/ #where the repos will be stored
mkdir /var/svn/users/ #where the user htpasswd will be stored


We'll need to give apache access to the repository root, because it will be the application that read/write on it. Giving ownership is safer and easy to manage than chmod'ing the directories to 755.
chown -R apache:apache /var/svn/


Step 3 : Creating a test SVN repository

Lets create a repository in the directory for testing purposes
cd /var/svn/repos/
svnadmin create testrepo


chown it to apache
chown -R apache:apache testrepo


Step 4 : Setting up Apache and mod_dav_svn

The mod_dav_svn RPM already provided a prebuild configuration for this purpose, you can found it at /etc/httpd/conf.d/subversion.conf. For the lazy people, you can just uncomment the all the entries in the config, change the path settings and start/restart/reload httpd. But lets uncomment a few lines first to test whether the repository can work or not. Don't forget to change the SVNParentPath to your SVN repository parent. If you want, you can also change the Location setting (in this howto, I use /svn).

<Location /svn> 
DAV svn
SVNParentPath /var/svn/repos
#
# # Limit write permission to list of valid users.
# <LimitExcept GET PROPFIND OPTIONS REPORT>
# # Require SSL connection for password protection.
# # SSLRequireSSL
#
# AuthType Basic
# AuthName "Authorization Realm"
# AuthUserFile /path/to/passwdfile
# Require valid-user
# </LimitExcept>
</Location>


Start/Reload apache for the settings to take effect.
service http reload

Then, try entering the repository by pointing your browser to the /svn/testrepo folder of the webserver (lets assume we are doing this on localhost). Open http://localhost/svn/testrepo/ . You should see a page with "Revision 0:/" as the header. If you can see the page it, if not, check if you've done something wrong (if you got error 403, check the folder permissions)

Step 6 : Securing the repository

To secure the repo and DAV, we rely on htpasswd protection, first, create a passwordfile to store the username and password
htpasswd -cb /path/to/passwdfile username password

eg:
htpasswd -cb /var/svn/users/passwords myuser mypasswd123

Then, uncomment these lines
<Location /svn> 
DAV svn
SVNParentPath /var/svn/repos
#
# # Limit write permission to list of valid users.
<LimitExcept GET PROPFIND OPTIONS REPORT>
# # Require SSL connection for password protection.
# SSLRequireSSL
#
AuthType Basic
AuthName "Authorization Realm"
AuthUserFile /var/svn/users/passwords
Require valid-user
</LimitExcept>
</Location>

and reload httpd
service httpd reload

By now, when you want to open the repo URL, the browser will ask for a username and a password.

Allowing Read access to all visitors/users

You might want to allow all users read operation but limit write to known members, you can do this by rearranging entries in the config into this and reload httpd

<Location /svn>
DAV svn
SVNParentPath /svn/repos
SVNListParentPath on
AuthType Basic
AuthName "Authorization Realm"
AuthUserFile /svn/users/passwords
# SSLRequireSSL
#
# Limit write permission to list of valid users.
<LimitExcept GET PROPFIND OPTIONS REPORT>
# # Require SSL connection for password protection.
# SSLRequireSSL
# AuthzSVNAccessFile /svn/permissions/svnauthz.conf
Require valid-user
</LimitExcept>
</Location>


Done

If you want more advanced access control using per-directory permission, you can read the blog post at Ferdy Christant's blog or this Gentoo wiki entry. I'm only covering the base set-up of a SVN server on FC6. If you want a Web based SVN interface, consider looking into WebSVN.

Favourite Icon

Just added a favourite icon for this blog. Thanks to a myOSS member, surface, for his howto.

http://linux.byexamples.com/archives/209/create-favicon/

HOWTO: Mirroring Yum repositories using Yum-Utils

As promised before in one of my previous post, a Howto on how to mirror and manage yum repositories using some of the utilities in yum-utils.

The first step is, well, of course, is to get yum-utils from fedora repository

yum install yum-utils


Reposync
Reposync is a utility for mirroring and synchronizing local copy of a yum/rpmmetadata repository.

This utility is very useful if you wanted to make a yum repository mirror. Before this, I used "wget -R -np -N" but this method is a little bit tedious and it doesnt work with repos that didn't use directory listing. Plus, it also download together additional site stuff that I don't need/want and it doesn't verify checksum of the downloaded packages.

Mirroring a repo using this utility is easy, just execute this command
reposync -r <repoid> -a <arch> -n

and the repo will be mirrored in a folder with the same name of the repoid in the directory you executed the command. Eg: you executed the command in /mnt/storage/mirrors/ and the repo you are mirroring is extras, so, the RPMs will be downloaded at /mnt/storage/mirrors/extras/.

Available options
$ reposync --help
usage:
Reposync is used to synchronize a remote yum repository to a local
directory using yum to retrieve the packages.

/usr/bin/reposync [options]


options:
-h, --help show this help message and exit
-c CONFIG, --config=CONFIG
config file to use (defaults to /etc/yum.conf)
-a ARCH, --arch=ARCH act as if running the specified arch (default: current
arch, note: does not override $releasever)
-r REPOID, --repoid=REPOID
specify repo ids to query, can be specified multiple
times (default is all enabled)
-t, --tempcache Use a temp dir for storing/accessing yum-cache
-p DESTDIR, --download_path=DESTDIR
Path to download packages to: defaults to current dir
-u, --urls Just list urls of what would be downloaded, don't
download
-n, --newest-only Download only newest packages per-repo
-q, --quiet Output as little as possible


Repomanage
Repomanage is a utility for repository managers to manage old and new packages in a repository. It will read the RPM packages in the directory and list out old/new packages from the directory to stdout.

Example of using repomanage for removing old packages in the current directory and its subdirectories.
repomanage --old . |xargs rm -rf


Available options
$ reposync --help
usage: repomanage [--old] [--new] path.

options:
-h, --help show this help message and exit
-o, --old print the older packages
-n, --new print the newest packages
-s, --space space separated output, not newline
-k KEEP, --keep=KEEP newest N packages to keep - defaults to 1
-c, --nocheck do not check package paload signatures/digests


Regenerating the repo

Now thats you've done mirroring and cleaning up old packages, its time to regenerate a repository metadata for the repo and make it usable through yum. Read my post on how to create your own Yum repository here.

Enjoy your new local repos~ :)

HOWTO: Extracting RPM from command line

Sometimes, admins might want to extract some files from a RPM file for some purposes. If on a system with GUI, this can be easily done using file-roller or some other GUI based archive manager that supports RPM/CPIO archives. RPMs are basically modified CPIO archives, so we use rpm2cpio and cpio command to extract files from it in a CLI environment.

List out contained files

rpm2cpio <rpmpackage.rpm> |cpio -t

Extract all files
rpm2cpio <rpmpackage.rpm> |cpio -id

Extract specific file
rpm2cpio <rpmpackage.rpm> |cpio -id <file>
Note: extracting specific files requires you to put the full path of the file in the archive which you get from the cpio -t output.

You can read more about using cpio from the manpages and from this site

HOWTO: Removing Firefox Menu Toolbar

Yet-another-shrinking-your-UI guide lol~..

Lets go straight to the point. First, to those you a newbie in editing userChrome.css, locate the file using this guide.

Then, just add these lines in userChrome.css.

toolbar#toolbar-menubar {display : none !important}

.toolbarbutton-menubutton-button > .toolbarbutton-box,
.toolbarbutton-1 > .toolbarbutton-box
{
max-width: 16px !important;
text-align: center !important;
}
Done.

(I'm in lazy mode)

Edit: For the Menu button, use the Compact Menu extension.

HOWTO: Making Firefox toolbar and tabs smaller

People with low resolution screens might want to make stuff smaller to save space. Below is a guide to shrink the Firefox toolbar .



Switching to small icons

First we need to use small icons for the toolbars. Just right click at the toolbar, click customize, and select "Use small icons".

Resizing the toolbar

There are no menus to change the toolbar width from within firefox. Therefore, we need to edit the userChrome.css file. The userChrome.css file is located in your Firefox profile folder. The location differs according to the OS. Locate your profile folder by following this guide. After you located the profile folder, find the file at <profile-folder>/chrome/userChrome.css . If it doesn't exist yet, create it.

Now, add this css entry into userChrome.css

toolbar {
max-height:30px !important;
}

This will resize the toolbars width to 30px.

Resizing the tabbrowser

Add this entry into userChrome.css to resize the tabbrowser tab width to 30px and remove any paddings and margins.
.tabbrowser-tabs {
max-height: 30px !important;
padding:0;
margin: 0;
}

Restart firefox, and you're done. Feel free to experiment with various values.

Btw, if you noticed in the screenshot, my menu toolbar has been removed and replaced with a menu button. I'll post a guide to do this when I have time.