Provisioning Vagrant with Salt

Vagrant sports out of the box integration with Saltstack, which works very well with minimum effort. However under the hood the default way this integration works is via a 4000-line bash script that bootstraps Saltstack on the VM. This would all be well and good, however, even if you were to pre-install the salt-call and salt-minion binaries onto your Vagrantbox, the salt-integration uses the same bash-script to install the configuration provided in the Vagrantfile.

So it has come to this..    I don’t really want this in my workflow. And I suspect any heavy Saltstack users might want to skip this aswell.

I found a way, that was not completely obvious, to make the Salt-integration work as quick and painless as I wanted in the Masterless mode:

  • Create a vagrantbox (in my case I use Packer with a set of templates), with the salt-binaries pre-installed.
  • Make sure the salt-minion daemon is disabled.
  • Overwrite the default minion config with the contents  “file_client: local” (and of course any other configuration you require)

This way you do not have to use the “minion_config” setting in your Vagrantfile, and the salt provisioner plugin will happily skip the bootstrapping script.

You could always check the Saltstack installation-script for the Packer-template for reference.

You can now use the following setup in your Vagrantfile:

config.vm.synced_folder "salt/roots/", "/srv/salt/"

config.vm.provision :salt do |salt|
  salt.run_highstate = true
end

In salt/roots/ place your top.sls which could look something like this:

base:
  '*':
    - default

Which would then execute the salt/roots/default/init.sls state.

Media services

I thought I’d write a little summary on current media services I use, and why. I have mostly stopped buying music pressed on plastic discs, and the amount of movies I buy on-disc has also gone down. However that does not mean I don’t pay for my entertainment. Well on to the services.

Music

spotify-logo

Spotify

I used to use Spotify actively, mainly due to their very good selection of EDM (Electronic Dance Music) and iOS-app, which has enabled me to completely stop syncing music from my computer. I was a premium subscriber for over a year, and the service (which cost around the price of 1 CD per month) was awesome. I used Spotify apps everywhere; iPhone, iPad, Mac, Linux (still a shamefully shoddy version though), and on Squeezebox. In addition to EDM, Spotify also features a more than good enough selection of “kid friendly” Norwegian music. When I checked out Rdio though I moved on..

rdio_logo

 

Rdio

A few annoyances with the Spotify iOS app, and a constantly hopeless experience on Linux made me very ripe for a migration when I was introduced to Rdio. Rdio is a very similar service to Spotify, it generally has a comparable selection of music to stream, has about the same quality and cost the same for a mobile-enabled subscription.

Where Rdio differs is firstly in the quality of its apps. If you are on desktop, you can just use a normal web-browser to stream, or download a prepared Site-Specifc-Browser “app” that will give you a similar experience to the Spotify app. It does not have indexing of local media as an option though, so if you use that you’re out of luck. On iOS the app is a lot more snazzy design-wise, also it correctly purges content you no longer want synced offline (you can select what content to mobile sync from the app/web too).

Secondly, Rdio lets me build a “collection” of albums and artists. By doing so I get notifications of new music from these artists, and I can easily browse my subset of all available music. This mode of browsing is highly preferable to the search focused Spotify experience to me.

soundcloud-logo-orange-II

Soundcloud

Soundcloud has mostly taken over the role Myspace had as a channel for artists to share their tunes, demos, live-recordings, DJ-mixes etc. I know there are some issues concerning takedowns of more mainstream DJ-mixes, and that everything is not perfect in the Soundcloud, but for me it works very well as a nice way to keep in touch with my favourite artists and their work. I pay for a premium service here too, but would probably not if it wasn’t for wanting to share my own DJ-sets. As a consumer the service works very well without a subscription. Their iOS-apps are workable, but not nearly as polished as Rdio, and have no way to utilize downloads/off-line storage as far as I know.

Last.fm

This used to be a lot higher on my list of services I used actively. But due to their very limited streaming capabilites and somewhat lackluster selection of hosted music I quit being a paying subscriber of Last.fm, and instead use it solely as a place to aggregate my listening statistics, and keep up with what others are listening to. The Facebook/Spotify-connected service has filled some of this need lately, but my Last.fm connections are still a source of interesting finds every now and then.

bandcamp_logo

Bandcamp

There are several issues with Bandcamp. One being that it has a very limited function for gifting music, or sharing CC-marked material, which is a shame really, as that would probably have made the service more interesting for both artists and fans. As it is Bandcamp provides a smooth way for me to pay the artists directly for FLAC downloads, and I highly prefer this model to Beatport (see below). Recently Bandcamp improved their music discovery options by introducing “My Bandcamp”. This allows me to track other peoples buying etc. and is better than not having any such features at all. It’s still no “Amazon for Music”, but getting better.

Beatport

Despite exorbitant prices, there is still no way to get around Beatport. The wide amount of EDM available through Beatport is mostly unmatched, even if one can often find tracks elsewhere. For the widest array of artists and tracks in lossless quality, it’s hard to beat Beatport though.. The website is almost workable too, but there are so many problems with the often half-assed approach to meta-data, and classification that it’s hard not to get a bit frustrated. I mean, when I pay more for a digital download than for a CD-copy (incl. shipping) I think I deserve proper metadata and the feeling that someone at Beatport cares enough to ensure classification remains somewhat appropriate?

Ektoplazm

While Beatport pushes material from any established artist, for the fresh stuff in my niche genre(s) I rely on Ektoplazm. An awesome source of free music, often free as in CC-licensed (type of CC license varies) too. And, just because it’s free doesn’t mean it features music that is worthless. Far from it, Ektoplazm often delivers music that is way more interesting than the commercial releases. I am sure there are other sites like Ektoplazm in other genres, or at least I hope so, as everyone deserves a service like this.

Gnome 3 adjustments and addons for a Gnome 2 user

As a long time professional Linux desktop user (since 2000 or so) I have used numerous desktop environments over the years. Initially Gnome1, then KDE2, then Gnome2 for a long time.

With the advent of Unity and Gnome 3.x, the distro vendors primary focus has understandably switched to supporting the future instead of maintaining the past. I will not go into the discussion whether this has happened too fast, or just fast enough.

Upgrading from the last Ubuntu that supported Gnome 2, I chose to try Unity, found out that it wasn’t for me (dual 1600×1200 monitor setup, multi workspace setup), then tried my luck with KDE (which I parted with around KDE3), and ended up with “Gnome Classic”. Now, after several issues in the process towards Precise Pangolin, I finally jumped ship to Fedora 16, and in that process tried to make the modern Gnome 3 work for me.

I will update this post as I make additional modifications, keeping it as a reference for my own use. Let me know in the comments if you have tips or suggestions.

Here are the adjustments and addons I have found, that improve the out-of-the-box Gnome 3 experience:

Prerequisites

In Fedora, ensure you have the following packages :

gnome-shell-extension-places-menu gnome-shell-extension-auto-move-windows gnome-shell-extension-alternative-status-menu gnome-shell-extension-pidgin gnome-shell-extension-remove-bluetooth-icon gnome-shell-extension-systemMonitor gnome-shell-extension-user-theme gnome-shell-extension-workspace-indicator gnome-shell-extension-remove-accessibility-icon gnome-shell-extension-apps-menu gnome-shell-theme-atolm gnome-tweak-tool

The very nice System Monitor shell extension is not packaged, but is easily installed from git:

https://github.com/paradoxxxzero/gnome-shell-system-monitor-applet/tree/gnome-3.2

I had little luck installing it into ~/.local/share/gnome-shell/extensions, but installing it globally under /usr/local/share/gnome-shell/extensions/ worked fine.

Most of the settings and extensions mentioned below are enabled through gnome-tweak-tool (listed as “Advanced Settings in the Gnome launcher).

Shell extensions

  • Workspace Indicator (re-enables a workspace indicator in the “tasktray”)
  • Pidgin IM Integration (improves the usability of Pidgin under Gnome 3, not as good as it used to be in Gnome 2 but still ..)
  • Remove Accessibility Icon (with the agressive removal of useful indicators in G3 it surprises me how much unnecessary stuff is default enabled)
  • Applications Menu (mostly improves the “familiar feeling”, I don’t really use this much)
  • System Monitor (visual, ever present system monitor, even looks pretty good)
  • Remove Bluetooth Icon (I don’t use BT on my desktop, so this is totally redundant)
  • Places Status Indicator (re-enables quick access to folders in the file browser)
  • User Themes (let’s the user configure Gnome Theme settings)

Theme

I kept most of the defaults, but found that using the “Atolm” Shell Theme made me feel more at home (it makes Gnome 3 look a lot more like Gnome 2 in earlier Ubuntu’s..). I also enabled “Menus Have Icons” and “Buttons Have Icons”. Cursor, Icon, GTK+ and Window themes were kept to their default settings.

Tweaks

In gconf-editor (aka “Configuration Editor” in the launcher) I modified these keys :

  • /desktop/gnome/shell/windows/workspaces_only_on_primary – False  (This makes my dual monitor setup work as I want it and disables the second screen from being a “sticky” workspace)
  • /desktop/gnome/shell/windows/button_layout – close,minimize,maximize:menu (My other OS of choice is OSX, and this makes the transition between them smoother)

Update for Gnome Shell 3.4

Settings that were previously in gconf are now migrated to dconf:

  • org.gnome.shell.overrides : workspaces-only-on-primary – False
  • org.gnome.shell.overrides : button-layout - close,minimize,maximize:menu
  • org.gnome.shell.overrides : attach-modal-dialogs – False (this detaches popupdialogs from their parent window)

 

Why I almost didn’t get an iPhone

While Apple has got a lot of things right in the iPhone, here are a few annoyances I have with the platform/gadget.

AppStore is cool, but Apples rules and rights of refusal are not. There are many stories of weird rejections and strict rules against improving on the experience with apps that cover basic functionality Apple itself already have developed solutions for. This means that nobody can create a better music player (with better codec support, integrated Last.fm scrobbling or other nice features), a better video player (again maybe including support for commonly used “internet-codecs”) or release a better browser or calendar..

It also means Apple, or rather Apples app-judges, can refuse to distribute an app even without giving a reason why. I know this is “the Apple way” but it's stupid and frustrating. Even Microsoft would know better :P

I already mentioned it, but it's a major annoyance for me; the lack of codecs the i*-experience can handle (iTunes, iPhone, iPod). If you are like me and have a lot of FLACs lying around, you're pretty much left to your own devices. There are various solutions to this, mp3fs being one, but nothing would be better than if iTunes could just get it right and convert my FLACs directly for me when sending to the portable gadget.

The connector required for charging is also a minus, not the biggest one, and one that will probably resolve itself anyway, but it's still less than optimal.

I don't think Apple will ever fix the two biggest, most important issues I have with the platform. And if you are now laughing and saying that this is to be expected when you sell out to a vendor of proprietary software and platforms, you're of course right ;) But there are simply too many things going for the iPhone right now, and the Android needs to grow up before it can be a viable alternative. (It probably will in time.)

Why I will get an iPhone

(As English is our new official company language, and my tweets are now mainly English I think I'll switch to primarily blogging in English. This might change back without warning.)

I've been weighing it back and forth for a while. Which smartphone will be my first, after the Nokia N93 fiasco some years ago? (Symbian S60 seemed so cool back then.) Well, I think I've come to the conclusion that it'll be an iPhone 3GS. Here is why.

I like Android as a mobile OS, probably more than iPhone OSX. But, and this is an important objection, there is no comparably cool hardware devices out yet to run Android. The iPhone 3GS hardware is awesome, has a fast GL capable 3D chip and a speedy ARM CPU. A colleague, who recently got himself an HTC Magic, said that after getting accustomed to the graphics/3D capabilities of the iPod Touch (1st gen) he wasn't exactly bowled over by the Magic.

Then there is the camera features, or lack of, on the Android devices so far. Neither the HTC Magic nor the HTC Hero have very sophisticated camera features. They're decent enough for sure, but one thing the N93 actually did pretty well was to eliminate the need for bringing a pocket digicam. I still have a decent amount of “in the moment” snaps and vids, shot with the phonecam. This includes the need for a proper flash/camera led. Are you listening HTC? The Samsung 7500 something rather will feature a 5 megapixel camera, but megapixels aren't everything, it could be good though.

Another factor is the amount of available addons, cases, cables, gadgets, stuff and weirdness for the iPhone family. This is of course not something one can blame Google or HTC for, it's just a matter of Apple selling so many devices that the 3rd party manufacturers are sprouting around the platform.

The AppStore and the amount of awesome apps and games is another strong reason to get the iPhone. Multitouch and the aforementioned 3D chip launched the iPhone/iPod Touch as a gaming platform in its own right. Sony is forced on the defence and just launched the “PSP Go” as a countermeasure (I don't think it's a good counter though, more on that later). The AppStore is mostly a win for everyone, it's an effective content distribution platform with a massive potential customer base.

Summing it up, when I want the iPhone it's not simply as an advanced smartphone. The iPhone will enable me to bring one gadget that does a lot of things well enough that it eliminates the need for other gadgets in my pockets. No longer will I need a separate mp3-player, I can shoot photos and short videos, I can surf the web efficiently with a browser that works (the Android also covers this bit well), I have a mobile gaming device with a good selection of cheap and cool games on the go. Throw in a GPS and I'm pretty content. This is also why the PSP Go will not succeed. It might be a decent gaming platform (but less so than the Nintendo DS), but it still lacks the other features of the iPhone.

With the iPhone platform, Apple has done a lot of things right, it mixes an attractive OS, good application support, a decent mix of features with a properly sized hardware platform (Nokia has failed on the latter point so many times). At the moment I cannot see any real competition for my kroner. Now I just need to choose a provider. Any thoughts why choose one over the other?

There are sore spots with the iPhone / Apple experience. These will be the focus of my next post..

mp3fs in OSX

As I have not found a quick and easy guide on how to use mp3fs in OSX I'll write this in english.

mp3fs is a very nice idea and a smooth way to use a vast library of lossless archived CDs in the awesome FLAC with silly mp3players without native support.

The concept of mp3fs is a FUSE filesystem which converts FLACs to mp3s on the fly (CBR only as of now) via lame. Thus you can have the original FLACs stored, and expose a folder structure of converted mp3s to whatever you want. In my case iTunes.

This is all pretty easy under Linux, but in OSX there are a few hurdles along the way. First one is that the current OSX patch for mp3fs is only compatible with the Macports version of MacFUSE (currently 1.7_1). So any currently installed MacFUSE package (via DMG or otherwise) has to be removed.

Once this is done installing mp3fs and MacFUSE is as easy as installing the mp3fs port. Here is a step-by-step working guide (tested with OSX Leopard 10.5.7).

1. Install Macports (http://www.macports.org/install.php).
2. Open your favourite terminal.
3. “sudo port install mp3fs”
4. Make yourself a nice cup of your favourite hot beverage.
5. Create a mountpoint : “mkdir mp3fs”
6. Mount the mp3fs : “sudo mp3fs /Path/To/Your/FLAC/Dir,BITRATE /Path/To/Your/Mountpoint -o allow_other,ro”
Example : “sudo mp3fs /Users/denis/Music/CDRips,256 /mnt/mp3fs -o allow_other,ro”
7. You now have an mp3fs filesystem at /mnt/mp3fs :)

Running “mp3fs” with no options will show usage (no manpage yet), and running “mp3fs /Dir1,256 /Mountpoint -h” will show you FUSE mountoptions, one of these is -d for debug which could come in handy.

Thanks to the coders of this nifty little FUSE fs, and to the guys patching it for OSX. Any chance we could have a cleaner patch that would also work with newer MacFUSE versions?

How to read Mac .dmg images in Linux

How to read Mac .dmg images in Linux (via dmg2img) :

Quick Guide that was tested on Ubuntu Linux Jaunty Jackalope.

1. Download and compile DMG2IMG http://vu1tur.eu.org/tools/download.pl?dmg2img.tar.gz (http://vu1tur.eu.org/tools/) :

wget -O dmg2img.tar.gz http://vu1tur.eu.org/tools/download.pl?dmg2img.tar.gz
tar xfz dmg2img.tar.gz
cd dmg2img
make

2. Convert the DMG to IMG with dmg2img :

./dmg2img file.dmg

3. Install hfsplus :

sudo apt-get install hfsplus

4. Mount the image as a loopback device :

sudo mkdir /mnt/macimage
sudo mount -t hfsplus -o loop file.img /mnt/macimage

Voila.

Norwegian holidays in Zimbra

Nicolai wrote an excellent howto on how to get Norwegian holidays into Zimbra , but I thought it required a bit many steps, and figured there should be an easier way :)

1. Switch to the Calendar view in the Zimbra webui.
2. Click “New Calendar” (or “Ny kalender” in Norwegian).
3. Name it something nice like “Norwegian public holidays”.
4. Check the box “Synchronize events from remote calendar” (“Synkroniser avtaler mot ekstern kalender” in Norwegian).
5. Paste http://ical.mac.com/bjorkheim/Norske%20helligdager.ics
6. Click Ok.

As long as the calendar maintainer bothers to update, Zimbra wil automatically receive updates. If you have another remote .ICS calendar you’d like to subscribe to, just add that one instead..