Salt is an automation and deployment system. I've started implementing it at work. I plan to write more about the specific things we've done, but not now, now I want to share something that I discovered.

We basically have decided to divide the machines in two different "classes"; Internal and external based on subnets. Initially I couldn't find a good way to do this. I tried all manner of weird matchings including 'G@ipv4:10.0.0.*'. Looking at the source of the ipcidr-matcher I discovered something... it can be used in States/pillar-matching!

I found out that you can do it like so:

# Pillar
  - match: ipcidr
  - node_class:internal

This is more or less unmentioned in the documentation, so I've done a pull request that got merged which documents how this is done. My next plan is to implement IPv6-support in the ipcidr()-matcher, something I suspect won't be as easy.

During the weekend I visited my dad. We went on a nice and relaxing walk and I brought my camera in case I saw something that caught my eye. I managed to snap one of those fancy "old factory electrical"-stuff photos of one of the larger of the 12 brickworks which used to be operational in the muncipiality.

Something that I've been doing the last few days is setting my camera to RAW only, this means I have to go through the photos and do postprocessing before I can do anything with them.

Speaking of photography; A fun, photo-related thing that I've just backed on Kickstarter is Lightbox Photography Cards. This is a really fun idea, I can barely contain my excitement. I, as many other hobby photographers, doesn't photograph as much as I would like. There aren't many times that I photograph for photographys own sake, but I am going to try and change that and I think that these photography cards can help with that.

layout: post title: "New format for this blog"

categories: blog

I've noticed that I don't write very often. Most of the time it's because I don't feel I have any interesting updates on any "projects" that I can share. So now I'm going to try and stop writing shareworthy posts and just write for my own sake. That's why one should write, not in case someone else wants to read it. I am no writer though, I'm a technician.

I will do my best to make at least 2 posts per month about something. Be it cooking, photograpgy, electronics, linux or programming or just one of those "sorry-that-I-dont-have-anything-to-write-posts".

With my blog set up as it is now, making a post is very effortless. All I do is use my rake-file to make a new post and start writing. There seems to be some bug/misconfiguration though. It doesn't name the file with a fileextension. I just had a look at my 'config.yml' and I had spelled extension as extentsion...

Two weeks ago I attended Stockholm Robot Championship at Tekniska Muséet. I participated with two robots; my minisumo Perfected Titan and a linefollower named squarewave which I didn't get to work properly in time. The results weren't that bad... Perfected Titan finished on 8th place out of 16 participants but he has played out his role now. He's been at two competitions so far and have only finished sort of half both times, it's time for a new build. The results from the competitions are here if anyone is interested. I filmed the minisumo-deathmatch of the competition, so here it is;

I develop using Vim as my IDE, it's very handy, but it has taken me a while to get there. I've recently spent time cleaning my vim plugins, now everything is fetched via Vundle.
Anyway, let's get on with it.
Two very crucial plugins for developing any C or C++, not just AVR-C, is YouCompleteMe and Ultisnips.
Both these plugins work very well together with a bit of configuring:

" Ycm vs ultisnips
let g:ycm_key_list_select_completion=[]
let g:ycm_key_list_select_previous_compltetion=[]

let &path = "/usr/avr/include,/usr/include,./"

au BufEnter * exec "inoremap <silent> " . g:UltiSnipsJumpBackwardTrigger . " <C-R>=g:UltiSnips_Reverse()<cr>"

let g:UltiSnipsJumpBackwardTrigger="<s-tab>"

The important part here being let &path = "/usr/avr/include,/usr/include,./". It adds /usr/include and /usr/avr/include to YCMs path where it looks for things to complete with.

When you're developing microcontroller code you very often have the datasheet for the microcontroller in question open at the same time, because let's face it; no one remembers all those registers in their head :).
For this I use Open-Pdf and a simple mapping that saves me a few keystrokes. I save all the datasheets of the processors/components that I work with in ~/Documents/Datasheets which is then linked to my ownCloud-folder so that I can have the same set of Datasheets on all my devices. The mapping is nothing more than a timesaver: map <Leader>d :Pdf ~/Documents/Datasheets/. It certainly doesn't look perfect, but it's quite handy to be able to search for registers and the like from within vim directly.