Skip to content

Instantly share code, notes, and snippets.

apt update && apt install python-pip -y && pip install shadowsocks
cat << EOF > /etc/shadowsocks/ss.json
{
"server": "0.0.0.0",
"server_port": "1080",
"password":"changeme",
"timeout": 300,
"method":"aes-256-cfb"
"mode": "tcp_only",
@gardner
gardner / lieange_build.sh
Created November 4, 2019 04:30
build lineageos
#!/bin/bash
apt-get update && apt-get install aria2 wget bc bison build-essential ccache \
curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev \
lib32readline-dev lib32z1-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev \
libwxgtk3.0-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools \
xsltproc zip zlib1g-dev -y
mkdir -p ~/bin ~/android/system
aria2c -x8 -o bin/repo https://storage.googleapis.com/git-repo-downloads/repo && chmod a+x ~/bin/repo
@gardner
gardner / dc.sh
Created October 17, 2019 01:27
docker-compose command
#!/bin/bash
FILE='';
for f in *.yml; do
FILES="$FILES -f $f"
done
if [ ! -e .last-pull ]; then
touch .last-pull
@gardner
gardner / mk_aria2_conf.sh
Created October 8, 2019 22:35
Write sane defaults to aria2 config file
mkdir -p ~/.aria2
cat << EOF > ~/.aria2/aria2.conf
continue=true
max-connection-per-server=5
min-split-size=5M
EOF
chmod 0600 ~/.aria2/aria2.conf
apt-get update && \
apt-get install linux-headers-$(uname --kernel-release) && \
apt-get update && \
apt-get install wireguard -y && \
modprobe wireguard
mkdir -p /etc/wireguard/keys && \
cd /etc/wireguard/keys && \
umask 077 && \
wg genkey | tee privatekey | wg pubkey > publickey
apt-get update && \
apt-get install linux-headers-$(uname --kernel-release) && \
apt-get update && \
apt-get install wireguard -y && \
modprobe wireguard
mkdir -p /etc/wireguard/keys && \
cd /etc/wireguard/keys && \
umask 077 && \
wg genkey | tee privatekey | wg pubkey > publickey
@gardner
gardner / register_domain_name.sh
Last active March 1, 2022 13:28
Wait for a domain name to become available and then register it
#!/bin/bash
# Install the aws cli: https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html
# Then configure the cli: https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html
while : ; do
aws --region us-east-1 route53domains check-domain-availability --domain-name domain.com | grep UNAVAILABLE
if [ $? -ne 0 ]; then
aws --region us-east-1 route53domains register-domain --cli-input-json '{"DomainName":"domain.com","DurationInYears":1,"AutoRenew":true,"AdminContact":{"FirstName":"Gardner","LastName":"Bickford","ContactType":"PERSON","AddressLine1":"123 Main St","AddressLine2":"","City":"Boulder","State":"CO","CountryCode":"US","ZipCode":"80301","PhoneNumber":"+1.5555555","Email":"webmaster@spunts.net"},"RegistrantContact":{"FirstName":"Gardner","LastName":"Bickford","ContactType":"PERSON","AddressLine1":"123 Main St","AddressLine2":"","City":"Boulder","State":"CO","CountryCode":"US","ZipCode":"80301","PhoneNumber":"+1.5555555","Email":"webmaster@spunts.net"},"TechContact"
{
"gitlens.codeLens.enabled": false,
"breadcrumbs.enabled": true,
"prettier.eslintIntegration": true,
"eslint.autoFixOnSave": true
}
@gardner
gardner / runme.sh
Created April 20, 2018 00:00
Ubuntu Keybindings for Developers used to macOS
gsettings set org.gnome.desktop.wm.keybindings switch-applications "[]"
gsettings set org.gnome.desktop.wm.keybindings switch-applications-backward "[]"
gsettings set org.gnome.desktop.wm.keybindings switch-windows "['<Alt>Tab', '<Super>Tab']"
gsettings set org.gnome.desktop.wm.keybindings switch-windows-backward "['<Alt><Shift>Tab', '<Super><Shift>Tab']"

Keybase proof

I hereby claim:

  • I am gardner on github.
  • I am gbickford (https://keybase.io/gbickford) on keybase.
  • I have a public key ASC1xdWdbMj5Wox1M_C7kCEXZ9m8XkVcRsTLRAyh7585cgo

To claim this, I am signing this object: