Gabriel J. Durazo

bringing digital dreams to life

Scotland

Isle of Skye, Inverness, water rafting… will fill this out at some point.

Tiptoeing through the internet

It seems like these days every link you click on the internet sets off a chain reaction of events, notifying a vast array of tracking websites of your movement, and kicking off dozens of scripts to dazzle you while obscuring the content you’re trying to read.

This is how I fight back.

Tiptoeing through the internet (part 1: HTTP)

New blog setup with S3, jekyll, bourbon/neat, rsync

Start the server to watch files, navigate to jekyll/ and run:

1
jekyll $ jekyll --server --auto

then browse to:

1
http://0.0.0.0:4000

Bourbon/neat are simply drop in sass files. So have sass watch the directory, and compile to the css folder:

1
jekyll $ sass --watch sass:css

Then, if we change a sass file, it will compile to the css folder, which jekyll will watch.

New blog setup with nginx, Hakyll, rsync

I’ve decided to move to a static site so it remains snappy with a minimum CPU overhead. The site is now generated by Hakyll (and Compass/Sass for the CSS), and rsynced to my server running nginx. The process becomes:

  1. Write a post in markup.
  2. Use hakyll to compile it to a static site.
  3. rsync it with my linode server.
  4. Visit! Let nginx work its magic.

Cracker Barrel Triangle Peg-Jumping Puzzle Solver in C

Recently I was given a puzzle like the kind that Cracker Barrel sells: You have a triangular board of holes filled with pegs (except for one). You then jump one peg over another into an empty space, removing the peg that was jumped. The goal is to perform the proper sequence of jumps such that you’re left with one peg.

Cracker Barrel puzzle

I fiddled with it for a little while but didn’t find a solution. In the end, I decided it would be fun to write a little C program to solve it for me!

Best Full-Length, Black, Waterproof Duster

I have been looking for the best piece of outerwear that is: 1) Full Length (covers my pants), 2) Waterproof, 3) Rugged. That garment seems to be a “Duster”.

A Duster (or “Drover” in Australian English) is a full-length garment originally designed to keep dust off your clothes while riding a horse. In addition, many are designed to be waterproof by using materials like waxed canvas. Perfect for a blustery rainy day. As far as I can tell, the duster is like a trench coat, but longer.

Toying with Getting a Server

As of late, my roommate and I have thought it would be fun to build and administer a server for our apartment. Unfortunately, it doesn’t seem wise, for me, to spend money on a server at this point (I recently negotiated myself down from 60 hrs/wk to 30 at work in order to work on an iPhone app with a friend). However, my temporary self-justification is this:

I recently liquidated my position in palladium and am looking for my next investment. I have no idea what’s going to happen with the economy. I’m generally bearish, thinking we’ll have the Dow crash below 9000 before it hits 12,000 again. On the flip side, I’m worried about inflation, so I don’t want to maintain a large cash position either. TIPS might be good, but the government debt is so huge, I’m somewhat worried about default. So I don’t know where to invest. About the only thing I’m sure I’ll always have a good ROI on is me! So, why not spend the money on a server? I’ll blog about all my decisions and research, and I’ll learn a ton. Right? Right?

So, assuming I decide to move forward with this, I will get to research and decide on lots of interesting things, including:

Incremental Data in Safari, Firefox, Chrome, and Opera

Fun little tidbit: Firefox, Safari, Chrome, and Opera each behave slightly differently when faced with slowly incoming incremental data.

I wrote a very short little node.js server script which basically:

  1. Notices an incoming request
  2. Waits five seconds and responds with the headers and text “A”
  3. Waits five more seconds and sends “B”
  4. Waits five more seconds, sends “C”, and closes the connection

So I fire up each browser, go to the address bar, type “localhost:8124”, hit Enter, and watch:

Monitoring a Twitter Page with BeautifulSoup, sendmail, and cron

Imagine, if you will, a baffling business establishment which

  1. Sells the most delicious cupcakes you’ve ever had
  2. Sells these cupcakes out of a mobile cupcake truck
  3. Has no single permanent location
  4. Only gives out clues to its location at any given moment via Twitter

My friends, I give you Cupcakory.

Now, I just wanted to be sent an email whenever Cupcakory tweeted something new. Is this not possible in Twitter? Twitter can send you an SMS on new tweets, and the new tweets of course show up on your homepage if you’re a follower, but I don’t use text messages or Twitter, so those didn’t work for me.

So here’s a simple Python script I wrote to do what I needed. The script looks at the most recent tweet by a Twitter user and compares it to the most recent it knows about. If it’s a new tweet, the script will send the contents in an email. Works well with cron to periodically check for new tweets.