leif's blog

Convering Github markdown to PDFs

I've been using this tool called pandoc to convert various files to PDF. In addition to pandoc itself, I also had to install TeX on my macOS box. Details for that is given here. Once all is installed, pandoc via HomeBrew of course, I simply do e.g.

$ export PATH=${PATH}:/Library/TeX/texbin   # Yeh, I could add this to my RC files
$ pandoc CppCoreGuidelines.md -o CppCoreGuidelines.pdf

You might need the additional images etc. properly downloaded as well, of course.

Comparing RPM packages between two systems

I needed to sync two different Fedora boxes, such that they have similar (but not identical) packages installed. This turns out to be fairly straight forward with some basic command line utilities. First, create a list of all packages on each machine, with something like

$ rpm -qa --queryformat='%{NAME}\n' | sort > machine-1.txt
$ rpm -qa --queryformat='%{NAME}\n' | sort > machine-2.txt

​Then, using the -f option to grep, you can see what's missing from each system. E.g.

$ grep -v -f machine-1.txt machine-2.txt


systemd strikes again with systemd-resolved...

systemd must be the worst thing ever invented. It started off being a good replacement for old rc startup scripts, but has since evolved into a monstrocity that makes Linux unusable. The latest nonsense is call systemd-resolved. It's apparently there to deal with a local resolver for things that can not support NSS, like Chrome.

Not only does this seems rather silly, for something I clearly do not care about at all, but it's also detrimental when your app does its own resolution. In my case, Apache Traffic Server fails to run its regression when it finds this local resolver ...

The solution was simple for me, just disable this useless systemd service:

$ sudo systemctl disable systemd-resolved.service



Windows 10 and too many connections ...

This weekend, I decided (foolishly...) to upgrade the only Windows 10 box that we have, a NUC that me and Peter use for some gaming time. This ended up being an enormous mistake (read: clusterfuck), because the box sort of bricked itself with an error

The number of connections to this computer is limited and all connections are in use right now.
Try connecting later or contact your system administrator.

So, neither of the proposed solutions worked; I even tried rebooting numerous times, to try to get it to Safe Boot, which it did not. And lo and behold, Windows 10 has removed the F8  boot option to go into safe mode as well... I did a little bit of research on this, and found a solution that suggested disconnecting the box from the LAN. Well, this was easily said than done, since the box is on WiFi, and you can't turn off WiFi from Windows unless you can boot into it. But, there is a BIOS, and fortunately, this Intel NUC machines has a BIOS option to turn off the WiFi (what they call the WLAN).

I did that, and this time Windows continued booting, finished with the upgrades that I had started, and so far so good. I haven't turned on the WiFi yet, so we'll see what happens after I do that...


Compiling LLVM with distcc

First off, I'm not a cmake expert, so I'm not 100% sure if I'm doing this right, but it does seem to work... Basically, I wanted to distribute my LLVM builds across a set of machines, using distcc. This is what I did

  1. As root, the first thing to do is making sure you have distcc linked to various compilers, e.g

    $ sudo ln -s /usr/bin/distcc /usr/local/lib/distcc/gcc
    $ sudo ln -s /usr/bin/distcc /usr/local/lib/distcc/g++


  2. Run cmake like

    $ CC=/usr/local/lib/distcc/gcc CXX=/usr/local/lib/distcc/g++ cmake -DCMAKE_INSTALL_PREFIX=/opt/llvm -G "Unix Makefiles" ../src
    $ pump make -j30  CC=/usr/local/lib/distcc/gcc CXX=/usr/local/lib/distcc/g++


However, the final link stages did not fair well with the parallel make, so I had to run again, without a -j option to make.



Subscribe to RSS - leif's blog