Sensible is a super simple plugin for Vim by Tim Pope. It is nothing but a set of sensible settings for your vimrc. It is a great way to start off on a new system where you do not have access to your fully featured vimrc. I only wish he explained some of the choices he made for the options in this file.
If I have a local account on the remote or new computer, I find it far easier to just replicate my vimrc, and other dot files, using GNU Stow.
I updated Ubuntu packages, which included Firefox and I updated Selenium using pip3 cause that also depends on the Firefox version. But running my existing Python scripts that use Selenium popped this error:
FileNotFoundError: [Errno 2] No such file or directory: 'geckodriver'
Firefox now provides the geckodriver as a separate binary. You can download the version matching your OS and CPU here. Unzip the file and place the binary anywhere that is in your PATH. Your Python scripts should work now.
To use just type EmojiOne Picker at the Dash. Note that it takes a few seconds to load and finally settles down in the system tray area with a smiley face. Right-click on it to get the fully detailed list of emoji. Click on any one and it will be copied to your clipboard for easy pasting into any app or website.
In Settings, I like to choose the Low end computer mode which reduces the number of emoji and thus makes loading and usage of this app faster.
It is useful to be able to autocomplete a path to a directory or filename while typing code or script files. This helps in ensuring that there are no mistakes and the path is correct. Thankfully, Vim has an autocompletion feature for typing path in insert mode! It calls this feature as file name completion.
Ctrl-x Ctrl-f: This is the shortcut to autocomplete path in insert mode. Start typing a path (absolute or relative) and use this keyboard shortcut. You will see a dropdown menu filled with the next entries from the filesystem that can be used to fill the path.
Ctrl-n or Ctrl-p: Shortcuts to move up and down the entries in the autocomplete dropdown menu. If you move off the top or bottom of the dropdown menu, you get the empty entry.
Absolute path: Any path that you begin typing with a slash is autocompleted as an absolute path.
Relative path: This is any path that does not begin with a slash. They are autocompleted too. Note that they will use the directory that Vim was launched from (PWD) as the root.
Hidden files or directories: I found that this was autocompleted only if I typed the first period and then used Ctrl-x Ctrl-f.
RSync has some different and confusing behavior depending on whether you put a trailing slash on the source directory or not.
No trailing slash on source directory: this copies the source directory itself as a subdirectory into the destination directory.
$ rsync -a /some/path/foobar .
Trailing slash on source directory: this copies the contents inside source directory into the destination directory.
$ rsync -a /some/path/foobar/ .
You do not see such confusing behavior with cp or mv. I guess rsync has this because it is usually used for synchronizing the contents of two directories but it is also sometimes used to copy over directories.
I recently discovered that a user on a server had accidentally killed my program. Many users, including me, on this server have sudo permissions. So, I guess the kill was carried out by using sudo. How to find out who is the killer?
Thankfully, all actions taken under sudo are logged in the /var/log/auth.log file. You will find entries of this form:
Sep 26 08:31:26 foobar-machine sudo: joe : TTY=pts/1 ; PWD=/home/joe/scripts ; USER=root ; COMMAND=/usr/sbin/openvpn --daemon --config foobar.ovpn
Sep 26 08:31:26 foobar-machine sudo: pam_unix(sudo:session): session opened for user root by joe(uid=0)
Sep 26 08:31:27 foobar-machine sudo: pam_unix(sudo:session): session closed for user root
You can see that all pertinent information is available in the log: who ran the command, what command and when.
Disk IO can be the bottleneck for certain programs. When I work with such programs on remote servers, I prefer to place their data or direct their output to SSD instead of HDD. I can view the available partitions and their filesystems using the df command. But, how to find out which of the mounted partitions is on a SSD and which on HDD?
You probably know that the disk of a partition listed as /dev/sdb7 is /dev/sdb. That is, by removing the numerical suffix from the partition, you get the disk.
To find out if the disk is SSD or HDD, check the /sys pseudo filesystem using the disk name:
$ cat /sys/block/sdb/queue/rotational
If it is HDD, and thus a rotational disk, the value will be 1. For SSD, the value will be 0.