- Create
config.gateway.json
to configure USG - Create
config.properties
to configure switch / AP / etc... - Place
config.gateway.json
andconfig.properties
indata/sites/default
- Restart controller (maybe?)
- Reprovision all devices
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
# This script checks out the latest chromium and builds the headless | |
# version of it. When the chromium source is already present, the | |
# repository is updated. | |
# | |
# A .tar.gz is created in $DIR containing the headless_shell binary, | |
# this binary runs chromium. The resulting binary should be quite | |
# portable given that the (few) dependencies are installed on the target | |
# machine. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# brew-go-get | |
# Original: https://blog.filippo.io/cleaning-up-my-gopath-with-homebrew/ | |
set -euo pipefail | |
name_to_repo() { | |
local name="$1" | |
name="${name/go-get-}" | |
echo "${name//--//}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
if (( ! ${#@} )); then | |
print "Convert mp3 to m4r (Apple Tone)" | |
print "Usage: $0 file1.mp3 file2.mp3" | |
exit 1 | |
fi | |
tmpdir=$(mktemp -d) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Creates remarkable_backup-(date).tar.gz with todays date, backs up /home/root. | |
( | |
ssh root@10.11.99.1 'tar cf - .' \ | |
| gzip >remarkable_backup-$(date '+%Y-%m-%d').tar.gz | |
) 2 >err.log | |
cat err.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){window.location='https://translate.google.com/translate?sl=auto&tl=en&js=y&prev=_t&hl=en&ie=UTF-8&edit-text=&u='+encodeURIComponent(window.location.href)})();void(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"net/http" | |
"time" | |
"github.com/mafredri/cdp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This example gives permission to access geolocation | |
// and fetches the current position via JavaScript. | |
// Tested on: cdp v0.18.7 and Chrome Canary 70.0.3532.0, | |
// and seems to work in both headless and headfull mode. | |
package main | |
import ( | |
"context" | |
"fmt" | |
"log" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
# gpg-yubikey-sign | |
# | |
# This script lets you use any of your unexpired subkeys connected to | |
# your public key (0xDEADBEEFCAFEBAAD) to sign git commits. It will also | |
# display "Waiting for YubiKey touch..." to remind you that an action is | |
# required. | |
# | |
# Add this script to your PATH and configure git to use it for gpg | |
# signing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env expect -f | |
# Description: Expect script to automate WireGuard upgrade on UniFi Security Gateway | |
# Author: Mathias Fredriksson <mafredri@gmail.com> | |
# This script assumes non-interactive ssh login. | |
# Usage upgrade.expect <[user@]usg> <https://github.com/Lochnair/vyatta-wireguard/releases/download/${RELEASE}/wireguard-${BOARD}-${RELEASE}.deb> | |
set timeout 60 |