Tag: ubuntu

Upgrading to Ubuntu 24.04

Didn’t go smoothly. I was on 22.04 I believe and I decided to upgrade without waiting for 24.04.1. It was a mistake. I started the upgrade with do-release-upgrade -d, but way too soon I ran into a very nasty crash screen telling me “Oh no! Something has gone wrong and the system can’t recover”.

Aside. I personally hate these “friendly” additions like “Oh no!” Fuck off? My system just crashed, I’m pissed and the last thing I need now is some linux dev who thinks they know how to be friendly rubbing it in.

The way to fix it for me was: first reboot and choose recovery mode in the Grub menu. Once recovery mode is on, enable network then drop into a root terminal. Run dpkg --configure -a to fix whatever was interrupted. After reboot it should boot all right (at least the GUI would work).

However the network was still broken. I could ping 1.1.1.1 so the connection itself was alive, but nothing could be resolved. Turns out the installation removed the resolve component of systemd. Luckily for me sudo apt-get install systemd-resolved could install it back and that solved the connection issue.

At this point the system seems to be functioning properly (nothing is obviously broken other than Thunderbird for some reason getting removed from my dash), but I don’t know if the interrupted install broke anything nor how to check if anything is broken or in an uexpected state.


Mounting folders as Docker volumes

When trying to pass data between a Docker container and the host, using ADD in the Dockerfile might be sufficient at first. However, it’s one way, get burned in the image and so very inflexible.

The usual solution is to mount folders using docker‘s -v option. It’s simple, easy to use and pretty reliable. Just add -v "$(pwd):/root" and the current folder will be mounted to the /root folder in the container.

Using volumes is nice because they’re (can be) two way and (can) sync in real-time. Now you don’t need to rebuild your image every time you fix a typo. -v has pretty deep configuration options too, in case you want to go down the rabbit hole.


Ubuntu 18.04 L2TP IPsec VPN

Occasionally I work from home, and access to certain development resources is restricted to either the office IP or the use of a secure VPN. Since everyone uses Macs or Windows at the office there are no manuals or guides to set it up on linux, so I had to figure stuff out myself.

First of all, Ubuntu doesn’t have L2TP support out of the box currently, but luckily Ask Ubuntu has plenty of questions on the topic. Apparently L2TP was removed at 16.04 for some dependency reason, and replaced with a package called StrongSwan. Luckily it’s in the main repository, so it can be installed without much hassle. (However, I tried it on 18.04 and I was unable to add a VPN as the Save/Apply button simply wouldn’t work.)


Dual screen workspaces in Ubuntu 17.10

I expected the aardvark to break a couple of things. They switched back from Unity to Gnome, so even more than usual, I feared the system might not even start.

Compared to that, things went quite smoothly. One problem I ran into is how Gnome devs apparently never used a dual screen setup, and thought it would be a good idea to only switch workspaces on the main screen, and keep the other screen static. Needless to say, that’s not how workspaces are supposed to work.


Adding Spotify support to my #nowplaying script

Spotify had a really charming summer sale, three months for 100 yen, and that was more inviting than what I could resist. As a result, I’ve been listening to various artist radios at home too (without premium it wouldn’t let the desktop client on).

Now that it works, of course I’d occasionally want to post #nowplaying tweets/toots too, so I added that functionality to my script. From the experience with fixing it for Clementine the other day, it was really easy.


Ubuntu 17.04 new Terminal

I use Terminal a lot. I vaguely remember there being a time when I was frustrated about having to start it up to do stuff, but by now it’s my natural go-to for basically everything from just finding files to applying replay gain to a whole folder tree.

I also use two screens and three workspaces (one for idle browsing, one for focused work and one just for GitKraken and Clementine), so I tend to have multiple Terminal instances running in parallel. However, with the upgrade to 17.04, getting there got harder.


rm -rf

There are few things as scary as the command rm -rf. It deletes everything (it’s allowed to) without asking, recursively. Use it in the wrong place or on the wrong target and welcome to the “oh fuck” zone.

I don’t think I’ve ever had it run amok though, mostly because I don’t use the -f switch much. If something can’t be trivially deleted then it should ask me just in case. There are really damn scary stories out there about how bugs combined with rm -rf can ruin stuff.

I don’t exactly know how I ended up in the situation I did. The root of all evil was a hardlink to a directory on my server. I thought Ubuntu didn’t allow that (my server runs Ubuntu too and I just tested locally that it doesn’t let me create one), but it was still there in my www folder, pointing at the folder that contained my blog’s stuff.

Yeah, past tense.


Ubuntu DNS errors

Basically every Ubuntu upgrade I run into this issue of my network connection dropping all the time – at least it looks that way. What temporarily solves it is clicking the “Auto Ethernet” item in the Network menu, but when it happens once every few minutes, it gets pretty frustrating. Especially since plenty of JavaScript based sites don’t handle sudden errors like that properly so I often ended up clicking on the retweet button a bunch of times before I realized something was wrong and confirmed it was my connection (again) in the browser’s console.

It kept throwing errors like DNS_PROBE_FINISHED_BAD_CONFIG and various other DNS related errors (NXDOMAIN, NO_INTERNET). Searching the net gives plenty of options for possible points of failure, and fixing the NetworkManager.conf (that was overwritten during the upgrade) helped me before.


Clementine DBus changes with Ubuntu 17.04

My #nowplaying poster for Clementine stopped working with the upgrade to Ubuntu 17.04 Zesty. After short debugging with D-feet it turned out that there were some changes to the way it interacts with DBus – which is, I guess, also the reason why it can be controlled properly through the Media menu now.

However, I was (am) totally ignorant re: DBus, so figuring out how this pretty complex system worked, in one hour, still slightly tipsy, past 2am, was not exactly a simple task. Though it was still faster and easier than getting vsftpd to work properly (sober and early afternoon), as there I just gave up and apt-get purged it.


MeCab for MySQL on Ubuntu Xenial

I was looking at fulltext search options when I found out that there is a Japanese language-specific plugin to make indexing more meaningful. Japanese doesn’t have word-delimiting spaces, so fulltext usually has a very hard time with it. MeCab uses a dictionary approach to that, in contrast to n-gram which just splits up words into equal sized bits.

Let’s check my MySQL version first… Apparently I have 5.17, which supposedly comes shipped with MeCab. Except it doesn’t, if you use Ubuntu, because apparently dependency rules for the universe repo don’t let them include it. Which is a huge pain in the ass, since I now have to look for the libpluginmecab.so file myself, and finding it wasn’t exactly an easy task.

Sure I’m not very well versed in the workings of open source dev communities, so I’ve got no idea where I’m supposed to look. I figured that if they can’t include that plugin file in the repo, then they might make it available elsewhere. I found it eventually in the community package .deb for the server, so I tried naively just extracting it and putting it in my plugins folder (which is /usr/lib/mysql/plugin/ in my case).