Skip to content

Instantly share code, notes, and snippets.

View DanielChuDC's full-sized avatar
🎯
Focusing

danielchu DanielChuDC

🎯
Focusing
  • singapore
View GitHub Profile
@DanielChuDC
DanielChuDC / lvm.sh
Created May 10, 2020 01:38 — forked from jchodakowski/lvm.sh
Complex filesystem shell script
#!/bin/sh
case "$1" in
# update the file 'partman-base.postinst' with our filesystem "installer"
installer)
#sed -i 's/partman/\/tmp\/lvm.sh partman/' /var/lib/dpkg/info/partman-base.postinst
sed -i 's/partman/\/tmp\/lvm.sh destroy; \/tmp\/lvm.sh partman/' /var/lib/dpkg/info/partman-base.postinst
logger -t lvm.sh modified partman-base.postinst
;;
@DanielChuDC
DanielChuDC / .bash_aliases
Created May 4, 2020 14:58 — forked from vratiu/.bash_aliases
Git shell coloring
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset
@DanielChuDC
DanielChuDC / VMwareFusion_Export_ovf.txt
Created March 28, 2020 03:48 — forked from xl7dev/VMwareFusion_Export_ovf.txt
HowTo Export a VM in OVA format in VMware Fusion for OS X
> cd /Applications/VMware Fusion.app/Contents/Library/VMware OVF Tool
> ./ovftool --acceptAllEulas /Users/marco/Documents/Virtual\ Machines.localized/Windows\ 8.1\ x64.vmwarevm/Windows\ 8.1\ x64.vmx /Users/marco/Desktop/Win81.ova
@DanielChuDC
DanielChuDC / vagrant virtualbox vm to vmwarefusion.md
Created March 27, 2020 07:54 — forked from biophonc/vagrant virtualbox vm to vmwarefusion.md
Migrate Vagrant VirtualBox VM to VMware Fusion

Migrate Vagrant VirtualBox VM to VMware Fusion

Notes:

  • Unfortunately the process is not as simple as I'd have expected it, that's why I wrote this little step-by-step instruction.
  • My setup is/was:
    • OSX 10.9.4
    • VirtualBox 4.3.12
    • VMware Fusion 6.0.4
    • OS as VM to migrate: Ubuntu 10.04.4 LTS
@DanielChuDC
DanielChuDC / update-golang.md
Created March 20, 2020 02:40 — forked from nikhita/update-golang.md
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by:

@DanielChuDC
DanielChuDC / reregister-qemu-binfmt.sh
Created March 13, 2020 11:18 — forked from ArturKlauser/reregister-qemu-binfmt.sh
Building Multi-Architecture Docker Images With Buildx
#!/bin/bash
# (c) [email protected]
#
# This script tries to reregister QEMU's binfmt_misc handlers with the
# fix-binary (F) flag in order to be usable with 'docker buildx' to build
# multi-architecture images.
# For more information see:
# https://nexus.eddiesinentropy.net/2020/01/12/Building-Multi-architecture-Docker-Images-With-Buildx/
function remove_binfmt() {
@DanielChuDC
DanielChuDC / check-qemu-binfmt.sh
Created March 13, 2020 11:16 — forked from ArturKlauser/check-qemu-binfmt.sh
Building Multi-Architecture Docker Images With Buildx
#!/bin/bash
# (c) [email protected]
#
# This script checks if all software requirements are met in a Linux environment
# in order to use 'docker buildx' to build multi-architecture images.
# For more information see:
# https://nexus.eddiesinentropy.net/2020/01/12/Building-Multi-architecture-Docker-Images-With-Buildx/
function error() {
echo "ERROR: $*"
@DanielChuDC
DanielChuDC / iterm2-solarized.md
Created February 16, 2020 12:31 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@DanielChuDC
DanielChuDC / delete-evicted-pods-all-namespaces.sh
Created February 4, 2020 23:32 — forked from svx/delete-evicted-pods-all-namespaces.sh
Delete evicted pods from all namespaces (also ImagePullBackOff and ErrImagePull)
#!/bin/sh
# based on https://gist.github.com/ipedrazas/9c622404fb41f2343a0db85b3821275d
# delete all evicted pods from all namespaces
kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
# delete all containers in ImagePullBackOff state from all namespaces
kubectl get pods --all-namespaces | grep 'ImagePullBackOff' | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
# delete all containers in ImagePullBackOff or ErrImagePull or Evicted state from all namespaces
@DanielChuDC
DanielChuDC / GIF-Screencast-OSX.md
Created January 1, 2020 15:06 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: