• Create .htaccess restricted login

    //

    //

    Go here http://tools.dynamicdrive.com/password/

    Read more

  • How to search for a string in a selection of files

    //

    //

    find . -exec grep “www.athabasca” ‘{}’ \; -print This command will search in the current directory and all sub directories. All files that contain the string will have their path printed to standard output. Source: http://www.athabascau.ca/html/depts/compserv/webunit/HOWTO/find.htm

    Read more

  • MySQL root can be viewed with

    //

    //

    cat ~mysql/.my.cnf

    Read more

  • kill do_backup process for 4PSA Total Plesk Backup

    //

    //

    To debug kill the do_backup process: killall -9 do_backup and run it with debugging: /usr/local/tbackup/do_backup -d You should see exactly what happens.

    Read more

  • Shell du command tip – estimate file space usage and exclude particular files

    //

    //

    The du command estimate file space usage and summarize disk usage of each FILE, recursively for directories. It displays the file system block usage for each file argument and for each directory in the file hierarchy rooted in each direc tory argument. If no file is specified it will use current directory. du command Examples…

    Read more

  • Disable suexec

    //

    ,

    //

    To find suexec type in whereis suexec Result suexec: /usr/sbin/suexec /usr/sbin/suexec.saved_by_psa /usr/share/man/man8/suexec.8.gz Now move the file to a backup mv /usr/sbin/suexec /usr/sbin/suexec_old Restart apache /etc/init.d/httpd  restart

    Read more

  • Load a mysql database dump via command line

    //

    //

    Run this command on the command line to load a mysql database dump file mysql -u yourusername -p -h localhost databasename < data.sql

    Read more

  • Transfer files from one server to another using scp

    //

    //

    Type this command on the command line to move files from one server to another scp bkp.tar username@name_of_the_server:/emplacement_to_put_the_file Source: http://www.webmaster-talk.com/php-forum/119073-transfer-files-from-one-server-another.html

    Read more

  • How to dump a mysql database via command line

    //

    //

    Run this command to dump a database via command line mysqldump –u yourusername –p yourdatabasename > yourdumpfile.sql

    Read more

  • How do I create a symbolic link?

    //

    //

    ln -s [TARGET DIRECTORY OR FILE] ./[SHORTCUT] For example: ln -s /usr/local/apache/logs ./logs This points a symbolic link “./logs” to “/usr/local/apache/logs” Source: http://help.hardhathosting.com/question.php/95

    Read more

  • Process .html as PHP

    //

    //

    To setup a Linux server running Apache web server to process .html (.htm) files as PHP. create an .htaccess file in the root folder of your website and add these lines to the .htaccess file: AddType application/x-httpd-php .htm AddType application/x-httpd-php .html Source: http://www.lgr.ca/blog/2007/02/process-html-as-php.html

    Read more

  • unzip – list, test and extract compressed files in a ZIP archive

    //

    //

    Synopsis unzip filename.zip Description Unzip will list, test, or extract files from a ZIP archive, commonly found on MS-DOS systems. The default behavior (with no options) is to extract into the current directory (and subdirectories below it) all files from the specified ZIP archive. A companion program, zip(1L), creates ZIP archives; both programs are compatible…

    Read more

  • Linux / Unix rmdir command

    //

    //

    About rmdir Deletes a directory. Syntax rmdir [OPTION]… DIRECTORY… –ignore-fail-on-non-empty ignore each failure that is solely because a directory is non-empty. -p, –parents Remove DIRECTORY and its ancestors. E.g., `rmdir -p a/b/c’ is similar to `rmdir a/b/c a/b a’. -v, –verbose output a diagnostic for every directory processed. –version output version information and exit. Examples…

    Read more

  • Pack folder and contents with tar gz

    //

    //

    Packing folders using tar.gz tar -zcvf packagename.tar.gz folder/ Source: http://snipplr.com/view/1755/unix-pack-folder-and-contents-with-tar-gz/

    Read more

  • How do I unpack a compressed tar file

    //

    //

    Unzipping a .gz file gunzip filename.tar.gz This replaces filename.tar.gz with filename.tar Extracting tar files tar xvf filename.tar Note: Always move to an empty directory before unpacking a tarfile. When you unpack a tarfile its contents are written to the current directory. Any file or directory with the same name as the contents of the tarfile will…

    Read more