Skip to content

Instantly share code, notes, and snippets.

View stephonchen's full-sized avatar

Stephon, Bo-Tsung Chen stephonchen

View GitHub Profile
@stephonchen
stephonchen / Deploy_Oracle_Linux_in_GCE.md
Last active July 15, 2024 10:50
Deploy Oracle Linux in GCE
  • Install Oracle Linux in VirtualBox

  • Before shutdown, be aware to do these things

    • Edit /etc/default/grub
      • Remove splash & quiet & rhgb
      • Add console=ttyS0,38400n8d
    • Update grub
      sudo grub2-mkconfig -o /boot/grub2/grub.cfg
      
@stephonchen
stephonchen / Raspberry Pi 4 with Raspbian access without connection to micro-HDMI.md
Last active December 20, 2019 03:11
Raspberry Pi 4 with Raspbian access without connection to micro-HDMI
  • Write Raspbian image to SD card
  • Enable SSH access by Putting 'ssh' to boot directory
touch /Volumes/boot/ssh
  • Configure network by using
    • Wire (with DHCP support)
    • WiFi (/Volumes/boot/wpa_supplicant.conf), and sample

country=TW

kubectl get namespace annoying-namespace-to-delete -o json > tmp.json
# Edit tmp.json, and remove contents in finalizers with empty array []
curl -k -H "Content-Type: application/json" -X PUT --data-binary @tmp.json https://kubernetes-cluster-ip/api/v1/namespaces/annoying-namespace-to-delete/finalize
@stephonchen
stephonchen / puppeteer-tor.js
Last active November 28, 2023 23:32
puppeteer + tor + polipo
#!/usr/bin/node
// use puppeteer 0.12.0
// since puppeteer has problems in socks5
// use polipo as a http proxy, which parent proxy is tor (localhost:9050)
var time = require('time');
var sleep = require('sleep');
const random_max = 10;
@stephonchen
stephonchen / reset-sound-balance
Created January 9, 2018 08:09
Reset sound balance through CLI, using OSAScript
#!/usr/bin/osascript
(* Set Volume to 100 *)
set volume 100
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.sound"
reveal (first anchor of current pane whose name is "output")
end tell
tell application "System Events"
launch
@stephonchen
stephonchen / gist:5159103
Created March 14, 2013 05:44
Juniper switch config
Uplink
set interfaces ge-0/0/0 unit 0 family ethernet-switching