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
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
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 »
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 »
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 »
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 »
Very neat resource and clear explanations with diagrams. https://www.cs.swarthmore.edu/~newhall/cs31/resources/C-structs_pointers.php
There is a very subtle difference in the following: int *myarray[10] v’s int (*myarray)[10] The first declaration is interpreted as an array of 10 integers, that are pointers. That is you have 1 array holding 10 pointers that are of type integer. The square brackets have a higher precedence so the myarray[10] gets defined first.… Read More »
Learning about pointers in C is no mean feat. It may seem logical and obvious to the well trained but to the beginner or newbie, it is a challenge and a half. Not only that but trying to find good material on learning about C pointers is tricky as well. There is too much information… Read More »
I was researching on what “dnl” meant within a configure.ac file and my Google search showed results from http://www.gnu.org/software/m4/manual/m4-1.4.14/html_node/Dnl.html. Thinking this was the authoritative source, upon reading, I couldn’t for the life of me understand it. After searching some more, it was explained very clearly and succinctly at Stack Overflow of all places. http://stackoverflow.com/questions/3371239/autoconf-dnl-vs In configure.ac, lines commented with… Read More »
Viewing variable values via gdb of a va_list is not as straight forward as gdb> p myvar. It requires a few extra steps not only in execution but in understanding. Read on if you want to know how va_* works and how to view the underlying variables. Step 1: The first step is to understand… Read More »