Tuesday, February 1st, 2011
(The lastest version of this article is always available in stand-alone HTML format and in PDF format. The original AsciiDoc source is also available. Please link to the HTML version, not this Blog post!)
Update 19 Februari 2017: Alexandre Grojsgold has emailed me to say that these instructions are still valid as of 2017 for OpenSuse 11.2 and Ubuntu 16.04. I’m also grateful for his other feedback and suggestions.
1. Introduction
BoxBackup is an online remote backup tool for Unix systems (BSDs, Linux, MacOSX). It is robust, secure, low on resources and can perform both in continues backup mode and snapshotting. In continues backup mode changes will be pushed to the server soon after they happen; in snapshot mode mode BoxBackup behaves more like traditional backup programs and creates snapshots every fixed amount of time.
This article will describe how to set up a BoxBackup server and client on Debian and Ubuntu machines. Much of this article can also be used on other Unix-like systems, however it will not discuss how to compile BoxBackup.
(more…)
Wednesday, January 26th, 2011
I’ve just released the latest version of MCPlayerEdit: v0.8.
This release fixes a bug in the ‘give’ command. If the user supplied in invalid ID or item name, MCPlayerEdit would crash. (Patch by Stephen Rollyson). The ‘give’ command has also been extended with additional option menus when the user chooses an item by id, but there are multiple items with that id (logs, wools and dyes).
Get the new release here.
Happy Crafting!
Thursday, January 20th, 2011
I’ve just released the latest version of MCPlayerEdit: v0.7.
This release brings MCPlayerEdit up to date with Minecraft Beta v1.2 and adds the new block types (note blocks, wool, birch, redwood, sandstone, cake) and items (Dyes, bone, sugar, cake, charcoal) presented in Minecraft Beta v1.2. Some blocks and items already present have been renamed to their proper names, as indicated by the tooltips in Minecraft. A bug in the kitsave command was also fixed.
Get the new release here.
Happy Crafting!
Sunday, December 12th, 2010
I released version 0.6 of my MCPlayerEdit.
MCPlayerEdit is a MineCraft player/inventory editor for GNU/Linux, MacOSX and Windows.
This release adds the ability to create your own kits using the kitsave command, improved tab-completing for Windows, a warpto command which allows the player to warp to a specific set of coordinates (patch by Foone) and fixes a bug in the position command.
You can find the release here.
Friday, November 5th, 2010
I’ve been trying to get MacOS X working on VirtualBox for a while now, and it never worked due to some ACPI problems. The latest versions of VirtualBox have added MacOS X Server as a guest possibility, and it also seems to have fixed some problems with running the normal Mac OS X.
I got this working on the following hardware/software. If your hardware/software differs, your mileage may vary:
- CPU: Intel Pentium(R) Dual-Core CPU E5300 @ 2.60GHz
- Videocard: Intel Corporation 4 Series Chipset Integrated Graphics Controller (rev 03) (Some Intel integrated piece of crap).
- Ubuntu GNU/Linux v10.04
- VirtualBox v3.2 (important)
Here are the instructions:
- First, you’ll need to get get MacOS X. I used a pre-made illegal VMWare image I got from here. (I’m sure Apple’s legal team will be on my neck soon, but fuck it).
- Second, you need the latest VirtualBox. I’m using the Non-OSI v3.2.10. You can get it from the VirtualBox download page.
- Now, add a new VirtualBox guest and select ‘MacOS X‘ as the Operating System and either ‘Mac OS X Server’ or ‘Mac OS X Server (64 bits)’ as the version. I’m not quite sure it works on 32 bits host processors/operating systems, but it does work on 64 bits hosts.
- You need at least 1024 Mb of memory. Less will NOT work
- For the Virtual Hard Disk add the Mac OS X vmdk image as a harddisk
Okay, now you’ll have to through the settings and match them to the following settings:








The rest of the settings do not seem to matter, at least for getting MacOS X to boot succefully. To recap:
- Enable IO APIC must be ON.
- Enable absolute pointing device must be ON.
- You must enable only ONE SINGLE CPU. Mac OS X will not boot on VirtualBox with two or more CPUs
- Enable PAE/NX must be ON.
- Enable VT-x/AMD-v must be ON. This also means your hardware must support it. For Linux users, run the following command to check if your hardware has support for virtualisation enhancements:
grep "vm" /proc/cpuinfo.
You should see one or more of these lines:
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm xsave lahf_lm tpr_shadow vnmi flexpriority
If it’s not there, but you have a recent CPU, you may have to enable VT-x in your BIOS
- Enable nested paging must be OFF
- Enable 3D acceleration must be ON. This also means your hardware AND host operating system has to have support for 3D acceleration. Linux users can use the ‘glxgears‘ and ‘glxinfo‘ commands to see if 3D acceleration is working correctly.
- Virtual Storage must use a SATA controller of the AHCI type, and must NOT use host I/O cache
IMPORTANT: You MAY have to boot Mac OS X with the -v boot option. Directly after starting up the Virtual Machine, hit enter and at the boot: prompt, enter -v. I had to do this the first time to get Mac OS X successfully booted. After the first successful boot, it doesn’t seem necessary anymore. Safe-mode may also help in case of problems.
The Mac OS X image I linked to at the top of this post has its language set to Russian. Here’s a nice blog post about how to change it, including screenshots.
Thursday, November 4th, 2010
I’ve just released version 0.5 of MCPlayerEdit, a Minecraft player data and inventory editor.
Features:
- Modifying the inventory.
- Adding kits (collections of items) to the inventory.
- Showing and moving the player and spawn point coordinates.
- Setting the in-game time of day.
- Bookmark locations and warp back to them (works inter-dimensional).
- Track your inventory in case of death.
- Commandline history
- Commandline tab-completion (only on GNU/Linux for now)
Homepage.
Thursday, October 21st, 2010
Boxee is a pretty awesome media player for Linux. Now, I don’t have a remote to control it, but I do have a Logitech DiNovo Wireless keyboard with a detachable numeric pad. Modifying Boxee to support controlling it using the numeric pad is rather easy:
Browse to the map that contains the Boxee installation. For me that’s /opt/boxee but it’s probably different on your system (try /usr/share/boxee or /usr/lib/boxee). Open up the file system/keymaps/keyboard.xml in your favorite editor. Here you will see a big list of keybindings. Find the <global> section which contains the <keyboard> section. In that section, add the following:
<one>SkipPrevious</one>
<three>SkipNext</three>
<four>Left</four>
<five>Down</five>
<six>Right</six>
<seven>BigStepBack</seven>
<eight>Up</eight>
<nine>BigStepForward</nine>
<period>Pause</period>
Now comment out the following lines:
<!--
<zero>Number0</zero>
<one>Number1</one>
<two>Number2</two>
<three>Number3</three>
<four>Number4</four>
<five>Number5</five>
<six>Number6</six>
<seven>Number7</seven>
<eight>Number8</eight>
<nine>Number9</nine>
-->
You may also want to modify the <FullscreenVideo> section and add these:
<four>StepBack</four>
<six>StepForward</six>
Save the file, exit, and start Boxee. You can now control using your numeric pad.
Tuesday, October 19th, 2010
For a while now I’ve been trying to record my Ubuntu desktop with various levels of success. I’ve been using recordmydesktop to do my recording. Recordmydesktop is a simple commandline tool that outputs an .ogv (Ogg Video) file which is a container format that uses the Theora video codec and the Vorbis audio codec. Most modern video/audio applications on closed-source desktops such as Windows and MacOS-X won’t be able to read those, but we convert them to other formats using a range of open tools. We’ll get to that later.
Recording the desktop
Recording the desktop is fairly easy. We can either record the entire desktop:
recordmydesktop -o /home/todsah/out.ogv
or we can record a single window. For this we need the window id, which you can get with a commandline tool called xwininfo:
$ xwininfo
xwininfo: Please select the window about which you
would like information by clicking the
mouse in that window.
Now we click on the window, and xwininfo will give us the window ID:
xwininfo: Window id: 0x9c00003 "[root@eek]/home/fboender$"
Now we can tell recordmydesktop that we want to record just that window by giving it the window ID:
recordmydesktop --windowid 0x9c00003 -o /home/todsah/out.ogv
Once you’re done recording, simply press ctrl-c in the recordmydesktop terminal, and it will start encoding your recording to out.ogv.
Sound issues with PulseAudio
Okay, so far so good, except for the sound, which is simply missing. We can see that recordmydesktop did record some kind of sound by looking at the output of the encoding:
Done.
Written 1967932 bytes
(1845110 of which were video data and 122822 audio data)
So why isn’t there any sound in the video? The problem is PulseAudio (again and again and again). PulseAudio acts as a layer between all the applications, all the different sound architectures (ALSA, OSS, etc) and between the hardware. In my case, the problem was that recordmydesktop was recording from the incorrect device. Of course the default Sound Preference of Ubuntu 10.04 didn’t list any Recording devices, which is why it took me so long to find out what the problem was. To fix this, install the PulseAudio Volume Controller:
# aptitude install pavucontrol
You will now get a PulseAudio Volume Controller in the menu:

Start it up, and select the ‘Recording’ tab:

Now, make sure you’ve already started recording your desktop, or the application that’s trying to record sound will NOT show up in this list! You should also start playing a song or generate some other audio so it’s easier to spot when things are working. As you can see, it shows per application where that application is recording sound from. Select the source it will record from by clicking on the button that says ‘Monitor of Internal Audio Analog Stereo’. A list will appear with options. Try each option until the volume bar below the application comes to life. I have not yet experimented with microphones, but I wouldn’t be surprised if this was also the place to select that as a recording source.
recordmydesktop will now probably record sound also. You may have to tell it which channel to record sound from. This command at least worked for me:
recordmydesktop -o /home/todsah/out.ogv --fps 15 --channels 1 --freq 22050 --device pulse --v_quality 63 --s_quality 10 --workdir /tmp
You can also configure ‘pulse’ in the GTK front-end for recordmydesktop by going to Advanced → Sound → Device. Enter ‘pulse’ there.
Converting to other formats
Converting to other formats is, frankly, a real pain in the ass. There are basically three applications which you can use:
The main problem with encoding is codecs. A movie contains video and audio, and both of those are basically stuffed into a single file. Such a file is called a container. Examples of containers are Ogg, AVI and mp4. The video and audio files in these containers are called streams. The streams are almost always encoded in order to compress them or to allow for additional information to be embedded in the streams. Encoding these streams is done with codecs. And this is where we get in trouble. You see, most codecs are patented, trademarked, copyright and generally completely unsuitable for Free Software usages. This is why mencoder, ffmpeg and vlc usually have trouble with them.
Any of the above programs may not support the input container/codecs (Ogg container, Theora video, Vorbis audio) or may not support the output container/codecs such as the TS/Avi/Ogg/MP4/ASF containers which contain the Theora, Mpeg-4, Mpeg-2, WMV, etc video codecs and the AAC, MP3, etc audio codecs. VLC can usually play just about everything (because it provides many illegal decoding codecs), but it has trouble encoding in many format.
To my great regret, it’s up to you to find out which combinatation of containers and codecs works for you. You can check the Medibuntu website for instructions on how to add illegal codecs to your Ubuntu installation.
For me, it seems mencoder works the best. For instance, to convert the out.ogv file to an AVI file:
mencoder -idx out.ogv -ovc lavc -oac mp3lame -o output.avi
Monday, July 5th, 2010
Many people may not now, but you can comment your MySQL schema:
SQL: good comments conventions
Friday, June 18th, 2010
Maatkit is a suite of command-line tools for MySQL. It contains some rather nifty things for query analyses, replication, and other stuff. Some of the more interesting highlights:
Found via databasejournal.com, which has two articles on Maatkit:
The Wonders of Maatkit for MySQL and
Even more Maatkit for MySQL.
The text of all posts on this blog, unless specificly mentioned otherwise, are licensed under this license.