Home
15 April 2009 @ 10:54 am

$ ssh root@hostname.example.com
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
f3:a9:fc:81:1e:24:09:94:5a:ed:cf:66:2a:3f:98:94.
Please contact your system administrator.
Add correct host key in /home/username/.ssh/known_hosts to get rid of this message.
Offending key in /home/username/.ssh/known_hosts:117
RSA host key for hostname.example.com has changed and you have requested strict checking.
Host key verification failed.

I regularly connect to systems which get reinstalled frequently and receive the warning above, so this option to the ssh-keygen command is particularly useful:

ssh-keygen -R hostname.example.com

It will remove the entry for that hostname in the file ~/.ssh/known_hosts

 
 
11 January 2009 @ 05:56 pm

In order to make an animation showing a rotating earth, I used xplanet, imagemagick and mpeg2encode. Each individual frame is rendered with clouds overlayed from satellite imagery, details of which can be found on the xplanet homepage.

First, to allow xplanet to overlay clouds, its configuration file needs to know the path to the file containing the cloud map. I tend to use custom dayside and nightside images too; the file ~/.xplanet/config/default should contain:

[earth]
image=/home/dominic/.xplanet/images/earth.jpg
night_map=/home/dominic/.xplanet/images/night.jpg
cloud_map=/home/dominic/.xplanet/images/clouds.jpg

To make 360 images, one for each degree, use the following bash for-next loop:

$ for i in `seq -w 0 359` ; do xplanet -geometry 320x240 -num_times 1 -latitude 53 -longitude $i -output xplanet_$i.png && echo $i ; done

Then convert with imagemagick’s “convert” command and “mpeg2encode” from http://www.mpeg.org/MPEG/video/mssg-free-mpeg-software.html having compiled it (the Ubuntu release of Imagemagick does not include mpeg2encode):

$ convert xplanet_???.png xplanet_large.mpg

 
 
04 January 2009 @ 09:24 pm

When a folder on a Windows system is exported, it is possible to mount it on a linux system using smbfs. To this end, it may be necessary to install the relevant “smbfs” package, after which the command “mount.cifs” is available. The command to mount a filesystem on a one-off basis might be as follows:

$ sudo mount -t smbfs -o user=administrator,uid=500,gid=100 //192.168.1.6/sharename /mnt/samba

After executing the command, and possibly entering the linux user password for the purposes of running the command within sudo, you will be asked for the relevant password on the windows system, in this example the administrator password.

If the username and password are invalid, you may receive an IO error, it may be that the user specified does not have permissions to access the exported folder.

An alternative method of authentication is to use a credentials file, which contains the username and password:

The credentials file should contain just the following two lines:
username=value
password=value

The “credentials” option can then be used to point to this file. You should ensure that the file is properly secured with the relevant permissions.

$ sudo mount -t smbfs credentials=/home/dominic/.windows-user,uid=500,gid=100 //192.168.1.6/sharename /mnt/samba

 
 

As noted previously, I am running a customised kernel on my Eee 901; this results in there not being a module in the repository for VirtualBox, but after a little searching I discovered the commands necessary to download the source and compile it:

# module-assistant --text -f get virtualbox-ose-source
# module-assistant --text auto-install virtualbox-ose

 
 
28 December 2008 @ 07:12 pm

I often use two or more computers side–by–side, so it’s handy to be able to do so without having to switch keyboards and mice all the time.
Previously, I had used x2vnc when one of the computers ran windows and the other Linux or some other UNIX variant, but nowadays I tend to use linux on most systems. To complicate matters, there have been some changes to the way X–windows works which make it difficult to run remote applications.
One solution is to disable the “–nolisten” option on the X–windows instance which you want to display the application to, or under SuSE Linux, set the following option in /etc/sysconfig/displaymanager:

DISPLAYMANAGER_XSERVER_TCP_PORT_6000_OPEN="yes"

For Ubuntu Linux, this translates as setting the following option in /etc/gdm/gdm.conf:

DisallowTCP=false

Once remote disyplay is possible, you can install and run x2x on the system to which your preferred keyboard and mouse are connected:

$ x2x -west -to hostname:0.0

The more secure method is to use the remote–display functionality of ssh to do all this for you, by executing the following command on the system to which your preferred keyboard and mouse are connected:

$ ssh -X hostname 'x2x -west -to :0.0'

Where “hostname” is the name of the other system and “west” denotes that the slave system is to the left of the controlling system.

Notes: “computer”, “machine” and “system” tend to be synonyms when I write them. A dollar symbol at the beginning of a command denotes it should be executed in a shell as a normal user without the dollar symbol.

Tags: