Skip to content

Instantly share code, notes, and snippets.


Zulhilmi Zainudin zulhfreelancer

View GitHub Profile
zulhfreelancer /
Created Oct 8, 2021
Kubernetes ephemeral pod (like `docker run --rm`)
kubectl run debug --rm -i --tty --restart=Never --image=alpine --namespace=default -- /bin/sh
zulhfreelancer /
Last active Jun 21, 2021
How to use a local Ruby gem in Rails project?


You are working on a Rails app that uses a gem named abc. This gem is hosted on RubyGems and the source code of the gem is available at

You created a new branch locally for your gem (new-feature). You wanted to modify the gem and load it directly to your local Rails app. And, you don't want to push the gem changes to GitHub and publish the gem to RubyGems just yet.

You want all the changes that you made in your local gem directory get reflected immediately in your local Rails app without requiring you to run gem build and gem install command in the gem's local directory.


zulhfreelancer / _flash.html.erb
Last active Jun 13, 2021
How to add link inside Rails flash message? Tested with Rails 6.
View _flash.html.erb
* File: app/views/shared/_flash.html.erb
* Note: the `html_safe` is important here
<% flash.each do |type, msg| %>
<div class="alert alert-info">
<%= msg.html_safe %>
<% end %>
zulhfreelancer / gps-glonass-golang.go
Last active Jun 12, 2021
Get latitude and longitude from Glonass GPS USB stick (U-blox7) using Golang
View gps-glonass-golang.go
package main
import (
func main() {
var gps *gpsd.Session
zulhfreelancer /
Last active Jul 14, 2021
How to install an older or specific version of Homebrew tap package?


When using Homebrew Tap, it's quite hard to install an older or specific version of Homebrew package.

It took me awhile to run some tests before I found the solution (see below).

If you are facing the same problem, you can use my script below to solve the problem.


zulhfreelancer /
Last active Oct 20, 2021
How to fix Multipass stuck at "Starting" state on Mac OSX?
# Step 1: see the status of VMs
$ multipass ls
Name   State          IPv4           Image
vm1    Stopped        --             Ubuntu 20.04 LTS <-- this one is OK, stopped in previous command
vm2    Starting       --             Ubuntu 20.04 LTS <-- this one is not OK, why it's stuck?

# Step 2: apply the fix
zulhfreelancer /
Created May 24, 2021
How to use `pbcopy` on Linux server when using SSH?

If you are using iTerm2 on Mac OSX and trying to have pbcopy experience when using Linux server (over SSH), try this remote-pbcopy-iterm2 tool.

zulhfreelancer /
Created Apr 26, 2021
How to use Virsh command to interact with Kubevirt VMs running in Kubernetes cluster?
$ kubectl get pods
NAME                     READY   STATUS    RESTARTS   AGE
virt-launcher-vm-4sd8h   1/1     Running   0          2d13h

$ kubectl exec -it virt-launcher-vm-4sd8h -- bash
bash-5.0# virsh list
 Id   Name         State
zulhfreelancer /
Last active Mar 23, 2021
Regex to find WIP Golang function comments in VS Code