Category Archives: Programming
How do callbacks work?
Confused about how callbacks work? Check out this really neat example. def say_hello(value, callback): print value callback() def say_name(): print “Fra” say_hello(“ciao”, say_name) Ref: https://bytesforlunch.wordpress.com/2012/03/15/simple-callback-implementation-in-python/
Neat site for svg icons
This site http://www.flaticon.com has a whole bunch of cool svg for download. SVG stands for Scalable Vector Graphics and uses XML to draw images that do not lose resolution when scaled up. To test your SVG, this site here is very handy https://www.w3schools.com/html/tryit.asp?filename=tryhtml_svg_circle
What is Slow Loris Attack
Here is a neat article explaining the Slow Loris attack. Single Computer DoS – Slow Loris Attack
Grep search command everyone should memorise
It’s a neat and powerful command that all *nix users should know. >> grep -rn “keyword” * This does a search for the keyword. * = all files -r = recursive (for all child directories) -n = show line numbers
curl ifconfig.me
Ever needed to grab the public IP of the device you are on via terminal? This neat command will do the trick! curl ifconfig.me
The White Space Phenomenon
As a developer, one of the worst problems to encounter is the white space problem. In recent memory I’ve encountered this 2 times. Once in 2013 when integrating with MYOB, a trailing white space at the end of a variable caused an http 400 error which was a complete mystery at the time. The second time… Read More »
Connecting to Bitbucket Server via SSH
It can seem daunting at first, but connecting to a git server via SSH can be performed in a few easy steps. The idea is that with SSH, you create a public/private key pair that does the authentication for you so there is no need to type your password each time you want run git… Read More »
To build from source, binary or tarball?
It’s a lot quicker and less hassle to build from a tarball but lets face it, it’s just not as fun :). Let’s go through a simple sample process. There is an open source code call cpuminer that turns your computer into a bitcoin miner. Back in the days, this is how bitcoin mining all… Read More »
Basics of OSX .bashrc v .profile v .bash_profile
The key to understanding what all this means it is important first understand the difference between a login shell and a non-login shell. Types of Shells A login shell is when you are logging in remotely to another machine via ssh. You generally need to login. A non-login shell is when you are already logged into… Read More »