New forum, Global Friends Online

September 4th, 2008

You can now discuss with us at http://globalfriendsonline.com :)

Solution for rm error: -bash: /bin/rm: Argument list too long

July 23rd, 2007

If you try to remove huge amounts of files from a folder (for example bounch emails etc) through command line using rm your remove command may return the following:

  -bash: /bin/rm: Argument list too long

Read the rest of this entry »

How to determine numeric chmod value

March 14th, 2007

Chmod value calculation is very simple, here is a quick tutorial for those who doesn’t know how to do it or tend to forget (like I sometimes do).

Read the rest of this entry »

Hotlink protection using .htaccess file

March 14th, 2007

Put images you want to protect to one folder and to that folder create a new text file and put the following code to it (replace yourdomain.com with your domain), name it .htaccess :

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]

Read the rest of this entry »

Installing SQLite php4 extension

March 14th, 2007

Easiest way to install SQLite as php extension is to run a command

pecl install sqlite

Often this fails though as if tmp folder is secured (mounted as noexec) with following or similar error:

/bin/sh: bad interpreter: Permission denied
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF
environment variable is set correctly and then rerun this script.

ERROR: `phpize’ failed

In this case download sqlite module pack from http://pecl.php.net/package/SQLite , easiest way to download this is to use command:

Read the rest of this entry »

Center using css

March 14th, 2007

Elements can be centered using css with:

margin-left: auto;

margin-right: auto;

Moving files from one server to another over ssh

March 14th, 2007

Quick quide to moving files from one server to another by using wget

Read the rest of this entry »

How to open / edit big .sql or other text files

March 14th, 2007

With linux shell (over ssh for example) you can easilly chop big .sql or other text filesin pieces with for example following command:

Lets assume your sql file is example.sql. With this command the sql file will be choped to 50m pieces. CD to the directory where the sql file is located and execute following command:

split -b 50m example.sql example_

You will get files example_aa , example_ab and so on.

now you can open any of those files, edit and save. When you are done you can combine those files with a command like for example:

cat example_[aa-bb] > example.sql