Overlanding

So, for the last 6 weeks I’ve been over-landing from Cape Town to Nairobi. I decided to ditch almost all of my tech for the trip. My Samsung Galaxy S3 and my Thinkpad were replaced with an old school phone and a notepad. I also picked up a tiny little Sandisk Sansa Clip MP3 player for the trip. For reading I had my Kindle and a few USB keys for storing files and for Portableapps(which was a disaster I’ll write about another time). The decision for ditching was simply a need to be away from the tech and connectedness. I’m in Africa for a reason, and I simply didn’t want the constant distractions a phone brings me. I couldn’t help but notice on the way others were clamouring for internet when they thought it was an option. I appreciated having that option. Anyway, as a result I have a lot of time to write with the long journeys during the day and frankly I wish I had more information on the trip to see where the land lies before starting, so I figured I write this blog to give others a heads up and I’ve split things up into each destination. Here’s the skinny on countries I hit ...

July 18, 2013 · Shane Dowling

worksly.com — Find workspaces in the UK

It’s online here. Hopefully people find it useful, it’s got data from Foursquare, Yelp and a few other sources. The site itself is built in Python, Bottle, Bootstrap and MySQL, though I hope to upgrade to Postgres with PostGIS when I get the time. I also want to make it look a lot less bootstrappy. For scraping content, because Yelp renders it’s content in AJAX callbacks, it required Phantom JS and Python with it’s awesome beautifulsoup library. ...

May 22, 2013 · Shane Dowling

Circumventing The Pirate Bay Blockade

Fuck jou, Tim Kuik _Edit description_www.fucktimkuik.org will forward you to a number of viable options, but in case that goes down. Download music, movies, games, software! The Pirate Bay - The world’s most resilient BitTorrent… _Download music, movies, games, software and much more. The Pirate Bay is the world’s largest bittorrent tracker._thepiratebay.ee Loading… _Edit description_malaysiabay.org Loading… _Edit description_lanunbay.org And while you’re at it, could you be a doll and fill this in? ...

May 3, 2012 · Shane Dowling

Screwed Server Checklist

My servers started getting unusably slow at peak hours lately and I decided, midst panic to vaguely attempt to document the various things I had to go through to narrow down the problem, anyway I’m sticking them up here so a) I don’t lose the list and b) it might be of use to someone else. Some are obvious, some less so. I’ve already forgotten half of what I did to fix it, so here’s the other half before I forget anything else. ...

April 28, 2012 · Shane Dowling

Diary.py future proof memories.

I’ve created a little command line diary script for anyone whose interested. It stores your diaries in separate txt files so you know all of your memories will always be accessible to you in a format you’ll always be able to read. It’s super quick and easy to use. It’s based loosely on Gina Trapini’s todotxt. Documentation is here. Download is here. Works really well with Dropbox too!

March 8, 2012 · Shane Dowling

Quick vhost script

Quick script to setup a new virtualhost entry for apache. Works for me on archlinux. #!/usr/bin/python import sys, os, subprocess vhosts_file = "/etc/httpd/conf/extra/httpd-vhosts.conf" hosts_file = "/etc/hosts" domain_name=sys.argv[1] folder=sys.argv[2] def usage(): if (len(sys.argv) != 3): usage() sys.exit() currentUser = subprocess.getoutput("whoami") if currentUser != 'root': print("You need to be root!") sys.exit() if not os.path.exists(vhosts_file): print("Vhosts file doesn't exist, exiting") sys.exit() if not os.path.exists(hosts_file): print("Hosts file doesn't exist, exiting") sys.exit() if not os.path.exists(folder): print("Web folder doesn't exist, attempting to create") os.makedirs(folder) vhost_entry = "nnntServerAdmin your@%sntDocumentRoot "%s"ntServerName %sntServerAlias %s ntnttDirectoryIndex index.php index.htm index.htmlnttAddHandler cgi-script .cgi .plnttOptions ExecCGI Indexes FollowSymLinks MultiViews +IncludesnttAllowOverride NonenttOrder allow,denynttallow from allntn" % (domain_name, folder, domain_name, domain_name, folder) vhosts_file.write(vhost_entry) host_entry = "n127.0.0.1 %sn" % domain_name vhosts_file.write(host_entry) subprocess.call('/etc/rc.d/httpd restart', shell=True)

March 1, 2012 · Shane Dowling

Easily remember linux commands

I use an absolute ton of awesome tools my various linux distros. The problem is I tend to forget a lot of the time how to use the tools, so I got a list of frequently used command with and a few examples of how to use them from here. So here’s the file I use. — Create a new tar archive $ tar cvf archive_name.tar dirname/ — Extract from an existing tar archive. $ tar xvf archive_name.tar — Grep for a given string in a file (case in-sensitive search). $ grep -i “the” demo_file — Print the grep line, along with the 3 lines after it. $ grep -A 3 -i “example” demo_text — Grep for a given string in all files recursively $ grep -r “ramesh” * — Grep for a string that starts with $ char and contains what’s in $1 grep — color=auto -B 1 -E ‘^$.b’$1’b’ cmd_examples.txt — Find files using file-name ( case in-sensitve find) $ find -iname “MyCProgram.c” — Execute commands on files found by the find command $ find -iname “MyCProgram.c” -exec md5sum {} ; — Find all empty files in home directory $ find ~ -empty — Converts the DOS file format to Unix file format using sed command. $ sed ’s/.$//’ filename — Print file content in reverse order $ sed -n ‘1!G;h;$p’ thegeekstuff.txt — Add line number for all non-empty-lines in a file $ sed ‘/./=’ thegeekstuff.txt | sed ‘N; s/n/ /’ — Remove duplicate lines using awk $ awk ‘!($0 in array) { array[$0]; print }’ temp — Print all lines from /etc/passwd that has the same uid and gid $ awk -F ‘:’ ‘$3==$4’ passwd.txt — Print only specific field from a file. $ awk ‘{print $2,$5;}’ employee.txt — Diff ignore white space while comparing. $ diff -w name_list.txt name_list_new.txt — Sort a file in ascending order $ sort names.txt — Sort a file in descending order $ sort -r names.txt — Sort passwd file by 3rd field. — Xarg:Copy all images to external hard-drive $ ls *.jpg | xargs -n1 -i cp {} /external-hard-drive/directory — Xarg:Search all jpg images in the system and archive it. $ find / -name *.jpg -type f -print | xargs tar -cvzf images.tar.gz — XargLDownload all the URLs mentioned in the url-list.txt file $ cat url-list.txt | xargs wget –c — LS:Order Files Based on Last Modified Time (In Reverse Order) Using ls -ltr $ ls -ltr — LS:Visual Classification of Files With Special Characters Using ls -F $ ls -F — Gzip:Display compression ratio of the compressed file using gzip -l $ gzip -l *.gz $ bzip2 test.txt $ bzip2 -d test.txt.bz2 — UNZip:View the contents of *.zip file (Without unzipping it): $ unzip -l jasper.zip — Shutdown the system after 10 minutes. $ shutdown -h +10 — Force the filesystem check during reboot. ...

February 19, 2012 · Shane Dowling

Simple ubuntu backup to S3

After browsing the web for ages to find a decent solution to backup my server to amazon s3 I finally came across one and I’m just throwing it up here. So basically all I need it to do was backup my sites(filesystem and mysql databases) and some config for lighttpd. The post I’m basing this off is here. Install automysqlbackup using apt sudo apt-get install automysqlbackup Run automysqlbackup as root(just to give it a test) sudo automysqlbackup ...

January 14, 2012 · Shane Dowling

Simple git web interface

I decided instead of springing for a monthly github payed account I’d install git on a server and use a decent web interface that could be easily installed. So for this little guide I’m rocking ubuntu 10.04 with git and lighttpd already installed. It was a Goldilocks search for ease of installation vs web interfaces usefulness. I tried a number of options, gitweb looked a little rough for my liking and Gitorious and InDeferno were just an utter pain to install. Eventually I came across gitalist and decided I would give it’s incredibly simple to installation go(http://www.gitalist.com/install/). By simply following the directions I managed to get it running without any thought. The problem was it was running on port 3000, I wanted it to hook it into lighttpd and have it run under a subdomain. ...

January 7, 2012 · Shane Dowling

CLI Dash

Due to being flu-ridden for the entire holiday period, I decided to write up a quick tool I’ve been wanting to write for ages. It’s written in Python, so go easy, I’m no Python expert and I’m sick. The tool is essentially a wee-little dashboard for your linux server. It only supports a few system details at present(essentially handy little things python does) but I’ll add more as I get the time, if you’ve any suggestions let me know. ...

December 31, 2011 · Shane Dowling