systemd, netctl, ifplugd and bridge

Today I attended to automatic connection on wireless and wired interface. The wireless interface was no problem on Arch Linux. Just install wpa_actiond and enable netctl-auto@.service. More headache on the bridged interface:

ifplugd only recognizes interfaces listed in /proc/net/dev, where br0 isn't listed until it is started by netctl. So after a bit research I found /etc/ifplugd/netctl.action which is called by ifplugd in conjunction with netctl. A typical call is "/etc/ifplugd/netctl.action eth0 up". But eth0 isn't in one of my netctl profiles as interface and br0 is no device in which a cable is ever plugged in..

So I've had to options: 1. Giving up my bridge, 2. Adjusting netctl.action. Giving up my bridge would lead to unusable VMs, ergo only one option left:

Replace the test against the interface with the bridge interface and the test against the connection with "bridge". This will always use your bridge profile and nothing else anymore. In other words:

#Replace [[ "$Interface" == "$1" && "$Connection" == "ethernet" ]] || continue #with [[ "$Interface" == "br0" && "$Connection" == "bridge" ]] || continue

After changing netctl.action you just need to enable netctl-ifplugd@eth0.service and ifplugd@eth0.service (replace eth0 with your interface).

Attention: I use only one bridge profile with a static IP. Whenever I need a dynamic IP I use my WiFi. It is possible that this solution my not work, if you use other profiles as well...

Write a comment

2013-04-18 21:53:54

Convert Xen xva to vhd

Sometimes I need to convert a xen xva image to a vhd image for VirtualBox. So here is a quick howto:

qemu-img convert -O raw input_file.xva output.raw VBoxManage convertfromraw input_file.raw output_file.vhd --format VHD

Write a comment

2013-04-03 12:01:31

find | xargs

Today cron doesn't want to regexp my "cp [a-Z]* ...". Even if i set SHELL=/bin/bash in the crontab it got the error "cp: cannont stat [a-Z]*: No such file or directory". Manually on the shell there is no problem with regexp (it's locales fault; cron uses the POSIX locale and here I should use [a-zA-Z] as regexp). So I tried find in combination with xargs:

find /dir -print0 -type f | xargs cp -t /target/dir

The commandline switch -t makes it easier to use xargs with cp and even mv.

Write a comment

2013-03-26 09:24:53

udev rules

Looks like Linux 3.8 has a stupid bug. The e1000e driver for Intel NICs does not work correctly (ref. here). In short: The powersaving prevents the NIC from comming up correctly. So I wrote a udev rule to always power on my NIC. In fact there are only a little chances I won't need it:

SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{subsystem_device}=="0x21f3", ATTR{device}=="0x1502" ATTR{power/control}="on"

Compare vendor, subsystem_device and device with your own configuration. Either with udevadm(8) or with udevinfo(8).


Another problem with powersaving was my mouse. Everytime I didn't plugged in my powercord, I had a very stuttering cursor. So I wrote another udev rule:

SUBSYSTEM=="usb", ATTR{idVendor}=="1d6b", ATTR{idProduct}=="0002", ATTR{power/control}="on"

It is nearly the same except of the "search attributes".

Write a comment

2013-03-17 17:08:23

Brightness Control with Nvidia

My hopefully last challenge was to get the brightness control working with the hardware buttons and even with software. The proprietary Nvidia driver needs an additional config entry.

Add under "Device section":

Option "RegistryDwords" "EnableBrightnessControl=1"

Now you should control your brightness via software and via hardware on most Laptops

Write a comment

2013-02-27 14:27:52

Internal speakers Lenovo T530

Hi Folks,

just got a strange behavior on my Laptop. Last weekend I recognised, that the internal speakers weren't working correctly. Everything else worked find. After a bit googling I found, that it could "Auto-Mute Modes" fault. Setting it to disabled had no effect.

So today I took a closer look at the settings in alsamixer. The problem was just a muted channel. Unmuted the speaker channel and *tada* there is sound again on my speaker:

amixer -c 0 sset Speaker on

Write a comment

2013-02-05 21:08:28

Cleanup...

Cleaned up the download section. I removed old versions of DarX. The download statistics told me that only the most resent version is downloaded. So there should be no need of older version.

Even if you needed them it is too late. No files, no backup, no old versions. Grab the source code and build your own version.

Write a comment

2012-12-27 15:46:38

nDarx-0.1

Three months ago I promised to write a Linux pendant for DarX

Now it is time to release the first version. Nothing special. Just x01 with stats and highscore

Quick instruction:

  • Compile with make
  • Start the game
  • Adjust $HOME/.nDarx/conf
  • Enjoy

The next releases will contain adjustable settings from within the menu and cricket (my favourite game).

Write a comment

2012-12-26 19:11:54

DarX on GitHub

So this is probably my last post about DarX on OS X. I just published the sources on GitHub. Feel free to use it for your own scoring machine...

Write a comment

2012-11-07 12:11:44

SSH tunnel

From time to time I need a different IP with full webaccess for testing purpose. So I start an SSH tunnel to my server and configure my webbrowser to use a socksproxy at port 8080:

ssh -D 8080 -C -q -N host.tld

Write a comment

2012-11-06 22:24:48