Articles & Snippets

Search for content...
/

Start typing to search

Remove specific directories at once in Linux

Posted by Cătălin on Tue, 10 Dec 2013

Remove specific directories at once in Linux

find specific folder, ex: "_notes" find /home/www -name "_notes" delete all folders "_names" find /home/www/ -name '_notes' -print0 | xargs -0 rm -rf

Read More...
code

Backup MySQL with cron

Posted by Cătălin on Tue, 10 Dec 2013

Backup MySQL with cron

#!/bin/sh # List of databases to be backed up separated by space dblist="database1 database2 mysql information_schema" # Directory for backups backupdir=/Users/username/Documents/backups/mysql/gz ...

Read More...
code

Vacation plugin issue with Roundcube 0.95

Posted by Cătălin on Wed, 23 Oct 2013

Vacation plugin issue with Roundcube 0.95

Vacation plugin not compatible with Roundcube 0.95, due to changes in the way roundcube access database. To fix this, replace: $db = new rcube_mdb2($dsn, '', FALSE); with: if (!class_exists('rcube_db'))...

Read More...
code

.htaccess redirect

Posted by Cătălin on Mon, 7 Oct 2013

.htaccess redirect

Your website can be accessed with www.domain.com and domain.com. Since Google penalizes this due to duplicated content reasons, you have to stick your domain to either www.domain.com or domain.com. You...

Read More...
code

Capture hostname and uri using tshark

Posted by Cătălin on Tue, 24 Sep 2013

Capture hostname and uri using tshark

Web traffic (port 80): tshark -i eth0 -f 'port 80' -l -t ad -n -R 'http.request' -T fields -e http.host -e http.request.uri -e ip.src

Read More...
code

Linux Find Large Files

Posted by Cătălin on Tue, 24 Sep 2013

You can easily list all large files along with size, by using the following syntax

You can easily list all large files along with size, by using the following syntax: Search or find big files Linux (50MB) in current directory, enter: $ find . -type f -size +50000k -exec ls -lh...

Read More...
code