News items for tag linux - Koos van den Hout

2017-01-16 Living in two timezones 1 day ago
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 6 days 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 2 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! 2 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 2 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 2 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 2 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! 3 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 4 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 4 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 6 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 7 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 7 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 8 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 8 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: , ,
2016-04-28 First tries with letsencrypt certificates 8 months ago
A while ago I already pondered preparing links in my websites for https. With Let's Encrypt I can get free domain validating certificates for TLS encrypting my traffic. Even the subjectAltName extension is supported to get multiple domain names on one certificate. But it took me a while to really get around to implementing the rest and testing the results.

The standard way of using letsencrypt is a bit too much 'for dummies' to my taste. The suggested and supported method for using Let's Encrypt uses the standard Let's Encrypt client which is very good at modifying apache configurations on it's own.

I would like free certificates, but not at the price of letting that script do things to my webserver configuration. So I asked around and someone pointed me at letsencrypt-nosudo with the brilliant introduction:
I love the Let's Encrypt devs dearly, but there's no way I'm going to trust their script to run on my server as root, be able to edit my server configs, and have access to my private keys. I'd just like the free ssl certificate, please.
Exactly my thoughts. So I used that script, got my brain around what was happening and now I have a TLS certificate for a number of my private domains.
Read the rest of First tries with letsencrypt certificates

Tags: , , ,
2016-04-24 Improving my QSL workflow with cqrlog 8 months ago
Outgoing QSL cards
Outgoing QSL cards
Radio amateurs are supposed to keep a logbook of all contacts (although it is not a legal requirement anymore!) and part of the amateur community likes confirming contacts with QSL cards. The term QSL is from the Q codes in radio which date back to radio telegraphy on ships. QSL as an answer means I am acknowledging receipt. I have my own QSL card for my old callsign PD4KH and I will need a new batch for PE4KH some day.

To save on the costs of sending those cards there are QSL bureaus in the world. I submit my cards to the Dutch QSL Bureau via my radio club and eventually cards for me end up at my radio club. I have sent out numbers of QSL cards and received numbers of QSL cards.
Read the rest of Improving my QSL workflow with cqrlog

Tags: , ,
2016-04-01 Forcing a dual-band wireless card to 2.4 GHz channels 9 months ago
The wireless card of the weather station computer in the shed is dual-band but with only a 2.4 GHz capable antenna. Since the house access-point is configured to support both 2.4 GHz and 5 GHz channels the system sometimes selects the 5 GHz access and keeps having serious packet loss. I looked at ways to convince the driver to select 2.4 GHz channels only but found none, but then I found out wpa_supplicant can do this. But I configure wpa_supplicant through wpa-* options in /etc/network/interfaces so I had to find out how to configure it using those. The manpages for the interfaces file is very limited on the wpa-* options, but I found an explanation that a lot of wpa_supplicant options are supported, including the one to select frequencies. The sneaky part is that the option in wpa_supplicant.conf is freq_list and the option in /etc/network/interfaces is wpa-freq-list. A rather complete list can be found at Where can I find a full list of wpa-* options for the interfaces file? - superuser.com. So now I have in /etc/network/interfaces:
auto wlan0
iface wlan0 inet dhcp
        wpa-ssid default
        wpa-psk VerySecret
        wpa-freq-list 2412 2417 2422 2427 2432 2437 2442 2452 2457 2462 2467 2472
The ideal solution is to order a dual-band (2.4 GHz and 5 GHz) antenna.

Update: Noticeable absent are channels 12 and 13 which are available for regulatory domain NL but are not listed when I ask the driver for available channels:
koos@ritchie:~$ /sbin/iwlist wlan0 chann
wlan0     19 channels in total; available frequencies :
          Channel 01 : 2.412 GHz
          Channel 02 : 2.417 GHz
          Channel 03 : 2.422 GHz
          Channel 04 : 2.427 GHz
          Channel 05 : 2.432 GHz
          Channel 06 : 2.437 GHz
          Channel 07 : 2.442 GHz
          Channel 08 : 2.447 GHz
          Channel 09 : 2.452 GHz
          Channel 10 : 2.457 GHz
          Channel 11 : 2.462 GHz
          Channel 36 : 5.18 GHz
          Channel 40 : 5.2 GHz
          Channel 44 : 5.22 GHz
          Channel 48 : 5.24 GHz
          Channel 52 : 5.26 GHz
          Channel 56 : 5.28 GHz
          Channel 60 : 5.3 GHz
          Channel 64 : 5.32 GHz
          Current Frequency:2.462 GHz (Channel 11)
And now I wonder why those are missing.

Tags: , , ,
2016-03-30 Phone contesting with Linux 9 months ago
The reddit /r/amateurradio post [Question] Contest Logging in Linux made me look at yfktest again. Yfktest is a curses-based contest logging program in perl, written for Linux.

The difference between a normal logging program and a contest logging program is that a contest logging program is just interested in what is needed to complete a contest contact, usually a callsign, default signal reports and a serial number or area number (depends on the contest). A contest program is optimized to get this information logged as fast as possible with the minimal number of keystrokes.

First thing to get right after getting the source from the subversion repository was to get the rig control settings right. I had a bit of trouble doing this right the first time, but I found out it is easy to set it right since yfktest uses hamlib to control the radio and it starts rigctld with a file rigctld.sh which now contains:
koos@kernighan:~/src/trunk$ cat rigctld.sh 
rigctld -m 122 -r /dev/ttyUSB0 -s 38400 &
The program contains definitions for a number of contests. Having defined the contest before starting the log run means the program knows what to ask and how to calculate the scores during the contest.

I will have to do a dry-run before I dive into a real contest, and then try it in an upcoming contest to see how it works for me.

In digimode contests (where signals are exchanged by the computer) I use the contest options offered by fldigi which works fine for me.

Tags: , , ,
2016-03-04 New laptop with amateur radio software 10 months ago
I recently bought a new laptop for home use. The old Dell Latitude D630 was falling apart so it was time for a new one. A linux installation has been done and it's currently Ubuntu 14.04 (with xfce as window manager).

For future plans I want 'all' amateur radio software I use to work on it. So I tested a bit, with:
  • rigctld to control the FT-857 radio
  • display of the radio status with Grig grig -m 2 -r 127.0.0.1
  • audio coupling with the FT-857 radio with recording in audacity
  • control of the receive and sending frequency with gpredict for tracking amateur satellites
So I'm ready to track and record amateur satellite contacts and do other amateur radio stuff on the new laptop.

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