This are my notes in the fields of computer science and technology. Everything is written with ABSOLUTE NO WARRANTY of fitness for any purpose. Of course, feel free to comment anything.

Sunday, September 13, 2009

My virtual linux server

In the windows installation on my laptop, I also run a linux server in background. Here is how I setup my virtual linux server.

As a virtualization software I installed Sun VirtualBox. I created a virtual machine. I gave it a little less than the half of my memory and turned on support for AMD-V extensions (as I did also in my host machine BIOS). As HD controller I selected SATA (the default is IDE). For networking I use the NAT configuration. I forwarded the SSH port as described in the virtual box manual (backlinux is the name of my virtual machine):
VBoxManage setextradata "backlinux" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol" TCP
VBoxManage setextradata "backlinux" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort" 22
VBoxManage setextradata "backlinux" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort" 2222
Then I followed the suggestion of Sebastian Bauer's blog: I installed the ntwind software's hidden start tool (homepage) and created two one-liner batch files that I use to start and stop the virtual machine. There are also more sofisticated approaches to run the machine as a windows service, however I found this very simple and I chose it for this reason.

Here is the start.bat file: (paths are specific to my machine)
"c:\Program Files\standalone\hstart\hstart" /NOCONSOLE ""c:\Program Files\Sun\VirtualBox\vboxheadless" -s backlinux -vrdp off"
while the stop.bat file contains:
"c:\Program Files\Sun\VirtualBox\VBoxManage.exe" controlvm backlinux savestate
I created two hard disk images for the machine, called backlinux.vdi and backlinux.home.vdi. I set both to dynamical 8 Gb. I later attached backlinux.home to /home. I keep /home on a separate disk, so that I can make use of the snapshots feature of Virtualbox, without loosing the data in /home. To do this I changed the type of backlinux.home.vdi to write-through using:
"c:\Program Files\Sun\VirtualBox\VBoxManage.exe" modifyhd backlinux.home.vdi --type writethrough
Then I installed ubuntu-server (jaunty, i.e. 9.04) with the option "minimal virtual machine" (press F4 by the installation) and I added some software packages I need/like using aptitude (for example: libncurses-dev, libcairo2-dev, ruby1.9, git-core, gitk ... and relative dependences). The machine has no x-server installed, but I have an X server installed under Windows (Xming), so I can start also graphical software using X-forwarding.

To allow the virtual machine to access the host disk (C:), I installed the VBoxLinuxGuestAdditions from the shell script in the virtual CD image (.iso) provided with virtual box (you need to install linux-headers package for your kernel for that). Then I created a shared folder "c" using the virtual box gui. In Linux then I mounted the folder, creating a /C folder, adding this line to /etc/fstab:
c    /C    vboxsf
As last step, I created two icons starting from NewTux.svg of Wikimedia Commons (author: Larry Ewing). I resized it to a 48px square and overlayed a green triangle (start icon) and a red square (stop icon). I created then links to my batch files to my desktop and assigned the icons to the links.

Here is the result:

VirtualBox

There are several available platform virtual machines available. I generally use the Sun VirtualBox. I usually run a Linux server in my Windows-running laptop, using a virtual hard disk for it and accessing it with PuTTY and WinSCP.

VirtualBox is able to run a virtual machine also without an output terminal/window (headless). I use this for my Linux server.

Another possibility it offers is to run a machine booting from a real partition instead of a virtual hard disk. However this makes things quite difficult and is an experimental feature. The hardware found by the operating system will be different in a virtual box and booting as host, so this will lead to several problems. For example I was unable to run a deployed Vista from Linux and I could only run a deployed Ubuntu in Windows with command line interface.

Developer: Sun
Version: 3.0.6 (September 9, 2009)
Platform: Cross-platform

PuTTY

A terminal emulator using ssh or telnet connections to remote servers. I always use this for ssh connections from a Windows machine to a Linux machine (usually using WinSCP for file exchanges) - including my virtual linux server I run in background.

In Windows the program settings (including the saved sessions) are stored in the registry at the position: Computer\HKEY_CURRENT_USER\Software\SimonTatham\PuTTY .

Developer: Simon Thatam
Version: 0.60 (April 29, 2007)
Platform: cross-platform
License: open source

Saturday, September 12, 2009

DVD43

In order to rip/transcode DVD you own, for example to see the videos on your mobile device, this tool may be useful. It circumvents copy protection and zone settings. It may be illegal under certain circumstances and jurisdictions, however the tool itself is probably legal, if you don't engage in llegal activities with it.

Developer: unknown, maybe for legal reasons (?) [whois information]
Version: 4.4.1 (June 29, 2009)
License: closed source freeware
Platform: Windows

HandBrake

This software comes in hand, when you want to upload videos to a mobile phone or media player. It allows to transcode easily to mp4 format with a good control of options, encoder to use, resizing...

Here is my settings file (user_presets.xml), which I use to convert files to display them in my phone:
<?xml version="1.0"?>
<ArrayOfPreset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Preset>
<Level>0</Level>
<Name>Mobile phone</Name>
<Query> -f mp4 -w 400 -e ffmpeg -q 0.5 -a 1 -E faac -B 160 -R 0 -6 stereo -D 1 -m -v </Query>
</Preset>
</ArrayOfPreset>
My settings are: ffmpeg encoding, mp4 container format, aac stereo sound, 50% constant quality, resize to 400px width. Note that to be able to create a preset under Vista you need to start the application with administrative rights.

Platform: cross-platform
Version: 0.9.3 (Nov 23, 2008)
License: open source freeware

VLC media player

This media player allows to reproduce a wide spectrum of media files. It is extremely flexible and has a lot of advanced features, probably more than any other media player. The graphical interface (which is one of the different interfaces it has) is nevertheless very simple and lightweight.

You can select the GUI language using Ctrl+P and changing the first option in the dialog.

Homepage: http://www.videolan.org/vlc/
Developer: VideoLAN project
Version: 1.0.1 (July 27, 2009)
Platform: cross-platform
License: freeware, open source

SyncToy

As a simple backup strategy under Windows, I synchronize my important folders with a copy on an external drive. To do that I am using SyncToy, a free-to-download tool from Microsoft.

Download link: http://www.microsoft.com/downloads/[...]
Developer: Microsoft
Version: 2.0 (August 15, 2008)
Platform: Windows
License: freeware, closed source

Windows Alpha Blender

This tool allows to set the tranparency of a windows using a shortcut to increase (default: Ctrl+F11; my setting: Ctrl+<) or decrease (default: Ctrl+F12; my setting: Ctrl+Shift+<) the alpha transparency value of the currently active window. It is not very sofisticated, but it can be useful sometimes.

Personal settings (ie the keyboard shortcuts) are kept in the registry.

Homepage: http://www.vaultmate.com/freewaregifts.php
Developer: VaultMate Software
Version: 1.2 (June 7, 2008)
License: freeware, closed source
Platform: Windows

Colors in grep

To turn on colors in grep, you may add --color=auto to the GREP_OPTIONS environment variable. The way to do it is of course shell-dependant. E.g. add the following to your shell rc file:
export GREP_OPTIONS='--color=auto'

Unlocker

This tool allows to identify the process, which is currently locking a given file or directory and if desidered to force unlocking of the file from one or all processes. It works as a shell extension in explorer. Note that under Vista the program requires a confirmation to be allowed to access a file (if the UAC system is on).

Developer: Cedrick Collomb
Version: 1.8.7 (May 1st, 2008)
Platform: Windows
License: freeware, closed source

WinSCP

WinSCP is the perfect windows tool to connect to remote servers and exchange (download/upload) files or edit them. It is a SFTP and FTP client.

There is a standalone version and an installer based setup; if using the latter, beware that it will ask you install additional software using the OpenCandy system. However at least the default is not to install any additional software.

I like to store the preferences in ini file instead of the registry, so that I can export them easily to other computers. To turn on the ini preferences storage: in WinSCP login dialog select "preferences", then "Other general options: Preferences", "Storage" and change the "configuration storage" value to "INI file". The default location of the ini file under Windows Vista will be: "C:\Users\\AppData\Local\VirtualStore\Program Files\WinSCP". Under older Windows version it will be directly in the application directory (C:\program files\WinSCP).

Version: 4.2.3 beta (August 18, 2009)
Platform: Windows
License: freeware

ls colors

add an alias to your shell rc file:
alias ls "ls --color=auto"

Friday, September 11, 2009

Gimp

Gimp is great if you cannot afford on do not want to pay a lot of money for professional software (i.e. Photoshop). According to some it *is* a professional level software, according to other not yet; however it has more than enough features for amateur photo manipulation and other image related tasks (e.g. icon editing, image conversion, resizing etc). The first version was realeased in 1996 by two computer science students (Kimball and Mattis, currently Google engineers).

It is quite complicated to use and probably extreme complicated to master, however it is intuitive enough for simple tasks. Since version 2.6 they invested in an effort to make the interface easier to use (see Wikipedia article). An user manual and documentation page is also available.

If you want a different language than your operating system, here is the howto. In my Vista laptop I wanted the english version, so I did the following: I created a .bat file in C:/users/program files/GIMP2.0/bin (you need admin privileges to write it there) with the following content:
set lang=en
start gimp-2.6.exe
Then I changed the startmenu entry to point to the bat file instead of the exe file (other settings: execute minimized, use icon of the .exe file).

Name: Gimp
Version: 2.6.7 (August 14, 2009)
License: free, open-source software
Platform: cross-platform

JDiskReport

There are for sure a lot of disk space analysis tools, but I liked this German Java application a lot: JDiskReport. It is relatively fast and displays a lot of additional information. The space usage or number of files information can be grouped by location on the file system, but also by file size, modification time or file extension. All information can be displayed as pie chart, histogram or detailed list.

Name: JDiskReport
Developer: Karsten Lentzsch (JGoodies, www.jgoodies.com)
Current version: 1.3.1 (July 30, 2008)
License: freeware, partially closed source; open source release planned [see here]
Platform: cross-platform

About Me

My photo
Hamburg, Hamburg, Germany
Former molecular biologist and web developer (Rails) and currently research scientist in bioinformatics.