A bash script to keep two git branch identical.

#!/bin/bash

git push
currentbranch=`git branch --show-current`
if [ "${currentbranch}" == "local" ]; then
   git checkout develop
   git merge local
   git push
elif [ "${currentbranch}" == "develop" ]; then
   git checkout local
   git merge develop
   git push
fi
git checkout $currentbranch

Don't ask why I wrote this foolish script. I have to do it 😀

Using the cookie feature in Insomnia Core

It took me more than an hour to understand how to use cookies when you are sending a request to the API server.

The most important thing is that you only need to correctly add the cookies, then the cookies will be automatically sent to the API server. Don't try to add a cookie item at the headers' configuration part!

vim 命令模式粘贴寄存器中复制好的内容:先Ctrl+R,再输入寄存器名字。默认寄存器名字是 "

vim 命令模式粘贴寄存器中复制好的内容:先Ctrl+R,再输入寄存器名字。默认寄存器名字是 "

Attention: the first definition is used when you have more than one same host label in your .ssh/config file

I originally thought the later should be used. I was wrong.

Bash script for checking telnet service status


cat monitor.sh 
#!/bin/bash
source /etc/profile
cd /home/koala/Vagrant/windows-server-2019
(echo > /dev/tcp/192.168.178.220/23) > /dev/null 2>&1
if [ $? -ne 0 ]; then
  vagrant halt
  vagrant up
fi