<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Balaji's Tech Notes</title><link>https://nb.balaji.blog/</link><description>Recent content on Balaji's Tech Notes</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Thu, 29 Jul 2021 13:49:22 +0800</lastBuildDate><atom:link href="https://nb.balaji.blog/index.xml" rel="self" type="application/rss+xml"/><item><title>Using NTP Server Names instead of IP's in Mikrotik Routers</title><link>https://nb.balaji.blog/posts/ntp-server-names-mikrotik-routers/</link><pubDate>Mon, 10 Aug 2020 15:52:17 +0800</pubDate><guid>https://nb.balaji.blog/posts/ntp-server-names-mikrotik-routers/</guid><description>I&amp;rsquo;ve been having some issues with dying equipment in my kitchen recently which has resulted in the breakers tripping in the electrical junction box a few times. That meant that all of my network and servers went down unexpectedly which created it&amp;rsquo;s own problems - as it turns out I have enough equipment plugged in that just flipping the breaker again would result in another trip, due to too much power draw!</description></item><item><title>Using Custom DNS Servers with Mikrotik Routers</title><link>https://nb.balaji.blog/posts/mikrotik-dhcp-client-and-dns/</link><pubDate>Mon, 10 Aug 2020 15:23:08 +0800</pubDate><guid>https://nb.balaji.blog/posts/mikrotik-dhcp-client-and-dns/</guid><description>The most important reason for not using the DNS servers that your ISP provides is protecting your privacy as it&amp;rsquo;s been proved many times that ISP&amp;rsquo;s are not averse to hijacking your DNS results to serve ads or worse. But the other reason is that quite often the DNS servers that ISP&amp;rsquo;s operate are slow, they tend to have long cache times which means that changes to your domain IP&amp;rsquo;s can be hard to test from your local machine.</description></item><item><title>Fix Corrupt ZSH History File</title><link>https://nb.balaji.blog/posts/fix-corrupt-zsh-history/</link><pubDate>Sun, 19 Jul 2020 17:47:58 +0800</pubDate><guid>https://nb.balaji.blog/posts/fix-corrupt-zsh-history/</guid><description>I noticed that one of my homelab machines had a slight clock drift problem. However, once I fixed that I wound up with an issue where ZSH starting printing a message &amp;ldquo;Corrupt history file&amp;rdquo; after every command. I suspect that this is because the History file had a timestamp in the future as compared to the system time. Since I did not want to lose my entire shell history, I was able to fix this by running the following commands:</description></item><item><title>Adding a Quorum-only Host to Proxmox Cluster</title><link>https://nb.balaji.blog/posts/adding-quorum-host-proxmox-cluster/</link><pubDate>Sun, 19 Jul 2020 17:25:44 +0800</pubDate><guid>https://nb.balaji.blog/posts/adding-quorum-host-proxmox-cluster/</guid><description>I&amp;rsquo;ve mentioned this in passing in an earlier post about Proxmox but until recently, I had a 3-node Proxmox cluster on a set of NUC&amp;rsquo;s for my Homelab. The 3-node setup is great because it means you can reboot individual nodes without causing the entire cluster to become unavailable. Unfortunately, as I mentioned in the earlier post about Proxmox the NUC-clone I got from Aliexpress was basically unusable after the upgrade to Proxmox 6 - it would have regular Kernel panics and even installing kdump or setting up remote logging did not yield any results.</description></item><item><title>Fix tmux plugins not loading</title><link>https://nb.balaji.blog/posts/fix-tmux-plugins/</link><pubDate>Sat, 11 Jul 2020 15:50:02 +0800</pubDate><guid>https://nb.balaji.blog/posts/fix-tmux-plugins/</guid><description>Continuing the theme of upgrades breaking things, I realized that after the reinstallation of Proxmox I was not able to restore my tmux sessions. The mapped commands in my .tmux.conf for session-save, session-restore were not working but everything else was.
An initial check seemed to suggest it was PEBKAC error since I needed to clone the tmux plugin manager into my .tmux folder. However, even after doing that and trying to install the plugins via the plugin manager the session functionality was not working.</description></item><item><title>Fix Mixed Line Endings in Emacs</title><link>https://nb.balaji.blog/posts/emacs-fix-mixed-line-endings/</link><pubDate>Sun, 05 Jul 2020 16:14:39 +0800</pubDate><guid>https://nb.balaji.blog/posts/emacs-fix-mixed-line-endings/</guid><description>I have been dealing with a strange heisen-bug with my Zettelkasten notes where occasionally a note will wind up with the wrong (or mixed) line endings after it has been updated by a script that inserts backlinks within the notes. I say heisen-bug since I can&amp;rsquo;t reproduce it and I&amp;rsquo;m not 100% confident that it is the script that is triggering this problem.
The symptom of this problem is when the file is open in Emacs, you see ugly &amp;ldquo;^M&amp;rdquo; characters at the end of each-line.</description></item><item><title>Configure Confluence Live Search when using the Global theme</title><link>https://nb.balaji.blog/posts/limit-confluence-livesearch/</link><pubDate>Sun, 05 Jul 2020 15:40:58 +0800</pubDate><guid>https://nb.balaji.blog/posts/limit-confluence-livesearch/</guid><description>If you are using Confluence, you might have come across an annoying behaviour when using the type-ahead search that appears in the left navigation bar - the search bar will search across all available &amp;ldquo;Spaces&amp;rdquo; in the Confluence site which on a big shared site, can result in a lot of spurious hits. The Confluence documentation states that this is by design when using the default theme.
Thankfully, there is a way to fix the search so that it only searches within a particular Confluence&amp;quot; &amp;ldquo;Space&amp;rdquo;.</description></item><item><title>Fix Sultan Command Execution error in Windows</title><link>https://nb.balaji.blog/posts/fix-sultan-command-error/</link><pubDate>Wed, 01 Jul 2020 18:26:21 +0800</pubDate><guid>https://nb.balaji.blog/posts/fix-sultan-command-error/</guid><description>I came across Sultan many months ago and had filed it away for future reference. Cue the work I&amp;rsquo;ve been doing on automating my Zettelkasten workflow in Python and in order to simplify calling out to an external program (no points for guessing that the program I&amp;rsquo;m calling is pandoc) I decided to use Sultan.
In general, I found using Sultan a pretty smooth experience with the exception of one annoying glitch.</description></item><item><title>Show custom Python venv name in Windows Command Prompt</title><link>https://nb.balaji.blog/posts/python-venv-name-windows/</link><pubDate>Wed, 01 Jul 2020 17:44:11 +0800</pubDate><guid>https://nb.balaji.blog/posts/python-venv-name-windows/</guid><description>As part of my workflow for my Zettelkasten notes, I&amp;rsquo;ve been creating a set of Python scripts that change the wikilink-style links that most Zettelkasten software use into something better understood by standard Markdown renderers. I used Python venvs for these scripts and discovered one annoyance - if you use Windows Command Prompt (cmd.exe) as your default terminal in PyCharm or elsewhere, when you activate the venv, the environment name that appears in the prompt will the name of the venv folder and not of your git repo where you are developing the scripts.</description></item><item><title>Fix Intel Network Adapter (E1000) hanging/errors in Proxmox</title><link>https://nb.balaji.blog/posts/fix-intel-e1000-proxmox-hang/</link><pubDate>Tue, 30 Jun 2020 13:03:05 +0800</pubDate><guid>https://nb.balaji.blog/posts/fix-intel-e1000-proxmox-hang/</guid><description>After tearing my hair out 1 with the DHCP issue, the next problem I started seeing was one my NUC&amp;rsquo;s would randomly hard crash and only powering it down and back up again would fix the issue. In most cases, the syslog would be completely empty which made things worse but I eventually managed to find an entry in the syslog that looked like this:
e1000e 0000:00:1f.6 eno1: Detected Hardware Unit Hang Checking on the Proxmox forums for that error message turned up this very long thread within which I found the answer.</description></item><item><title>Fix DHCP issues with Bridge interfaces in Proxmox 6</title><link>https://nb.balaji.blog/posts/fix-bridge-interfaces-proxmox-6/</link><pubDate>Tue, 30 Jun 2020 12:15:55 +0800</pubDate><guid>https://nb.balaji.blog/posts/fix-bridge-interfaces-proxmox-6/</guid><description>Another Why does upgrading Linux break so many things post.
This time with my Home-lab which consists of 3 NUC&amp;rsquo;s 1 running Proxmox. The machines have been running Proxmox 5 until recently, when the company announced that support for Proxmox 5 was ending. With quite a bit of trepidation, I upgraded to Proxmox 6 and yet again the same problem as before - this time with the networking stack where the servers stopped picking up the fixed IP&amp;rsquo;s assigned to them from my router using MAC addresses.</description></item><item><title>Generating pandoc-style references from Bibliography files in Emacs</title><link>https://nb.balaji.blog/posts/emacs-integrating-bibliography-files/</link><pubDate>Tue, 30 Jun 2020 10:50:26 +0800</pubDate><guid>https://nb.balaji.blog/posts/emacs-integrating-bibliography-files/</guid><description>As I mentioned briefly in my earlier post on using Pandoc, one way to be able to use citations with pandoc is to use the zotxt extension with Zotero. The zotxt extension comes with an emacs integration as well zotxt-emacs, but I could not get it to work reliably.
Instead after quite a bit of searching on GitHub, I came across this gist which works pretty reliably. Reproducing the Gist here for reference:</description></item><item><title>Using LUA Filters with pandoc</title><link>https://nb.balaji.blog/posts/pandoc-lua-filters/</link><pubDate>Sun, 28 Jun 2020 15:59:20 +0800</pubDate><guid>https://nb.balaji.blog/posts/pandoc-lua-filters/</guid><description>While testing the Markdown files generated by pandoc in Hugo, I realized I had some duplicate content that was making the individual posts very difficult to read. After careful reading of the pandoc Manual I discovered to my sadness that there was no built-in way to remove the content I did not want 😉. The only option then was to write pandoc filters. Now pandoc has libraries that allow you to write filters in pretty much any modern language but out of the box, it supports filters written in Lua.</description></item><item><title>Extract and rewrite image paths in Markdown files using Pandoc</title><link>https://nb.balaji.blog/posts/pandoc-extract-images/</link><pubDate>Sun, 28 Jun 2020 15:08:35 +0800</pubDate><guid>https://nb.balaji.blog/posts/pandoc-extract-images/</guid><description>More document manipulation tricks using pandoc! This time I&amp;rsquo;m using pandoc to change image paths in Markdown documents - very useful for example, when publishing Zettelkasten notes written in Markdown files to a blog.
pandoc X:\path\to\source.md -f markdown ---standalone --resource-path= --resource-path=.;&amp;#34;X:\\path\\to\\parent\\folder\\\&amp;#34;;&amp;#34;X:\\path\\to\\another\\folder\\&amp;#34; --extract-media=/img t markdown_mmd+yaml_metadata_block -o X:\path\to\content\posts\target.md&amp;#34; This will make pandoc search for linked images and place them in a folder named img using the file SHA as the filename. It will also change the link in the output markdown file to point to the new location - neat!</description></item><item><title>Preview Markdown files in Emacs with pandoc plus Live preview!</title><link>https://nb.balaji.blog/posts/pandoc-emacs-preview/</link><pubDate>Thu, 28 May 2020 17:51:20 +0800</pubDate><guid>https://nb.balaji.blog/posts/pandoc-emacs-preview/</guid><description>The markdown-mode in Emacs does ship with a basic preview mode where it will show the Markdown content as HTML, but there are no CSS styles applied (naturally) and this makes it difficult to get a sense of how the page would render on GitHub. spacemacs ships with a extra function that renders the Markdown content in an Emacs window with GitHub formatting, but again this is without CSS styling. So let&amp;rsquo;s use pandoc instead!</description></item><item><title>Using Pandoc to expand citations (without Bibliographies) in Markdown</title><link>https://nb.balaji.blog/posts/pandoc-markdown-citations/</link><pubDate>Thu, 28 May 2020 17:12:02 +0800</pubDate><guid>https://nb.balaji.blog/posts/pandoc-markdown-citations/</guid><description>Not very surprisingly I think, given the Zettelkasten technique originated from an academic background a number of practitioners are from the same background and thus there is quite a lot of emphasis on citing the proper sources etc. I caught that bug as well if only in that I wanted a more reliable way to track articles I would use in my Zettelkasten than just Pinboard bookmarks. That lead me to Zotero and from there it was a one short fateful step to learning about pandoc.</description></item><item><title>Fix Method Not Allowed Error with OwnCloud</title><link>https://nb.balaji.blog/posts/owncloud-webdav-editors/</link><pubDate>Wed, 27 May 2020 16:50:49 +0800</pubDate><guid>https://nb.balaji.blog/posts/owncloud-webdav-editors/</guid><description>As part of my shift to plaintext based tools, I was looking for a good Markdown editor on iOS as well as an App that I could use to maintain a personal journal. For Markdown editing, I settled on 1Writer and for my journal I decided to use Notebooks. However, with both tools when I tried to connect them to my self-hosted OwnCloud instance I would get a &amp;ldquo;Method Not Allowed&amp;rdquo; error.</description></item><item><title>Automating Backlinks creation for Zettelkasten notes</title><link>https://nb.balaji.blog/posts/zettelkasten-backlinks/</link><pubDate>Wed, 27 May 2020 15:41:29 +0800</pubDate><guid>https://nb.balaji.blog/posts/zettelkasten-backlinks/</guid><description>Somewhere in parallel with my Emacs explorations, I came across the concept of Zettelkasten and I was instantly hooked. Much like GTD, Zettelkasten is a technique that&amp;rsquo;s &amp;ldquo;Easy to understand. Hard to apply&amp;rdquo; but my early experience with it has been very promising.
One of the ongoing debates in the Zettelkasten community is around the question of backlinks - basically how should you maintain the inter-relationships between your notes that are the heart of a Zettelkasten system?</description></item><item><title>Custom WinSCP ini files in Keypirinha</title><link>https://nb.balaji.blog/posts/winscp-keypirinha/</link><pubDate>Tue, 26 May 2020 15:14:27 +0800</pubDate><guid>https://nb.balaji.blog/posts/winscp-keypirinha/</guid><description>Keypirinha is an awesome new keystroke launcher for Windows. Much better than Launchy or Keybreeze which I&amp;rsquo;ve used before. 1
The best part of Keypirinha for me is that the configuration is entirely driven by text files so it&amp;rsquo;s really easy to tweak it to your satisfaction. The one annoyance I&amp;rsquo;ve had so far is with the WinSCP plugin for Keypirinha. It turns out that the package only works with the default locations for WinSCP settings - either the Registry entry or a WinSCP.</description></item><item><title>Editing files with sudo in TRAMP-mode on Windows 10</title><link>https://nb.balaji.blog/posts/sudo-tramp-windows10/</link><pubDate>Tue, 26 May 2020 14:33:56 +0800</pubDate><guid>https://nb.balaji.blog/posts/sudo-tramp-windows10/</guid><description>If you want to edit files owned by other users (or root) in TRAMP, you should note the following:
Make sure that the sudoers file includes /bin/sh in the list of allowed programs. You can then use the syntax /plinkx:[session-name]|sudo:[session-name]:/path/to/filename to access sudo protected files.</description></item><item><title>Using TRAMP-mode in Emacs on Windows 10</title><link>https://nb.balaji.blog/posts/tramp-mode-windows10/</link><pubDate>Tue, 26 May 2020 14:09:56 +0800</pubDate><guid>https://nb.balaji.blog/posts/tramp-mode-windows10/</guid><description>TRAMP is another one of those Emacs power tools that once you have it working you go &amp;ldquo;How did I live without this till now?&amp;rdquo; 1.
Getting it working on Windows 10 (I&amp;rsquo;m sensing a theme here) can be tricky due to some gotchas.
A lot of articles on TRAMP will suggest using /ssh to start the session. Do not use this with Windows 10! Annoyingly, TRAMP will parse the SSH config file on Windows 10 but any attempt to connect using those sessions will just hang Emacs.</description></item><item><title>Dealing with tmux/sslh and Linux upgrades</title><link>https://nb.balaji.blog/posts/frustrating-linux-tools/</link><pubDate>Mon, 25 May 2020 13:13:34 +0800</pubDate><guid>https://nb.balaji.blog/posts/frustrating-linux-tools/</guid><description>I understand that breaking changes are required from time in time in software. But I really don&amp;rsquo;t get why maintainers of some software tools are so obstinate about not wanting to write code to manage such scenarios. Case in point - tmux in Debian &amp;ldquo;buster&amp;rdquo; and at some point &amp;ldquo;sslh&amp;rdquo; as well.
I use tmux when setting up new servers. Once the servers are setup, I might leave a tmux session open with tools like &amp;ldquo;htop&amp;rdquo;/&amp;ldquo;iftop&amp;rdquo; etc.</description></item><item><title>Setting up shellcheck, platinum-searcher and zeal with Emacs</title><link>https://nb.balaji.blog/posts/emacs-other-tools-integration/</link><pubDate>Mon, 25 May 2020 12:48:51 +0800</pubDate><guid>https://nb.balaji.blog/posts/emacs-other-tools-integration/</guid><description>Unlike the complexity of setting up spellcheck, getting these tools to work with Emacs pretty much just requires installing them choco install shellcheck pt zeal. There are few other things you can do to make your Emacs experience nicer though:
In spacemacs, you can set &amp;ldquo;pt&amp;rdquo; as the default search tool by changing dotspacemacs-search-tools to have &amp;ldquo;pt&amp;rdquo; listed as the first tool - for example dotspacemacs-search-tools '(&amp;quot;pt&amp;quot; &amp;quot;ag&amp;quot; &amp;quot;rg&amp;quot; &amp;quot;ack&amp;quot; &amp;quot;grep&amp;quot;).</description></item><item><title>Setting up spellcheck in Emacs</title><link>https://nb.balaji.blog/posts/emacs-tools-integration-spellcheck/</link><pubDate>Mon, 25 May 2020 11:26:57 +0800</pubDate><guid>https://nb.balaji.blog/posts/emacs-tools-integration-spellcheck/</guid><description>Since Emacs is born in GNU-land, like all other Unix(y) tools it relies on other programs to do specific things. This includes some basic capabilities such as spell-checking, but the same applies for other integrations as well. All of this is of course much less straightforward when it comes to working in Windows.
Install hunspell using chocolatey1 choco install hunspell.portable Download the spelling dictionaries from the Libreoffice website The location of these dictionary files changes regularly so the above link can break.</description></item><item><title>Making Putty, Windows 10 SSH &amp; WSL work together</title><link>https://nb.balaji.blog/posts/wsl-ssh-pageant/</link><pubDate>Tue, 12 May 2020 17:58:49 +0800</pubDate><guid>https://nb.balaji.blog/posts/wsl-ssh-pageant/</guid><description>Since PuTTY has been the defacto SSH client on Windows since Windows XP, I tend to use PAGEANT.EXE to manage my SSH keys. Now that PUTTYGEN.EXE supports more robust ed25519 keys, I can get good security for my SSH keys and integration with apps such as Git and Emacs.
The only annoyance has been the Windows 10 ssh.exe and WSL1. Typically to get SSH keys working in these environments, you needed to setup keys again with ssh-agent or worse set it up twice - once for ssh.</description></item><item><title>Improving Emacs startup performance in Windows</title><link>https://nb.balaji.blog/posts/emacs-windows-performance/</link><pubDate>Sun, 10 May 2020 16:55:29 +0800</pubDate><guid>https://nb.balaji.blog/posts/emacs-windows-performance/</guid><description>Much like everything else to do with Emacs, getting it to run &amp;ldquo;snappily&amp;rdquo; 1 is a bit of a black art especially Windows. Here&amp;rsquo;s a quick list of everything that I did to get Emacs to start-up quickly.
Pick the right flavour of Emacs
The default Windows binary available on the GNU website is not the most optimized version and lacks some quality of life features such as having GnuTLS built in, which is needed for getting MELPA packages.</description></item><item><title>About</title><link>https://nb.balaji.blog/pages/about/</link><pubDate>Sat, 09 May 2020 11:39:50 +0800</pubDate><guid>https://nb.balaji.blog/pages/about/</guid><description>What This site is a collection of all the tips and solutions that I&amp;rsquo;ve discovered while working with software and other tech both in my work and in my hobbies. The content is public but is not really carefully edited, beyond fixing obvious typos. My actual blog can be found at Balaji&amp;rsquo;s Blog.
This site is heavily inspired by my friend Ashwin&amp;rsquo;s tech blog as well as Nelson Minar&amp;rsquo;s Log.</description></item></channel></rss>