Upgrading to gnupgp2

July 12th, 2017

I recently moved my mail server to stretch. I had a bit of trouble with gpg, as there are still some known bugs in exporting/importing keys.
I'm summarising a lot here, because I had to dick around quite a bit with it. It was actually kind of nice though, because it gave me a chance to get to know gpg a bit better.

$ echo 'use-agent' >> ~/.gnupg/gpg.conf

$ gpg1 --export-secret-subkeys > private.key
$ gpg -v --import private.key

$ gpg1 --export-secret-keys > private.key
$ gpg1 --export > public.key

restart, because I needed to do some upgrades

$ gpg -v --import public.key
$ gpg -v --import private.key

reinstall gnupgp2 as I was testing some stuff with the experimental package (It didn't pan out, obviously)

$ gpg -v --import private.key

I should document this better, but basically I just had to keep playing around with everything. Minor adjustments, as you would expect with upgrades like this.

Back to Android....

July 12th, 2017

As Ubuntu stepped out of the market (qq) I went back to Cyanogenmod. I quickly found out that Cyanogenmod is no more, and LineageOS is the replacement.

So I installed LineageOS, and its still.... OK. most of my problems with the platform are actually by design on Google's part. I really hate Android, but it's the least-terrible system out there for phones that I know of.

If your phone is already rooted, then you are probably good to go. Just put the image on, reboot to recovery mode and install.

If you need to root your phone, good luck. The landscape for that is still terrible: Download some shady binaries from shady websites, run them, hope your shit isn't owned, and reboot a bunch while typing some commands.

The wiki was pretty straighforward for me, but I also have a supported phone: https://wiki.lineageos.org/devices/m8/install

I honestly haven't noticed any major changes. I use nightly (which looks like it's actually built weekly, gg), and the only problems I have are:
1) wifi sometimes won't turn on after using the hotspot. I have to reboot the phone
2) widgets don't work. I can get some to work, but many apps that claim they have a widget don't seem to show up when I try to use them

Neither of these are a big deal to me, so I'll just keep dealing with them

Overall I'm sad that Ubuntu bailed, and I'm definitly *not* happy with Android, but I don't really have much choice. LineageOS looks and feels exactly like Cynaogenmod did for me, to the point that I probably couldn't tell you which one I was using. I hope Lineage does well, but I'm really holding out for an actual Linux phone.

Finally Set Up My GPG Key

June 7th, 2017

I finally set up my gpg key. I'm actually pretty ashamed that it took me this long to do. Just too many projects on my plate, and this fell to the bottom. But I'm here at last. Here's my pubkey!

Version: GnuPG v1


Syncing My Contacts

March 20th, 2017

I recently got an Ubuntu Touch phone. In general I like it, but that's a different post. The phone has an issue where it can only import contacts from Google Contacts. It's been a while since I've used Google Contacts, so I didn't want to import old data. I do store my current contact data on my own server at home, and so I wanted to script a way to download the latest from there, and import it into my phone.

I borrowed a script from here and added a curl command to login and download the data from my site.

Here's the script:

# Got this script from: https://hblok.net/blog/posts/2015/04/27/importing-contacts-to-the-ubuntu-touch-phone/

datestamp=$(date +%Y_%m_%d_%H_%M_%S)

cp /home/phablet/.local/share/evolution/addressbook/system/contacts.db "/home/phablet/.local/share/evolution/addressbook/system/contacts.db.${datestamp}"

# the default db file b/c it has some templating data
cp /home/phablet/.local/share/evolution/addressbook/system/contacts.db.empty /home/phablet/.local/share/evolution/addressbook/system/contacts.db

#### command to login and extract the vcard-data from my server here. Hidden some stuff to keep you bastards from breaking in
/usr/bin/curl --header 'Host: contactdata.thekyel.com' --header 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0' --header 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' --header 'Accept-Language: en-US,en;q=0.5' --header 'DNT: 1' --header 'Connection: keep-alive' --header 'Authorization: data-goes-here' --header 'Cookie: somemoredatahere' 'https://contactdata.thekyel.com/export_kyelw_contacts' -o /tmp/contacts.vcard -s -J -L

if [ ! -f /tmp/contacts.vcard ];
echo "could not find vcard file"
exit 1
sed "s/\"/'/g" /tmp/contacts.vcard | awk -F":" 'BEGIN { FS = ":"; i=0 }; {
if ($0 ~ /BEGIN/) {
print "INSERT INTO folder_id(uid, vcard) VALUES(\"" i "\", \"BEGIN:VCARD";
} else if ($0 ~ /END/) {
print "END:VCARD\");"
} else if ($0 ~ /FN/) {
print "X-EVOLUTION-FILE-AS:" $2 "\nFN:" $2
} else {
print $0
} }' > /tmp/contacts.sql

/usr/bin/sqlite3 /home/phablet/.local/share/evolution/addressbook/system/contacts.db < /tmp/contacts.sql

It seems to be serving me well so far, but I'd love to get an actual card-dav contents sync client on this phone.

This is one of the things that I like about the ubuntu phone: I can glue this shit together. I can just use the industry standard tools, scripts and automate what I want. Android greatly discourages that with their design, and that's why I'm glad I left them.

Screw you android.

Home Automation

March 17th, 2017

I had a friend ask me about my home automation setup, so here's a few videos showing it in action:
General controls:

MPD controls:

Voice controls (This one is a bit *LOUD*):

How it's done:
To play music, I use MPD, which I love.
To control the lights, I use MiLights with this script ('Example of Linux control' section).
I use pocketsphinx to convert my speech into text, then use tre-agrep to translate those words into shell commands.

Issues with speech-recognition:
Obviously the system is *slooooooow*. That's because it's running on a raspberry pi. The pocketsphinx software isn't really that fast, even on a desktop.

The other big problem is accurcy. I've been using tre-agrep to help, but I need to fine-tune the costs a bit more. It usually takes me one or two tries for it to get it right, depending on the command.

I've got some improvements to make for sure, but overall I'm pretty happy with it. I'm mostly happy that I don't have to send anything out to any third party server (other than part of the pocketsphinx setup). Once built, everything is self-contained. I plan on open-sourcing my scripts, but not sure when/if I'll get around to it.

We went to Europe!

December 24th, 2016

We went to Europe!
Here are some pictures that we took, enjoy!


back to post 1
forward to post 6