What I'm Thinking

Git Reflog
15 March 2014

Git reflog just saved my bacon. Last week my commit message referenced the wrong ticket and in attempting to fix the commit message I accidentally reset our develop branch of the project to the master branch. In short, I wiped out all our changes in the project! A few months of work gone, poof! Well, Git is a distributed repo system so everyone still had the original correct repo, but to top things off I had also pushed these changes to our our central repo server. ... Read More

Block SSH Attacks
1 March 2014

Periodically one of my servers gets hit by SSH brute force attacks, and I finally got tired of manually dealing with it. Previously I would go through the following flow; Get a notification that my server load was increasing Log into the sever Check/confirm that it was the usual issue, by looking at the logs Check where the offending IP address is originating from. Add an iptables rule to block the offending IP address iptables -I INPUT -s <OFFENDING_IP> -j DROP Watch as the load returned to normal So after a little research, with the goal of not wanting anything fancy or crazy to install and/or setup. ... Read More

1 January 2014

Onto the next stage of game development, developing a Hangman game. Actually Hangman can be developed instead of a text adventure game if text adventure games are not your thing. As with a text adventure game, Hangman is very much straight programming, and nothing fancy. The one interesting thing I did in my version of the Hangman game was to make use of the algorithm R(3.4.2) (Waterman’s “Reservoir Algorithm”) from Knuth’s “The Art of Computer Programming” (simplified version). ... Read More

Text Adventure
31 December 2013

Still working on learning game development and the first step is to create a text adventure game, so says all the articles on learning game development. So that is something I have done. The storyline is pretty much non-existant, but the programming part of it is there. I think, anyway. I actually enjoyed creating this more than I thought I would. The nice part about it is that the framework is there. ... Read More

Sockjs Examples
30 December 2013

Came across sockjs for go and seeing that I had created some code examples using socket.io and python, I decided to do the same using golang of sockjs, as an excuse to play with it. So far the examples are pretty simple. But I got to play with tickers and goroutines in go, so that was nice. I actually used the net/http package for handling the requests and did a little template parsing. ... Read More
Working with Django templating engine or Jinja2 you have the ability to inherit/extend templates. which I find very helpful in keeping things DRY. Now working on a golang app I wanted something similar and this is how I ended up doing it using the base packages. I’m sticking with the base packages for my first few apps, so I can actually learn them. When starting out with Python, I used Django mainly and I feel that was not the correct thing to do, as Django black boxed a lot of functionality and it took a while to get a deeper understanding. ... Read More
I was wondering how performant Golang is, so I decided to put together a little benchmarking example for myself. So I started with Python, which is what I know best and created the following simple script; #!/usr/bin/env python def fac(n): if n == 0: return 1 return n * fac(n - 1) if __name__ == "__main__": t = 0 for j in range(100000): for i in range(8): t += fac(i) print("total: {0}". ... Read More

24 December 2013

Still playing with golang and Martini is a package that I think I will be doing a lot of work with, seeing that web applications are what I am constantly working on. The nice thing about Martini is that it relies heavily on net/http and it a very thin layer to it. Creating a web application is straight forward and simple enough. It will be interesting to work on a larger application with it to get a better feel for it. ... Read More

Go Go Go
23 December 2013

Golang has been a fascination for some time, and I have finally jumped in and started learning about the language. Started off with the Tour of Go, and lately the Go Advent has been very helpful. The Go Advent series was really nice as it introduced a wide varied list of applications/uses of go. A number of them that I would not have even looked at or been aware of. ... Read More

That'S A First
28 October 2013

Well that’s a first, I was moving my monitoring system to a new server and decided to go back to using Nagios instead if Icinga and was looking into setting up NRPE on the remote server and did a quick Google on that and lo and behold the first entry in the Google results was an entry written by me on how to do that :) You would think I would remember that I write these things. ... Read More