Archive for May, 2008

Yum through a proxy with and without authentication.

Make sure you no other yum update service/process running.

Proxy variable without authentication:

export http_proxy=”http://proxyserver:port”

Proxy variable with authentication:

export http_proxy=”http://username:password@proxyserver:port”

How to configure VNC on CentOS/RedHat/Fedora

Configure VNC to run at startup

vi /etc/sysconfig/vncservers

VNCSERVERS=”1:username”
VNCSERVERARGS[1]=”-geometry 1024×768″

Use ntsysv to configure vncserver to run at startup.

Configure vnc session to use GNOME

su – username # if necessary
cd .vnc
cp -p xstartup xstartup.orig

vi xstartup
###Begin file###
#!/bin/sh

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &
startx &
###End file###

Note: Make sure there is not blank line after the startx line.

service vncserver restart

Use your vnc client to connect to hostname:1.

Great tools for monitoring linux performance real time.

top: Basic system monitoring tool. The following three tools use the same kind of display method.

iptstate: Used to monitor iptables traffic.

atop: Used to monitor overall system. Keeps historical data too.

iftop: Used to monitor network interfaces

Examples:

iptstate -f -L -t

atop 3

iftop -i eth1

top

Using tar over ssh.

Backup to a remote file location using tar over ssh:
tar cvzf – /localdirectory | ssh ssh root@remotehostname “dd of=/remotefilename”

Backup to a remote tape device using tar over ssh:
tar cvzf – /localdirectory | ssh ssh root@remotehostname $(mt -f remotetapedevice rewind; dd of=/remotetapedevice)$

Restore from a remote file location using tar over ssh:
cd /
ssh root@remotehostname “dd if=/remotefilename” | tar zxvf –

Examples:
Backup:
tar cvzf – /boot | ssh ssh root@thisis.myserver.name “dd of=/backup/boot.tar.gz”
tar cvzf – /boot | ssh ssh root@thisis.myserver.name $(mt -f /dev/nrst0 rewind; dd of=/dev/nrst0)$
Restore:
ssh root@thisis.myserver.name “dd if=/boot.tar.gz” | tar zxvf –

Return top

INFORMATION