skip to Main Content

grep tips

If you're looking for lines matching in files, my favorite command is: grep -Hrn 'search term' path/to/files -H causes the filename to be printed (implied when multiple files are searched) -r does a recursive search -n causes the line number…

Read More

Redirecting incoming tcp connections with redir

source: http://blog.remibergsma.com/2012/02/28/redirecting-incoming-tcp-connections-with-redir/ Redir redirects tcp connections coming in to a local port to a specified address/port combination like this:   The following redirects incoming web requests from 10.10.0.1 to 10.10.10.1: redir –laddr=10.10.0.1 –lport=80 –caddr=10.10.10.1 –cport=80 And here the same for ftp.…

Read More

Install drupal from command line with drush

cd /var/www/domain.com/web/ drush dl drupal --drupal-project-rename=new-directory-name chown www-data:www-data new-directory-name -R chmod 755 new-directory-name -R chmod 777 new-directory-name/sites/default -R cp new-directory-name/sites/default/default-settings.php new-directory-name/sites/default/settings.php drush site-install standard --db-url=mysql://user:pass@db.host.net/db_name --site-name=your_site_name --account-name=admin --account-pass=your_password --OR-- start the installation from the browser http://domain.com/new-directory-name/ after the installation is…

Read More

upgrade ubuntu kernel

[apt-get upgrade] warning: The following packages have been kept back: linux-headers-generic-lts-quantal linux-headers-virtual linux-image-generic-lts-quantal linux-image-virtual linux-virtual To fix: sudo apt-get install linux-generic

Read More

dd-wrt administration http disabled

Open the command prompt and run telnet. Connect to <Router_LAN_IP> e.g. 192.168.1.1 so in the command prompt, this would look like: telnet 192.168.1.1 When asked for the username, enter root (even if you changed username in web interface) When asked for…

Read More
Back To Top