Skip to content

Instantly share code, notes, and snippets.


Zulhilmi Zainudin zulhfreelancer

View GitHub Profile
zulhfreelancer /
Last active Mar 23, 2021
Regex to find WIP Golang function comments in VS Code
View global-snippets.code-snippets
// Useful tool:
"Go Test": {
"prefix": "test",
"body": [
"func Test(t *testing.T) {",
" //$1",
zulhfreelancer /
Last active Mar 9, 2021
Delete all GitHub Actions runs
# ===========================================================================
# Requirements
# * gh CLI: (make sure you are logged-in to the CLI)
# * jq CLI:
# ===========================================================================
export TARGET_USER=github_user_or_org
export TARGET_REPO=github_repo_name
while :
zulhfreelancer /
Created Feb 26, 2021
Download latest GitHub release and place it inside its own folder (using GitHub CLI)
# Requirements:
# * GitHub CLI -
# ---
# Notes:
# This script will create a new folder based on the release name e.g.
# v0.0.1 and place the release contents inside it. In this script,
# I'm just interested with YAML files - that's why I have the --pattern
# flags. Feel free to remove it if you want to download everything from the release.
zulhfreelancer /
Created Feb 5, 2021
How to use (ephemeral Docker image registry) //
UUID=$(uuidgen | awk '{print tolower($0)}') // generate UUID like "2e98d62e-a9e9-4397-a783-86458972fecc"${UUID}:1h // generate full image path like ""
docker build -t ${IMG} .
docker push ${IMG}
zulhfreelancer /
Last active Feb 15, 2021
How to run "kubectl apply -f" with inline YAML as stdin?
$ kubectl apply -f - <<EOF
<-- insert YAML content here -->


$ cat file.yaml | kubectl apply -f -
zulhfreelancer /
Last active Jan 14, 2021
How to prepend ZSH prompt with text and background color?

How to prepend ZSH prompt with text and background color?


  1. Open your Oh My ZSH theme file i.e. $ nano ~/.oh-my-zsh/themes/maran.zsh-theme

  2. Add the following code in the PROMPT variable:

zulhfreelancer /
Created Nov 23, 2020
How to generate a SSH key fingerprint that matched with AWS keypair's fingerprint?
$ ssh-keygen -f ~/.ssh/ -e -m PKCS8 | openssl pkey -pubin -outform DER | openssl md5 -c
zulhfreelancer / .zshrc-docker-machine
Last active Oct 29, 2020
Docker Machine — bash function to start Docker Engine (daemon) in VirtualBox and sets environment variables for Docker Client (running on host)
View .zshrc-docker-machine
# If Docker Engine in Virtualbox is running, set Docker client environment variables
if [ "$(docker-machine status default)" = "Running" ]
eval $(docker-machine env)
# Start Docker Engine function
docker-engine-start () { # <-- if that's too long, you can go with just `des`
echo "================================"
echo "Starting Docker Machine..."