Connecting to Vagrant with the Plain SSH Command

vagrant ssh-config command is used to output a valid SSH configuration

After the earlier Vagrant does not respond , it would be a problem if the vagrant ssh command became unusable, so — belatedly — I set up connecting over plain SSH. Connecting with plain ssh rather than using vagrant ssh seems to be faster and more responsive In my own Vagranfile the connection is already bridged, and the default port is 2222 Copy config.vm.network "public_network", ip: "192.168.1.10", bridge: "en0: Ethernet" If you have not configured the network part, write it as follows [Read More]

Fixing Vagrant When It Stops Responding on macOS Mojave

Vagrant not working on macOS 10.14 Mojave

I run vagrant on a Mac (Mojave), but recently I hit a situation where vagrant would not respond at all Copy $ vagrant ssh $ vagrant status $ vagrant info $ No matter which command I type, there is no reaction whatsoever!? Thinking that vagrant might be broken, I ran brew reinstall vagrant After that the vagrant command came back, but this time I got the error below Copy $ vagrant status Traceback (most recent call last): 2: from /opt/vagrant/embedded/gems/2.3.4/gems/vagrant-2.3.4/bin/vagrant:111:in `<main>' 1: from /opt/vagrant/embedded/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require' /opt/vagrant/embedded/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require': cannot load such file -- vagrant (LoadError) 12: from /opt/vagrant/embedded/gems/2.3.4/gems/vagrant-2.3.4/bin/vagrant:111:in `<main>' 11: from /opt/vagrant/embedded/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:147:in `require' 10: from /opt/vagrant/embedded/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:158:in `rescue in require' 9: from /opt/vagrant/embedded/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:158:in `require' … /opt/vagrant/embedded/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require': cannot load such file -- google/protobuf_c (LoadError) ~/vagrant ❯ w google/protobuf_c? Is this a ruby related error?? [Read More]

Fixing the Unresponsive Hamburger Menu in Hugo's Tranquilpeak Theme

how I got a Hamburger/Toggle menu to work on tranquilpeak at subpath

I suspect the symptom had been happening for a while, but I noticed that the hamburger menu displayed in responsive mode on the Hugo theme “Tranquilpeak” was not working, and I ended up spending almost a whole day tracking down and understanding the cause. The symptom With this phenomenon, there was no problem as long as BaseURL was the top directory; it occurred when a subpath (subdirectory) was configured. Specifically, [Read More]

Getting GA4 Working on Hugo with Beautifulhugo and Mainroad

Migrating Google Analytics to GA4

Migrating a site built with Hugo to GA4 In my environment I use the Beautifulhugo and Mainroad themes, so the customization here is limited to those Also, this assumes the GA4 code for Google Analytics has already been obtained, so I will skip the explanation of Google Analytics itself Beautifulhugo Copy head.html into the root folder and edit it Copy $ pwd /hugo $ cp themes/beautifulhugo/layouts/partials/head.html layouts/partials/. head.html (changed lines only) Copy - {{ template "_internal/google_analytics_async.html" . }} + {{- partial "analytics" . -}} Create /layouts/partials/analytics.html with the following content Copy {{ if not .Site.IsServer }} {{ with .Site.GoogleAnalytics }} <!-- Global site tag (gtag.js) - Google Analytics 4--> <script async src="https://www.googletagmanager.com/gtag/js?id={{ . }}"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', '{{ . }}'); </script> {{ end }} {{ end }} Write the GA4 code into config.toml (changed lines only) Copy googleAnalytics = "G-XXXXXXXXXX" Mainroad In the mainroad theme at the time of writing, analytics is loaded in layout/_default/baseof.html, and looking at the code below it seems as though GA4 is already supported [Read More]

Building Zabbix 6 with Docker Compose

Zabbix6.2 Docker Containers

The Zabbix server I keep running all the time was on the old version 4, and partly because of template-related issues it seems the data cannot be migrated to 6.x, so I built Zabbix 6.x from scratch with Docker. Maybe the data could be carried over by upgrading zabbix4 -> 5 –> 6 one step at a time, but in my case I do not monitor that many servers, so building 6.x in one go and configuring the monitoring again seemed more efficient. [Read More]

Installing Homebrew on Linux: Debian, Ubuntu, and RedHat

how to install homebrew on Linux

Homebrew has become pretty much the standard on macOS, but these days you can install Homebrew on Linux too. On Debian and RedHat you can manage packages with apt or dnf (yum), but Homebrew makes it easier to install and update programs that are not in those packages and are not published as a repository. For example, tools I use often such as Hugo, Docker’s docker-compose, and lazydocker have to be downloaded from the official site and swapped out every time there is an update, but this can now be simplified to something like brew update hugo, just as on macOS. [Read More]

Fixing Bloated Container Logs in /var/lib/docker/containers

Dealing with bloated Docker logs

An LDAP server running on Docker had reached 100% disk usage, so I looked into it. This LDAP server is close to read-only, so the data should not grow that much, should it? Copy # du -sh /var/lib/docker/* |sort -n 1.2G /var/lib/docker/overlay2 2.1M /var/lib/docker/image 4.0K /var/lib/docker/runtimes 4.0K /var/lib/docker/swarm 4.0K /var/lib/docker/tmp 4.0K /var/lib/docker/trust 4.4M /var/lib/docker/volumes 7.8G /var/lib/docker/containers 20K /var/lib/docker/builder 24K /var/lib/docker/plugins 60K /var/lib/docker/network 108K /var/lib/docker/buildkit /var/lib/docker/containers is clearly the one using a lot of space [Read More]

When a Dell PowerEdge Refuses to Boot from a USB Drive

Can the Dell PowerEdge boot from a USB

I wanted to install Debian on a PowerEdge R410 that I no longer used, so I created a bootable USB disk, but even after setting USB as the highest boot priority in the BIOS it would not boot from the USB, and I spent several hours on it. When I looked for a solution on the internet, the article below was a perfect match The boot solution On the startup screen (while the Dell logo is showing), press F2 to open the BIOS setup screen. In the BIOS settings, change USB Flash Drive Emulation Type from AUTO to Hard Disk. Save the settings and leave the BIOS setup screen (it reboots) On the startup screen (while the Dell logo is showing), press F11 to open the boot media selection. In the boot media selection, the USB flash media appears under the “Hard Disk” entry, so choose to boot from the USB flash media. The installer boots from the USB without trouble. The network is unusable The NIC is recognized, but it cannot connect to the network [Read More]

Adding HTTP Security Headers to a Hugo Site on Netlify

Hardening the security headers to defend against cross-site scripting and clickjacking

Three years are about to pass since this site moved to Hugo. I configured the HTTP security headers for the site, which had been left alone for a while. They are directives used by web applications to configure security measures in the web browser, and they are used to defend against things like cross-site scripting and clickjacking This article covers the configuration for the Hugo + Netlify environment that this site uses Also, I will leave out explanations of the configuration terminology [Read More]

Moving /var/lib/docker to Another Partition with a Bind Mount

Moving /var/lib/docker and using a bind mount on Debian11

The root partition (/) of the machine I run Docker on was getting tight, so I moved /var/lib/docker These days, when you install Linux without thinking about it, the automatic configuration often gives the root partition (/) something small such as 30GB. When you run Docker, /var/lib/docker grows and grows, so / ended up in a state close to full. So I moved it to /home, which is on a separate partition and has room to spare [Read More]