14 November, 2009

How to mount ftp to directory

If you are using Thunar on Xubuntu(xfce) and you would prefer to use file browser instead of external ftp client. It should work on every Linux distribution.

1) Download curlftpfs:

sudo apt-get install curlftpfs


2) How to use curlftpfs:

curlftpfs ftp://username:password@your.domanin.com/ /location/where/to/mount


For more information: curlftpfs homepage

08 November, 2009

Consider adjusting the PKG_CONFIG_PATH environment variable...

This is the error I got while compiling:
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables GTK_CFLAGS
and GTK_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.


Installing "gnome-core-devel" was the solution for my problem:
sudo apt-get install gnome-core-devel

01 November, 2009

How to use diff and patch in bash script

Diff and patch commands can be used to compare differences of files and change the content based on that. You can see something similar in SVN or wikis.

How to make and use .patch script:

You have to have the original version of file and the edited version of the same file. Then you can make .patch file about the differences with this command:
diff -u /original/file/location /edited/file/location > patch_file_name.patch

You can use the created .patch file on any file with this command:
patch /file/that/will/be/patched < location/of/patch/file.patch



Original Post

How to get self directory in bash script

This makes variable $SELF_DIR where is location of that script:
SELF_DIR=$(cd $(dirname $0); pwd -P)

This does the same thing as the first one but it adds the script file name to the variable:
SELF_DIR=$(cd $(dirname $0); pwd -P)/$(basename $0)


Original Post