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 | |
# Set hidden service directory | |
# | |
hsdir=/var/lib/tor/sshd | |
# Add hidden service config to /etc/tor/torrc | |
# | |
cat >> /tmp/test << __TOR_CONFIG__ | |
HiddenServiceDir $hsdir |
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
## /etc/apt/apt.conf.d/02proxy | |
# You can add this line for faster failover | |
Acquire::Retries 0; | |
# Make sure you use the full path | |
Acquire::http::Proxy-Auto-Detect "/usr/bin/apt-proxy-detect.sh"; |
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 | |
# Hightlights arguments from piped in text | |
cat - | grep --color=auto -E -i "^|$(echo "$*" | sed 's/ /|/g')" |
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
# Set up some logging. VERY useful to see why things aren't working. | |
logger_syslog=-1 | |
logger_syslog_level=2 | |
logger_stdout=-1 | |
logger_stdout_level=2 | |
# Which interface to use and which bridge to join | |
interface=wlan0 | |
bridge=br0 |
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 | |
apt-get update &>/dev/null | |
if [[ "$(lsmod | grep wireguard)" -n ]]; then | |
export HAS_WG_MODULE=1 | |
else | |
apt-get install wireguard wireguard-tools -y &>/dev/null | |
modprobe wireguard | |
fi |
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 | |
iptables -A INPUT -p tcp -m multiport --dports 80,443 -s $(curl -sSL --tlsv1.2 'https://www.cloudflare.com/ips-v4' | xargs | sed 's/ /,/g') -j ACCEPT | |
iptables -A INPUT -p tcp -m multiport --dports 80,443 -j REJECT --reject-with tcp-reset | |
ip6tables -A INPUT -p tcp -m multiport --dports 80,443 -s $(curl -sSL --tlsv1.2 'https://www.cloudflare.com/ips-v6' | xargs | sed 's/ /,/g') -j ACCEPT | |
ip6tables -A INPUT -p tcp -m multiport --dports 80,443 -j REJECT --reject-with tcp-reset |
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
# Adapted from https://blog.simos.info/how-to-easily-run-graphics-accelerated-gui-apps-in-lxd-containers-on-your-ubuntu-desktop/ | |
# | |
config: | |
environment.DISPLAY: :0 | |
raw.idmap: both 1000 1000 | |
user.user-data: | | |
#cloud-config | |
runcmd: | |
- 'sed -i "s/; enable-shm = yes/enable-shm = no/g" /etc/pulse/client.conf' | |
- 'echo export PULSE_SERVER=unix:/tmp/.pulse-native | tee --append /home/ubuntu/.profile' |
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 | |
# Shell script to bootstrap Bootstrap... | |
# JS Extra files w/ integrity hashes | |
JQ_URL="https://code.jquery.com/jquery-3.2.1.slim.min.js" | |
JQ_SHA384="KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" | |
POP_URL="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" | |
POP_SHA384="ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" |
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 | |
# This is a simple bash function to change strings (of arbitrary length) into integers (of arbitrary maximums). | |
# I use this to convert my "user@hostname" to a number between 1-255 and use that as a persistent color for the | |
# termnal prompt to remind me what box/user I am on. | |
# | |
# It just hashes whatever string you give it, converts the hex to a decimal and then mods around whatever your max int is. | |
# Usage: str_to_int [string_to_convert] [max_int_size] | |
# Example: str_to_int "user@hostname" 255 | |
# |
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
error_reporting = E_ALL | |
display_errors = On | |
display_startup_errors = On | |
log_errors = On | |
track_errors = On | |
html_errors = On | |
error_prepend_string = "<span style='color: #ff0000'>" | |
error_append_string = "</span>" |