Andreas Longo
  • Blog
  • Contact
  • Training

Things I learned

Some notes that might be valuable.

all | by date | by topic | search

Generating diagrams from AsciiDoc with Hugo

Asciidoctor, has good support for diagrams with the Diagram plugin. To make this work with Hugo, a static site generator, you need: a working asciidoctor-diagram plugin some settings in your Hugo site config Then run hugo --destination public to generate your site including all diagrams. Have a look at my example repository to get an idea of how this works.

January 28, 2022

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

Git: Renaming tags

Be careful. Renaming tags might be difficult depending on your situation. There is no single step for renaming a tag. You must create a new tag with a new name and then delete the old tag. What you should know TLDR: When replacing tags, make sure that your new tag points to a commit object and not to an old tag object. Git has the following types of tags:...

December 12, 2021

Auto updating container images

We can set the desired image pull policy during container startup. Podman/docker $ podman/docker container run --pull=always $ podman/docker container run --pull=newer Kubernetes spec: containers: - name: <name> imagePullPolicy: Always

December 10, 2021

Git: Deleting remote tags

Removing a remote tag: $ git push --delete <remote> <tag> $ git push --delete origin v1.0 Removing multiple remote tags: $ git push --delete <remote> <tag-1> <tag-2> <...> $ git push --delete origin v1.0

December 5, 2021

LVM: Extending a logical volume

Adding additional space to a LVM logical volume. $ sudo lvextend --resizefs --size <size> <group>/<volume> $ sudo lvextend --resizefs --size +2G centos/root Adding 100% of the available free space. $ sudo lvextend --resizefs --extents +100%FREE centos/root

December 5, 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
« Prev  Next  »
© 2023 Andreas Longo