Slow emacs startup on CentOS7 under VirtualBox

I use VirtualBox for most of my development efforts on my macBook. I recently had to reinstall CentOS7 on this new machine, and was noticing a 10s (2x 5s) delay on startup times for Emacs. Doing an strace -tt on the Emacs binary, I noticed it would timeout on trying to lookup its own hostname. I'm not sure why, but this timesout on the DNS lookups were annoying the hell out of me. The solution was to add the local hostname (set in /etc/hostname) to the entry in /etc/hosts.


gzip vs Brotli compression

I enabled Brotli on one of the sites that I run ( and I examined the logs (about 200,000 log entries so far), and comparing the sizes for each URL that gets both Brotli and gzip. I summarized by content type, and see 5-10% smaller objects with Brotli.

application/javascript  -6.42%
text/css               -10.05%
text/plain              -4.64%
text/html               -8.44%

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/

$ tmutil deletelocalsnapshots 2017-11-29-134430

Another alternative is to use the thinlocalsnapshots option

$ tmutil thinlocalsnapshots /Volumes/

However, that didn't do anything on my box. Instead, I just looped over all of the snapshots, and nuked them all:

for snap in $(tmutil listlocalsnapshotdates /Volumes/; do
    tmutil deletelocalsnapshots $snap

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



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 -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




Subscribe to RSS