Tuesday, July 28, 2009

Setting the right resolution for your Ubuntu 8.04


Bookmark and Share



I have just installed an Ubuntu 8.04 Hardy Heron and I noticed that I cannot modify the resolution of my screen since there is only one resolution available and its just so large that some parts of some of the application window I cannot be seen or accessed.

If you happen to be in the same problem with me right now, this is how to solve it:

  1. Press Control-Alt-F1 to login into a text-mode terminal

  2. Stop the GNOME Display Manager(gdm):
    # sudo /etc/init.d/gdm stop

  3. Reconfigure your screen resolution:
    # sudo dpkg-reconfigure -phigh xserver-xorg

  4. Start the GNOME Display Manager back again:
    # sudo /etc/init.d/gdm start

  5. Then go back to your X-Window by pressing Control-Alt-F7



And thats it! Hope this helps.

Bookmark and Share

Monday, July 27, 2009

Running Remote commands using SSH


Bookmark and Share



I found a very informative website discussing about how to run remote commands with SSH. Cool right?

It says there that it gets even cooler if you use SSH key-based authentication. That gives me an idea to summarize his discussion and also explain how to setup key-based authentication in ssh.

To run a remote command in ssh is pretty straight forward. Here is how you can do it:
# ssh remote_username@remote address 'remote_command' 

Example 1: To display the free disk space of your remote server

# ssh ruut@www.example.com 'df -h'
Filesystem Size Used Avail Use% Mounted on
/dev/ubda 3.5G 2.1G 1.4G 61% /
tmpfs 96M 4.0K 96M 1% /dev/shm

Example 2: To count the number of httpd process in your remote web server

# ssh ruut@www.example.com 'ps -ax | grep httpd | grep -v grep | wc -l'
11


The above examples will still prompt you to input the user's password if you still have not configured a key-based ssh authentication. Alright, I don't mind typing my password, after all it is there for security reasons. Why would I use the key-based authentication?

You will need this key-based authentication when for example you create a script that will execute a remote command regularly to monitor your remote sites. So you will configure your cron to do the job for you right?

Convinced now? Let me show you how to do it.

  1. Generate a private and public keys using ssh-keygen
    # ssh-keygen -t dsa -b 1024 

    To make this straight forward, just press the enter key when asked to enter a passphrase.
    This will create two files inside your
    /home/username/.ssh/
    directory:

    • id_dsa - your private key

    • id_dsa.pub - your public key



  2. Copy your public key securely to your remote site and place it inside /home/username/.ssh/ and name the file as authorized_keys
    # scp /home/username/.ssh/id_dsa.pub ruut@www.example.com:/home/ruut/.ssh/authorized_keys

  3. Now you can execute our Example 1 like to and it should not prompt you to input the password of your remote site account:
    # ssh -i /home/username/.ssh/id_dsa ruut@www.example.com 'df -h'




So that's how its done. I hope this article has help you in some ways.

Bookmark and Share

Installing and Running VMWare Server 1.0.8 in Ubuntu 9.04 Jaunty Jacalope


Bookmark and Share


I just recently installed VMWare Server 1.0.8 in Ubuntu 9.04 and while doing so, I have encountered several problems which prompted me to do some google queries that leads me to the different fragments of solutions.

I picked up this bits and fragments and form this article hoping that when you land into this blog, you will find all the steps you need to successfully install your VMWare Server 1.0.8 in Ubuntu 9.04.

Here are the 10 bits and pieces that I put together:

  1. Download VMware-server-1.0.8:
    # wget -c http://download3.vmware.com/software/vmserver/VMware-server-1.0.8-126538.tar.gz

  2. Download VMware-server Installation Script Patch:
    # wget -c http://www.insecure.ws/warehouse/vmware-update-2.6.27-5.5.7-2.tar.gz 

  3. Untar the VMware-server:
    # tar xzvf VMware-server-1.0.8-126538.tar.gz

  4. Untar the Patch:
    # tar xzvf vmware-update-2.6.27-5.5.7-2.tar.gz

  5. Install some package dependencies:
    # sudo aptitude install build-essential linux-headers-`uname -r` xinetd g++ ia32-libs 

  6. Go to the VMware-server directory:
    # cd vmware-server-distrib

  7. Install:
    sudo ./vmware-install.pl 

    Note: When you reached the stage in which the installer will ask if your want to run configuration script, type no.

  8. Go to the VMware patch directory:
    # cd ../vmware-update-2.6.27-5.5.7-2

  9. Run the patch installer:
    # sudo ./runme.pl

  10. Read the instructions carefully until you are done.



Note:
- if you encounter this error:
"Unable to get the last modification timestamp of the destination file /etc/vmware/ssl/rui.key." 

Do the following:

# sudo touch /etc/vmware/ssl/rui.key
# sudo touch /etc/vmware/ssl/rui.crt


Bookmark and Share