cURL snippets

Send a POST request curl -X POST -d @data.txt @ is necessary. Enable redirecting curl -L Ignore TLS certificate error in cURL Frequently used in test environment. curl --insecure # or curl -k Download a content which includes redirect curl -L --output myfilename IPv6 Force curl to DNS as IPv6. curl -6 # From man # -6, --ipv6 Resolve names to IPv6 addresses Show header only curl -sS -I https://youdomain.

SSH snippets

Local Port forwarding ssh -L SSH portforwarding in backgraound ssh -fNT -L 8888:localhost:8888 official mannual -f: Requests ssh to go to background just before command execution. -N: Do not execute a remote command. This is useful for just forwarding ports (protocol version 2 only). -T: Disable pseudo-tty allocation. Config file Host User git Port 22 Hostname IdentityFile ~/.ssh/id_ecdsa TCPKeepAlive yes IdentitiesOnly yes Host myserver*.com User atlex00 Host gcp User atlex00 Hostname 192.

Linux CLI snippets

for loop of all files in a directory The following snippet shows all files in Loop_dir. Loop_dir="path_to_dir" for entry in "$Loop_dir"/* do echo "$entry" done cf) Check argument is set or not process tree ps -aef —forest Find from all files in the directory Find all lines from files in the current directory find ./ -type f -print | xargs grep 'foo' I created my custom alias. alias afind="find -type f -print | xargs grep" Delete prefix of files in a directory Here is a pioneer.


/etc/modules Here are the list of modules that Kernel load at boot. logrotate Good tool. OpenProject Using docker image docker run -d -p 8080:80 -e SECRET_KEY_BASE=secret openproject/community:latest Docker or LXD -> not so good for me -> comprehensive and this is what I want. Compare 2 directories diff -qr dir1/ dir2 Wildcard server auth TLS certificate The wildcard * can’t indicate sub-subdirectory such as Vim - centerning the cursor aloways http://vimdoc.

Snippets of Git

Completely delete submodule from the repository Here is the graceful memo. I copy&paste it to here. To remove a submodule you need to: Delete the relevant section from the .gitmodules file. Stage the .gitmodules changes git add .gitmodules Delete the relevant section from .git/config. Run git rm –cached path_to_submodule (no trailing slash). Run rm -rf .git/modules/path_to_submodule (no trailing slash). Commit git commit -m “Removed submodule ” Delete the now untracked submodule files rm -rf path_to_submodule Do you forgot to clone with --recursive ?