Smokes your problems, coughs fresh air.

Author: halfgaar (Page 26 of 26)

Halfgaar is Wiebe. Wiebe is a contributing author on this weblog. He also has a lot of stuff (such as long, in-depth articles) on his personal website.

Wiebe's day job is as a senior software developer and system administrator at YTEC.

In his free time, he built the free, open-source FlashMQ software. Together with Jeroen and Rowan, he is now building a managed MQTT hosting business around his open masterpiece.

Push the limits

Besides making good music, Enigma also writes meaningful lyrics. A quote from “Push the Limits”, from the album “The Screen Behind the Mirror”, by Enigma:

Don’t submit to stupid rules
Be yourself and not a fool.
Don’t accept average habits
Open your heart and push the limits.

The irony of this is, that while most people agree with this, they don’t really understand it or put it into practice. This was true for me personally as well. It’s all too easy to accept consensus reality without a second thought. But this consensus reality is often misleading and it can be hard to oppose it, mostly because of social reasons.

Anyway, my suggestion for today is: read the quote again and apply it. Allow your doubts to float to the surface and express them, because I know those doubts are there.

Ron Paul: Going the Distance

Here I am again with a message about Ron Paul. He asks not to give up, even though election victories are already practically claimed, prematurely of course. He also wants to organize a march to Washington D.C., to give the media something they can’t ignore, like they usually do.

Take a look at this campaign update.

https://youtu.be/ryMliyeIDp4

And learn more about the revolution march.

Rolling back a failed rdiff-backup session on a full partition

For those of you who use rdiff-backup, you may have run into the situation where the partition you’re backing up to has no more space available. This is a very annoying situation, because rdiff-backup needs space to be able to roll back the session, so you’re kind of stuck. You might think: “doesn’t a decent file system have a reserved amount of space for the super user?” Yes, decent file systems do, but you’ll often be running rdiff-backup as root, so that won’t do any good.

There is a very simple solution. So simple, you might not think of it, hence this post. Simply make a dummy file of, say, 50 MB on the target partition, which you can delete when you need the space for rolling back. To make such a file l33t-style:

dd if=/dev/zero of=/location/dummyfile bs=1048576 count=50

Getting your terminal unstuck

Have you ever had your terminal freezing on you for a reason you can’t identify? Fret no more, because this post will save your future login session.

Your problems are most likely caused by sending an XOFF character to the server, by pressing CTRL-S. The XOFF character is a flow control character, which instructs the server to stop sending data. To undo this, you need to send an XON character, which you can do with CTRL-Q.

Misfortune would have it that CTRL-S is the forward search command of the readline library. This makes searching in your bash history, among other things, a little annoying. Luckily, you’ll mostly use CTRL-R, for backward search, but sometimes you need a forward search as well. I would welcome any suggestion as to how to use CTRL-S without having your terminal freezing on you. The terminal program I use, Putty, doesn’t seem to have an option for it.

Efficient scanning and storing of documents

I don’t like having an administration in dead-tree format, but there are those who insist on sending you all kinds of things in this format. To make this data easier to access and back up, I scan it to a digital format. I used to do this manually, with the GIMP, but I decided it was time for some automation. Therefore I wrote a script, which scans whatever you put under the lid of the scanner in lineart mode, and stores it very efficiently in a DjVu DjVuBitonal document. And here it is:

#! /bin/bash
# Author: halfgaar
 
# Prevent attacker from placing unholy replacements of system commands in your
# working path.
PATH="/usr/bin:/bin:/usr/local/bin"
 
# User settings
RESOLUTION="400"
SCANNER_DEVICE="plustek"
 
OUTPUT_FILE_BASENAME=$1
OUTPUT_FILE="$OUTPUT_FILE_BASENAME.djvu"
TEMP_FILE="/tmp/halfgaars_scanned_image"
 
[ ! -n "$OUTPUT_FILE_BASENAME" ] && "No filename given" && 1
 [ -e "$TEMP_FILE" ];
  "Temp file $TEMP_FILE already exists. We don't want to create a symlink vulnerability here..."
  1
 [ -e "$OUTPUT_FILE" ];
  "$OUTPUT_FILE already exists."
  1
 
# page dimensions are in mm
scanimage -d $SCANNER_DEVICE -x 210 -y 297 --mode lineart --resolution $RESOLUTION > $TEMP_FILE
cjb2 -dpi $RESOLUTION $TEMP_FILE $OUTPUT_FILE
 
rm $TEMP_FILE

Simple, but effective. I may extend it in the future to also be able to scan into a DjVuDocument file (a file containing both DjVuBitonal and DjVuPhoto segments), but for now, this serves.

Newer posts »

© 2024 BigSmoke

Theme by Anders NorenUp ↑