Skip to content

Instantly share code, notes, and snippets.

View 111a5ab1's full-sized avatar

Wasabi ワサビ /°\  111a5ab1

View GitHub Profile
@111a5ab1
111a5ab1 / keybase.md
Created July 27, 2017 01:06
Keybase.io verification

Keybase proof

I hereby claim:

  • I am 111a5ab1 on github.
  • I am wasabi (https://keybase.io/wasabi) on keybase.
  • I have a public key ASA3vrB6Vn0qEXbd0MQW_ssVgsQ2gLJKInBdwPbQQmCs9Qo

To claim this, I am signing this object:

@111a5ab1
111a5ab1 / edgeos_cli_firewall_group_martians
Last active July 3, 2018 15:11
EdgeOS CLI: "Martian" packet firewall groups
delete firewall group address-group martians-v4-adr
delete firewall group network-group martians-v4-net
delete firewall group ipv6-address-group martians-v6-adr
delete firewall group ipv6-network-group martians-v6-net
delete firewall group ipv6-network-group martians6to4-v6-net
delete firewall group ipv6-network-group martiansTeredo-v6-net
set firewall group address-group martians-v4-adr description "IPv4 addresses reserved for special-use by IANA that should never appear on the public Internet"
set firewall group address-group martians-v4-adr address 255.255.255.255
set firewall group network-group martians-v4-net description "IPv4 networks reserved for special-use by IANA that should never appear on the public Internet"
@111a5ab1
111a5ab1 / EdgeOS_node.def
Created January 17, 2018 10:04
To view what an EdgeOS option does, such as "firewall all-ping enable", cat the coresponding node.def file.
root@ubnt:~# cd /opt/vyatta/share/vyatta-cfg/templates/firewall/all-ping
root@ubnt:/opt/vyatta/share/vyatta-cfg/templates/firewall/all-ping# cat node.def
# icmp_echo_ignore_all
# default value - 0
# If set non-zero, then kernel will ignore all ICMP ECHO requests sent to it
type: txt
help: Policy for handling of all IPv4 ICMP echo requests
@111a5ab1
111a5ab1 / edgeos_cli_mss_wireguard
Last active December 2, 2021 23:28
EdgeOS CLI: TCP MSS clamping to resolve PMTUD black holes (RFC2923) when using Wireguard
set firewall options mss-clamp interface-type all
set firewall options mss-clamp mss 1380
set firewall options mss-clamp6 interface-type all
set firewall options mss-clamp6 mss 1360
@111a5ab1
111a5ab1 / ubnt_check_latest_usg_firmware.sh
Last active February 3, 2018 09:05
Query latest Ubiquiti USG firmware from command-line (depends: curl + jq)
#!/bin/bash
# Will output the latest firmware version and download URL for the Ubuqiti USG
# Depends on curl (https://curl.haxx.se/) and jq (https://stedolan.github.io/jq/)
curl -s 'https://www.ubnt.com/download/?group=usg' -H 'x-requested-with: XMLHttpRequest' | ./jq-osx-amd64 -c '[ .downloads[] | select(.category__slug=="firmware")] | max_by(.version) | {Version: .version, File: @text "https://dl.ubnt.com\(.file_path)" }'
@111a5ab1
111a5ab1 / git.md
Last active April 4, 2018 10:33
git command-line cheatsheet

View changes between HEAD and previous commit:

git diff HEAD^ HEAD

View changes between HEAD and <commit_id>:

git diff 0232ea938e607942e3e477e4a72e5e7fbf3dc496 HEAD
@111a5ab1
111a5ab1 / tmux.md
Last active June 29, 2019 11:03
tmux cheatsheet
@111a5ab1
111a5ab1 / i3-trackpad-notes
Created June 15, 2019 02:02
Macbook Pro trackpad configuration on i3 via xinput/libinput
# List all the input devices
xinput --list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Broadcom Corp. Bluetooth USB Host Controller id=11 [slave pointer (2)]
⎜ ↳ bcm5974 id=13 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
@111a5ab1
111a5ab1 / github-create-repo
Last active July 4, 2019 02:40
Create Github repo via command-line
#!/usr/bin/env bash
set -e
#-----------------------------------------------
# REPOSITORY
# Define GitHub repository details
#-----------------------------------------------
readonly USER="111A5AB1"
readonly REPOSITORY_NAME="terraform-gitlab-repos"
@111a5ab1
111a5ab1 / awsAccessKeysCSVToCredentials.sh
Last active December 2, 2019 23:45
One liner to create an AWS CLI "credentials" file from a downloaded accessKeys.csv
while IFS=, read -r id secret; do echo -e "[default]\naws_access_key_id = $id\naws_secret_access_key = $secret" > credentials; done <<< $(tail -n1 accessKeys.csv)