Skip to content

Instantly share code, notes, and snippets.

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 sudo install minikube-linux-amd64 /usr/local/bin/minikube
document.body.style.backgroundColor = "red";
@sckn
sckn / test
Last active November 6, 2021 14:38
document.body.style.backgroundColor = "red";
//document.getElementsByClassName("tyj39b-5")[0].click();
kubectl get ns | grep Terminating|cut -d " " -f 1|while read NSNAME; do echo $NSNAME;kubectl get namespace $NSNAME -o json|jq ".spec.finalizers = []"|kubectl replace --raw "/api/v1/namespaces/$NSNAME/finalize" -f -;done
@sckn
sckn / cgw
Created May 1, 2017 20:00
Change gateway
#!/bin/bash
# vim /usr/local/bin/cgw
# chmod +x /usr/local/bin/cgw
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I|grep My_Home_SSID >/dev/null || exit 0
route delete default
route add default 10.1.1.40
networksetup -setdnsservers Wi-Fi 10.1.1.40
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" \
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>networkchange</string>
<key>LowPriorityIO</key>
<true/>
<key>ProgramArguments</key>
#!/bin/bash
echo -e "{\"id\":1,\"method\":\"$1\",\"params\":[$2]}\r\n" |nc 192.168.1.36 55443
# ./yeelight.sh set_power \"on\"
# ./yeelight.sh set_power \"off\"
# ./yeelight.sh set_bright 1
# ./yeelight.sh set_bright 100
xorriso -as mkisofs -r -J -joliet-long -l -cache-inodes \
-isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -partition_offset 16 -A \
"Debian CustomNetInstall" -b isolinux/isolinux.bin -c isolinux/boot.cat \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-o ~/workspace/netinstall/debian-custom-8.2.0-amd64-netinst.iso ~/workspace/netinstall/cd
### Localization
d-i debian-installer/language string en
d-i debian-installer/country string US
d-i debian-installer/locale string en_US.UTF-8
# Keyboard selection.
d-i console-keymaps-at/keymap select us
d-i keyboard-configuration/xkb-keymap select us
### Network configuration
function scknorg_checkmp4(filename){
regex = filename.match(/(.*?).mp4/g);
if(regex){
return true;
}
return false;
}