Gl.ib.ly

(glibly); Just another techie blog.

Doing OCR on linux/Mac

Posted by Tariq • Monday, July 27. 2009 • Category: Programming, Tidbits
Yesterday somebody gave me a USB key with ~1000 JPEGs on it. Each JPEG was a scanned page, ugh, and the task was to find some useful information about topic X. Now each JPEG was about 1-2mb and I needed to do something useful with these images quickly. So what follows is quick walk through of how to do Optical Character Recognition (OCR, that means taking silly image files and ripping out any text identified in them) on Linux or in my case a Mac.

Continue reading "Doing OCR on linux/Mac"

Deleting specific emails from the postfix mail queue

Posted by Tariq • Thursday, January 8. 2009 • Category: Computers, One liners
A week ago a development database server lost power, which is usually no big deal only that I have some reporting scripts that run every 5 minutes for each database. When these databases became unavailable they (the scripts) like to send me a quick mail telling me what went wrong. The network switch also was out of action so there was no route to the outside world from this small development network. The server lost power for three days and a massive amount of mail built up in the mail queue. When power was restored the SPAM started pouring in.

Continue reading "Deleting specific emails from the postfix mail queue"

Defined tags for this entry: , , , , , , ,

All configuration variables in Moodle code?

Posted by Tariq • Monday, December 15. 2008 • Category: Moodle, One liners
Sometimes Moodle introduces some nice new configuration variables and I like to make sure that I know what they are and where they are. So to begin my investigation without heading off to the web I use the following command to get me a sorted list of the $CFG variables.

Continue reading "All configuration variables in Moodle code?"

Defined tags for this entry: , , , , , , ,

Adding a malicious system call to the Linux kernel

Posted by Tariq • Thursday, December 11. 2008 • Category: Security
Today I am adding a malicious system call to the Linux kernel which will allow the caller to do something they cannot normally do in user mode. When attacking a Linux box our goal is usually to become root; as root we can do anything we like, so the system call I will add to the Linux kernel gives the caller real and effective user ids of zero.

There are relatively few tutorials out there on how to do this, unfortunately there a little differences between versions of Linux that can easily stump beginners, so this tutorial tries to give you an environment which you can easily replicate using a virtual machine and go through the tutorial.

Continue reading "Adding a malicious system call to the Linux kernel"

Creating an HTML file with white space traces

Posted by Tariq • Tuesday, December 9. 2008 • Category: One liners
Once upon a time I was comparing some Java files. Now one way to find plagiarism among students who share program code is to look at the white space traces in a file. Students typically try and edit the source code: changing variable names and function names; however, they usually fail to conceal the original author's white space patterns. White space consists of characters which don't appear on screen such as spaces, tabs, and new line characters. Anyway you can catch lots of cheaters by looking at the white space patterns in files ... maybe that's another blog entry, so back to this one.


Continue reading "Creating an HTML file with white space traces"

Defined tags for this entry: , , , ,