Tips for the Unemployed

My friend Gordon wrote a blog post entitled "7 tips for unemployed Jamaicans (people)", where he distills his list of useful tips to job hopefuls. An interesting perspective from someone who proclaims "Always the employer, never the employee". Here I hope to offer a judicious voice from both sides of the fence, the employed and the employer -and more importantly, the self employed. Been there, done that, as they say.

Being a university/college graduate, I am perhaps not qualified to speak for more than half of our labour force, so these tips are likely skewed to my limited perspective. In any case, I would hope to discuss something worthwhile for everyone.


His first point, and arguably most important point, is about networking. Talent and skills will keep you in a job and get you promoted, but it rarely gets you the job you deserve. Networking helps to put you in touch with the right players so you have more options moving forward. I don't encourage you to try to make friends with everyone or pretend to like powerful people to get a job. You can meet people in a professional capacity without seeiming overbearing.

The difficulty with networking

Let's admit, meeting the right people is a matter of social class sometimes. Social stratification is strong in this country (and elsewhere). Education is the only equaliser that helps at all, and even then it doesn't always work. If you are the shiny face, sweaty black guy in the gabardine pants and old cotton shirt trying to wrangle a business executive about a sales position, it might not go well. Unless he is smart enough to recognise your hustle, but I wouldn't bet on it.

Where and how to network

  • Seek out professional clubs and associations in your industry; join the relevant clubs at your university if possible.
  • Find thought leaders online, twitter is a good place for this, or their personal blogs. Sometimes just keeping up with their online presence is a big start. Prime yourself with their work and be ready to reach out when the time is right.
  • Participate in competitions relating to your industry. Competitions are a good place to meet like minded people you may work with in the future.
  • Maintain an online presence with your best material. Networking is a two way street. If you present something of value people will naturally gravitate to you.

Consider that you will give of your time and talents to others in exchange for experience. This is a good trade off when you just begin to grow your personal brand.

As for networking at parties, I don't agree with Gordon's stance on this. If you are trying to meet business executives and CEOs, sure, bad idea. If you are trying to meet a popular Visual Artist, then an EDM rave is a great place to start. It comes down to the personalities and type of work involved.

Improve your craft

Spend the time and effort to really learn your craft/skill. Perfect practice makes perfect. Set milestones for yourself and go for it. Watch your self improve over time. Make a habit of getting better. Being better and becoming an expert at your field is a life long journey. They say it takes 10,000 hours worth of steadfast application in any field for you to become good at it. How many hours have you gone so far?

It is beneficial to also spend time improving auxiliary skills not specific to your craft (unless they are your craft); such as essay writing, public speaking and time management. These skills will put you in a class above your peers.

Look outside your chosen field

If your chosen field of work is saturated, perhaps you can start investing some time in a related field that will open up some options for you. Having multiple disciplines gives you a new perspective that can prove valuable to many industries. For instance, a writer who programs is likely to get a great job working for Google on their PR team over someone who just writes.

Make your own job

If all else fails, look to starting your own products/services. Self-employment is the ultimate form of resourcefulness -and the absolute last resort, if not the first -for those actively seeking employment from another. You may partner with a small group of people if that is preferrable. As it turns out, you don't always have to succeed at running your own business for long. The very nature of running a business will help you in your networking and reputation building efforts and you may just meet someone who values your work enough to offer you a job, if at that point finding a job is still appealing. You never know, you might just get used to working for yourself.

Update: as a bonus

As a bonus, this is me with my current boss (in the jacket suit). I met him through SlashRoots Developer Competition after winning as a member of YamZilla with Jermaine. I was also self-employed at the time, and I was networking heavily on twitter (where I met Jermaine). See, I took my own advice.
SlashRoots winners

Capture and Log Requests and Responses in ASP.NET MVC 3

Suppose you want to capture the HTTP requests coming into your service or website built on ASP.NET MVC3 (should also work with MVC 4). This includes the HTTP headers, request type (GET,POST,PUT,DELETE,HEAD), request body, and the URL requested. One way of doing this is to:

  • Create an action filter derived from System.Web.ActionFilterAttribute: override OnActionExecuting and OnResultExecuted
  • Create a stream wrapper derived from System.IO.Stream: write a copy of the data to your own stream while writing to the HTTP stream.
  • Class to store the collected data (and presumably store in a database or file)

Let's start with the custom Action Filter:

The key line here is where we switch out the response filter with our own filter:

filterContext.HttpContext.Response.Filter = new CapturingResponseFilter(filterContext.HttpContext.Response.Filter, item);

The custom filter/stream wrapper was aken from MVCContrib/UI/CapturingResponseFilter.cs. This class was modifed to write to both our memory stream and to the underlying HTTP Filter we are overriding.

And lastly, the class used to store the response/request data:

public class APIAccessLogItem
    public long ID { get; set; }
    public string Url { get; set; }
    public string RequestType { get; set; }
    public string RequestHeader { get; set; }
    public string RequestBody { get; set; }
    public string IPAddress { get; set; }
    public string Action { get; set; }
    public string Controller { get; set; }
    public DateTime RequestDate { get; set; }
    public string ResponseHeader { get; set; }
    public string ResponseBody { get; set; }
    public DateTime ResponseDate { get; set; }

To make this work, just decorate your controller with [LoggerFilter] and all the requests will be logged. You could also add the LoggerFilterAttribute as a global filter in your global.asx file.

Oh, and don't forget to put in your logging specific code for your database, file, in memory log, whatever.

Command Line Fu Part 2: Backing up EduFocal

I've been actively using Debian as my operating system of choice to work on EduFocal (full disclosure, I connect to a remote machine using a windows machine over putty). Every bit of EduFocal code that I wrote was written in vim. I actively use grep, sed, find, git, htop, and screen in my every day programming. It has been a fascinating and liberating journey from cumbersome (and not so cumbersome) IDEs and visual editors to relying soley on the power of the *Nix command line. I don't think I would ever go back. Linux is all the integrated development environment I need to get my work done.

In writing these posts, I am hoping I can subtly demonstrate the power of the *Nix command line to my peers and get them interested in how productive they can become once they get the hang of it.

Today I want to demonstrate the backup solution that I use for EduFocal. Well, one half of the back up solution. No backup solution is complete without a recovery solution. An automated recovery solution, preferably. However, today I will only show the automated backup. You won't believe how simple it is. The script below is run by cron at 4AM every morning.

cd /my/backup/folder
innobackupex-1.5.1 --user=dbuser --password=mydbpassword --defaults-file=/etc/mysql/my.cnf --databases="edufocal_db1" --stream=tar ./ | gzip -c -1 > ./db.`date +%Y-%m-%d-%H-%M-%S`.tar.gz

tar -czf assets.`date +%Y-%m-%d-%H-%M-%S`.tar.gz ../assets

find ./* -iname '*.tar.gz' -mtime +30 -exec rm {} \;

rsync -avz -e ssh /my/backup/folder/*

Let's break it down. I found this wonderful database backup utility developed by percona called the percona toolkit. It comes with innobackupex which is able to perform a full backup of a live database without losing any data. It locks each table for a second or so while performing the backup, then use the transaction logs to fill in any operations it may have missed.

I pipe that output to gzip and save it as a file with a name like db.2013-03-18-20-53-17.tar.gz.

I then backup the file system using tar and name it something like assets.2013-03-16-03-00-42.tar.gz.

I then use find to delete any backup that is older than 30 days.

Next I use rsync to copy the changes to another server (can't be too safe!)

The next server is setup to also replicate it's files to another server (as I said, can't be too safe).

The rsync command saves me a bunch of bandwidth each time as it only sends the changes. Also not shown here is the fact that I am using key authentication on the servers to allow rsync to connect.

What folks will say

I imagine one may say: Paul why aren't you just replicating the database? Well I do, but I don't trust replication very much. If something goes wrong, the wrong gets replicated and then the replication is also worthless.

One may also say, so Paul what about your code? Ofcourse, our code is backed up on github and on a diskette buried in the Amazon forest.

Next time I will show the automated recovery.