First post, second try

- Posted in Life by

Hi again,

So, I tried using drupal, but it's just too heavy for just a little blog (and lightweight hardware). Let's retry this with something that actually boasts it's lightweightness.

Teeny-tiny: Prefer your blog systems without the bloat? Anchor weighs in smaller than a standard JPG image at ~250kb (compressed).

distro-sync for Debian

- Posted in Linux by

Red Hat like systems have a feature called "distro-sync", or "distribution-synchronization". This will upgrade/downgrade all packages to the version that is provided by the current sources. Debian, and Ubuntu, and Debian-like systems, don't have this. But you can somewhat emulate this behavior by using the pinning feature of apt.

When you install/upgrade a package, apt evaluates the various versions it has in its database . You can see this with the apt policy command. Try it out for any package, bash for example: apt policy bash. If the priority of a package is high enough, apt will even downgrade. 1001 is usually enough.

We need to change the priority of our preferred version. To do that, we add a file to the /etc/apt/preferences.d/ directory, with the content:

Package: *
Pin: release a=PUTYOURRELEASENAMEHERE
Pin-Priority: 1001

Instead of PUTYOURRELEASENAMEHERE, you should mention your favorite release name. The same one that is also used in your sources list (i.e. oldstable, stable, unstable). After that, is it (mostly) a matter of doing an apt upgrade, and an apt full-upgrade. Mind you, if you're correcting a semi-broken state of your system, you might need to remove some packages and reinstall them later. It might be a good idea to keep track of the packages you remove by writing the important ones down. At least try to keep you graphical environment working, by making sure "gnome" is installed for example. You can do this easily by using tasksel.

Don't forget to remove the pinning file.

Create linux services the easy way

- Posted in Linux by

Linux used to struggle with managing services because of the simple design of SysV init. It was not really a service configuration system, just a folder structure that decided when processes were started. You had to configure it all yourself. You needed to write a lot of boiler plate in your init scripts to get it going the right way, and mistakes were easy to make and hard to solve.

Not too long ago I ran into this where ulimits were correctly applied when a service started on reboot, but not when the service was restarted by the root user. When you discover why, it's evident, but until then, it feels like the system is just mocking you.

So, when systemd was introduced, it tried (and succeeded) to solve a lot of this by actually managing background services. Nowadays it does much much more, but let's focus on the service management. You can convert any process into your own service in under a minute. Easy for any Linux system, including Raspberry Pi's running Raspbian, or any other Linux flavour.

We start by identifying what needs to start. If it's just a simple process /usr/bin/myprocess that you start from the command line, your systemd config file would look like this:

[Unit]
Description=My fancy description
After=network.target

[Service]
Type=simple (or forking, if the prompt comes back after starting it manually)
ExecStart=/usr/bin/myprocess
Restart=on-failure

[Install]
WantedBy=multi-user.target

You can edit your config file with nano by issuing the command sudo nano /etc/systemd/system/myname.service. When done, just enable the service by issuing the commands: - To reload the systemd configuration: sudo systemctl daemon-reload (or reboot). - To enable the service for startup on reboot: sudo systemctl enable myname - To start the service: sudo systemctl start myname

Raspberry baby steps

- Posted in Linux by

Slowly moving over some simple services from main power hungry server to raspberry mini-server. Target situation would be that the main server is offline most of the day and is only powered up when I am actually home or in need of hefty services (power up on magicpacket).

Step 1 is done: Basic installation, DHCP, DNS and NTP. Next step would be web and mail services. Not sure how to design that one. Maybe keep mail (zarafa) running on main server, but cache incoming mail on raspberry. Maybe move web interface from apache to nginx if zarafa web interface works with that setup. That is something for next weekend.

Tasting some beers last night...

- Posted in Uncategorized by

...many beers...which is of course the very best moment to start upgrading your phone software to the latest nightly release including new recovery roms. Flashed Philz Touch recovery and CMW 20130309 on my Samsung Galaxy S2. Balls to the wall!

To my surprise, it was a complete success. No brick, just Android 4.2.2 working like a charm....that is no fun. Nice to have though...

Pancakeday

- Posted in Home Automation by

Last Tuesday was pancakeday. Sadly, I had to miss it...but today I corrected it. Had some nice pancakes with some friends....cheers!

Page 2 of 2