~$ sudo apt-get

Archive for October, 2009

Force SSL with mod_rewrite

by on Oct.15, 2009, under Apache, Linux

Create a .htaccess within the document root with the following.

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]

You must ensure AllowOverride is set to All within the apache configuration or it will not read the .htaccess.

Leave a Comment more...

Parse single table from mysqldump

by on Oct.08, 2009, under Linux

If you wish to pull a single table from a large mysqldump, the following commands will accomplish this.

# grep -n "CREATE TABLE" databasedump.sql

If the table you want starts on line 100, and the proceeding table is on line 150, run the following commands to parse the dump.

# head -n 142 databasedump.sql > parsed.sql

# tail -n 100 parsed.sql > table.sql

Do not use the exact line number returned from grep as you will have the create table statement from the next table.

Leave a Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...