I often need to open a specific file in a deeply nested folders project. ZSH globbing does help but I wanted to have something faster.

Most of the time I already know the exact name of the file I want to open with my favorite editor $EDITOR . The only thing I need to do is to find the first matching file in my current tree that matches the filename I want to edit.

Here’s a quick look of how my solution works.

Image for post
Image for post

Below the snippet to make it work. Simply paste it into your .bashrc/.zshrc file.

Enjoy! 🎉

UPDATE: I've also made an autocomplete function that works with zsh.

Here is how it looks like:

Image for post
Image for post
Simple example for matching two files or a single file with autocomplete on

Simply paste the following code in .oh-my-zsh/custom/vs.zsh


In this story I will walk you through a PostgreSQL master/slave cluster using repmgr. It also uses repmgrd for an automatic failover mechanism.

Image for post
Image for post

Vagrant for local testing

In order to test all the commands with two local machines I am using Vagrant. However, you can also use your own public / private cloud servers.

Create a Vagrantfile and run vagrant up

Create two servers

Configure DNS / Hosts

First you should configure either a private DNS server for example Route53 if you are on AWS or you can just modify your hosts file.

For this demo, the IP addresses used are

  • 10.0.15.21 for server1 (master node)
  • 10.0.15.22 for server2 (standby…


I mainly use Github for all my projects. When working with a team, I have a specific git flow which is composed of two protected branches:

  • master main branch (production)
  • dev always ready to be pushed to master, thus to production

I can as well setup continuous integration with services like Travis or CircleCI to ensure that my code is always working in a neutral environment.

Now that I have my two protected branches, if I want to work on a specific a branch I have to create a new branch from dev, implement all the needed features and then make a pull request. …

About

Victor Boissiere

DevOps engineer & SRE

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store