News items for tag linux - Koos van den Hout

2017-02-06 Squeezing a bit more powersaving from Linux 2 weeks ago
The c't magazine this month had a few tips on linux powersaving. I tried them on the homeserver and saw indeed a very slight reduction in power use as logged by the UPS.

For powersaving in sound card(s):
# echo 1 > /sys/module/snd_hda_intel/parameters/power_save
This can cause plopping sounds on some sound cards.

For powersaving in disk communication:
# cd /sys/class/scsi_host/
# for i in host*/link_power_management_policy; do echo min_power > "$i"; done

Tags: , ,
2017-01-27 Nice neighbours sharing their weather readings 3 weeks ago
A posting about reading 433.920 MHz signals triggered the idea I had ages ago to decode those signals and see what weather stations are available nearby. The original posting 433,92Mhz ontvangen (Dutch) was about receiving remote controls (KlikAanKlikUit) and had a screenshot of some Linux software for receiving those signals but no name of the software (that would be useful information).

But a simple google search found me rtl_433 on github which receives and decodes all kinds of signals on 433.922 MHz.

I downloaded it on the raspberry pi for radio experiments, and it is working fine receiving weather information from probably nearby weather stations. At least one outside temperature and humidity sensor, one inside temperature and humidity and one wind and temperature sensor. This last one could be nice for my weather station!
2017-01-27 21:00:27 :   HIDEKI Wind sensor
        Rolling Code:    15
        Channel:         4
        Battery:         OK
        Temperature:     3.6 C
        Wind Strength:   5.31 km/h
        Direction:       67.5 °
and a rain sensor:
2017-01-27 21:01:05 :   HIDEKI Rain sensor
        Rolling Code:    0
        Channel:         4
        Battery:         OK
        Rain:    648.2 mm
Thanks for sharing, neighbours!

Tags: , , , ,
2017-01-23 Ontbrekende stukje grotere MTU met VDSL op DrayTek Vigor 130 en Ubuntu 1 month ago
Ongeveer een jaar geleden ging ik over op het Draytek Vigor 130 VDSL modem om weer een configuratie te krijgen waar ik maximale controle heb.

Het nog openstaande punt is dat ik de ppp configuratie graag naar een MTU van 1500 bytes wil. En dat dat toen niet lukte in Vigor VDSL modem in gebruik en Xs4all VDSL met DrayTek Vigor 130 VDSL modem en PPP eindpunt op Linux (ubuntu) server.

Wat ik al goed had was de MTU van de ethernet interfaces hoger en het vinkje op de Draytek aangepast. Maar als ik de mtu/mru hoger forceerde in de ppp opties ging het mis.

Nu kwam voorbij in xs4all.general over dit onderwerp:
> 1500 wordt ondersteund door Xs4all en je test eerst bij 1492 welk pakket
> via ping erdoor gaat zonder in stukken gebroken te worden.
> Daarna zet je de MTU naar 1500 en kijkt of je inderdaad 8 bits meer door
> router kunt drukken zonder dat die gebroken wordt.

Wel zorgen dat het apparaat waar je de PPPoE termineert RFC4638
implementeert.
Die moet dan in de PADI een extra tag plaatsen (PPP payload is 1500
bytes), en de BRAS zet dat ook weet in zijn PADO antwoord.
Zo maar een grotere MTU gebruiken gaat niet werken...
De PPPoE sessie komt bij mij vanaf de thuisserver met rp-pppoe. Even zoeken leverde mij op dat voor rp-pppoe met MaxPayload onderhandeling ik minstens 3.11 nodig heb, en bij de huidige ubuntu versie zit nog 3.8. Tijd om een nieuwere versie te testen.

Update: Daarvoor moeten zowel de pppoe binary als de rp-pppoe.so plugin voor pppd bijgewerkt worden, en dat lukt me op dit moment even niet. Gelukkig had ik de oude pppoe binaries expres klaar staan en kon ik dus heel snel terug.

Tags: , , ,
2017-01-20 APRS on the Raspberry Pi: trying to decode APRS packets 1 month ago
So the mobilinkd is now connected to serial over bluetooth on the Raspberry Pi, but now to get APRS data into aprx.

So far aprx does start but I see absolutely no data coming in, even when aprsdroid will see traffic. Something strange.
koos@joy:~ $ sudo aprx -v
2017-01-20 22:05:10.593 aprx start - 2.9.0
2017-01-20 22:05:10.594 TTY /dev/rfcomm0 opened
2017-01-20 22:05:20.624 CONNECT APRSIS aprsc.pa4tw.nl:14580
^C
2017-01-20 22:18:06.115 aprx ending (SIG 2) - 2.9.0
2017-01-20 22:18:06.116 aprx ending (SIG 2) - 2.9.0
It's a good thing aprsc.pa4tw.nl has an IPv6 address as this Raspberry Pi is only configured for IPv6.

Testing with minicom on /dev/rfcomm0 does show the startup messages from the mobilinkd but absolutely no APRS data in KISS format,,,
== BeRTOS AVR/Mobilinkd TNC2
== Version 2.0.1.571
== Voltage: 4019mV
== Starting.
Switching the mobilinkd between the Raspberry Pi and the smartphone with aprsdroid does seem to confuse something, it's not always showing data in aprsdroid either.

Installing the Linux ax25-tools and using kissattach and configuring aprx to use that interface doesn't help either.

Back to the KISS over serial port over bluetooth config I changed the setting 'bluetooth tracking' on the mobilinkd, which is advised for digipeater setups. And now I am seeing something:
koos@joy:~ $ sudo aprx -v
2017-01-20 23:12:17.568 aprx start - 2.9.0
2017-01-20 23:12:17.569 TTY /dev/rfcomm0 opened
9621    PE4KH-8   R     DB0NY>APZ17,DB0KX-2*,PE0FK-10*,PI1SHB*,PA7J-2*,WIDE2*,PI1APU*,LOCAL:!5103.84N/00736.63E#www.g07.de
2017-01-20 23:12:30.378 CONNECT APRSIS aprsc.pa4tw.nl:14580
9728    PE4KH-8   R     PI1APU>APND13:>W3,NL7      PAradigm    operation!
9831    PE4KH-8   R     PA3BXR-9>UQ5QW1,PA7J-2*,WIDE1*,PI1APU*,WIDE2-1:`zDKnA8>/]"3m}431.275MHz=
9867    PE4KH-8   R     PI1SHB>APRX29,PI1APU*,WIDE2-1:!5142.02N/00520.78E#PHG3460/2m Digi/IGate 's-Hertogenbosch
9934    PE4KH-8   R     PA5JB>APU25N,PE2KDK*,PI1APU*,WIDE2*:>202317zDX: PI1SHB 51.42.02N 5.20.78E 76.3km 133� 23:13
9942    PE4KH-8   R     PI1DFT>APMI01,PI1SHB*,PI1APU*,WIDE2*:@202317z5159.70N/00420.17E#WX3IN1 Digipeater 2 mtr. pi1dft ziggo.nl
10007   PE4KH-8   R     PI1APV-2>APMI04,PI1DFT*,PA7J-2*,WIDE1*,PI1APU*,LOCAL:@202318z5130.81N/00344.00EI digi vliegveld MIDDEN ZEELAND
10018   PE4KH-8   R     DB0OTV-2>APOT21,DB0KX-2*,PE0FK-10*,PI1SHB*,PI1APU*,WIDE2*:>FILL IN DIGI + D-Star + C4FM QRG = 439,500 MHz -7,6 MHz
10122   PE4KH-8   R     PE9R>APX204,PI1APU*,WIDE2-1:=5202.5 N/00439.0 E-PHG2290QRV PI6NOS/ PI2NOS
10175   PE4KH-8   R     PA7J-2>APMI01,PI1APU*,WIDE2*:@210000z5149.68N/00450.43E-WX3IN1 PA7J Digi & I-gate Hardinxveld
10209   PE4KH-8   R     PD0JAC-10>UQ4XS8,PI1SHB*,PI1APU*,WIDE2-1:`{Mym>5#/>"4/}=
10227   PE4KH-8   R     PA3BI-10>APRS,PI1DFT*,WIDE1*,PA7J-2*,WIDE2*,PI1APU*,LOCAL:!5214.65N/00426.30E-000/000www.isemann.nl/A=000696
10277   PE4KH-8   R     PI1APV-2>APMI04,PI1DFT*,PA7J-2*,WIDE2*,PI1APU*,LOCAL::PI1APV-2 :BITS.11111111,Telemetry
10316   PE4KH-8   R     PI1SHB>APRX29,PI1APU*,WIDE2-1:!5142.02N/00520.78E#PHG3460/2m Digi/IGate 's-Hertogenbosch
And the results are showing up via the aprsc dashboard on aprsc.pa4tw.nl. Almost all packets I receive and forward are rejected as duplicate packets, but I have seen some packets accepted. So I guess I'm not really needed as an I-gate.

Tags: , , ,
2017-01-20 APRS on the Raspberry Pi: talking to the mobilinkd 1 month ago
So I want to run APRS on the Raspberry Pi. My ultimate goal is to announce the meeting of our local radio club over 2 meter APRS but I will start with just playing "I-gate" which means I receive messages over the air and forward them to the nearest APRS server on the Internet which will then probably reject them because I'm not the only one receiving them.

The first step is to link the Raspberry Pi to a radio. The easiest way is (in my opinion) to link using the mobilinkd which uses serial over bluetooth, something the Raspberry understands.

I looked up how to use bluetooth on the raspberry and found Installing Bluetooth - Raspberry Pi Projects but using the suggested graphical tools requires a lot of packages:
koos@joy:~ $ sudo apt-get install bluetooth bluez blueman
Reading package lists... Done
Building dependency tree       
Reading state information... Done
bluez is already the newest version.
bluez set to manually installed.
The following extra packages will be installed:
  adwaita-icon-theme at-spi2-core colord colord-data dconf-gsettings-backend
  dconf-service fontconfig fontconfig-config fonts-dejavu-core fonts-droid
  gconf-service gconf2-common ghostscript gir1.2-appindicator3-0.1
  gir1.2-atk-1.0 gir1.2-freedesktop gir1.2-gconf-2.0 gir1.2-gdkpixbuf-2.0
  gir1.2-glib-2.0 gir1.2-gtk-3.0 gir1.2-notify-0.7 gir1.2-pango-1.0
  glib-networking glib-networking-common glib-networking-services
  gnome-icon-theme gsettings-desktop-schemas gsfonts hicolor-icon-theme
  imagemagick-common indicator-application libappindicator3-1 libasyncns0
  libatk-bridge2.0-0 libatk1.0-0 libatk1.0-data libatspi2.0-0 libavahi-client3
  libbluetooth3 libcairo-gobject2 libcairo2 libcanberra-gtk3-0
  libcanberra-gtk3-module libcanberra0 libcolord2 libcolorhug2 libcroco3
  libcups2 libcupsfilters1 libcupsimage2 libdatrie1 libdbus-glib-1-2
  libdbusmenu-glib4 libdbusmenu-gtk3-4 libdconf1 libexif12 libfftw3-double3
  libfile-copy-recursive-perl libflac8 libfontconfig1 libgconf-2-4 libgd3
  libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgirepository-1.0-1
  libgphoto2-6 libgphoto2-l10n libgphoto2-port10 libgraphite2-3 libgs9
  libgs9-common libgtk-3-0 libgtk-3-bin libgtk-3-common libgudev-1.0-0
  libgusb2 libharfbuzz0b libice6 libieee1284-3 libijs-0.35 libindicator3-7
  libjasper1 libjbig0 libjbig2dec0 libjpeg8 libjson-glib-1.0-0
  libjson-glib-1.0-common liblcms2-2 liblqr-1-0 libltdl7 libmagickcore-6.q16-2
  libmagickwand-6.q16-2 libnotify4 libogg0 libopenobex1 libpam-systemd
  libpango-1.0-0 libpango1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0
  libpangox-1.0-0 libpangoxft-1.0-0 libpaper-utils libpaper1 libpixman-1-0
  libpolkit-agent-1-0 libpolkit-backend-1-0 libpolkit-gobject-1-0 libproxy1
  libpulse-mainloop-glib0 libpulse0 librest-0.7-0 librsvg2-2 librsvg2-common
  libsane libsane-common libsane-extras libsane-extras-common libsm6
  libsndfile1 libsoup-gnome2.4-1 libsoup2.4-1 libstartup-notification0 libtdb1
  libthai-data libthai0 libtiff5 libvorbis0a libvorbisenc2 libvorbisfile3
  libvpx1 libwayland-client0 libwayland-cursor0 libx11-xcb1 libxcb-render0
  libxcb-shm0 libxcb-util0 libxcomposite1 libxcursor1 libxdamage1 libxfixes3
  libxft2 libxi6 libxinerama1 libxkbcommon0 libxpm4 libxrandr2 libxrender1
  libxtst6 notification-daemon obex-data-server policykit-1 poppler-data
  python-cairo python-dbus python-dbus-dev python-gi python-gi-cairo
  python-gobject python-gobject-2 sane-utils update-inetd x11-common
Suggested packages:
  bluez-cups bluez-obexd ghostscript-x libcanberra-gtk0 libcanberra-pulse
  cups-common libfftw3-bin libfftw3-dev libgd-tools gphoto2 gtkam gvfs
  libjasper-runtime liblcms2-utils libmagickcore-6.q16-2-extra pulseaudio
  librsvg2-bin hplip hpoj poppler-utils fonts-japanese-mincho
  fonts-ipafont-mincho fonts-japanese-gothic fonts-ipafont-gothic
  fonts-arphic-ukai fonts-arphic-uming fonts-nanum python-dbus-doc
  python-dbus-dbg python-gobject-2-dbg unpaper
The following NEW packages will be installed:
  adwaita-icon-theme at-spi2-core blueman bluetooth colord colord-data
  dconf-gsettings-backend dconf-service fontconfig fontconfig-config
  fonts-dejavu-core fonts-droid gconf-service gconf2-common ghostscript
  gir1.2-appindicator3-0.1 gir1.2-atk-1.0 gir1.2-freedesktop gir1.2-gconf-2.0
  gir1.2-gdkpixbuf-2.0 gir1.2-glib-2.0 gir1.2-gtk-3.0 gir1.2-notify-0.7
  gir1.2-pango-1.0 glib-networking glib-networking-common
  glib-networking-services gnome-icon-theme gsettings-desktop-schemas gsfonts
  hicolor-icon-theme imagemagick-common indicator-application
  libappindicator3-1 libasyncns0 libatk-bridge2.0-0 libatk1.0-0 libatk1.0-data
  libatspi2.0-0 libavahi-client3 libbluetooth3 libcairo-gobject2 libcairo2
  libcanberra-gtk3-0 libcanberra-gtk3-module libcanberra0 libcolord2
  libcolorhug2 libcroco3 libcups2 libcupsfilters1 libcupsimage2 libdatrie1
  libdbus-glib-1-2 libdbusmenu-glib4 libdbusmenu-gtk3-4 libdconf1 libexif12
  libfftw3-double3 libfile-copy-recursive-perl libflac8 libfontconfig1
  libgconf-2-4 libgd3 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common
  libgirepository-1.0-1 libgphoto2-6 libgphoto2-l10n libgphoto2-port10
  libgraphite2-3 libgs9 libgs9-common libgtk-3-0 libgtk-3-bin libgtk-3-common
  libgudev-1.0-0 libgusb2 libharfbuzz0b libice6 libieee1284-3 libijs-0.35
  libindicator3-7 libjasper1 libjbig0 libjbig2dec0 libjpeg8 libjson-glib-1.0-0
  libjson-glib-1.0-common liblcms2-2 liblqr-1-0 libltdl7 libmagickcore-6.q16-2
  libmagickwand-6.q16-2 libnotify4 libogg0 libopenobex1 libpam-systemd
  libpango-1.0-0 libpango1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0
  libpangox-1.0-0 libpangoxft-1.0-0 libpaper-utils libpaper1 libpixman-1-0
  libpolkit-agent-1-0 libpolkit-backend-1-0 libpolkit-gobject-1-0 libproxy1
  libpulse-mainloop-glib0 libpulse0 librest-0.7-0 librsvg2-2 librsvg2-common
  libsane libsane-common libsane-extras libsane-extras-common libsm6
  libsndfile1 libsoup-gnome2.4-1 libsoup2.4-1 libstartup-notification0 libtdb1
  libthai-data libthai0 libtiff5 libvorbis0a libvorbisenc2 libvorbisfile3
  libvpx1 libwayland-client0 libwayland-cursor0 libx11-xcb1 libxcb-render0
  libxcb-shm0 libxcb-util0 libxcomposite1 libxcursor1 libxdamage1 libxfixes3
  libxft2 libxi6 libxinerama1 libxkbcommon0 libxpm4 libxrandr2 libxrender1
  libxtst6 notification-daemon obex-data-server policykit-1 poppler-data
  python-cairo python-dbus python-dbus-dev python-gi python-gi-cairo
  python-gobject python-gobject-2 sane-utils update-inetd x11-common
0 upgraded, 165 newly installed, 0 to remove and 0 not upgraded.
Need to get 65.6 MB of archives.
After this operation, 189 MB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.
I don't need the whole graphical environment (I run my Raspberry Pi headless, so it doesn't have a graphical environment).

So I searched some more and found the command bluetoothctl which does pairing in text mode, exactly what I want. It took some trying:
koos@joy:~ $ hcitool scan
Scanning ...
        30:14:11:xx:xx:xx       Mobilinkd TNC2
koos@joy:~ $ bluetoothctl 
[NEW] Controller B8:27:EB:xx:xx:xx joy [default]
bluetooth]# pair
Missing device address argument
[bluetooth]# scan
Missing on/off argument
[bluetooth]# scan on
Discovery started
[CHG] Controller B8:27:EB:xx:xx:xx Discovering: yes
[NEW] Device 9C:20:7B:xx:xx:xx 9C-20-7B-XX-XX-XX
[NEW] Device D0:03:4B:xx:xx:xx D0-03-4B-XX-XX-XX
[NEW] Device F4:F5:D8:xx:xx:xx F4-F5-D8-XX-XX-XX
[NEW] Device 30:14:11:xx:xx:xx 30-14-11-XX-XX-XX
[bluetooth]# pair 30:14:11:xx:xx:xx
Attempting to pair with 30:14:11:xx:xx:xx
Failed to pair: org.bluez.Error.AuthenticationFailed
[bluetooth]# ?
Invalid command
[bluetooth]# help
Available commands:
  list                       List available controllers
  show [ctrl]                Controller information
  select <ctrl>              Select default controller
  devices                    List available devices
  paired-devices             List paired devices
  power <on/off>             Set controller power
  pairable <on/off>          Set controller pairable mode
  discoverable <on/off>      Set controller discoverable mode
  agent <on/off/capability>  Enable/disable agent with given capability
  default-agent              Set agent as the default one
  scan <on/off>              Scan for devices
  info <dev>                 Device information
  pair <dev>                 Pair with device
  trust <dev>                Trust device
  untrust <dev>              Untrust device
  block <dev>                Block device
  unblock <dev>              Unblock device
  remove <dev>               Remove device
  connect <dev>              Connect device
  disconnect <dev>           Disconnect device
  version                    Display version
  quit                       Quit program
[bluetooth]# pairable on
Changing pairable on succeeded
[bluetooth]# pair 30:14:11:xx:xx:xx
Attempting to pair with 30:14:11:xx:xx:xx
[CHG] Device 30:14:11:xx:xx:xx Connected: yes
[CHG] Device 30:14:11:xx:xx:xx Name: Mobilinkd TNC2
[CHG] Device 30:14:11:xx:xx:xx Alias: Mobilinkd TNC2
Failed to pair: org.bluez.Error.AuthenticationFailed
[CHG] Device 30:14:11:xx:xx:xx Connected: no
[bluetooth]# agent on
Agent registered
[bluetooth]# pair 30:14:11:xx:xx:xx
Attempting to pair with 30:14:11:xx:xx:xx
[CHG] Device 30:14:11:xx:xx:xx Connected: yes
Request PIN code
[agent] Enter PIN code: 1234
[CHG] Device 30:14:11:xx:xx:xx UUIDs:
        00001101-0000-1000-8000-00805f9b34fb
[CHG] Device 30:14:11:xx:xx:xx Paired: yes
Pairing successful
[CHG] Device 30:14:11:xx:xx:xx Connected: no
[bluetooth]# 
So I have to set 'scan on', 'pairable on' and 'agent on' to get in a state where a 'pair' command will start the bluetooth pairing process and ask for a pincode.

Now we have a pairing, and I could add a serial connection over this. By hand this can be done with commandline rfcomm:
koos@joy:~ $ sudo rfcomm connect /dev/rfcomm0 30:14:11:xx:xx:xx
Connected /dev/rfcomm0 to 30:14:11:xx:xx:xx on channel 1
Press CTRL-C for hangup
And in another terminal:
koos@joy:~ $ cat /dev/rfcomm0 


== BeRTOS AVR/Mobilinkd TNC2

== Version 2.0.1.571

== Voltage: 4045mV

== Starting.

So there is communications possible! Now to get aprs data from the mobilinkd. This should happen via the KISS protocol, but at this time I have no idea what that would like.

Tags: , ,
2017-01-16 Living in two timezones 1 month ago
PyHamClock Radio amateurs who make contacts over the borders constantly live in two timezones: both their local timezone and the UTC timezone. Logging contacts with UTC timestamps ensures the timestamps align across different parts of the world.

To help with this logging programs for amateur radio like CQRLOG will show the current time in UTC and log in UTC.

But I also like having a desktop clock in Linux with both the local time and the UTC time. One of the reasons is with WSJT-X: in this mode transmissions start at second :00 and end at second :50 so I have to check the WSJT-X screen every minute between seconds 50 and 00 (or every second minute when I'm in a contact). This gets tedious and I get distracted when there is 50 or 110 seconds to just wait.

There are hardware 'amateur radio' clocks like the CK-2 LED Digital Dual Time Zone Clock which is over 200 US dollars and looks like it would fit into a missile launch command center. Or from MFJ: MFJ-148RC dual time LCD clock, atomic W/GMT ZONE, id timer at nearly 60 US dollars.

I decided to just look for some software for this task and after a few searches I ended up with PyHamClock which is now running on my amateur radio desktop system.

Tags: , ,
2017-01-11 Debugging a crashing cqrlog 1 month ago
This morning cqrlog crashed soon after I started it. On a restart it crashed instantly without even giving me any option to select anything.

Since there was some mysql corruption in my system anyway I decided to completely wipe out the databases/configuration, start over, import the backups again and be on my way. I never got that far, every time shortly after initializing cqrlog it started crashing. So I started testing what could be causing this and ended up with the DXCC update being the cause. So I did not do this update, loaded my logs from the backup, improved some things in my configuration and reported my findings via mail to de cqrlog developer. I can live with the DXCC tables being somewhat outdated, I have contacts with stable countries here in Europe.

I hope an update comes out soon for cqrlog. Also noted in the cqrlog forums where at least one other user has seen the same workaround. I haven't posted it on the forum yet as I wasn't registered there.

Update 2017-01-12: During the day an update for cqrlog was made available which fixes the problem. Applause to the developers of cqrlog for responding this fast.

Tags: , ,
2016-11-12 Disabling IPv4 on the Raspberry Pi 3 months ago
I have two Raspberry Pi's running in the house, currently with IPv4 still enabled on them. They both run Raspbian 8.0. I was wondering whether I can disable IPv4 on the Raspberry Pi, but a google search does not yield very helpful answers, most of the search terms I try still find pages about disabling IPv6. I want to disable the legacy IP protocol.

Only one way to find out: go for it. Now rebooting one with the statement ipv6only in /etc/dhcpcd.conf.

First thing I noticed was that the searchdomain was not set in /etc/resolv.conf which was indeed only available via the DHCP process for IPv4. So now radvd advertises the search domain via the DNSSL option in /etc/radvd.conf:
   RDNSS 2001:980:14ca:42::18 {
   };
   DNSSL idefix.net {
   };
The first results are:
  • It turned out the ntp config on the raspberry had one IPv6-only and one IPv4-only server. Added a dual-stack server.
  • And ndpmon really does not like the DNSSL option, even when I add it in the config_ndpmon.xml file as
                      <dnssl>
                        <domain lifetime="600">idefix.net</domain>
                      </dnssl>
    
    Fixed by changing it to
                      <dnssl>
                        <domain lifetime="600">^Fidefix^Cnet</domain>
                      </dnssl>
    
    yes, with literal ctrl-F and ctrl-C characters, showing that there is some error in the parsing somewhere.
  • rwhod is IPv4-only so the status is not visible in my network anymore. A workaround for that is not disabling IPv4 completely but just removing the default route, not using ipv6only in /etc/dhcpcd.conf but using the option nooption routers.

Tags: , , ,
2016-11-10 Backup to .. the cloud! 3 months ago
So I now have some cloudstorage space available also via webdav and I am working on using this for backups. The main idea is to have a daily backup to the cloud service and do the tape backups less often.

I still want incremental backups so I can go back to specific older versions of files. So I want to use amanda for backups. I installed the davfs2 package to be able to mount the webdav filesystem and access it from Linux. The first few clues come from Set Up Virtual Tapes - Amanda Howto but I had to switch to the chg-multi driver as described in Backup to Virtual Tapes on a non-UNIX Filesystem - Amanda Howto because the webdav filesystem does not support symlinks.

I/O performance during the backup isn't ideal and the vdsl uplink is completely full during the filetransfer. Maybe I need to slow down the backup process a bit and ratelimit the webdav transfer.

Tags: , ,
2016-11-03 Speeding up my website(s) with mod_perl 3 months ago
I am currently working on a new version of one of the sites I manage in perl, rewriting it from php. I noticed loading times were slower and gave mod_perl a try.

The basic configuration of mod_perl is quite simple. This did not give me the big advantage in web server speed, that came when I added:
PerlModule Apache::DBI
to the apache2 config. The Apache::DBI module caches database connections for supported drivers, this speeds up database-dependent scripts. The module comes from the ubuntu package libapache-dbi-perl and Apache will throw really bad errors at you when the module you want to load is not available.

This is now enabled for my homepage site too. The processing times of the pages don't change much, but the startup of the perl interpreter, modules and scripts is much faster so the waiting time is a lot less.

Tags: , , ,
2016-11-03 De gasmeter van de slimme meter ging over op wintertijd 3 months ago
Ik ontdekte dat de gasmeter niet meer uitgelezen werd in de scripts die de slimme meter bulletins verwerken. Bij het napluizen van de Dutch smart meter standard v4.0 P1 protocol bleek dat het bericht met de gasmeterstand (0-1:24.2.1) bij de 'Capture Time' een timestamp heeft met S voor summertime en W voor wintertime.

Het script is nu aangepast om dit goed te verwerken en nu zie ik weer het gasgebruik.

Tags: , ,
2016-10-25 Speeding up apache by not resolving for access 4 months ago
I was testing something on my own webserver and noticed the loading time of the page was over 10 seconds. Browsing the log showed me the hostname of the client was logged which was not what I wanted, and the IPv4 address I had at that moment was slow to resolve. It turned out this was caused because the part I was visiting has an authentication check, which looked like:
    <Location />
        Order deny,allow
        Deny from all
        Allow from localhost
        AuthName "Restricted access"
        AuthType basic
        AuthUserFile /...
        AuthGroupFile /dev/null
        Require valid-user
        Satisfy Any
    </Location>
Using the name 'localhost' triggered the resolver. A big speedup was caused by changing to:
    <Location />
        Order deny,allow
        Deny from all
        Allow from 127.0.0.1
        AuthName "Restricted access"
        AuthType basic
        AuthUserFile /...
        AuthGroupFile /dev/null
        Require valid-user
        Satisfy Any
    </Location>
Which let me concentrate on other methods to speed up the site.

Tags: , ,
2016-10-05 A blast from the past! 4 months ago
I just saw:
220 pi FTP server (Version wu-2.6.2(1) Mon Apr 30 20:10:54 UTC 2012) ready.

230-This is an experimental FTP server.  If have any unusual problems,
230-please report them via e-mail to .
230-
230-If you do have problems, please try using a dash (-) as the first
230-character of your password -- this will turn off the continuation
230-messages that may be confusing your FTP client.
That's a long time ago, the default welcome file of wu-ftpd version wu-2.6.2(1).

Oh and the current default passive mode of ftp wasn't working, I had to dig up an old client to use the default active mode.

Tags: , ,
2016-09-04 Editing gpg encrypted text files 5 months ago
For a while I have been using the gnupg.vim plugin but I noticed recently after changing my gnupg configuration to show long IDs that this plugin had problems. I searched and found a new version of the plugin at vim-gnupg/gnupg.vim at master · jamessan/vim-gnupg which does not have this problem.

So now I can simply keep text information in encrypted files and I need to type the passphrase every time I want to edit the file.

The easiest way to create an encrypted file to use with this plugin is create an empty file, encrypt that file from the command line and then edit it with the plugin:
$ touch datafile.txt
$ gpg -e datafile.txt
You did not specify a user ID. (you may use "-r")

Current recipients:
4096g/0xCC166EB91F480E9A 2011-01-11 "Koos van den Hout <koos@kzdoos.xs4all.nl>"

Enter the user ID.  End with an empty line: 
$ ls -l datafile.txt*
-rw-r--r-- 1 koos users    0 Sep  4 20:49 datafile.txt
-rw-r--r-- 1 koos users 1114 Sep  4 20:50 datafile.txt.gpg
$ wipe datafile.txt
Okay to WIPE 1 regular file ? (Yes/No) Yes
Operation finished.                                                           
1 file wiped and 0 special files ignored in 0 directories, 0 symlinks removed but not followed, 0 errors occured.
Now editing the file with vim datafile.txt.gpg goes through decrypting the file before starting the editing session and saves it encrypted when done.

Tags: , ,
2016-09-04 De slimme meter uitlezen 5 months ago
Slimme meter uitlezen De slimme meter die meer dan een maand geleden ons huis in kwam wordt nu constant uitgelezen en de resulterende gegevens worden opgeslagen in rrdtool databases van het electriciteits- en gas gebruik.

Uitlezen van een seriele poort vanuit Perl bleek niet makkelijk stabiel te krijgen te zijn. Uiteindelijk heb ik maar een oplossing gekozen/geleend van iemand anders: een stuk python wat cu aanroept: P1/P1-python-cu.py at master · sanderjo/P1. Dit script zou nog iets robuuster zijn als het de CRC controleert, maar dat is dan een wens voor een toekomstige versie.

Vervolgens sla ik de output van dit script op in /var/run/telemetry/smartmeteroutput. De keuze voor /var/run is omdat ik niet elke vijf minuten op de SD kaart van de raspberry wil schrijven. Ik heb dus ook /etc/rc.local aangepast om een /var/run/telemetry met als eigenaar user telemetry te maken, er worden daar meer meetgegevens neergezet voor verdere verwerking in statistieken. Het telemetry concept wat ik gebruik is het verzamelen in ASCII leesbare vorm van meetgegevens op systemen waarna deze opgehaald kunnen worden door een verzamelaar die ze gaat importeren in rrdtool databases (of andere verzamelingen). Omdat de verbinding tussen het te monitoren systeem en de verzamelaar als onbetrouwbaar gezien wordt (sommige systemen waarvan ik meetgegevens verzamel zitten achter een hikkende wifi verbinding) worden de meetgegevens lokaal opgeslagen met een tijdsaanduiding in de bestandsnaam en worden ze in rrdtool geimporteerd met deze tijdsaanduiding.

Het script wat de meetgegevens van de slimme meter verwerkt moet er tegen kunnen dat er soms velden ontbreken. Ik heb er voor gekozen uiteindelijk de dag- en nacht tellerstanden afgenomen en teruggeleverd (meetwaardes 1.8.1, 1.8.2, 2.8.1 en 2.8.2 in de Dutch smart meter standard) als 'verplicht' te tellen en de overige meetwaardes als 'optioneel'.

Uiteindelijk komen er dan mooie grafieken uit. De conclusie die ik eerder trok dat uit energie meetwaarden per kwartier prima af te leiden is wat bewoners doen is nog steeds valide. Uit grafieken over langere termijn is ook keurig af te zien wanneer we op vakantie waren.

Tags: , , , ,
2016-06-27 Ancient configuration causing warnings 8 months ago
Lots of error messages showing up recently looking like:
Jun 27 12:02:23 greenblatt named[4789]: checkhints: d.root-servers.net/A (199.7.91.13) missing from hints
Jun 27 12:02:23 greenblatt named[4789]: checkhints: d.root-servers.net/A (128.8.10.90) extra record in hints
The hints come from the root-hints file which the resolver software (bind9) uses to know where to start resolving. I checked my db.root, which said:
;       last update:    Jun 17, 2010
;       related version of root zone:   2010061700
But it is from the ubuntu 12.04 bind9 package:
# dpkg -S /etc/bind/db.root
bind9: /etc/bind/db.root
Solution with help from How Do I Update The Root Hints Data File for BIND Named Server? - UNIX fu was getting the latest from ftp.rs.internic.net which now says
;       last update:    March 23, 2016
;       related version of root zone:   2016032301
and I should get less warnings now. Comparing the two files shows changed IPv4 addresses for d.root-servers and h.root-servers, changed IPv6 addresses for a.root-servers and h.root-servers and added(!) IPv6 addresses for c.root-servers, d.root-servers, i.root-servers and j.root-servers.

Tags: , ,
2016-06-16 Recovered the Raspberry Pi 8 months ago
So when the Raspberry Pi 3 came out in February I bought one, complete with power supply, case, microSD card and small keyboard. I just could not resist it. I installed it, connected it to the network and did not really have a task for it. It is joy.idefix.net.

After a while this changed and I started running dump1090 on it to get an idea of the planes in range from my house. It is connected to the antenna used in the earlier ADS-B receiving experiments and sees high altitude and/or nearby airplanes fine.

Recently I ran some updates and those failed because the root-filesystem was filling up. I did not notice that left some files missing, so I just ran the commands to resize the raspbian root filesystem to fill the SD card - Coderwall and waited for the reboot. This ended up in a nice multicolour screen with nothing running. I looked that up and found Raspberry Pi with boots up with Rainbow screen - Raspberry Pi Stack Exchange so it was time to recover. I mounted the SD card on an x86 linux system and found the kernel.img and other files in /boot were missing. I searched how to mount the raspbian image and found How can I mount a Raspberry Pi Linux distro image? - Raspberry Pi Stack Exchange. I started with using the loopback device, copied the whole /boot directory from that image and did a filesystem check in the SD card. It booted again but showed driver issues. I reran all the updates which reinstalled the raspberrypi-kernel package and after that the driver problems were gone and things worked again.

Tags: , ,
2016-06-16 Connecting to eduroam with the new laptop 8 months ago
For the first time I brought my new personal laptop to a place where I could use eduroam wireless network. This gave some trouble, eduroam did not work out of the box. I had to set the authentication method to 'Protected EAP (PEAP)' and set the inner authentication correct. And I had to set the CA-Certificate to check. If you don't set it, network manager settings will ask if you are sure, but if you say you are sure the net result in the background is that the request for a valid certificate is set but there is no certificate set to check against, resulting in the connection not working.

Tags: , , ,
2016-04-29 Virus mail overstressing the mime parser 10 months ago
This does not work as planned in mutt:
Subject: hi prnt
Content-Type: multipart/mixed; boundary=31BE31246BD934D65C63831D7238

--31BE31246BD934D65C63831D7238
Content-Type: multipart/alternative; boundary=31BE31246BD934D65C63831D7238

--31BE31246BD934D65C63831D7238
Content-Type: text/plain; charset=UTF-8



--31BE31246BD934D65C63831D7238
Content-Type: text/html; charset=UTF-8

<div dir="ltr"><br></div>

--31BE31246BD934D65C63831D7238--
--31BE31246BD934D65C63831D7238
Content-Type: application/zip; name="816847_304695.zip"
Content-Disposition: attachment; filename="816847_304695.zip"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_519392564

UEsDBBQAAgAIAPVmnUiLxtYfTRIAAA0pAAAUAAAANzM1NzE1NjJfODYzNjA4MTYuanO1Wmt3
2zaT/tye0/+A8rSvxViW7eRt0tp1u4osx67vlyTOOt4ekIQkRCRA8yJZNv3f9xmApKjY6abd
Shows as
  I     1                      [text/plain, 7bit, us-ascii, 0K]
  I     2                       [text/plain, 7bit, utf-8, 0.1K]
  I     3                        [text/html, 7bit, utf-8, 0.1K]

Tags: , , ,
2016-04-29 Now available as TLS encrypted website 10 months ago
Encrypt all the things meme I consider it testing at the moment, but you can visit https://idefix.net/. The mixed-content warning will not go away soon since I partly depend on images and audiofiles from sources not (yet) available via https.

Tags: , ,
  Older news items for tag linux ⇒
, reachable as koos+website@idefix.net. PGP encrypted e-mail preferred.

PGP key 2C66 3B5D F0D7 C263 local copy PGP key 2C66 3B5D F0D7 C263 via keyservers pgp key statistics for 0x2C663B5DF0D7C263 Koos van den Hout
RSS
Other webprojects: Camp Wireless, wireless Internet access at campsites, The Virtual Bookcase, book reviews, Weather maps