Snippets: a simple tech blog.

  • Fix HTML not working in Hugo

    By default, Hugo does not render HTML (and JavaScript). So you can’t use HTML tags in the markdown files. To enable this, change the following setting in config.yml: If your theme uses TOML or JSON, you can get instructions for these here. Shortcode to open links in new tab If HTML rendering is enabled in…

  • Install Pi-hole on WSL2 and use externally with Tailscale

    Use your devices with Pi-hole when not connected to your LAN. Pi-hole is normally configured on your router or on a separate device on your LAN (e.g., Raspberry Pi) so that all devices connected to your LAN (Wi-Fi) can use it. But this doesn’t help when you’re not connected to your home network. To use…

  • Install Nextcloud on WSL2 and access anywhere with Tailscale

    Install Nextcloud on WSL2 and access anywhere with Tailscale

    Installing Nextcloud on WSL2 Nextcloud requires Apache server, PHP and MariaDB to run. You can install the required packages using the Linux package manager in WSL2. This guide assumes that you have Ubuntu installed on WSL2 but the steps are the same for other distros, only the installation commands will differ. Install the required LAMP…

  • Install Tailscale on WSL2

    Install Tailscale on WSL2

    Tailscale is your own personal VPN that opens up a lot of possibilities. A private VPN gives you access to all your devices even when you’re not connected to the same local network. Tailscale gives your device a “static” IP that you can use to connect to it from anywhere. This lets you set up…

  • Fix OneNote’s Quick Notes sync

    Fix Quick Notes sync across Windows, Android and iOS. One reason for sync issues is because OneNote uses different default locations for the Quick Notes section on different platforms. The default Quick Notes on Windows creates and uses a local notebook which is stored in UserProfile/Documents/OneNote Notebooks. This notebook is not synced to your Microsoft…

  • Change the footer in WordPress admin

    To change the footer text in the WordPress admin area, add the following lines to your theme’s functions.php. To remove the version number on the right side of the footer, you need to remove the existing text and then add the new text.

  • Run multiple versions of PHP in XAMPP

    Download the required version of PHP from https://www.php.net/downloads.php. For PHP7+, you can download the Thread Safe version. For older PHP, try the Non Thread Safe version. Create another folder in C:\xampp for this version of PHP apart from the existing C:\xampp\php. E.g., C:\xampp\php74. Copy the downloaded version’s files into this folder Create php.ini in this…

  • Redirect Subfolder to Subdomain in Apache using .htaccess

    Setup redirection after migrating a site from a subfolder to a subdomain. When a site in a subfolder is moved to a subdomain, .htaccess rules need to updated to redirect URLs. This can be done by adding the following lines to the .htaccess file in the root folder: This will redirect all calls to domain.com/subfolder/*…

  • Overflow both sides in CSS

    Normally, when content or an image overflows outside a div, the overflowing content is shown on the right outside the “box”. If you want to position the content to the center, so that overflow is on both sides, you can use this class. This is useful to position an image such that the centre of…