Repairing video files with FFmpeg

I often record a short screencast to document some process rather than taking a long series of screenshots. To me this is more effective to produce and most of the time also more convenient to consume later on. When I need some screenshots for written or printed documentation, I take them from the screencast after the fact. For recording, I use the GNOME builtin recorder. It is instantaneously ready to use and requires no fiddling with settings or file paths....

July 13, 2023

SSH: Using wildcards with `scp` to copy remote files

Use quotes for the remote side of your command. Copying multiple files from remote to local: $ scp 'remote-host:path/source-file*' ./local-target source-file1.png 100% 10KB 180.1KB/s 00:00 source-file2.png 100% 17KB 282.7KB/s 00:00 source-file3.png 100% 12KB 274.4KB/s 00:00 With quotes, wildcards are expanded by the remote shell instead of your local shell which cannot see the remote files.

December 15, 2021

Zsh: Configuration files

Zsh config files and the order of sourcing during startup. 1 ~/.zshenv always sourced 2 ~/.zprofile sourced if login shell 3 ~/.zshrc sourced if interactive shell 4 ~/.zlogin sourced if login shell 5 ~/.zlogout sourced when exiting shell

December 4, 2021

Cygwin: A `sudo` like command

You can run commands from Cygwin with elevated permissions. On Windows, you have something like Run as different user or Run as administrator. And on Linux, you probably use the sudo command for this. To get similar functionality on Cygwin, you can add a new alias to your shell’s config file. The following is for Zsh, but it should also work for other bash-like shells. ~/.zshrc alias sudo='cygstart --action=runas' Now you can run something like this to test the alias....

February 24, 2021

Cygwin: Change the default home directory

You can define the default home directory for all Cygwin users in the nsswitch.conf file. For example, the following sets your default home directory to /cygdrive/c/Users/{user_name}/home, or in Windows notation to C:\Users\{user_name}\home. /etc/nsswitch.conf db_home: /%H/home You can change it to whatever you like. See the Cygwin documentation for more information. Look here below the /path section for more on supported wildcard characters.

February 24, 2021

Cygwin: Using the clipboard with Vim

To use the Windows clipboard in Vim on Cygwin, add the following to your Vim config file. .vimrc set clipboard=unnamed Vim will now use the clipboard register * for yank, delete, change and put operations. The * register gets synced with the Windows clipboard automatically.

February 24, 2021

Vim: Undo branches

You can retrieve the state of your text as it was some time ago. This concept is called undo tree or undo branches. Moving through the undo tree Go to newer/older text state. g+ g- Go to older text state, 10 minutes before. :earlier 10m Go to newer text state, 5 minutes later. :later 5m Using g- and g+ will get you to all possible text states while repeating u and CTRL-R does not....

February 14, 2021

Editor plugins for working with web APIs

These two plugins might come in handy if you are a developer or consumer of web APIs (e.g. REST). They allow you to send requests to your API and receive responses without leaving your editor. You can quickly explore APIs while saving your calls along the way as simple text file for documentation and sharing. They might supplement or replace tools like curl or Postman in your workflow. This plugin is for Vim....

February 11, 2021