Command line tools

How to connect to remote MySQL using SSH tunnel

During local development, you may need to test something against your production or remote databases. There are a couple of things you can do to achieve this.

How to reload ZSH configuration

I've been using Zsh with Oh-My-Zsh for a long time. All MacOS users have the Zsh (Z shell) installed and configured by default. 

My Zsh configuration changes very rarely, but when it does, I need to restart my shell in order for my changes to take effect. Since I'm using tmux I can open a new window (which loads a new Zsh instance), but most of the time, I prefer to reload the current window.

To reload your Zsh (Z shell) .zshrc configuration, you can use the following command

$ exec zsh

How to modify image EXIF metadata - Date Created / Date Modified [Command line tool]

To modify image EXIF metadata - Date Created / Date Modified you can use ExifTool with the following command:

exiftool -AllDates='2021:11:11 13:25:23' my_image.jpg

Where 2021:11:11 13:25:23 is the desired date and my_image.jpg is the filename of the image.

Note that this is a command line tool that has no graphical interface.

Full Exiftool installation guide

You can find step by step tutorial below.

How to get all indices in ElasticSearch with curl command?

To get all indices in ElasticSearch with curl, you can use the following command:

$ curl localhost:9200/_cat/indices

which outputs

$ curl localhost:9200/_cat/indices
yellow open test-index-yoan                 5ChC9F9ZSGSRmooDAIrd9A 1 1 0  0   208b   208b
yellow open my-index-000001                 Be3surqXQzy8_EVW9k1VZA 1 1 0  0   208b   208b

How to install wrk on Ubuntu

To install wrk on Ubuntu, you need to run:

sudo apt-get update
sudo apt-get install wrk

Rclone sync vs copy - What are the differences?

Both sync and copy commands copy files from source to destination, but with one significant difference - sync will delete files from the destination that are not existent on the source.

Let's look at some examples to understand the differences better.

Phpactor vs Intelephense [Feature comparison]

PHPactor and Intelephense are both PHP language servers used to enhance PHP development within integrated development environments (IDEs) or text editors. They provide features like code completion, code navigation, and static analysis to make PHP development more efficient.

The best NeoVim/Vim PHP autocomplete plugin by far

Ever since I started using VIM/NeoVim as my primary IDE for PHP development, I felt the need for better autocomplete, with methods, namespaces, go-to definitions and all the good stuff that big IDE's autocomplete systems like PHPStorm already have. Many times, I've tried and searched for a good php autocomplete plugin, but I've never managed to find one.