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 | |
string=$(openssl rand -base64 15 | sed -e ':a;N;$!ba;s/\n//g' -e 's/[^a-zA-Z0-9]//g' -e "s/ //g") | |
echo ${string:0:3}-${string:3:3}-${string:6:3}-${string:9:3} |
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
<!-- Add the following lines to theme's html code right before </head> --> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script> | |
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script> | |
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script> | |
<!-- | |
Usage: just add <div class="gist">[gist URL]</div> | |
Example: <div class="gist">https://gist.github.com/1395926</div> | |
--> |
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 | |
#sudo sh -c "TERM=linux setterm -blank X >/dev/tty0" | |
# where X is number in minutes. If set to 0, screen will disable blanking. | |
# Turn the screen on and blank it again after 5 minute(s) | |
sudo sh -c "TERM=linux setterm -blank 5 >/dev/tty0" |
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
ctrl_interface=/var/run/wpa_supplicant | |
network={ | |
ssid="YOUR_NETWORK_NAME" | |
psk="YOUR_PASSWORD" | |
key_mgmt=WPA-PSK | |
} |
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 | |
echo -ne "\033[9;0]" >/dev/tty1 |
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 the Pi Zero ACT LED trigger to 'none'. | |
echo none | sudo tee /sys/class/leds/led0/trigger | |
# Turn off the Pi Zero ACT LED. | |
echo 1 | sudo tee /sys/class/leds/led0/brightness |
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 | |
if [ -z "${VPN_NAME}" ] | |
then | |
VPN_NAME="vpnname" | |
fi | |
if [ -z "${MY_NAME}" ] | |
then | |
MY_NAME="thisisme" |
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
export VPN_NAME="my_private_vpn" | |
export MY_NAME="ubuntu" | |
export VPN_IP="172.16.1.1" # change this to be different for each node | |
export CONNECTION="WAN" # is this server connected to a "WAN" or "LAN" | |
export MY_HOSTNAME="ubuntu.server.com" | |
export TINC_PORT="655" | |
export AUTO_TRUE="YES" |
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
export VPN_NAME="my_private_vpn" | |
export MY_NAME="raspi" | |
export VPN_IP="172.16.1.2" # change this to be different for each node | |
export CONNECTION="LAN" # is this server connected to a "WAN" or "LAN" | |
export TINC_PORT="655" | |
export AUTO_TRUE="YES" |
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/sh | |
# Writes an APR1-format password hash to the provided <htpasswd-file> for a provided <username> | |
# This is useful where an alternative web server (e.g. nginx) supports APR1 but no `htpasswd` is installed. | |
# The APR1 format provides signifcantly stronger password validation, and is described here: | |
# http://httpd.apache.org/docs/current/misc/password_encryptions.html | |
help (){ | |
cat <<EOF | |
Usage: $0 <htpasswd-file> <username> |
OlderNewer