Emacs: Buffer-switch indicator
Most of the time, I have many windows open in Emacs, so it really helps to have an indicator of the current window (and buffer) especially when switching between windows.
Most of the time, I have many windows open in Emacs, so it really helps to have an indicator of the current window (and buffer) especially when switching between windows.
elpy
is a great minor-mode for python-mode
(major-mode) in Emacs, but managing multiple venvs (virtual environments) has always been tricky as pyvenv
(that elpy
uses) doesn't have a way to have buffer-local venv (virtual environment) -- any venv activated using e.g. pyvenv-activate
/pyvenv-workon
is (process) global.
I use blacken-mode
(uses black
) to auto-format Python code on save -- it works great but not much helpful while dealing with strings. For example, if I want to set a max limit on columns (characters) per line when writing a string, black
is of no help. So I needed to come up with something in emacs
that does the auto-format of strings -- set a max limit on-the-fly on number of columns per line for writing strings.
Emacs has a global fringe-mode
for fringes, which I always keep disabled as it takes a bit of space in the frame and I like to start typing the first character on a line to the very left. But there are some cases where fringes are quite useful e.g. when flycheck
shows different checker warnings/errors in code, it uses fringes (if enabled) to have a nice arrow to indicate the line(s) with the warnings/errors -- great to have a quick glance at everything.
The eww
browser of emacs
(GNU Emacs 29.3) uses gnutls-cli
to setup TLS connections to web servers. And on my Linux Mint 21.3 (based on Ubuntu 22.04), it wasn't installed; so whenever I was trying to visit any HTTPS site, the following error was shown (truncated):
Opening TLS connection with ‘gnutls-cli --x509cafile /etc/ssl/certs/ca-certificates.crt -p 443 ’...failed
Recently, I had a sort of unusual requirement to get the last modified file (tracked by git
) in a certain directory for a specific branch. I tried to look for any existing porcelain or plumbing command in git
that can be used to advantage, but couldn't find anything, so had to stitch up something combining several utilities.
Here's how it looks eventually:
Oftentimes, I need to record my webcam and microphone, so I created a tiny snippet to automate this on my GNU/Linux system (ffmpeg
devices are different in different operating systems as they depend on the kernel modules, one can do ffmpeg -devices
to find the available devices on their system). One straight-up ffmpeg
command to record webcam and microphone is:
In Linux, V4L (Video4Linux) dictates how a video-capture device (as character node) is created in the device tmpfs
filesystem (devtmpfs
specifically, mounted on /dev
). The webcam devices are usually created as /dev/video<index>
e.g. /dev/video0
. Different udev
rules are then used to give these devices locations in /dev
based on their ID (in /dev/v4l/by-id/
), bus path (in /dev/v4l/by-path/
) and so on.
When working with torchaudio
for audio-oriented neural network implementations, one of the very first things we do is to get the metadata of the audio input using torchaudio.info
.
Panel is the perfect place in Linux Mint to put the launchers for programs/commands that are used most often. To create a launcher we need a .desktop
file that describes some attributes of the program. Most installed GUI programs come with their launchers (.desktop
files), but when we have a custom command/program of our own that we want to create the launcher for, the only thing we need to do is create a .desktop
file.