Recent posts

XS4ALL IPTV multicast sources changed

Some of my XS4ALL (KPN) IPTV channels stopped workking properly. The started to stutter, normally an indication of trouble at multicast subscriptions. Looking at the logfile (while the little one was trying to watch BabyTV) I found the culprit:

The source address 217.166.226.39 for group 224.0.252.39, is not in any valid net for upstream VIF[0]. This address is part of a multicast block 217.166.0.0/16 assigned to KPN.

Adding this new network to /usr/local/etc/igmpproxy.conf using the altnet 217.166.0.0/16 made it all work again.

Ubuntu Server shorten motd message

Ubuntu MOTD gets more lengthly every time a new release comes around with all kind of 'usefull' information and even 'newsflashes'. To disable bits remove executable permissions from parts you do not care about in /etc/update-motd.d/

For example to disable the introduction links, motd 'news' and livepatch 'spam':

$ sudo chmod 0666 /etc/update-motd.d/10-help-text
$ sudo chmod 0666 /etc/update-motd.d/50-motd-news
$ sudo chmod 0666 /etc/update-motd.d/80-livepatch

You can check the result using:

$ sudo run-parts /etc/update-motd.d/

ownCloud client disable update notification

For some reason the Fedora 27 ownCloud client is nagging me for more than 3 weeks about the fact that my version is not yet up2date. This is utterly useless on a package managed Linux system. Since they also do not provide Fedora 27 packages on their website there is no simple way of getting the latest version.

Lucky there is a way to turn it of the notifications

ownCloud documentation nicely describes how-to disable the update notification.

Welcome (back)

After 4 years I have decided to recreate my digital dumping place for various bits and pieces.

Revenge of the jumpers

Searching for two hours why my X and Y direction stepper motors where not travelling the same distance when evoking the same amounts of steps. Turned out to be 'interesting'. By closer inspection of my jumpers which controlled the step sizes, it turned out one was 'empty'.

By replacing the jumper all where happy again. During my testing I noticed that the steps where also limited to 200um instead of 100um. By closer inspection this is caused by slack on the timer-belt. I am hoping to improve it by the means of using different belt.

I used a very simple test program for testing purposes, this basic framework is also nice if you want to play with single steps and all kind of other accuracy settings.

Line 
1// Pin headers for Megatronics v2.0 (MOTHERBOARD 701 in Marlin Firmware)
2#define X_STEP_PIN         26
3#define X_DIR_PIN          27
4
5#define Y_STEP_PIN         4 // A6
6#define Y_DIR_PIN          54 // A0
7
8#define Z_STEP_PIN         56 // A2
9#define Z_DIR_PIN          60 // A6
10
11unsigned long prevMillis;
12int steps = 0;
13bool dir = HIGH;
14
15void loop () {
16   // Reverse direction after 100 steps
17   if (steps == 100) {
18     dir  = !dir;
19     steps = 0;
20   }
21
22   digitalWrite(X_DIR_PIN, dir);
23   digitalWrite(Y_DIR_PIN, dir);
24   // digitalWrite(Z_DIR_PIN, dir);
25   steps += 1;
26   
27   digitalWrite(X_STEP_PIN, HIGH);
28   digitalWrite(Y_STEP_PIN, HIGH);
29   // digitalWrite(Z_STEP_PIN, HIGH);
30   delay(5);
31
32   digitalWrite(X_STEP_PIN ,LOW);
33   digitalWrite(Y_STEP_PIN ,LOW);
34   // digitalWrite(Z_STEP_PIN ,LOW);
35   delay(3);
36
37
38}

My first panorama


Pre-editing with Gimp, stitching with Hugin (Large Version)

One Way to Support the FreeBSD project

One way to support the FreeBSD project is to donate funds, but a much more interesting way of donating to the FreeBSD project is to run your own freebsd router/appliance/server which joins in on the FreeBSD ISO torrent website.

This a rather simple job. First install net-p2p/transmission-daemon and depending on your favorite way go for the web solution www/transmission-web --make sure to change the ACLs to match your setup-- or the CLI net-p2p/transmission-cli.

Next make sure TCP port 51413 inbound is allowed (or configure your transmission-daemon to use a different one.

Make sure you install at least the most popular ones (the full release versions like (8.1-RELEASE-amd64-all and 8.1-RELEASE-i386-all). By manually adding the torrent links to the queue. Wait... you can also try my hack to automatically use the latest available torrents (useful to quickly get in sync on a new releases). Take a look at source:transmission/rss-sync.sh

As I have FreeBSD installed on CF card readonly, I host the torrents of a mobile USB hard drive mounted at /data which makes my config source:transmission/settings.json a bit different than the usual ones.

EFI and GPT two new kinds in town

Introduction

EFI (Extensible Firmware Interface) GPT (GUID Partition Table) have been around for a while. As a matter of fact the have been under my fingers for almost two years, as my MacBookPro4,1 had both available.

So why the sudden interest in them? I got forced re-installing my operating systems when I was playing around with FreeBSD experimental installs (say bye-bye to the partion table, my own fault!). Hence I thought it would be nice to make a QuadBoot+ system of it.

Using the good old MBR way I could in theory host 4 Operating Sytems, but their is a 'hidden' EFI firmware-to-be-installed-and-used-maybe-in-the-future-partion causing this great plan to fail. As this was claiming one of my presious MBR partions. So here is where GPT comes into handy. This partion scheme allows us to use as many partions as we want. And with an hybrid setup the 4 partions are synced back to MBR partions allowing the ooldies in OS world to still boot somehow.

So here is where EFI comes around the corner. As this (in theory) allows booting to other partitions as this is NOT a standard PC-BIOS thing ---and so does not behave like one _really_!--- you will endup in some big pain if things go wrong.

Planned setup

First things first. The Planned Partion layout with type and mount point if needed. Due to the hybrid setup partions can be dual labeled.

  1. EFI firmware
  2. Linux (ext4) (/ mountpoint)
  3. FreeBSD (ufs)
  4. Windows XP (NTFS)
  5. MacOSX (hfs+)
  6. Linux (swap)
  7. Linux (ext4) (/home mountpoint)
  8. FreeBSD (swap)
  9. Windows7 x64

Problems

First thing to wonder, why Windows XP on partion 4, just because, if you don't it simply fail no explanation possible. It also does NOT support any EFI/GPT magic so you will need the good old 'bootcamp'/hybrid way.

Secondly Windows7 x64. Note that the i386 versions does not support EFI at all. Also MacbookPro4,1 has UEFI implementation 1.1 while Windows7 _really_ needs UEFI implementation 2.0. So no luck for the Windows7 as well.

Next Linux (or Ubuntu 10.10 in my case). When you try to run it with a native EFI boot loader by following the guide: http://grub.enbug.org/TestingOnMacbook you will find yourself in a pretty useless situation as the linux kernel (and both nouveau/nvidia kernel modules) makes all kind of assumptions about having a PC-BIOS at all. The provided emulation is not actived when booting with native EFI and grub is (not yet) smart enough to get all going again. So you will end up with a not working system (altough bootable and with some basic screen capacities).

FreeBSD (8.1-RELEASE) does not even support booting natively from EFI yet (motivation found so far: the EFI loaders, provide enough BIOS emulation to get it booting anyways), but does support GPT out-of-the-box. But their gptboot enabled loader thinks as beeing the only one in the world and is not capable of booting any other operating system. So we are going to need GRUB2 to fire off this partion.

Working setup

  1. First of all install MACOSX and create your partions using the 'Disk Utility'. You can format them HFS+, and the windows partion FAT32 as you can savely reconfigure at later stages. But you really only need one FAT32 in your list of first 4, else the windows installer gets confused.
  2. Now intall rEFIt, this GUI EFI loader will save you a lot of keypressing and hoping the embedded bootloader picks the right CD/disk/whatever.
  3. (Optional): Install Windows XP, I have not tried it, but it should work fine.
  4. Have rEFIt 'resync' partions before trying to boot anything.
  5. Install Ubuntu, the GRUB2 bootloader automatically get installed on the MBR bit which we later need to boot all kind of OS fun.
  6. Have rEFIt 'resync' partions before trying to boot anything.
  7. Install FreeBSD, the manual way, don't use the sysinstall and DO NOT install the bootloader/bootmanager as this will have you to restart again.
  8. Point your Grub boot loader to also allow booting to FreeBSD (see my previous blog post).

Conclusion

GPT is a pretty usefull and workable subsistute for MBR, to finally get rid of the pain which comes when installing multiple Operating Systems (or versions of it) and is also nicely supported by all modern operating sytems.

EFI on the other hand really needs working on. GRUB2 and Linux, kind of work. But FreeBSD is not supported/working yet and also does not provide a native loader to start with. Windows7 really needs modern hardware which seems like a resonable choice as mine notebook is older than 2 years and is barely specd to run it anyways.

Will keep you posted as I really like to run native EFI powered OS to finally say goodbye to PC-BIOS. Which is in my option be around for far to long.

How-to boot FreeBSD with Grub2 under Ubuntu 10.10

I recently upgrade to Ubuntu 10.10. Which also caused grub to be updated to version 1.98 (to be exactly {1.98+201000804-5ubuntu3), which used a different syntax to define partitions instead of numbers which where off by one, they now use msdosX style formatting.

My FreeBSD is located at /dev/sda3 on a good old MBR partition table and I want to use the good old FreeBSD boot loader as well (so chainloading is required). To activate within Ubuntu. Put the following contents in /etc/grub.d/40_custom:

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry "FreeBSD (on /dev/sda3)" {
        savedefault
        insmod chain
        set root='(hd0,msdos3)'
        chainloader +1
}

Note: My hd0 is /dev/sda under Linux and got named /dev/ad6 under FreeBSD
If you want to boot of a GPT partion use the following syntax

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry "FreeBSD (on /dev/ad6p3)" {
        savedefault
        insmod ufs2
        set root='(hd0,gpt3)'
        kfreebsd /boot/loader
}

Update your grub and use should be done:
rick-eee$ sudo update-grub

Image sorting with oneliners

I have many images on my devices, which can become messy after a while. Today I like to have all my images from my (old) Nokia N95 archived in two (year) folders:

Tip: This require installing the exif package.
Note: The quotes and -I templating is needed as some files contained spaces within them.

First find me all pictures including the thumbnails and other junk from some old photo editing software program and store them in an folder called /media/RICK_250GB/Pictures/N95/ :

$ find . | grep -i 'jpg$' | grep -v '/\.' | grep -v 'Data\.noindex'  |\
  xargs -n 1 -I % sh -c "exif '%' | grep -q 'N95' && \
  cp '%' /media/RICK_250GB/Pictures/N95/"

Some other raw pictures also got included, I only want the ones from the N95 which have exact 11 digits and have prefix jpg. So get rid of all others:

$ cd /media/RICK_250GB/Pictures/N95/
$ ls | grep -v -E '^[0-9]{11,11}\.jpg*' | xargs -n 1 -I % rm '%'

Now store all in the correct folder:

$ cd /media/RICK_250GB/Pictures/N95/
$ mkdir 2008 2009 2010
$ ls * | xargs -n 1 -I % sh -c 'echo mv % `exif -t 0x9003  -m % | cut -c 1-4`/%' | sh