Making a small ramdisk or memory storage for temporary calculations

Doing small experiments with databases will almost always make your disk-activity led flicker like it needs to be replaced. However, all that disk activity is not needed as most computers nowadays have enough memory to store even a 100Mb of experimental random data.

Using a memory based SQLite database is not always doable as you may have to share it between different languages and processes. The easiest and most general solution is to create a small disk in memory which you can use to store whatever you want. Here is how...

My git repos online

I've installed gitweb and now you can download all my code from my git repo at: http://git.logfish.net/
It will slowly start to collect all my code ramblings and small local projects. Things that I just publish for the fun of it, not big enough for SF, not complicated enough for multiple developers. Just the idiotic but sometimes useful things.

Previews of TrueType fonts available in Ubuntu

There is a new page on logfish.net, a preview of TrueType fonts available in Ubuntu packages. The previews are pretty large and the whole page weighs in at about 7MB.
You can find it at: http://logfish.net/pr/ubuntufonts/

Download the MOTU development movies from YouTube

The Ubuntu MOTU team has brought out some video's on YouTube. Want to see geeks tell you about packaging? Here is how to download them all.

Cut an APE file into pieces using a CUE file

If you ever encounter one of those old APE files, you should consider either recoding it to FLAC or simply cut it up and put it into a lossy OGG container. Here I will go through the command-line steps to do that last option.

Say we start off with these files:

CDImage.ape
CDImage.cue

Download the MOTU packaging video's from YouTube

There are actually video's on YouTube which will guide you into becoming a Master of the Universe (in the sense of Ubuntu packaging that is) and you can download them by installing youtube-dl:
sudo aptitude install youtube-dl
and then downloading and executing the attached script. Happy viewing!

64 bit Linux rocks, when it comes to commandline arguments....

Running one of the usual autotools generated configure scripts, I came across this:

checking the maximum length of command line arguments... 1572864

So I can actually support one million five hundred seventy two thousand eight hundred and sixty four command-line arguments on my 64 bit Linux. That rocks!

Hmm... I should definitely try to pass the Gutenberg project as a command-line argument to echo now.

No batteries? Oh yes there are batteries

In China they where selling these cool LED based lights. They where small, light and had and you could just squeezing them would give them enough energy to light up your day. What I thought was a cool light, turned out to be pretty stupid and useless.

GDBM class for Boost C++ serializable objects

I havn't writtin the iterators yet, but below is a simple class wrapping a GDBM database allowing you to store Boost serializable objects in the file on disk. Usage is pretty simple:

  Gdbm st(databaseName);

  std::map<std::string, double> amap;
  amap["a"] = 10;
  amap["b"] = 12.5;
  cout << "Into file a: " << amap["a"] << endl;
  st.store("example", amap); //Serialize and store the map

  std::map<std::string, double> fromFile;
  st.load("example", fromFile); //Serialize and restore the map
  cout << "From file a: " << fromFile["a"] << endl;

Shutting down a GNOME session without root privileges

If you want to turn of your computer form the command-line, doing a simple sudo sh -c 'poweroff' is nolonger really an option. The problem with this command is twofold: it will kill everything and you need root privileges for this.

If you want to turn of your computer without root privileges, you can do so using the privileges that gdm has (the login manager). If you are running a GNOME desktop you should use gnome-power-cmd.sh shutdown. You can give other commands to gnome-power-cmd.sh, running it without commands will tell you so.

Syndicate content