Skip to content

Instantly share code, notes, and snippets.

View sapjunior's full-sized avatar
🙄
crazy

Thananop Kobchaisawat sapjunior

🙄
crazy
View GitHub Profile
@sapjunior
sapjunior / idle-shutdown.sh
Created January 13, 2020 05:29 — forked from JustinShenk/idle-shutdown.sh
Google Cloud Platform (GCP) instance idle shutdown
#!/bin/bash
# Add to instance metadata with `gcloud compute instances add-metadata \
# instance-name --metadata-from-file startup-script=idle-shutdown.sh` and reboot
# NOTE: requires `bc`, eg, sudo apt-get install bc
# Modified from https://stackoverflow.com/questions/30556920/how-can-i-automatically-kill-idle-gce-instances-based-on-cpu-usage
threshold=0.1
count=0
wait_minutes=60
while true
@sapjunior
sapjunior / set-access-point.sh
Created March 27, 2019 13:08 — forked from archy-bold/set-access-point.sh
Script to find the access points for the given network SSID and set the BSSID for that network to the MAC of the access point with the highest strength
#!/bin/bash
# Usage: ./set-access-points.sh [network SSID] [network interface id = wlan0]
# Read in the arguements
ssid=$1;
interface=$2;
# SSID is required
if [ -z "$ssid" ]; then