karlgrz

symphonic code: my gift to the coding gods

Ubuntu Unity: Changing from High DPI to Dual Monitors

I've been running Ubuntu Desktop on my desktop machine at home for a few years now (I put together a great system in January 2014). Just recently, in November 2014, I switched my work laptop from a retina MacBook Pro to a Dell XPS 15 (High DPI w/ touchscreen: amazon.com ) running Ubuntu Desktop 14.04. For some reason, I prefer Linux to OS X, I guess I'm weird, heh.

The screen on this model is a 3200x1800 touchscreen, and text looks just as good (if not better) than the retina MacBook does at max DPI.

The problem is: it's Linux, so...high DPI is not exactly a well supported feature throughout the ecosystem.

At the time I received the Dell, it was pointless trying to run day to day work activities in high DPI. Everything looked all jacked up, whether it was browsing the web in Chrome or Firefox, editing text with Sublime Text, chatting in HipChat, querying postgresql with PgAdmin, or looking at source trees in TortoiseHG, amongst other things. Odd stuff like this was commonplace:

A photo posted by Karl Grzeszczak (@karlgrz) on

I tried all kinds of hacks and settings to get things working nicely, but alas, it was frustrating, and it was just easier to run in 1920x1080. It still looked ok, but it wasn't as good as it could be.

This pissed me off, obviously ;-)

Last week, I saw an update for Chromium. Every time I see an update for Chromium, I try it on high DPI. Lo and behold, they finally have scaling working properly! Huzzah! This is what it looks like now:

Present day Chromium

So I put in a bit more work, and I'm happy to say my entire workflow can be sustained in high DPI, with a few caveats that I can put up with.

  • HipChat still looks a little weird (shrug)
  • PgAdmin looks really weird. Query output windows are really smooshed in grid view.
  • TortoiseHg is hilarious:

Thanks, QT

  • VirtualBox guests have no respect for scaling factor. This is fine, because I don't do much work in Windows anymore, so I just need to run an IIS server for MVC 5 apps until vNext is fully supported on Linux.
  • Dual monitors are still jacked up because you can't set monitor independent text scaling factors (I think this is supported in 14.10 or 15.04 but I can wait for that).

So this is great when I'm just using the laptop, but what about when I go to the office and use my second monitor?

Like I said, I'm on 14.04, so this might be better (or hopefully unnecessary) in 14.10 or 15.04 (PLEASE let me know in the comments if it's the case!), but I just whipped up a couple very simple scripts to run when I switch between the two.

SetupForHighDPI.sh

#!/bin/bash

dconf write /com/ubuntu/user-interface/scale-factor "{'DP1': 8, 'eDP1': 16}"
gsettings set org.gnome.desktop.interface text-scaling-factor '1.25'

SetupForDualMonitors.sh

#!/bin/bash

dconf write /com/ubuntu/user-interface/scale-factor "{'DP1': 8, 'eDP1': 8}"
gsettings set org.gnome.desktop.interface text-scaling-factor '1.0'

What these scripts do, basically, is just automate setting the Text Scaling Factor from Unity Tweak Tool and the Scaling Factor from Settings -> Displays menu. You'll need to find the settings for your specific system, these posts helped me out:

http://askubuntu.com/questions/454279/change-default-system-font-using-terminal-only-in-14-04

http://askubuntu.com/questions/510457/how-do-i-get-the-value-of-display-scale-for-menu-and-title-bars-from-the-c/510476#510476

It's annoying to have to run a script each time I switch from just the laptop to using my external monitor at work. It's all worth for those beautiful looking, high DPI fonts though!

Hopefully soon I won't need any of this and high DPI in Unity will Just Work™. A lot of people tell me to switch to GNOME or KDE or xfce. I've used all those, and while they are great in their own right, I've come to like Unity. It should work well here, too. It seems like all the problematic apps are using QT. Could be a coincidence.

My Favorite Records of 2014

Another year down, another year where my only post is about my favorite records. Fitting.

This year didn't have nearly the volume of great records that was bestowed upon us in 2013, but there was still an abundance of quality stuff to go around. There's quite a few surprises in here. Get on with it!

Spoiler alert: I'm still looking for a contender to Yellow & Green for "Album of the Decade." Maybe next year...

25.) Trap Them - Blissfucker

Grindcore meets crust punk for a bone-slamming ride on the thrash train. I really like these guys. Fast paced record for when you want to let off some steam.

24.) Alcest - Shelter

This record feels like it REALLY wants to just jump out and get heavy at times, but it never really does. And it works. Great songs, a lot of really beautiful musical moments on here. Not quite the same aggression but the feeling is there.

23.) At The Gates - At War With Reality

OG death metal lords are back. What a record. Last year we got a new Carcass and Gorguts record. This year new At The Gates. This album rips. I'm so glad this didn't suck, I was really anticipating it for a long time. TONS of great guitars in here.

22.) Devin Townsend - Z²

Devin Townsend is on a roll. This is more of a theatrical performance than just "a metal record." The first album is Devin Townsend Project, the second album is Ziltoid. I thought all the voice acting was really something special, and really made for an incredible listening experience. On the second playthrough I skipped a lot of the skits, but you should give it a full listen at least once. I would love to see this live with a full stage show.

21.) Primus - Primus And The Chocolate Factory With The Fungi Ensemble

Do you like Primus? Do you like Willy Wonka? If either answer is "yes" you are in for a treat. If both "yes" then you will love this as much as I did. Someone uploaded a version of the movie that has this synced up with the soundtrack and it is great. I wonder how this sounds on mushrooms, which is clearly how they wrote and recorded this. And probably intended for it to be listened to. Weird and creepy, just the way I like it.

20.) YOB - Clearing the Path to Ascend

For some reason I thought these guys were even older than they are. I never got into them before, as this was the first thing I really listened to of theirs. Loved this. Great doom record. I need to visit the catalog soon.

19.) John Garcia - John Garcia

Kyuss' frontman put out a solo record. It's as good as you think it should be.

18.) Every Time I Die - From Parts Unknown

I was greatly anticipating this record, and it was a worthy follow up to Ex-Lives. These guys really capture their insane live show on record. Great tunes. Moor is awesome. Keith Buckley continues his legacy with some great lyrics and delivery. Two horns up.

17.) ✝✝✝ - ✝✝✝

Chino's voice is magical. He is in so many projects, and he owns every single one of them. I loved the first two EPs, and this is basically a repackaging of those plus another EP worth of material. The new songs are really good. "The Epilogue" is probably my vote for song of the year. If you've never listened to this and you like Deftones you have no idea what you are missing out on.

16.) Jack White - Lazaretto

Jack White's solo stuff is bluesy rock done right, every single time. Such a good record. The discography he is building for himself is the story of legends.

15.) Killer Be Killed - Killer Be Killed

Supergroups come and go, but Killer Be Killed may be one of the best vocally. Troy Saunders puts out two amazing records in one year, and Greg Puciato further affirms his seat at the top of metal vocalists. And Max does some good stuff, too. The chemistry of these guys is fantastic, I'd really like to see them live. Mastodon fans and DEP fans, this is a little bit different, but some good metal nonetheless.

14.) Floor - Oblation

Sludgy sludge. I -loved- this record. Didn't really get into these guys older stuff but this seems to be their best.

13.) Pallbearer - Foundations of Burden

Arkansas Doom-ers Pallbearer knocked this one out of the park. Every second of this record feels just right. Great record and a great follow up to Sorrow and Extinction.

12.) Insomnium - Shadows of the Dying Sun

Dreary, cold, and dark. This record makes me feel like going on a walk in the winter without a jacket on. It's hauntingly epic.

11.) Electric Wizard - Time to Die

English Doom legends. I never heard of them before this record other than hearing the name, and I was pleasantly surprised to find a deep catalog. This album is awesome.

10.) Darren Korb - Transistor OST

Yes, this is a video game soundtrack. According to last.fm, I listened to this record about 50 times throughout the year. Darren Korb also wrote the wonderfully amazing Bastion OST, which is equally as good. Ashley Barrett is on a handful of tracks on this one, as well, and her voice shines on each track. Outstanding. Spoiler: I have only played the game for a few minutes to make sure it worked on Linux (as Wasteland 2 needs to finished, first).

9.) Soen - Tellurian

These guys claim Tool as an influence right on their wikipedia page. Influence is an understatement. This album rules. Another supergroup on my list, these guys have former Opeth drummer Martin Lopez and Willowtree vocalist Joel Ekelöf amongst their ranks. Ekelöf is a dead ringer for Opeth's Mikael Åkerfeldt on nearly every track. So much, in fact, that I thought he appeared as a guest. This was the closest we got to a new Tool record this year, and it's incredible.

8.) Animals as Leaders - The Joy of Motion

Tosin Abasi kicking more ass, as usual. Awesome guitars. Awesome songwriting. Awesome record.

7.) The Pineapple Thief - Magnolia

The theme of the year was "Look at all these bands you've never heard of that have lots of great songs." This record surprised the hell out of me. It's magnificent. Go listen to the first two tracks ("Simple As That" and "Alone At Sea") and try not to nod your head to the beat. These British rockers started in 1999 and have put out TEN solid, meaty records in that time. This one kind of has a Radiohead meets dredg approach to the song writing (I guess). Excellent discovery and excellent record. I wish I heard of these guys a long time ago.

6.) Opeth - Pale Communion

I think I was one of the few metalheads that actually liked Heritage. I love this record. If Mikael Åkerfeldt doesn't want to scream anymore I am perfectly happy with that as long as they keep records like this coming. Forget what you know about Opeth, the screaming and death metal influences are nowhere to be found here. Classic rock meets bluesy prog magic comes together in a holy matrimony of aural bliss. Spin it.

5.) So Hideous - Last Poem / First Light

Another unknown that blew me away this year. The opening track "Rising" sounds like the audio equivalent of a horror movie. Start to finish, this never lets up.

4.) Winterfylleth - The Divination of Antiquity

Best black metal record I've heard in a LOOONG time. These guys write some great riffs, and the musicianship all around is top notch. "A Careworn Heart" is as good a song as I've ever heard in the genre. Listen to it for yourself, it's amazing. In fact, I'm listening to this as I write this post.

3.) Mastodon - Once More 'Round The Sun

One of my favorite bands. I really liked The Hunter. Crack The Skye was one of my favorite records of all time. This is better than both. Mastodon stepped it up on this. Every single song is memorable. "Aunt Lisa" is my runner up for song of the year (that chorus with the ladies from The Coathangers is infectious).

2.) Slipknot - .5 : The Gray Chapter

This was the most hyped record of the year and this actually delivered the goods. I was worried that the loss of Paul and the booting of Joey was going to turn the rhythm section into a joke, but the newcomers rose to the occassion and delivered.

I'm a huge Slipknot fan, and have been ever since I heard the self titled record and saw Clown douse himself with fire twice on that first small club tour in 1999.

It seems like Slipknot has become it's own genre over the years, turning into something of a giant rock monster in and of itself. I was disappointed with All Hope Is Gone, but it was still ok. But it didn't have that "wow" factor that their other records did, and this left a bad taste in my mouth for the past few years.

This record made me a Slipknot fan again. The Devil In I is probably my favorite Slipknot song since the s/t record, and you can really feel all the passion and emotion that went into the writing and recording of this masterpiece. Say what you want about Slipknot: there is no denying they have captured a pivotal point in their career and turned a terrible situation into a phenomenal piece of art.

1.) Destrage - Are You Kidding Me? No.

"Are you kidding me? No!" is usually what the conversation sounds like after I have been telling people what my favorite album of the year was. There was no doubt. This came out on March 4th and right after the first spin I was saying "NOTHING WILL BE BETTER!!!" to myself.

Another band I had never heard of before this dropped, Destrage is one frenetic pile of energy if I ever heard one. These Italians are all virtuosos on their respective instruments. Every single one of them. In fact, you should check out this documentary from the "Are You Kidding Me? No." recording and just watch Federico bang on the drums in amazement. This guy is one of the best drummers I have ever seen or heard. So good.

Their guitarists (Ralph Salati and Matteo Di Gioia) and bassist Gabriel Pignata deserve to be in every single "Best Metal Guitarst / Bassist" discussion going forward. Mature, deep, insatiable riffs combined with really catchy song writing make for some memorable songs.

And their vocalist, Paolo Colavolpe? I find it incredibly hard to believe that one person makes all the vocal noise on this recording. The blitzkrieg delivery comes to a halt for beautiful singing, then right back to schizophrenic barking in the blink of an eye. I'd be greatly surprised if he can pull any of this off live, but I'll live in wonder for now and just enjoy this incredible recording.

Hands down the best record I heard all year.

Honorable Mentions

  • Tombs - Savage Gold
  • Goatwhore - Constricting Rage of the Merciless
  • Bloodbath - Grand Morbid Funeral
  • White Arms Of Athena - White Arms Of Athena
  • Nothing - Guilty of Everything
  • Architects - Lost Forever // Lost Together
  • Junius - Forgiving The Cleansing Meteor
  • Ne Obliviscaris - Citadel
  • Skyharbor - Guiding Lights
  • Pink Floyd - The Endless River
  • He Is Legend - Heavy Fruit

My Favorite Records of 2013

I listened to quite a lot of new music this year. Lots of metal, a bit of hip-hop, a ton of retro / psychedelic stuff. A lot of REALLY BAD garbage.

These are all the albums that stuck with me somehow. Mostly, these are the albums I played more than once. Overall, I'd say 2013 was one of the best musical outputs of any year this century (so far). Here's my favorites...

25.) The Safety Fire - Mouth of Swords

I was pumped to catch these guys with Between the Buried and Me in the fall of 2012. But I missed the show. I had heard so much good stuff about these guys but never listened to them before. Mouth of Swords really wowed me. Excellent metal record, right up the BTBaM alley. Tommy Giles even makes a guest appearance. I really like their song writing, solid record overall.

24.) Eminem - The Marshall Mathers LP 2

Ok, before I go into this record, my gripe with the title. I got into several heated arguments about the title, and how I don't think this record IN ANY WAY resembles a "follow-up" to the original opus. But I digress...

What a banger. Front to back, this record is awesome (with a couple misses in the middle). Rap God, Berzerk, and Brainless are all stand outs. This guy spits fire at the drop of a hat, and I love listening to him rhyme.

23.) David Bowie - The Next Day

Bowie is timeless. This record really blew me away. I wasn't expecting it to be bad, but I didn't think it would be this great. He keeps up with the times AND holds onto his bread and butter songwriting.

22.) Tesseract - Altered State

The sophomore record from Tesseract. 4 songs divided into 10 tracks. All clean vocals. Progressive metal masterpiece. A brilliant follow up to One, if you like intricate, progressive metal, check this out.

21.) Russian Circles - Memorial

I love this band. They make some excellent atmospheric instrumental metal. Memorial is no exception.

20.) Dead Letter Circus - The Catalyst Fire

I first heard about these Aussies from a friend of mine when he showed "One Step" and I was chomping at the bit for more.

I was really looking forward to this record, and it shines. Kim Benzie's voice is incredible. Reminds me of Maynard.

19.) Ghost - Infestissumam

Ahh, Ghost. What a band. What a record. These guys have really grown on me in the last year. Infestissumam is an excellent record. If you can put aside the EXTREMELY over-the-top Satanic references you get some truly great 70s-style fuzzy metal, and it rocks.

18.) Protest the Hero - Volition

What do you get when Protest the Hero has Lamb of God's Chris Adler play drums on their new record? A masterpiece, that's what. Better than everything they've ever done, in my opinion.

17.) Kanye West - Yeezus

Yeezus. Weird record. Really weird. But I like it. This guy is full of himself, almost to a fault. But he makes good tunes. Blood on the Leaves, what a jam.

16.) Red Fang - Whales and Leeches

I'd love to party with these guys. They make some kick ass tunes, and have been for a while. I put them in the same league as Mastodon, and they deserve it.

15.) Pelican - Forever Becoming

I played this record 3 times the first time I heard it. It's awesome. These Chicago natives know how to groove and write some truly magical tunes.

14.) The Ocean - Pelagial

Something about these guys strikes me as quite pretentious, but I don't care that much because they rock the house. Pelagial is beautiful, both with vocals and on the instrumental. These guys haven't made a bad record yet, and this one is really great.

13.) Carcass - Surgical Steel

CARCASS! Their first record since 1996 and it SLAMS! This has to be one of the best produced, best sounding albums of 2013. Solid riffs, incredible drums, and great songs. You want some good, solid death metal, then you've come to the right place.

12.) Anciients - Heart of Oak

I never heard of these guys before their debut record dropped. I listened to it the day it came out and was blown away. Kind of a heavier Mastodon with a bit less melody. Great record.

11.) Gorguts - Colored Sands

Razor blade proficiency on these riffs. Gorguts is awesome, and they put out one of the best death metal records of the year.

10.) Kylesa - Ultraviolet

This one caught me off guard. I've heard of Kylesa before, and had an idea what they were all about. They've had quite a history so far. Ultraviolet is just incredible.

The dual vocals of Laura Pleasants and Phillip Cope work so well together. And the twin drummers make for some interesting rhythmic assaults. Slamming record from start to finish.

9.) The Black Dahlia Murder - Everblack

Hands down one of my most anticipated records of the year, and boy did it deliver. I love this band. Everblack was incredible. Production, song writing, riffs, everything was great. I look forward to hearing these songs live when they come around with Carcass.

8.) Clutch - Earth Rocker

I never have been a die hard Clutch fan, but this record might have changed that. Every single song on this record is great. Gone Cold gives me goosebumps every time I hear it.

7.) The Dillinger Escape Plan - One of Us is The Killer

First time I listened to this record I was impressed, but I wasn't falling in love with it or anything. Then I let it sit there for a while, and came back later. And came back again. And again. Now I can't get these songs out of my head. Nothing's Funny and One of Us is the Killer do not leave my brain much. Incredible record from one of the best live bands I've ever seen (there, I said it).

6.) Nine Inch Nails - Hesitation Marks

Trent Reznor came back with a vengeance on Hesitation Marks, and it delivered. This record reminded me a lot of With Teeth or Year Zero more than anything else, and it rocked. Lots of catchy NIN type stuff, and the songs are still stuck in my head. I'm pissed I didn't get to catch any of the live shows, the production looked incredible.

5.) Uncle Acid & The Deadbeats - Mind Control

Best band name ever. This record had to be good to make it into my top 5. Just go listen to it. Stoner / psychedelic rock from the 70s with just enough headbanging groove to make it heavy.

4.) Queens of the Stone Age - ...Like Clockwork

I think this is the record I listened to the most out of anything that came out in 2013. It's so good. Josh Homme is one of my favorite song writers, and I've been a Queens of the Stone Age fan since Rated R. The supporting cast on ...Like Clockwork is all-stars, and the Elton John inspiration is bizarrely amazing. Vampyre of Time and Memory, Smooth Sailing, Fairweather Friends, My God Is The Sun, well, every song on this record should be a single. It's so good. Can't say anything more about it.

3.) Deafheaven - Sunbather

This record is terrifyingly beautiful. I listened to it the day it came out before everyone started praising the hell out of it (though, to be fair, people that leaked it were praising it like crazy long before the release date). I was excited to check it out because I had never heard of them before. Blown away is an understatement.

This record sounds like the band I would want to be in if I was a drummer. The drumming on this record is phenomenal. It's not the most technical or fast or whatever, but it is SO DAMN GOOD and so atmospheric and rhythmic that it makes me want to be drummer.

The guitars are epic. I love the way Kerry McCoy goes from some insanely black metal trill picking riff almost instantaneously into an epic thunderstorm of hanging chords and lush melodies.

George Clarke's vocals are insane. More than just a voice, he adds an additional instrument to each song. You can feel every word and scream that he puts out, and the production makes it that much more impactful.

It's such a damn good record. Do yourself a favor and just listen to it. Forget about genres, forget about preconceived notions of whatever you might think it is, just listen to it as a great piece of music and appreciate it for what it is. I can't wait to see them when they come around.

2.) Purson - The Circle and The Blue Door

Never heard of these folks before this record dropped. Never heard much press. Maybe that's why I love it so much.

Rosalie Cunningham's voice is beautiful, and every single one of these songs was stuck in my head after the first play through. They remind me of what would happen if Blue Oyster Cult, Janis Joplin, and Led Zeppelin all got in a room and decided to write an album together. There are so many beautiful moments on this record that you should just listen to it for yourself. The Contract, Spiderwood Farm, and Sapphire Ward really stood out for me, but the entire thing is a retro nod to the classics, and it's awesome.

1.) Atoms for Peace - Amok

What do you get when you stuff Thom Yorke, Flea, Nigel Godrich, Joey Waronker, and Mauro Refosco into a studio? Apparently a great record.

Seriously, I don't want to know how this was conceived. I don't care how it was recorded. All I know is the finished product is, hands down, the best record I heard all year. Every single moment on this record feels like it is in the right place and naturally belongs EXACTLY where they put it. It blows my mind how many awesome musical moments they have crammed into one album.

I dare you to listen to any song on this album and not be humming it to yourself all day. Try it. You will fail.

I like Radiohead, but I think this blows everything they've done out of the water. Judge, Jury, and Executioner, Default, Stuck Together Pieces, and Dropped...oh man, DROPPED, that song is a monument all to itself. That song sinks the teeth in and just grooves me away.

I look forward to the next record they write, but until then, I'm pretty sure I'll be playing this one a lot in the months / years to come. Album of the year, hands down.

Honorable Mentions

  • .letlive - The Blackest Beautiful
  • A Storm of Light - Nations to Flames
  • Alice in Chains - The Devil Put Dinosaurs Here
  • Amon Amarth - Deceiver of the Gods
  • Arctic Monkeys - AM
  • Autopsy - The Headless Ritual
  • Bad Rabbits - American Love
  • Black Sabbath - 13
  • Black Tusk - Tend No Wounds
  • Bring Me The Horizon - Sempiternal
  • Cult of Luna - Vertikal II
  • Felix Martin - The Scenic Album
  • Haken - The Mountain
  • I is Another - I is Another
  • Ihsahn - Das Seelenbrechen
  • In Solitude - Sister
  • Intronaut - Habitual Levitations
  • Karnivool - Asymmetry
  • Killswitch Engage - Disarm the Descent
  • Locrian - Return to Annihilation
  • Mouth of the Architect - Dawning
  • Mustasch - Sounds Like Hell, Feels Like Heaven
  • Norma Jean - Wrongdoers
  • Oblivion - Called to Rise
  • Orchid - The Mouths of Madness
  • Phantom Glue - A War of Light Cones
  • Pyres - Year of Sleep
  • Pyrramids - Brightest Darkest Day
  • Revocation - Revocation
  • Rosetta - The Anaesthete
  • Scorpion Child - Scorpion Child
  • She & Him - Volume 3
  • Soilwork - The Living Infinite
  • Sound City - Reel to Reel
  • Spiritual Beggars - Earth Blues
  • Stomach Earth - Stomach Earth
  • The Ongoing Concept - SAloon
  • Toxic Holocaust - Chemistry of Consciousness
  • True Widow - Circumambulation
  • Volto - Incitare
  • We Butter the Bread With Butter - Goldkinder
  • Windhand - Soma

Enabling Wifi in Raspbian

I've started playing around with a Raspberry Pi recently. It's pretty slick, but there are a few gotchas I've run into, particularly regarding wifi.

I'm using a Model B Raspberry Pi which came with a USB wifi dongle, since my TV and router are not in the same room.

With raspbmc, it asks for your ssid and passphrase, but with an image like raspian, you have to configure the settings yourself. It's not too bad, but the documentation I searched for was not very helpful or clear.

This worked for me. Here's is what my /etc/network/interfaces looks like:

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ssid "YourSSIDGoesInHere"
wpa-psk "YourWifiPassphraseGoesInHere"

After that, run this to reboot the pi:

sudo reboot

Once it starts back up you should see a message displaying your pi's new IP address handed out from your router displayed during boot.

Testing Salt States Rapidly with Docker

At Mediafly we have been using Puppet for a lot of our configuration management. While it does the job, it's a little opinionated and a little more complex than I'd like.

I've been using Salt a lot lately outside of work and I love the simplicity. I'll save my opinions for another post, but I guess if I'm writing about it that means I enjoy using it, right?

In conjunction with that, we've also been experimenting a lot with Docker. I'm learning that I wish Docker was around a long, long time ago (or that I discovered LXC a long time ago).

I just wanted to share how I've been using Docker to rapidly test Salt states (and I presume you could do the same for puppet or Chef).

Before Docker, when I wanted to test a system state (using shell scripts, puppet, or even just manual statements) I would spin up a base ubuntu server image in AWS and have to wait for it to get going, which takes a long time (~2-3 minutes). Soon I'd grow tired of this and moved on to just using VMs in VirtualBox on my dev machine. While this helped out in the time of spinning up a new instance in a fresh state, it would still take up a lot more time than I'd like (as close to instant as possible).

With Docker, the feedback cycle shortens to near instantaneous. Here's how I do it. Note that I'm not advocating this as the best way by any means, this is just the simple approach that works very well for me.

Let's get a few assumptions out of the way. I will assume that you have Docker running properly in your environment. If you do not, this is the best way to get started.

Also, if you wish to persist changes to the Docker images you make, you should set up an account here so you can push and pull your images easily.

The best way to get Salt onto a fresh machine is with salt-bootstrap. As such, you should clone this repo in your dev environment somewhere that your Docker container can access it (I'll explain later). You'll also need the Salt states you'll be running (if you are just getting started you can clone this, which are some very good examples to get started).

Now, let's get started with a fresh ubuntu image. We're going to use 12.04 (at the time of writing) which is the default Docker ubuntu image. First, start the Docker daemon:

sudo docker -d

Next, let's run the following command, which will attempt to connect to the base ubuntu image from index.docker.io - since this is the first time it is running, Docker will download the image to your dev environment:

sudo docker run -i -t ubuntu /bin/bash

Once this all downloads, you should be at a bash shell prompt, with a vanilla ubuntu 12.04 install, as the root user.

Now, for Salt testing, we want this container to have access to our code in our Salt repository, wherever that may be. To do this, let's create the folder /srv/salt inside our Docker container:

mkdir -p /srv/salt

Salt by default looks for states inside /srv/salt, so we'll use this for our testing.

Now, we want to commit the change we just made, so that the /srv/salt directory persists in our Docker image.

In another terminal, run the following command to get the list of running Docker containers:

sudo docker ps

This will come back with something like this:

karl@karl-VirtualBox:~$ sudo docker ps
[sudo] password for karl: 
ID                  IMAGE                              COMMAND             CREATED             STATUS              PORTS
93963124836e        ubuntu:latest   /bin/bash           15 seconds ago      Up 15 seconds     

Now, to commit the changes, run this, replacing the ID you see in your environment:

sudo docker commit 93963124836e karlgrz/salt-base

Ok, couple things here. karlgrz/salt-base is just a name for an image I want to push up to index.docker.io and takes the form of username/image-name. This could be whatever you want if you are not pushing to a repository, I just like to follow that practice. If you did want to push it to index.docker.io, you just issue the following command:

sudo docker push karlgrz/salt-base

Now you have an image that is base ubuntu, plus a folder at /srv/salt. Now, let's make another directory, which is where that salt-bootstrap repo will be mounted, inside our Docker container:

mkdir -p /srv/salt-bootstrap

Again, commit the change:

sudo docker commit 93963124836e karlgrz/salt-base

Now we have the following folder structure in our Docker container:

- srv
    - salt
    - salt-bootstrap

In the shell, hit Ctrl+D to exit and disconnect from the Docker container.

Now we want to mount our Salt states repo and the salt-bootstrap repo INSIDE that Docker container (because we shouldn't need to do any editing of source code inside there, leave that for your comfortable dev environment).

Start the Docker container like this to do that (replacing your local paths as necessary):

sudo docker run -i -v /home/karl/workspace/salt-bootstrap:/srv/salt-bootstrap -v /home/karl/workspace/salt-states:/srv/salt -t karlgrz/salt-base /bin/bash

Ok, now if you cd in to /srv/salt in our Docker container, you will see all the code from /home/karl/workspace/salt-states, and /srv/salt-bootstrap contains the salt-bootstrap stuff.

That's it! Now run the following command from /srv inside the Docker container:

salt-call --local state.highstate

And that will run salt locally, using the states in /srv/salt. You can view the output like you would on a normal machine, but now, when you stop and re-start the Docker container, you're at a fresh state. No need to wait for an AWS instance or a VM to spin up. This makes that feedback cycle SO MUCH FASTER!

Obviously, you aren't limited to just Salt or Puppet or Chef testing here. Docker presents new ways to control deployments and infrastructure partitioning that have been eye opening to me, and I think I've only begun to scratch the surface.