Posts

Backup of postgres in a kubernetes pod (and a docker container)

Kubernetes is a lot of things, some cool, some vexsome. One of the things is that it does not necessarily make it easy to make backups of data stored in pods.  And if the data is a database you can't really back it up from the outside in the data storage mount either since the backup is liable to become inconsistent and unusable. You have to deal with the database engine to get a consistent backup. At work we have a self hosted kubernetes cluster and quite a bit og old fashioned infrastructure too.  Lately some postgres databases have been deployed here with the bitnami helm chart . We use automation tools to set up backups and all kinds of things.  And in these tools we prefer not to put passwords if we can avoid it. One _could_ make a backup using pg_dump or similar giving it the pod IP, username and password, but we'd like to avoid that. Examining the bitnami postgres pod it was set up quite interestingly with postgres running at uid 1001 which does not have a user account a

Ubuntu 22.04 and their snap love afair - or: how to get rid of snap - or: firefox without snap

Some years ago Ubuntu introduced snap and said it would be better.  In my experience it was slower. And then they started packaging chromium-browser as a SNAP only, this broke the kde-plasma and kde-connect (media and phone desktop integrations, and I resorted to installing chrome from Google.  This was quite easy because Chrome comes as a .deb package which also installs a apt-source so it's upgraded just like the rest of the system. This, by the way is the apt source for Chrome, you drop it in e.g.  /etc/apt/sources.list.d/google-chrome.list : deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main And then you install the google signing key:  wget -qO-  https://dl.google.com/linux/linux_signing_key.pub | sudo tee /etc/apt/ trusted.gpg.d/google-linux-signing-key.asc Then you can do ' apt update ' and ' apt install google-chrome-stable '.  See also https://www.google.com/linuxrepositories/ for further information Lately I've been using Chrome less

DLNA servers for our Samsung TV on Linux

We have a Samsung Smart TV, I like it. We also have a cable box, a BluRay player (because sometimes we borrow movies at the library and anyone in the family needs to be able to play them with no help from dad), and a Chromecast.  All three HDMI inputs on the TV are used. Samsung was pretty big on DLNA, a UPnP based protocol for media playback. Now it's not a feature they tout a lot: People want Netflix. Samsung also had very good codec support from the start which reduces the need for transcoding greatly.  They still have the DLNA client builtin in their TVs and the codec support is even better now.  So this solves the in-house streaming problem very neatly without needing a extra box by the TV to do it. The server in the basement ought to be enough when the TV had DLNA. I understand that DLNA is a bit low featured in 2021: no on screen movie/episode synopsis, not very slick navigation and on screen controls for everything. But it's enough. DLNA is right featured. The Samsung D

New Linux on old hardware

Since our family relies on the servers in our basement for email, music, movies, and so on it's been bothering me that we have no extra hardware in case something goes wrong. I've been given two old Dell machines, I want to use one for stuff and one as spares in case something breaks. Both needed reinstalling: I like Ubuntu and made myself a memory stick with Ubutnus usb-creator software.  The machines never managed to boot of those.  The Ubuntu server ISOs are too large to fit on a CD. Found ubuntus netboot ISOs for 18.04 which fits a CD ten times over.  Again they didn't boot from the memory stick nor off a CD with various error messages or just passing it by and booting off the old OS on the harddrive. After a while I recalled "unetbootin" - a old, but still updated - tool to make memory sticks from ISO images. It currently lives here:  https://unetbootin.github.io/ I had to repartition my memory stick ( cfdisk /dev/sdc in my case) and make a msdos filesystem

Bluray with menus on Linux - on Ubuntu

For the longest time it was impossible to play BluRay disks on Linux due to the lack of players that could do it.  VLC has been the most capable video player on Linux and some time ago they managed it. I run Ubuntu at home.  I can easily install VLC but some parts were missing to get it working. Be root:  sudo -i libaacs decodes Blurays: apt-get install lib aacs0 BluRays or at least VLC need Java 8:  apt-get install openjdk-8-jre Ubuntu and VLC does not agree on the right directory name:  cd /usr/lib/jvm/ Link the right one:  ln -s java-1.8.0-openjdk-amd64 java-8-openjdk This library implements BD-J menus  apt-get install libbluray-bdj Now insert a BluRay disk and play it: vlc bluray:// It should start up with menus. Use arrow keys to navigate and Enter to choose.

The most important thing about Apache

The most important thing you should know about Apache, the web-server, is that if you feel stupid after trying to get something working on it - this is perfectly normal - and does not mean you are stupid. Try NGiNX next time.  If it supports the thing you need.

git log -p splitting

At work we have two related code bases.  Recently one of them received a lot of loving, and the other needed the same treatment to work better with new Perl and modules. The one had gotten several hundred patches, and browsing that many and cherrypicking them got tiresome.  It was better for me to split the whole log into separate patches and review and apply one by one and then moving the "done" patches to a different directory. Here, the small hack to split "git log -p" into one patch pr. file: #!/bin/bash awk 'BEGIN { FN=0; }      /^commit / { FN++; }      { print $0 >> FN }' $1