This file contains hidden or 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 bash | |
# included shebang for completeness but likely you'd wanna tack this onto a profile or bashrc, something that gets sourced by your shell | |
function isDir() { | |
if [ -d "$1" ]; then return 0; else | |
echo "$1 is not a directory, bail" | |
return 1 | |
fi | |
} | |
This file contains hidden or 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
# pretty version | |
# | |
##!/bin/bash | |
# | |
## optional | |
#apt-get update | |
#apt-get -y full-upgrade | |
# | |
## pre-deps | |
#apt-get -y install git curl wget ca-certificates curl gnupg lsb-release |
This file contains hidden or 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 bash | |
_port=${LXD_PORT:-"8443"} | |
_fqdn=${LXD_FQDN:-"ebaumsworld.com"} | |
set -e | |
function req { | |
go version || return 1 | |
git version || return 1 | |
ssh -V || return 1 | |
} | |
function ensure_path { |
This file contains hidden or 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
while :; do data="$(sensors | grep Tctl | awk '{print $2}' | tr -d '+' | awk -F '.' '{print $1}')"; case $data in 4[0-9]) col="blue" ;; 5[0-9]) col="green" ;; 5[0-9]) col="green" ;; 6[0-9]) col="yellow" ;; 7[0-9]) col="red" ;; 8[0-9]) col="red" ;; 9[0-9]) col="red" ;; *) col="white" ;; esac ; out="$(echo "$data°C" | toilet -f fig.mono12 | colorize $col/black --attr bold)"; clear; echo "$out"; sleep 0.5; done |
This file contains hidden or 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 ( | |
"os" | |
"strconv" | |
"golang.org/x/sys/unix" | |
) | |
func getBaudRate(name string) (int, error) { |
This file contains hidden or 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
{ | |
"name": "GitHub Go Search", | |
"description": "Add Golang GitHub results to your search engines", | |
"version": "0.1", | |
"manifest_version": 2, | |
"icons": { | |
"20": "icon.svg", | |
"48": "icon.svg", | |
"96": "icon.svg" |
This file contains hidden or 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 bash | |
_IF=$1 | |
# note that if you have different masks i'm bad at bash and this is only removing '/24' atm | |
/bin/ip --brief a | grep "$_IF" | sed 's|/24||g' | awk -F 'P' '{print $NF}' | sed 's| |\n|g' | grep \. | sort | while read line; do | |
echo -e "-A INPUT -i $_IF -s $line -j LOG --log-prefix '[$line SPOOF DROP] '\n-A INPUT -i $_IF -s $line -j DROP"; | |
done |
This file contains hidden or 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 bash | |
# further development here: https://git.tcp.direct/tcp.direct/proxmox-scripts | |
_ignore=("tcp.ac") | |
get-targets() { | |
cat /etc/hosts | awk '{print $NF}' | grep -v localhost | grep -v "$(uname -n | awk -F '.' '{print $1}')" | /bin/grep "[a-z]" | |
} |
This file contains hidden or 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/sh | |
ipt="iptables -w" | |
ip6t="ip6tables -w" | |
dedup() { | |
iptables-save | sed -n "/$1/,/COMMIT/p" | grep "^-" | sort | uniq -dc | while read l | |
do | |
c=$(echo "$l" | sed "s|^[ ]*\([0-9]*\).*$|\1|") | |
rule=$(echo "$l" | sed "s|^[ ]*[0-9]* -A\(.*\)$|-t $1 -D\1|") |
This file contains hidden or 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 bash | |
_TEMPLATE="nmap -p [v] [k] -oX [k].xml" | |
_KVSEP=':' | |
# - - - - - - - - - - - - - - - - - - - - - - - | |
# example usage: | |
# | |
# _TEMPLATE="nmap -p [v] [k] -oX [k].xml" | |
# |