OSS licensing

There are so many different license models out there in the open-source community. I don’t know what all the fuss is about… I hate legal stuff, just ship it and ask for permissions later!

Nevertheless I have a license for my open source projects on github as well and it’s just there to say FU to everyone that actually cares about licensing. It’s called “THE BEER-WARE LICENSE”:http://en.wikipedia.org/wiki/Beerware:

/*
 * ----------------------------------------------------------------------------
 * "THE BEER-WARE LICENSE" (Revision 42):
 *  wrote this file. As long as you retain this notice you
 * can do whatever you want with this stuff. If we meet some day, and you think
 * this stuff is worth it, you can buy me a beer in return Poul-Henning Kamp
 * ----------------------------------------------------------------------------
 */

h3. THE (extended) BEER-WARE LICENSE

I modified it a little to come closer to my own needs (markdown + more beers!):

## License
"THE (extended) BEER-WARE LICENSE" (Revision 42.0815): [phoet](mailto:[email protected]) contributed to this project.

As long as you retain this notice you can do whatever you want with this stuff.
If we meet some day, and you think this stuff is worth it, you can buy me some beers in return.

Cheers!

Moustache Swag

Pulling strings on Raspberry Pi

I got my “Raspberry PI Starter Kit”:http://www.amazon.de/gp/product/B00AD12VLW/ this week. The Kit is very nice, as it comes packaged with everything you need in order to get your PI up and running ASAP. Just plugin the SD-Card, connect Ethernet cable and USB Power supply and your ready to go!

h2. Booting Up

After the PI has booted from the provided Image on the SD-Card, it is accessible through SSH:

ssh [email protected]

It’s a good idea to copy the SSH public key to the machine, so that you do not have to type in the passphrase everytime:

ssh [email protected] "mkdir -p .ssh"
scp ~/.ssh/id_dsa.pub [email protected]:.ssh/authorized_keys

When the provided Raspberry PI distro is outdated, you can update it with the builtin admin tool:

sudo raspi-config 
=> select update, exit
sudo reboot

h2. Bootstrap for Puppet

As an experiment, I wanted to provision my PI with “Puppet”:http://puppetlabs.com/. Since the PI comes packaged with Python as a programming language, you need to install Ruby in order to run Puppet.
There are several Ruby Versions available as Debian packages, but I wanted to try out “RBenv”:https://github.com/sstephenson/rbenv just for fun. This is only an option if you have plenty of time, cause building a Ruby from source takes round about 2 hours…

# update aptitude
sudo apt-get update -y
# install some basics like git and support for ruby to compile and puppet to work
sudo apt-get install build-essential zlib1g-dev libssl-dev libreadline-dev git-core curl libyaml-dev -y

# clone the rbenv repo and setup the env
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.profile
echo 'eval "$(rbenv init -)"' >> ~/.profile
exec $SHELL -l

# add the ruby-build plugin and install a ruby 1.9.3
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
rbenv install 1.9.3-p327
# set the ruby as the global ruby version
rbenv global 1.9.3-p327
rbenv rehash
# check if it's working fine
ruby -v

# add the rbenv sudo plugin
git clone git://github.com/dcarley/rbenv-sudo.git ~/.rbenv/plugins/rbenv-sudo

Having a running Ruby, installing Puppet is just a matter of minutes, as it is distributed as a Ruby Gem. It’s a good idea though to “disable RDoc and RI documentation generation”:http://stackoverflow.com/questions/1381725/how-to-make-no-ri-no-rdoc-the-default-for-gem-install to speed up the installation:

# puppet needs it's own user and group
sudo useradd --comment "Puppet" --no-create-home --system --shell /bin/false puppet
# disable documentation generation for gems
echo "gem: --no-ri --no-rdoc" > ~/.gemrc
# install the gem
gem install puppet
# make puppet executables available through rbenv
rbenv rehash
# check if facter is installed properly
facter

If facter complains about a problem with the fact fqdn, just add a real hostname to /etc/hosts:

sudo vi /etc/hosts
127.0.1.1       raspberrypi.nofail.de raspberrypi

h2. First Puppet run

After that puppet should run without warnings and you can start writing the first manifest:

mkdir /home/pi/puppet
cd /home/pi/puppet
vi base.pp

Add this to base.pp to install VIM to the Raspberry PI:

package { "vim":
  ensure => installed,
}

This manifest can be applied with rbenv sudo:

rbenv sudo puppet apply base.pp

Et voila, VIM is installed on your PI.

h2. Samba

Working with the tools on my Mac is cool, so sharing a directory on the PI is a nice way of editing locally and running stuff on the server. Deriving from “a basic installation of Samba”:http://baleinoid.com/whaly/2012/06/rpi-sharing-files-between-the-raspberry-pi-and-a-computer-with-windows-7-home/ that’s what needs to be done on the PI:

# install samba
sudo apt-get install samba samba-common-bin
# update config
sudo vi /etc/samba/smb.conf

In /etc/samba/smb.conf uncomment line security = user and add the following section:

[Puppet]
  comment = Puppet share 
  path = /home/pi/puppet
  writeable = yes
  guest ok = no

Once you did this, add a Samba user and restart the service:

# make shared dir writable
chmod 777 /home/pi/puppet
# add the user for access over smb
sudo smbpasswd -a pi
# restart smb
sudo /etc/init.d/samba restart

Using ⌘+k on the Mac connects to a remote server. Enter smb://[email protected] and connect to the Puppet share. You can now access your files via open /Volumes/Puppet/.

h2. DynDNS

In order to access the PI over the internet, subscribing to a free Dynamic DNS service like “NO-IP”:http://www.no-ip.com/ is a nice way to get a static hostname for name resolution.
NO-IP has some “Tools available for download”:http://www.no-ip.com/downloads.php?page=mac that help you keeping the switching IP up to date. Since the provided binaries did not work on the PI, the NO-IP client needs to be “compiled from source”:http://support.no-ip.com/customer/portal/articles/363247-installing-the-linux-dynamic-update-client-on-ubuntu.

On my Airport Extreme I enabled “port-forwarding”:https://discussions.apple.com/docs/DOC-3414 so that i can route services to the PI.

h2. WiFi

If you want the PI to connect to your wireless network, just buy yourself a “mini wifi USB adapter”:http://www.amazon.de/gp/product/B003MTTJOY/ref=oh_details_o00_s00_i00?ie=UTF8&psc=1. It’s pretty easy to get the PI up and running with this on your local wifi, just enable the network device in _/etc/network/interfaces_, mine looks like this:

# /etc/network/interfaces
auto wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa.config

auto eth0
iface eth0 inet dhcp

and add the wifi connection settings to _/etc/wpa.config_:

# /etc/wpa.config
network={
  ssid="YOUR_SSID"
  proto=RSN
  key_mgmt=WPA-PSK
  pairwise=CCMP TKIP
  group=CCMP TKIP
  psk="YOUR_PASSWORD"
}

Raspberry PI with cream and sugar!

Bringing Usergroups on Ruby

I am one of the “organizers”:http://hamburg.onruby.de/#wishes of the local “Ruby Usergroup in Hamburg”:http://hamburg.onruby.de/ for over two years now. We meet on a regular basis, every second wednesday each month. Some times we meet in a bar to grab some beers, some times we have full fledged community events with sponsors and high quality talks.

All this is currently managed using the “On Ruby”:https://github.com/phoet/on_ruby plattform that was created to bring the events close to

the Ruby devs. It also eases the process of creating events, submitting talks, finding locations and publishing all that to Twitter, Google+ and Mailinglists.

Some month ago, the project was forked by “Cologne.rb”:http://www.colognerb.de/ and they built their custom version for the Ruby Usergroup in Cologne. After that some more Usergroups wanted to use the tool and that was the reason we merged the Cologne.rb codebase and created a whitelabel version of the application, which is customizable in many regards. It also comes with a “Mobile version”:https://github.com/phoet/on_ruby#the-guide-to-your-rug for iPhone and Android.

If you are interested in joining “Hamburg”:http://hamburg.onruby.de/, “Cologne”:http://cologne.onruby.de/, “Bremen”:http://bremen.onruby.de/, “Saarland”:http://saar.onruby.de/ and “Karlsruhe”:http://karlsruhe.onruby.de/ just “follow the guide for creating your own OnRuby Usergroup”:https://github.com/phoet/on_ruby#the-guide-to-your-rug!

Senor Developer Competition at Scottish Ruby Conference

Our “Señor Developer Shirts ™(c)(r)”:http://blog.nofail.de/2012/04/senior-developer-my-ass/ are a great success! So far we have delivered around 300 Shirts all over the world, including most European Countries, Russia, US, Uruguay, and New Zealand. We have been to “Railsberry”:http://railsberry.com/ and “EuRuKo”:http://www.euruko2012.org/ to promote them (while recovering from our hangovers). Even “Aaron Petterson”:https://twitter.com/#!/tenderlove and “Yehuda Katz”:https://twitter.com/#!/wycats wanted one, even though I have not seen them on any Friday-Hug photo…

The next stop of the Señor Developer World Europe Tour will be Edinburgh and the “Scottish Ruby Conference”:http://scottishrubyconference.com/!

We want to do a little Señor Developer Competition there. The base idea is to give away free shirts to visitors of the conference with Awesome Moustaches (should be a trademark of “Sven Fuchs”:https://twitter.com/#!/svenfuchs):

We don’t want everybody to grow a moustache, instead you could also moustachify yourself in different ways: mask yourself with a fake-moustache, create digital moustaches, wear moustache swag, tinker something moustachilitious!

Just surprise us and have fun!

[“Oldschool Señor Developer Shop”:http://senordevelopershop.spreadshirt.de]
[“Deluxe Señor Developer Shop”:http://senordesigner.spreadshirt.net]
[“Señor Developer mini Shop for US”:http://senordeveloper.spreadshirt.com/]
[“Fotos obviously stolen from Railsberry”:http://portfotolio.net/39342275@N02]