Archive for April, 2009

29th April
2009
written by Nick Anderson

So I noticed my places.sqlite has grown to over 80M. Since Firefox 3 thats where things like bookmarks are stored. I guess favicons are stored in that same database. At any rate I am very tab happy. I have to control myself and about once every 2 weeks or so I have to sit down and close out a bunch of tabs. Its not uncommon for me to have 90ish tabs open. Boy firefox gets sluggish. Anyway you can perform a bit of maintenance on your firefox databases. I saw a significant speed improvement when opening firefox as well as opening new tabs after doing this. You have to close all firefox instances that are using the profile and it might be a good idea to just backup your profile before you do this but its pretty safe.

Note: this command will just do it for every profile you have.

for i in ~/.mozilla/firefox/*/*.sqlite; do sqlite3 $i VACUUM;done;
Tags: ,
28th April
2009
written by Nick Anderson

Last week I stumbled on a nice console regex helper. It’s not that I’m bad at regex but switching between sed, vim, python, perl regex trips me up a bit sometimes.

Go ahead and check it out for yourself

sudo aptitude install txt2regex


[.]quit [0]reset [*]color [/]programs ^txt2regex$

!! not supported
RegEx perl :
RegEx php :
RegEx postgres:
RegEx python :
RegEx sed :
RegEx vim :

.oO()()
[1-2]:

start to match:
1) on the line beginning
2) in any part of the line

27th April
2009
written by Nick Anderson

nginx is a high performance HTTP and mail proxy server written by Igor Sysoev.

I’m not sure what the init scripts do for other distros but it seems a bit of an oversight to leave out checking the config file when running the init script.

Add this line to your nginx init script right after the text -x $DAEMON line to make it check the config before proceeding to start stop or restart the service.

$DAEMON -t > /dev/null 2>&1
if [ $? -ne 0 ]; then
        echo "Configuration file has errors, try $DAEMON -t"
        exit 0
fi
Tags:
16th April
2009
written by Nick Anderson

I hadn’t seen this tool before so I figured I would share. Swaks is the swiss army knife SMTP according to the homepage.

I’ve covered testing email from the command line before but this tool sure makes it easier.

swaks --to nick@tld --from nick@tld
*** MX Routing not available: requires Net::DNS.  Using localhost as mail server
=== Trying localhost:25...
=== Connected to localhost.
<-  220 cmdln-laptop ESMTP Exim 4.69 Thu, 16 Apr 2009 12:23:24 -0500
 -> EHLO cmdln-laptop
<-  250-cmdln-laptop Hello localhost [127.0.0.1]
<-  250-SIZE 52428800
<-  250-PIPELINING
<-  250 HELP
 -> MAIL FROM:<nick@tld>
<-  250 OK
 -> RCPT TO:<nick@tld>
<-  250 Accepted
 -> DATA
<-  354 Enter message, ending with "." on a line by itself
 -> Date: Thu, 16 Apr 2009 12:23:24 -0500
 -> To: nick@tld
 -> From: nick@tld
 -> Subject: test Thu, 16 Apr 2009 12:23:24 -0500
 -> X-Mailer: swaks v20061116.0 jetmore.org/john/code/#swaks
 ->
 -> This is a test mailing
 ->
 -> .
<-  250 OK id=1LuVJ6-0007ge-Jf
 -> QUIT
<-  221 cmdln-laptop closing connection
=== Connection closed with remote host.