Saturday, November 13, 2010

Edit main menu in fedora

Starting from fedora 12, I found out that I cannot edit my main menu anymore. This is kind of frustrating since I installed many custom applications, and I would like it to be easily accessible from the main menu. After searching around, i found out that one package is not included in fedora 12 livecd. The package is called alacarte.

$ rpm -qi alacarte
Name : alacarte Relocations: (not relocatable)
Version : 0.12.4 Vendor: Fedora Project
Release : 1.fc12 Build Date: Tue 22 Sep 2009 08:41:26 AM MYT
Install Date: Sat 13 Nov 2010 07:17:32 AM MYT Build Host: xenbuilder4.fedora.phx.redhat.com
Group : Applications/System Source RPM: alacarte-0.12.4-1.fc12.src.rpm
Size : 367423 License: LGPLv2+
Signature : RSA/8, Thu 01 Oct 2009 03:42:28 AM MYT, Key ID 9d1cc34857bbccba
Packager : Fedora Project
URL : http://www.gnome.org
Summary : Menu editor for the GNOME desktop
Description :
Alacarte is a graphical menu editor that lets you edit, add, and delete
menu entries. It follows the freedesktop.org menu specification and
should work with any desktop environment that uses this specification.

So, just install the alacarte package using yum, and select "System -> Preferences -> Main Menu", and you can now edit your main menu.
# yum install alacarte -y
That's all folks

Tuesday, October 26, 2010

Xen's domU always depend on dom0's time and date

By default, the time and date in domU is following dom0. To reset that, below are just what you have to do to decouple the domU's date from dom0

On dom0:

Append xen.independent_wallclock=1 to /etc/sysctl.conf

# echo "xen.independent_wallclock=1"  >> /etc/sysctl.conf
Activate the change
# sysctl -p
Append extra="clocksource=jiffies" to the domU's configuration file.
# echo "extra=\"clocksource=jiffies\"" >> /etc/xen/<domU's name>.cfg 


On domU:

Append xen.independent_wallclock=1
# echo "xen.independent_wallclock=1"  >> /etc/sysctl.conf 
Activate the change
# sysctl -p 
Append jiffies to /sys/devices/system/clocksource/clocksource0/current_clocksource
# echo "jiffies" >> /sys/devices/system/clocksource/clocksource0/current_clocksource

Now you can set your domU's date using "date" command or "ntpdate" to get update from ntp servers.

That's all folks

Friday, October 15, 2010

Using ssh as proxy

To create ssh tunnel is very easy. Let's say you want to use machine1.example.com as your ssh proxy, your username is foo and you choose port 8080 on your localhost to be your local proxy port. Type below command on your localhost:

$ ssh -D 8080 foo@machine1.example.com
Once connected, set your browser to use Socks5 proxy on port 8080 on your local machine. For firefox, the setting is "Tools -> Options -> Advanced -> Network -> Settings -> Manual proxy configuration" and follow below picture for the proxy setting. Just make sure to keep the ssh connection connected to reap the ssh proxy benefits :)



That's all :)

Cygwin man search problem

If you are a windows user, and you use cygwin, there is a problem with man page. The search function is a bit weird, where it cannot find something like "-D" in ssh man page. To overcome this, you have to set the LANG environment variable to c. To do this, just add export LANG=c to your .bashrc:

$ echo "export LANG=c" >> .bashrc

That's all folks :)

Thursday, October 7, 2010

Forcing user to change password the first time they log in

If you are creating new user in your machine, and you would like them to change password the first time they login, using command chage is the way. Let's say our user is foo.

# chage -d 0 foo
where -d is for lastday. When we set it to 0, it will ask for password change the first time foo logs in.

That's all folks :)