Category Archives: OS tricks

Setup, config and usage of different OSes, mainly UNIX based ones.

Powerpoint presenters mode in VirtualBox

After switching to Linux as my main operating system I was expecting problems. Even though it has come far, it’s not really your granny’s operating system. πŸ˜‰ I don’t use much Windows only software, but one of the problems was definitely going to be working with Powerpoint.

So I figured VirtualBox with Windows and Powerpoint would be a decent solution. And it has worked like a charm.

But I did miss presenters mode when doing the talks, and never really thought it would be possible. Until I discovered that you can change the number of displays associated with your VM. πŸ™‚

It’s not without it’s quirks, but doable if you get used to it. So you can do:

  • Plug in your external monitor
  • Make sure the Linux settings are correct with resolution and placement
  • Make sure the VM isn’t started
  • Go into settings > Display on you VirtualBox VM
  • Set the VM to have 2 displays
  • Boot the VM
  • Go full screen with the VM
  • Configure windows settings to reflect multiple displays and resolution and position
  • Start PowerPoint and do F5 for presentation

It should work now. πŸ™‚ Good luck with your presentation… πŸ˜‰

Speeding up development cycles with Docker

When I started doing Puppet development I was looking for a nice way to do testing. Vagrant was the best option at the time. But when Docker surfaced, and I figured it could speed things up considerably. And it does. πŸ™‚

If you would like to move on to the code you can find my setup on Github. It should’nt take much work to transfer to your project or something else that is similar without Puppet. Go to Github for the code: .

Let me know what you think. The README should help you getting started, but let me know if anything can be changed. πŸ™‚

Docker is some kick ass technology. It can be used for a wide variety of many tasks. It gives complete isolation between containers when it comes to processes and software, while NOT reserving large amounts of disk, memory or CPU. And it is lightning fast (really, starting a new container takes less than a second)! Look into it if you haven’t.

Doing Puppet means that you need a VM, but you also you need to reset it every once in a while to simulate building a machine from the bottom up. Combining the mechanisms in Docker I was able to minimise what happens when you reset, except for the things Puppet does of course. So I have:

  • Created a Docker image (not uploaded to repo, created on the fly by the scripts) that can be used for launching Puppet scripts. Having everything like puppet rpms etc. installed, updated and available saves a lot of time when running.
  • Launch a SSH Daemon. This serves two purposes: Keeping the container running and allowing for a interface to run the puppet command.
  • Kill the container to reset, so you will get a “fresh” container to run on.

Doing this enables you to “boot” a fresh new image in no time, and get running Puppet scripts as fast as possible. It is my new favorite toy for automating and virtualising tests. πŸ™‚ Let me know if there’s anything I can make clearer.

Bash #3 – Default values

When handling parameters from the command line I usually want one or two parameters to have a default value. In Bash I can achieve this through:


Where “DIRECTORY_FROM_COMMAND_LINE” is just another variable and thus can be 1 (for $1).

Bash #2

Part of what I find really hard with Bash scripts is encapsulation and error handling. It all became a tiny bit better when I discovered how I can print the call stack when something occurs. Check out this blog post for how to print the call stack.

I’m thinking this fits nicely with trap, but I’ll have to try that another day. πŸ™‚

Bash #1

I’m currently working on automating our deployment with Bash scripts. For a TDD loving Java programmer it can be quite hard to figure this all out, but I’m getting better. I don’t ever think I’ll start to love it, but maybe one day I can like it. πŸ˜‰ I’ll try to share small snippets of what I learn here.

set -e
set -u

I always have these early in my scripts. That way I know if anything fails (set -e) and if any variables is undefined (set -u).

Any other tips?

The backups you never make

So my harddrive for my home-server crashed. Seems like it short-circuited or something. Any tips for restoring would be appreciated. πŸ™‚ I had devised some sort og backup mechanism, that obviously didn’t work. Lost about a years worth of posts. πŸ™

Have signed up to Dreamhost now which offers 200GB diskspace on the cheapest plans. Finnally we are seeing hostingplans that are viable for my hosting. My first impression of their controlpanels etc. are really good too. Some minor glitches, but seems like a well thought through product.

UPDATE: Think I retrieved most my content from some caches. It’ll be a fair bit of job to put it back into wordpress, but at least it’s not lost. πŸ™‚

Cleanup directory

So we started running Maven snapshots at a fairly regular basis to enable automatic running of Watir tests. This fills up the disk really fast so I had to do some research to fine a linux command that would delete all but the newest snapshot from multiple projects:

find /var/www/maven2-snapshots -type d -path '*SNAPSHOT' | xargs -i bash -c "find {} -type f -not -path '*maven-metadata*' | grep projectname | sort -r | awk 'NR>6'"

The above command will keep everything that is called maven-metadata something and the 6 latest files in the directory (Maven generates 6 files for each snapshot).

Oracle XE on Linux

I’m not a big fan of Oracle. I’ve had my fair share of problems with their products, but I’ve mentioned before that I think they’re on the right track. As one example you now got deb packages for Oracle Express Edition. Check out a tutorial here.

Update: Another blog that also includes some details about environment and user creation here.

The final steps of installing D-Link DWL-G520+ on Fedora Core 5

This is how I installed my D-Link DWL-G520+ wlan card on Fedora Core 5 (FC5). This card has Texas Instruments chipset and needs the acx111 driver.

  1. Follow the instructions found at the homepage.
  2. Add “alias wlan0 acx” at the botom of the file /etc/modprobe.conf
  3. Check that “chkconfig --list NetworkManager” says “:on” under runlevel 3 and 5
    If not execute “chkconfig --level 35 NetworkManager on” and check again.
  4. Run “depmod -a
  5. Restart the computer. (I do not think have to do this, but you’ll never know.)
  6. You should now be able to see your wlan card in the GUI-based Network Configuration tool found under System->Administration->Network (in KDE.. Will swich to Gnome soon).

This is what did the trick for me and I think i have remembered everything. I used kernel 2.6.15-1.2054_FC5-i686 and driver version acx-20060521. Well, no that I am onlie i should upgrade my system and do it all over again with the newest kernel ang gnome.. I’ll update this post if I find any major differences.

Good Luck!