Using Heidimysql over SSH tunnel

HeidiSQL LogoIf  like me your servers block mysql from outside connections, you will need to use ssh tunneling if you want to use a gui tool like Heidimysql to manager your Mysql dbs. I struggled to get this new feature working in Heidi until i stumbled on a post by Casey Mclaughlin that contains the missing step (saving server public key to your Win registry using Plink.exe).

So hopefully if anyone finds this post, this will is the link.


Extract Email Addresses from Text Files on Linux

Was looking for a quick way to extract email addresses only from a folder full of csv files. Perl to the rescue Ijust did this

cat *.csv > all.csv
perl -wne'while(/[\w\.\-]+@[\w\.\-]+\w+/g){print "$&\n"}' all.csv | sort -u > output.txt

Presto a nice alphbetical list of email addreses ripped from the beating heart of the csvs.

Searching folder of files for a string

Ill never remember this and its just come in very handy

grep -lr “string” path

-l – this makes it list the filenames where it finds the string
-r – this makes it recursively scan all sub folders


grep -lr “/var/www/proj” ./*

This would scan for the string “var/www/prog” in all files/folders starting from the current working directory.

Love linux!