A programmer started to cuss --- Because getting to sleep was a fuss --- As he lay there in bed --- Looping 'round in his head --- was: while(!asleep()) sheep++;

Interesting unix commands and techniques

In an article on Reddit I found some interesting unix commands I didn't know - even though I've been using unix/*nix for years.

The first one enables you to edit the current command in your $EDITOR before executing it. It's great when you want to type a multi-line command, for instance. In ZSH you can enable this functionality by inserting the following into your .zshrc:

autoload -z edit-command-line
zle -N edit-command-line
bindkey -e

Pontifex - an output-feedback mode stream cipher

Just the other day I finished the novel Cryptonomicon by Neal Stephenson (it's really good and I recommend it to the masses!) in which a cryptosystem, dubbed "Pontifex", is used in order for Randy Waterhouse and Enoch Root to communicate in prison cells using only decks of cards. The book actually has an appendix in the end describing it. In fact, the cryptosystem was invented by Bruce Schneier and is called Solitaire.

OpenCL at first glance

OpenCL is short for "Open Computing Language" and it's a framework for doing effective, parallel computing on the available processors of a system, be it GPUs, CPUs, Cells, DSPs or something else.

GDB on Multithreaded Programs

In recent years the number of cores on the CPUs have exploded because the cores themselves aren't getting any faster. Our programs, therefore, need to run in an interleaved fashion; using a thread primitive. And then you might be thinking to yourself how you debug such multithreaded programs. Luckily, GDB supports debugging of multithreaded programs but it isn't all just fine and dandy. If the program relies on the responsiveness of the spawned threads, then suspending them might result in unwanted behavior. However, if this isn't a problem then you are ready to rock and roll.

GDB Tricks

Tagged:  

In continuation to my last post, GDB Introduction, I now want to show some interesting and useful commands.

Emacs

I often run GDB through Emacs (my beloved editor. All hail!) because It makes the experience just a bit nicer. Invoke GDB by M-x gdb. It will present a small dialog in the bottom to specify how to start GDB (arguments etc.). When it has started the major mode will be gud-mode (grand unified debugger).

Here's a quick cheat sheet:
Step: C-c C-s
Next: C-c C-n
Continue: C-c C-r

GDB Introduction

Every programmer knows that the debugger is his best friend. And even though "print debugging" solves a lot of problems there comes a time when a debugger is simply the better solution. One such scenario could be debugging an occurrence of a segmentation fault (memory access violation) or similar. The program suddenly crashes but what caused it? And why? It might be due to a nontrivial cause but it could be a simple "off by one" too (as it often is) or a null pointer. GDB (GNU Debugger) comes to the rescue!

Thumbs up for HTC Wildfire

It has now been a couple of weeks since I bought my HTC Wildfire. Within this timespan I've become quite taken by this smartphone, the "mini HTC Desire" as it has been called. Comparing to Desire, it's true that the 3.2" QVGA screen isn't as great as the 3.7" AMOLED screen and that Desire's got the Snapdragon processor, otherwise it's a pretty close race if you look at the specification of the two models. Keep in mind that Wildfire is cheaper than Desire, too.

This is actually my first smartphone (yes, I know it's a bit late but that's how it is anyways) and now I'm simply addicted to having a somewhat good internet connection constantly available; automatically checking some mail accounts every 15 minutes, updating the RSS feeds, synchronizing contacts and calendars (Google, Facebook, and Twitter), and a lot of other stuff. I also use the phone as an MP3 player via my Bluetooth headset - flawless. One of the only bad things about the device is the battery duration time, which of course depends upon the usage. But even though I turn off WLAN, Bluetooth, and GPS (when I don't use them, that is) I still have to charge it every evening more or less.

Splay tree data structure implementation

In 1985 Sleator & Tarjan developed the self-adjusting Splay tree data structure. It is a binary search tree which implicitly reorders and readjusts itself by the use of so called splay operations. Regular operations such as insert, delete, lookup, min, max etc. all take amortized time O(log n), where n is the amount of nodes in the tree. The Splay tree is most efficient when a sequence of operations are carried at which point it rivals other binary search trees.

Injecting a VNC server into a remote computer

In the previous two posts (Exploiting SMB on Windows and Stealing a photo from a remote webcam) about using Metasploit to obtain access to a remote computer, the focus remained mostly on gaining access and then dropping into a shell locally or transferring back a picture from the webcam. This time we will take a different approach.

Stealing a photo from a remote webcam

Ever wanted to capture a photo from a remote webcam? Like from one of your friends perhaps. Probably if you've a little hacker in your belly.. This is another demonstration of the use of Metasploit like I did in my previous article Exploiting SMB on Windows. Therefore, I won't talk about installing the framework and running the supplied program msfconsole.

Syndicate content