Articles & Snippets

Search for content...
/

Start typing to search

Unblock IP from Fail2Ban

Posted by Cătălin on Fri, 17 Jan 2014

Unblock IP from Fail2Ban

Search for IP 192.168.1.1 to see its been blocked by firewall iptables -L -n | grep 192.168.1.1 DROP all -- 192.168.1.1 0.0.0.0/0 Remove 192.168.1.1 iptables -D fail2ban-sasl...

Read More...
code

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