Posted on August 5, 2013 | no comments
From time to time, I have been known to accidentally type my password into a “username” prompt in a
bash shell. In that situation, the password you entered is now a part of your
~/.bash_history file forever, unless you truncate or redact it.
A quick command to do this is
$ history -c
Don’t forget to end your session ASAP as your password will still be stored in memory until you do.
For the truly paranoid (like me), I also recommend changing your password right away, in the eventuality that someone was snooping your session at the exact time that you happened to enter your password in plain text.
Now, where’s my tinfoil hat?
Posted on June 6, 2013 | no comments
If you’re writing a performance-focused app, it’s nice to be able to time how long various pieces of code take to execute. Below is the class I use (called
StopWatch) and a really simple example of how I use it.
Here’s a silly example to time how long it takes to sleep for 2 seconds using
When I run this on my local WAMP stack, I get
Elapsed time: 1.9999310970306 seconds. The results vary, but they’re all as close to 2 seconds as makes no difference.
A better example would be if you were sending a file to a remote location (such as Amazon S3) and you want to find out how long it takes.
Note: This example uses the PHP S3 class from https://github.com/tpyo/amazon-s3-php-class.
This would produce something more like
Elapsed time: 3.7492766736612 seconds (depending on how big
file_to_upload.zip is obviously. This little tool has come in useful for me a number of times, especially when trying to identify bottlenecks in systems that perform a large amount of juggling with complex data structures. You could add all kinds of other options to it as well, like defining what units to return (seconds, milliseconds, nanoseconds).
Posted on June 5, 2013 | no comments
Something I noticed as a general trend with modern technology (especially in mobile development) is a trend away from shiny, glossy UI elements like icons and buttons to a more flat, conservative style.
Here’s a really interesting discussion I found about the subject on the UX stackexchange site http://ux.stackexchange.com/questions/35576/what-explains-the-current-shift-from-glossy-uis-to-matte-uis
Looks like the main culprits would be Windows and Android, while Apple seems to be sticking with what they know (for iOS at least).
Posted on May 23, 2013 | no comments
I recently came across a neat piece of software that maps out your mouse movements and creates artwork out of them. Check out the image below – it’s a graph of my mouse movements on my left monitor over a 9 – 5 working day. Click to see full resolution.
The black circles represent times when the mouse did not move – the huge black circle was when I went for a 2 hour meeting.
The software I used is called IOGraphica (http://iographica.com/) – try it out and see what you get!
Posted on May 15, 2013 | no comments
Posted on May 1, 2013 | no comments
Oli is ready for his first NHL playoffs – GO LEAFS GO
Posted on April 26, 2013 | no comments
As a web developer, I can’t help but wonder what technology stack any given website is running. Most of the time it’s obvious (e.g. if the URLs end in
.php it’s probably written in PHP), and other times not so much. Below is a list of various websites that I frequent and my best guess at the technology at work.
Take a read and comment with any others you’ve found, and I’ll add them to the list!
IT news, reviews, and analysis
|PHP, Memcache, WordPress
||Tags like this:
<body class="single single-post postid-35787 single-format-standard grid-view light">. A lot of self-referential links have
wp-content in them and they appear to use batcache.
British news network
||Server type is
Apache and mysterious comments referencing
.inc files. The Apache server could just be a proxy, however.
A news network that almost always checks its facts
|Java with nginx as load balancer/proxy
||Hard to tell on the main site, but their Job Openings page returns a server type of
Social network giant
|PHP, HipHop, MySQL
||A lot of their pages have a
.php extension. This is a great read also – gives a sense of the scale of their operation.
Social Coding for all
|Ruby on Rails and Erlang
||Honestly, I could not tell so I googled it, and it says right on their Wiki page that it’s RoR with Erlang. The more you know.
Career-oriented social network
Server HTTP response header was set to
National Hockey League website
||HTTP response header
Pictures of cats and atheism
|Python on Amazon AWS
||It’s open source. Also, their
Server HTTP header responds as
'; DROP TABLE servertypes; -- haha!
Programming Q&A site
|C#, ASP.NET MVC, SQL Server 2008
||They make it quite obvious
Game-centric content delivery system & online store
||HTTP Response headers
Via: 1.1 varnish and
X-Varnish: 1673704970. I guessed at PHP for the programming language because their forums and knowledge base are PHP-based.
Micro-blogging social networking
|Some combination of Ruby on Rails, Scala, Java, Thrift, MySQL and memcached
||Lots of reading, but this was the most interesting.
This is not an exhaustive list, but I’d like to expand it. If you figure any more out, leave me a comment and I’ll add it to the list! Also let me know if I made any mistakes (highly probable) or if you find any more info to add to the “Evidence” column.
Posted on April 20, 2013 | no comments
It’s not a good idea to have your
.git directory or any of its contents web-accessible. In an ideal world, your deploy process will ignore those files so that they aren’t even in your web root to begin with. If you have to have it there for whatever reason, make sure to restrict access to it using something like:
Deny from all
Put this within the
VirtualHost directive for your site, then reload Apache’s config with:
sudo service apache2 reload
Now you should be presented with a
403 Forbidden message when trying to access
http://your-web-app.com/.git. Try it!