Friday, July 31, 2009

Creating a symlink in Ubuntu

Linking to a directory is a great way to access files and even trick programs to access files that are placed in a totally different place than it expects. What one is doing is creating a link which will list the content of a different directory when accessed.

So if I want a folder in my home area to point the my external harddrive mount point I could create a symbolic link, a symlink, to the external harddrive and its content would be shown when I accessed my symlink as a directory. The original location would also still be available.

To create a symlink one uses the program ln. In a console window, navigate to the directory where you want to create a symlink directory and type the following:
ln -s 'location to link to' 'name of symlink'

For example:
ln -s /media/ExternDrive moreFilesLink

Solution found at http://www.linuxforums.org/forum/linux-newbie/65415-creating-symlink.html

Update: To update/change where a symlink is pointing, use the flags sfn instead of just s:
ln -sfn 'location to link to' 'name of symlink'

For example:
ln -sfn /media/ExternDrive2 moreFilesLink

Solution: http://www.programmersparadox.com/2010/10/09/updating-a-symlink/

Changing the Blogger icon

In most cases the Blogger icon ruins some of the effect you are trying to create from your blog, thus changing the icon would be great addition. Heres how:

Create an image 20x20 pixels with your wanted logo. Check out some tutorials on making icons as an image shrunk to this size may look quite different than one intended. Save the image as a png file.

Upload the icon file to somewhere it is available online at all times, such as your homepage service (your ISP, geocities, etc.)

Go to Blogger Layout and select Edit Html. Add the following line to between the <title> and the <b:skin>:
<link href='URL to your image' rel='shortcut icon' type='image/vnd.microsoft.icon'/>

It will for example look like this:
<title><data:blog.pageTitle/></title>
<link href='http://www.somewhere.com/myicon.png' rel='shortcut icon' type='image/vnd.microsoft.icon'/>
<b:skin><![CDATA[/*

This solution was found at http://isaacyassar.blogspot.com/2008/12/changing-blogger-tab-icon.html