About

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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
YCsC2GHCz1uYx2ULQCIeLKUyWApe2TShwXbMS+ALnBAZxxO24sLgf8bZiX4tGkTE
IYw6qFTbT0mx22OLRTwDsyl8TnjWIBcnnXHDXoRllXgfP1+hgaegkm6jed1gi2k2
BftabB6IpycLI1RzscHdj1ZRWvwS1M3JABEBAAGJAR8EGAECAAkFAlk4t14CGwwA
CgkQKwfU2mVJlBl6bwf5AV1Gwp+vqhJPQNBGduMVQvnCRINB9pD2wn/QLFfi4EdL
iUKk3TO844GLWgnjVAQE4usLmZScjqyVLfxi+j5BPVB6ZNye36bNRWabtK2+G5PO
704G1bDLlexKGT59iQcekyfmWKJ2j7kgXdk/o/Vcr7x6eLsWpiYPfe5wa05b7kL+
JTa/V/yFNktU6u1qEksSzJXAkjMpxrpu46wnUwtNYyshEyi+9Y5YsL44WDl2nNlA
bNOKUQ0D1ppb+un8ZInTgykQL3hcUXL2R15i5a5gYeSxkhDAGoBJcu1HpNO57my0
B94+GM/HhIKKN9GR/iyJ6ycbj/QwZHLcUzvJ2gSuTA==
=fZvo
-----END PGP PUBLIC KEY BLOCK-----



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:

#!/bin/bash
# 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 ];
then
echo "could not find vcard file"
exit 1
else
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";
i=i+1;
} 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
fi

/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.

<siderant>
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.
</siderant>



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.


Beta-Stage:
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!

https://pictures.thekyel.com/index.php?/category/115

back to post 1
forward to post 6