Tag Archives: Linux

My May New Years Resolution Post

This has been a kind of crazy month. I’ve been working on unpacking, preparing for my new work permit and trying to adapt to the current restrictions here. Toughest restrictions I’ve experienced since Covid-19 started, but not the toughest Nova Scotia has had.

I’ve slacked on posts here this month, haven’t even really touched the drafts even. Same for my journal too.
I’ve done more tinkering with digital modes on Amateur Radio and studying to upgrade my license. Honestly I’ve done more with the former.

This is the first post written with a new Surface Pro. I must say it was nice setting up outside, feeling the breeze and sun while typing on something that can run for a day on it’s batteries and waiting for the sunset.

Lastly, learning (read: playing) with my camera settings and figuring out how to take better shots. Here’s one from the new place.

My March New Years Resolution Post

I swear I’m trying to get to a point where I’ve got more content here than just monthly personal updates and one paragraph tech tips. I don’t like giving out teasers but I’m making an exception today for a few that I intend to have out over the next month.

After a lot of trial and error, I finally have a working APRS and Winlink station. I think I had at least three different things working against me, I’m still not sure what some of the issues were but in the end I switched the cable and USB soundcard out for a Signalink USB & 20 minutes to tweak audio levels. I’ll go into more details on this in a later post. I was delaying my March update just for this, after three months of this I really wanted to be able to say it’s working! (In fairness, a lot of that time was waiting on shipping parts, trying out the parts, ordering another little trinket & waiting on shipping again)

I’ve been working on creating my own little Debian software repository & I’ve started to learn how do make Debian packages. I’m slowly learning docker, which seems like something I should have done a long time ago. Alongside this I’ve been studying for various certifications & licenses. Thanks to my employer I expect to be a Splunk Core Certified User before summer.

I still wish there were things I could do in-person again, Covid-19 has made that a real challenge & I get it, I want everyone to be safe but zoom calls, social media posts, online chats, mailing lists & instant messages just aren’t the same. I haven’t been able to see the Halifax Mooseheads play in person, they’re playing three more games (two at home, then heading to PEI for a third, which I can’t go to due to the current covid-19 rules) and then I don’t know (every game after that is on June 24th, which just isn’t possible, I’m guessing they are just doing a few at a time until vaccines are out and/or guidance from various local authorities across the league are clarified, using that date as a placeholder)

Don’t get me wrong, it could be worse. My hometown team the Erie Otters have 5 postponed games from the 2019-2020 season and they’ve not played a game since March 8th 2020. I could be working somewhere with others, worrying about each wave again too.

Last thing for the month, I’ve been going back over past projects and catching up on documenting what works so I don’t have to go through so much trial and error if I ever rebuild them. Some of these I’ll share on the blog, so that it may help everyone.

Backing Up My Laptop With Exoscale Object Storage

So I somehow filled my laptop’s M.2 SSD, my external USB drives are full and possibly failing too, this is a wake up call that I need to do better with my backup plans.

First I had to free up some space just to be able to work on it. I was lucky that I technically did have about 4 GB of free space. (It might have been less, unfortunately I didn’t make a note of it) So the first thing I did was find files I could replace from elsewhere or otherwise no longer needed (for me this was all the Linux ISO’s I keep in ~/ISO/ I just had to make sure I didn’t delete my Windows one too)

Now I booted up a USB Drive with Ubuntu 20.10 on it and then proceeded to mount my drive. (This might be as simple as a mouse click for some, I use disk encryption so for me it was a little more involved.)
I mounted it to /tmp/laptop for the purposes of this post. You may need to change this to reflect your setup.

Now I need to install some tools for all this, along with my GPG public key

sudo apt install s3cmd duplicity python3-boto python3-azure-storage pcscd scdaemon gnupg2 pv

gpg --keyserver keyserver.ubuntu.com --recv-keys FC5BFC514D82D7B443C2DCD4A068289733EAAA5F

sudo gpg --keyserver keyserver.ubuntu.com --recv-keys FC5BFC514D82D7B443C2DCD4A068289733EAAA5F

I also need to set the trust level for this key, in order to avoid issues later on.
Since I know this is my own key, I’m going to tell it 5 = I trust ultimately.

gpg --edit-key FC5BFC514D82D7B443C2DCD4A068289733EAAA5F
gpg> trust
Please decide how far you trust this user to correctly verify other users' keys
(by looking at passports, checking fingerprints from different sources, etc.)

  1 = I don't know or won't say
  2 = I do NOT trust
  3 = I trust marginally
  4 = I trust fully
  5 = I trust ultimately
  m = back to the main menu

Your decision? 
5

I need to do this again as root (using sudo) for duplicity too.

Now I didn’t start with duplicity, which was likely a mistake on my part.
I started with trying to make a tarball file but storing the file on the same disk, deleting files as I went couldn’t help some large files I had (server backups, virtual machine images and such) I piped it thru pv to give me some idea of progress & then compressed it with xz & encrypted it with GPG (setting it to encrypt it to the key on my yubikey)

sudo tar --remove-files -c /tmp/laptop/ |pv| xz -9 | gpg -r FC5BFC514D82D7B443C2DCD4A068289733EAAA5F -e | s3cmd put - s3://bucket-id/2020-01-25_Laptop.tar.xz.gpg

If we need to decrypt this later on, we’d run.

s3cmd get s3://bucket-id/2020-01-25_Laptop.tar.xz.gpg - | gpg -d | xz -d | tar -xv

At this stage I had everything backed up and I decided to also reinstall Ubuntu 20.10 onto my laptop. I bought a new external drive as well so I’d have a local copy and a remote one. I also installed the same dependencies listed above. I copy the whole system minus some directories we don’t need if we’re doing a recovery. (If you choose to alter this, know that duplicity tends to freak out over the weirdness in /proc )
First is the command to Exoscale & second is to the new external drive.

sudo duplicity --s3-use-new-style --encrypt-key FC5BFC514D82D7B443C2DCD4A068289733EAAA5F --exclude /media --exclude /run --exclude /mnt --exclude /tmp --exclude /proc --exclude /dev --exclude /sys / s3://sos-ch-dk-2.exo.io/bucket-id/MSI-Laptop

sudo duplicity --encrypt-key FC5BFC514D82D7B443C2DCD4A068289733EAAA5F --exclude /media --exclude /run --exclude /mnt --exclude /tmp --exclude /proc --exclude /dev --exclude /sys / file:///path/to/external/drive/MSI-Laptop

The best part of doing this right after a re-installation is duplicity supports incremental backups, so as I add my music collection back & configure my vpn & dns settings and work my way to filling my drive again (I hope not) duplicity will make incremental backups every few hours.

Now all that remains is trying to backup the old external drives before they fail and cause data loss (I might already be too late, unfortunately)

Update: Something I overlooked in the decryption section. My GPG keys are on the Yubikey, but when I plugged the yubikey into the live cd to decrypt one of the backups it appeared the private keys were missing. I spent a bit trying to make sense of this, and stumbled into the answer.

gpg --card-status

I ran this to get some output for debugging, and it happened to also wake up the yubikey and show GPG that it had the private keys we need.