Home » Shell Scripting

Shell Scripting

FFmpeg Cheatsheet

FFmpeg is a great command-line tool for dealing with audio and video files. Here are some useful commands: 1. Reduce the size of a file Try passing the file straight through ffmpeg and check if the size reduces: 1 ffmpeg -i input.mp4 output.mp4 To reduce the size further, scale the video to half the width and height: 1 ffmpeg -i ...

Read More »

Oh-my-bash MacOSX iTerm and stuff

I decided to up my command line game, so this a ‘remember how to do stuff‘ post for me. I do acknowledge that there are tons of different ways on doing things, especially when you have to deal with the command line. So don’t shoot the pianist. Step 0: I do use brewUse brew to manage a lot of command ...

Read More »

Some bash functions for git

Here some git related functions in my .bachrc. Is mostly a backup for me, but it might also be useful for someone else. Cloning a git repo Because I usually clone repos from my github account, this is a shortcut that allows me to just type clone *repo_name* and it will create the URL. function clone { if [ $# ...

Read More »

Multiple Derby Network Servers on the same Host

Abstract Suppose you want to start multiple Derby network servers on the same host. They need to be listening on different ports and ideally store their data in different locations. The listings below show Linux bash and Windows batch scripts to configure starting a Derby network server. In this example, the Derby network server will listen on port 1110. Each ...

Read More »

Writing safe(r) bash scripts

After writing more and more bash scripts for a client, I’ve decided to write down my thoughts about it. This assumes you have some knowledge about bash, as it is not intended as a beginner’s tutorial. Why bash scripts? Bash is present in almost every unix/linux-based stack, now some Windows as well. An exception is the ‘alpine’ docker images, which ...

Read More »

Increasing Shell Productivity With Zsh Aliases

The zsh shell, such as many others, supports aliases to minimize the amount of typing required. Beside simple command aliases, zsh comes with a multitude of extended alias features. Normal, or command aliases are very helpful for commands that you keep typing all over again. How often do you type git status, mvn clean install, or docker build yourself, manually? ...

Read More »

PowerShell Tutorial (Especially for People Who Hate PowerShell)

My relationship with the terminal—especially Windows PowerShell—has been a bit of a roller coaster. I first discovered the terminal when I heard about Python and didn’t know anything about anything. Like the average person who uses computers for games and applications like Excel and PowerPoint, I went to the site, downloaded the installer, installed it, and clicked the icon. Imagine ...

Read More »

Asciidoctor: Creating a macro

I’ve been writing the TWIN4j blog for almost a year now and during that time I’ve written a few different asciidoc macros to avoid repetition. The most recent one I wrote does the formatting around the Featured Community Member of the Week. I call it like this from the asciidoc, passing in the name of the person and a link ...

Read More »