Nick Geoghegan

Professional Yak Shaver

Author: Nick

Mutex vs. Semaphore

Back when I taught C programming labs, a student asked what was the difference between a Mutex and a Semaphore. My simple explination is below. Little did I know, Niclas Winquist came up with the same explanation in 2005. To me, this really is the best explanation for a non-technical audience. Mutex Mutex is also called “Mutual Exclusion”. […]

Read More


Programmers have a very precise understanding of truth. You can’t lie to a compiler. Try it sometime. Garbage in, garbage out. Booleans, the ones and zeros, trues and falses, make up the world programmers live in. That’s all there is! I think programming is deep, it teaches us about the non-cyber universe we live in. […]

Read More

PHP5-CGI on Debian Lenny

  This is a story all about how, my life got twist turned upside down – by PHP5-CGI on Debian Lenny. The documentation on this isn’t the best, so here’s how I was able to get PHP5 running.   All commands are assumed to be run as root.   apt-get install php5-cgi Installs PHP5-CGI, obviously. […]

Read More

C can be crazy

C can be crazy some times. #include void(*swap)() = (void(*)()) “\x8b\x44\x24\x04\x8b\x5c\x24\x08\x8b\x00\x8b\x1b\x31\xc3\x31\xd8\x31\xc3\x8b\x4c\x24\x04\x89\x01\x8b\x4c\x24\x08\x89\x19\xc3” “Oh, there you are Mr. Insanity…”; int main(){ // works on GCC 3+4 int a = 37, b = 13; swap(&a, &b); printf(“%d%d”,a,b); } So, what the fuck is going on? This code, basically, takes a block of raw instructions, stick it into the memory, […]

Read More

I saw a guy get killed today

I was riding home from work today on my bus, listening to music and not paying attention to anything. As we were stopping at one of the bus stops, a girl in the back started screaming. I looked back and saw her pointing out the window, and I followed her stare. Out in a garden […]

Read More


I liked school I liked learning ideas that I never would have taught myself I liked being put in situations designed simply to challenge me I even liked being thrown into the grading process But now my school days are over And the assignments have stopped No one is forcing us to learn anymore It […]

Read More

Snow was general all over Ireland

Yes, the newspapers were right: snow was general all over Ireland. It was falling on every part of the dark central plain, on the treeless hills, falling softly on the Bog of Allen and, farther westward, softly falling into the dark mutinous Shannon waves. It was falling, too, upon every part of the lonely churchyard […]

Read More

Server alerts via SMS

There was a server recently, that I used regularly, that I noticed kept going down in the middle of the night every Friday. Since I was fairly annoyed at not being able to check the websites hosted on the server on the weekends, and not able to check the exact time the server went down, […]

Read More