Topics: Red Hat / Linux

Installing VNC server

This is a description on how to install a VNC server on a Linux system, and how to access it from a Windows desktop.

First run on the Linux server:

# yum install vnc-server twm xterm
Edit file /etc/sysconfig/vncservers, and add:
VNCSERVERS="1:user1 2:user2 3:user3 4:user4 "
VNCSERVERARGS[1]="-geometry 1024x768"
VNCSERVERARGS[2]="-geometry 1024x768"
VNCSERVERARGS[3]="-geometry 1024x768"
VNCSERVERARGS[4]="-geometry 1024x768"
For your situation, make sure you enter valid user accounts for each user that you want to allow a VNC connection. In the example above, these are users user1, user2, user3 and user4. Also make sure that you create a VNCSERVERARGS entry for each user.

Create the users (if they don't exist already):
# useradd user1
# passwd user1
# su - user1
# vncpasswd
Repeat for the other users.

Add ports 5901, 5902, 5903 and 5904 to the firewall (tcp). This step depends on your Linux system.

Edit /home/user1/.vnc/xstartup:
#!/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 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
Copy this xstartup file to the home directory of the other users.

Restart the vncserver:
# service vncserver restart
Download & install TightVNC on your Windows desktop; you only need to install the Viewer.

http://www.tightvnc.com/download.html

Run TightVNC Viewer, and enter hostname:x (where "x" is the number of your display as defined in the vncservers file above, and where hostname is the hostname of the Linux server) as the VNC server, and click on Connect. Enter the corresponding password as set by the vncpasswd command and you should get a VNC window on your host.

Topics: Red Hat / Linux

Auto-starting ssh

If you want to make sure SSH is auto-started at system reboot on Red Hat:

# chkconfig --list sshd
If you don't see the word "on" under the 3 and 5 columns then:
# chkconfig sshd on
# service sshd start

Topics: Installation, Red Hat / Linux

Yum

Use yum to update your system (for Fedora or Red Hat):

# yum update
will update all the packages on your system. If you need to configure a proxy server for yum to use, then just add the following line to /etc/yum.conf:
proxy=http://address-of-proxyserver.org:80
Of course set it to your correct proxy server and port number.

Topics: Red Hat / Linux

Finding empty directories

A very easy command to find all empty directories on a system:

# find dir -empty -type d -depth -print
The "-empty" parameter doesn't work on AIX.

Topics: Installation, Red Hat / Linux

Extra's in Ubuntu

Even though Ubuntu is very complete initially, you might want extra's, like a media player. You can use a script to do this for you:

# wget http://download.ubuntuforums.org/ubuntusetup/ubuntusetup.sh
# sudo sh ubuntusetup.sh

Topics: Installation, Red Hat / Linux

APT

APT is short for Advanced Packaging Tool and is found in Debian distributions of Linux, like Ubuntu. To be able to use APT, you first need to download a list of available software:

# sudo apt-get update
To download the webbrowser Firefox, type:
# sudo apt-get install mozilla-firefox
With the command
# sudo apt-cache search [search-term]
you can search for a specific program.
To upgrade your complete system:
# sudo apt-get upgrade
Besides the command-line, you can also use the graphical user interface Synaptic.

Topics: Red Hat / Linux

Linux Links

Here's a list of links related to Linux:

Topics: Red Hat / Linux, Storage, VMWare

Increasing the VMWare disk drive

If you have any VMWare images, where you made the disk size a little too small, then fortunately in VMWare Workstation you can change the size of a disk with a simple command line program. Sadly the command only makes your drive bigger not the actual partition. And especially Windows won't allow you to resize the partition where the Windows binaries are installed. So how can you get around that?

First, create a copy of your vmdk file to somewhere else, should the next action fail for some reason.

Then resize the disk to the required size:

# vmware-vdiskmanager -x 8GB myDisk.vmdk
You need to have plenty of disk space free to do this operation, as your vmdk file will be copied by vmware-vdiskmanager. BTW, this command may take a while, depending on the size of your vmdk file.

Now get the ISO image of System Rescue CD-ROM and set the VMWare session to boot of the ISO image. Then, run QTParted. You can do this by starting this CD-ROM with a framebuffer (press F2 at start) and then run run_qtparted as soon as Linux has started. Select the windows drive partition with the right mouse button and choose resize. Set the new size and commit the change. Then exit from QTParted and from Linux (init 0). Remove the ISO image from the VMWare session and restart VMWare to normally start Windows. Windows will detect the disk change and force a chk_disk to run. Once Windows has started, the new disk size is present.

Topics: AIX, Monitoring

Removing error report entries forever

There's a way to avoid certain entries appearing in the error report indefinitely. You can use this for example for tape cleaning messages:

The following command shows you the entries that are written to the error log, but not reported on:

# errpt -t -F Report=0
Let's say you don't want any reports on errors with ID D1A1AE6F:
# errupdate [Enter]
=D1A1AE6F: [Enter]
Report=False [Enter]
[Ctrl-D]
[Ctrl-D]
With "Report=False", errors are still logged in your logfile (usually /var/adm/ras/errlog). If you don't want them to be logged to the error log, for example when you have an errnotify (which still starts an action, also for error ID's with "Report=False"), you can change "Report=False" to "Log=False".

More info on this subject can be found here.

Topics: AIX, Red Hat / Linux

Converting a UNIX time stamp

UNIX records its timestamp in seconds since January 1, 1970. An easy way to convert this time stamp to some readable format: unixtimestamp.com.

Number of results found: 469.
Displaying results: 451 - 460.