Categories
General OS tricks

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… 😉

Categories
Development Operations OS tricks

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: https://github.com/anderssv/puppet-docker .

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.

Categories
Development OS tricks

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:

DIRECTORY=${DIRECTORY_FROM_COMMAND_LINE:-"/tmp"}

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