A Scripter's Notes โš

Emacs, scripting and anything text oriented.

String Functions: Nim vs Python

While learning the Nim language and trying to correlate that with my Python 3 knowledge, I came across this awesome comparison table of string manipulation functions between the two languages.

My utmost gratitude goes to the developers of Nim, Python, Org, ob-nim and ob-python, and of course Hugo which allowed me to publish my notes in this presentable format.

Building Org Development version

I am assuming that you already know what Org or org-mode is and that’s why you are here.

You would want to build Org from its development branch (master branch) to get the latest and greatest goodies plus bug fixes! Go through the ORG-NEWS file to read about the new features.

If you like what you see there, here are the steps for installing the development version of Org.

A Better Less?

I use emacs – with a server1 and client setup – so that I can quickly open new files in it using emacsclient. My typical setup is to have xterm + tmux on one monitor and a single emacs(client) frame on another. But there are times when I do not want to shift focus from one monitor to another, like when I just need to review some log file. So I started using an alias to emacs -nw -Q to quickly open log files, review, filter, and C-x C-c.

Of course, that’s not where this post ends. An alias was no longer adequate to do what I wanted it to do more ..

Installing bleeding edge Hugo + Goorgeous

Update (2017/06/16)

Updated the github source references as per the changes in hugo v0.231. Also made the shell script ShellCheck-passing! ๐Ÿ™Œ ยง

You already got go installed, and that’s why are you reading it.

         If not – Go! Install it!

So.. now that you have go installed, why settle for the release version of hugo! You are reading this blog post generated using the bleeding edge of hugo2.

In addition, Hugo v0.19 onwards supports the org-mode syntax3, which is so much more awesome than markdown, especially if you are using emacs.

This post is about how you can install the latest versions of hugo and the go package that adds the org-mode support – goorgeous.

Installing go toolchain

There are 2 reasons why I suggest installing go to anymore, whether they are Go developers, or not (like me).

  1. You can then build amazing utilities like peco, hugo and noti.
  2. It’s easy!

Stuff about command-line ftp

To connect to a machine with ip MACHINE, you simply need to enter the below at command-line:


See below for a list of commands you would typically use once you ftp to a machine.

Installing rust toolchain

Lately, I have come to know of a command line search utility called ripgrep, coded in rust, that is capable of faster code searches (at least for my use cases) than grep or ag. So I got interested in building the latest versions of rg (ripgrep binary name) directly from its github master branch rather than waiting for its release binaries.

So came the need to install the rust toolchain on my machine. Luckily, installing that was super easy; here are the steps:

Count Down Timer in Shell

I was working on a tcsh script that did some cool stuff. But if a user ran that script not knowing the true impact of the script, it could make some bad irreversible changes.

While I could simply echo a warning statement and put a sleep 10, I wanted the wait time to be shown live.

Optimize your .git

I was reviewing what was occupying the maximum disk space using the ncdu command line utility. One of the top candidates was the git clone of org-mode. It was using 2.4GB of my disk space!

Surprised by that, I started looking around1 if there was a way to optimize the cloned git repositories i.e. the .git/ directories. And sure enough, there was a way.

Check If a Command Exists from Shell Script

I often need to check if a particular executable is present in the PATH before I can proceed with what I am doing in a shell script. Also I need to work with both tcsh and bash scripts. Below presents the different solutions that have worked for these shell scripts for me.