Running Dnsmasq in Docker as an Internal DNS Server for a Home LAN

Resolving my own domain inside the LAN with dnsmasq on Docker

On my home server I use my own domain and run several servers on it, but from inside the home LAN the traffic goes through the router, so accessing them with my own domain does not reach the servers inside the house It is easier to understand if you refer to this article When you only have a few PCs and devices, you can write the entries in each hosts file instead of introducing dnsmasq, but I also wanted to manage the hosts file in one place, so I built dnsmasq as a DNS server inside the LAN with Docker [Read More]
dns 

Self-Hosting Bitwarden with Docker as a LastPass Replacement

Migrating from LastPass to Bitwarden

Since the free version of LastPass gets a device limit from the middle of March, I wanted to move away from LastPass sooner rather than later, so I looked into whether there was any open source password manager out there, and Bitwarden looked good, so — as always — I tried self-hosting it with Docker. What I do for the work is almost the same as the article below ↓ Bitwarden Here is the official site. If you are not going to self-host, it is easier to create an account and use that [Read More]

How to Find the Subnet Range of an ISP with whois

Usable not only for ISPs but for any organisation

There are times when you want to know the subnet range of an ISP or similar. For example, when you want to allow SSH only from your home subnet on an external server such as AWS or a VPS, and therefore want to know the range of the dynamic IP in your home environment. You can look it up with whois, which is a surprisingly simple method (well, the web based JPNIC WHOIS Gateway (in Japanese) is simple too…) [Read More]

Fixing Hugo Source Build Errors on CentOS 7

Working around the errors that appear when building hugo from source

I posted a similar article before in GCC error with hugo on CentOS7 , but recently the build from source failed, so I worked on it. Incidentally, the version of hugo I am trying to build is 0.82 Environment Copy # cat /etc/redhat-release CentOS Linux release 7.9.2009 (Core) # git version git version 1.8.3.1 # go version go version go1.15.5 linux/amd64 Building hugo from source Copy $ vim from-gh.sh mkdir $HOME/src cd $HOME/src git clone https://github.com/gohugoio/hugo.git cd hugo go install --tags extended $ sh from-gh.sh Error Copy Cloning into 'hugo'... remote: Enumerating objects: 50309, done. remote: Total 50309 (delta 0), reused 0 (delta 0), pack-reused 50309 Receiving objects: 100% (50309/50309), 93.65 MiB | 9.80 MiB/s, done. Resolving deltas: 100% (34542/34542), done. go: github.com/sanity-io/[email protected] requires github.com/pmezard/[email protected]: invalid version: git fetch --unshallow -f origin in /root/go/pkg/mod/cache/vcs/b66720d7c9f6776b1690ab6c7de6bd08fe64d74a3eaff8dbdef6603dac225370: exit status 128: fatal: git fetch-pack: expected shallow list When I updated git to the latest version, this time I got the error below [Read More]

Customizing image and link output with Hugo Render hooks

Render Hooks allow custom templates to override markdown rendering functionality

To insert an image in Hugo you write the standard Markdown ![Text](Link-URL), which renders as <img src "~">, but I had been wanting to build native lazy-load into the img tag. Incidentally, native lazy-load means that You can configure lazy loading of images easily just by adding the HTML loading attribute, without needing Javascript At first I thought it could only be inserted by using the figure tag or a shortcut and went through some trial and error, but when I looked into it I learned that it becomes possible by using Hugo’s Render hooks. If you want to know Render hooks in detail, see the official documentation. [Read More]

Beautifulhugo Stops Showing the Last Modified Date on Hugo 0.76 and Later

Failed to get translated string for language "ja" and ID "lastModified": template: :1:22: executing "" at <.Count>: can't evaluate field Count in type string

Beautifulhugo is the Hugo theme I still use today, and a symptom where the last modified date was not displayed showed up, so I dealt with it Incidentally, the hugo version is 0.80.0 Symptoms When I start the server locally, the last modified date is not displayed and the error below appears Copy $ hugo server -D .... Failed to get translated string for language "ja" and ID "lastModified": template: :1:22: executing "" at <.Count>: can't evaluate field Count in type string Since I deploy with Netlify, raising the hugo version in netlify.toml produces the same symptom Copy ... [context.production.environment] HUGO_VERSION = "0.80.0" HUGO_ENV = "production" HUGO_ENABLEGITINFO = "true" Cause Looking at the error message, the <.Count> notation seems to be the problem, and it is used in en.yaml, ja.yaml and the like inside beautifulhugo/i18n/. [Read More]

Instagram Embeds Broke My Hugo Build After the oEmbed API Shutdown

Failed to retrieve remote file: Bad Request

Recently, after fixing Hugo settings or creating and editing articles, the build started failing and I could no longer update the site. Symptoms Failed to get JSON resource “https://api.instagram.com/oembed/?url=https://www.instagram.com/p/BGvuInxxxx/&maxwidth=640&omitscript=true" : Failed to retrieve remote file: Bad Request Looking at the deploy log, Failed was displayed at the Instagram API part and the build was being aborted. It seems that in Hugo, when an instagram shortcode is inserted, the build now fails. [Read More]

Why Scripts in /etc/cron.weekly Do Not Run on Debian

Scripts placed in /etc/cron.weekly on Debian do not run

Running on debian10(Buster), I had placed a backup script (backup.sh) under /etc/cron.weekly/, but apparently it was not running. Of course I had given it execute permission, and I had confirmed it works when run manually. Checking my other machines, it turned out that it works without any problem on CentOS while none of them run on Debian. Looking into it, according to run-parts(8), it seems that extensions containing a dot, such as .sh or .pl, do not run [Read More]

Adding a netlify.toml to a Hugo Site

Setting up netlify.toml in a Hugo + Netlify environment

About a year has passed since I moved to a Hugo + Netlify environment, and because nothing in particular had gone wrong I had left it alone, but I finally got around to setting up netlify.toml. The theme used on this site: Beautifulhugo (submodule) netlify.toml The official page has the format for netlify.toml, so create it under hugo with the following content Copy [build] publish = "public" command = "hugo --gc --minify" [context.production.environment] HUGO_VERSION = "0.74.3" HUGO_ENV = "production" HUGO_ENABLEGITINFO = "true" [context.split1] command = "hugo --gc --minify --enableGitInfo" [context.split1.environment] HUGO_VERSION = "0.74.3" HUGO_ENV = "production" [context.deploy-preview] command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL" [context.deploy-preview.environment] HUGO_VERSION = "0.74.3" [context.branch-deploy] command = "hugo --gc --minify -b $DEPLOY_PRIME_URL" [context.branch-deploy.environment] HUGO_VERSION = "0.74.3" [context.next.environment] HUGO_ENABLEGITINFO = "true" When the theme is a submodule You need to specify the theme in the build command, so add --theme=beautifulhugo [Read More]

JpGraph Charts Stop Rendering on PHP 7.3 and Later

JpGraph Error: 25092

At the time of writing (2021.10), the problem below appears to be fixed in the latest version, 4.3.5. It says PHP 7.2 is supported, but the product information says it supports up to 7.4, so which is right?? As long as it works properly I do not really mind. I am leaving the old article below for reference Symptoms Under Apache2.4+PHP7.3+Jpgraph4.3.1, the error JpGraph Error: 25092 meant graphs were no longer output [Read More]
php