leif's blog

High Sierra and local TimeMachine backups

I was wondering where some of my disk space was going, and realized that macOS HighSierra will make local TimeMachine backups as needed, and while disk space is available. This might be cool in some cases, and you can see (and delete) these snapshots with 

$ tmutil listlocalsnapshotdates /Volumes/com.apple.TimeMachine.localsnapshots
2017-11-29-134430
2017-11-29-144409
2017-11-29-154648

$ tmutil deletelocalsnapshots 2017-11-29-134430

 

TCP Fast Open

i've been fiddling with TFO lately, and my BFF Randall found this excellent article on the topic. Well worth a read! Doing some tests, for small requests / responses, you can make resonse times quite noircably faster!

Note: On my modern linux kernel, the command to get the TFO metrics out of netstat is not correct. It should be

$ grep "^TcpExt:" /proc/net/netstat | cut -d " " -f 91-96  | column -t

 

Hacking: 

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

Hacking: 

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

 

Hacking: 

Pages

Subscribe to RSS - leif's blog