Bash aliases turn long, repetitive commands into short custom shortcuts that load every time you open a terminal. Here's how to set them up, where to store them, and a practical set of aliases built for real sysadmin work. Continue reading...
#scripts
6 posts
20 Apr
20 Apr 2020
Over the past few years I have been participating in Stand-up meetings and it took me some time to find a convenient and effective way for keeping notes about what I was doing every day. I needed to be able to: keep notes on the issues I worked on, the meetings I participated in and stuff that blocked my work…
6 Feb 2020
Yesterday I saw a great command that finds the palindrome dates between now and x days ago. The command was posted on Twitter by @climagic (a great account to follow if you want to find awesome command line stuff). In this post we are going to break it down and explain how it works. What is a palindrome Palindrome is…
16 May 2019
Suppose you have a text file and you need to remove all of its duplicate lines. TL;DR To remove the duplicate lines preserving their order in the file use: awk '!visited[$0]++' your_file > deduplicated_file How it works The script keeps an associative array with indices equal to the unique lines of the file and values equal to their occurrences. For…
2 May 2019
In this post we are going to manage nested objects of a document indexed with Elasticsearch. The nested type is a specialised version of the object datatype that allows arrays of objects to be indexed in a way that they can be queried independently of each other. – Nested datatype - Official Elasticsearch reference Prerequisites To follow this post you…
10 Apr 2019
I use the terminal a lot and in my day to day work I tend to navigate to the same bunch of directories. There are some awesome tools out there (like autojump or z) but sometimes, especially when the directories are similarly named, there is a need to be explicit to navigate to the proper one. I decided to write…