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
# Install Device Tree Compiler | |
sudo apt-get install device-tree-compiler | |
# Generate a DTS file from DTB | |
dtc -I dtb -O dts -o a.dts a.dtb | |
# Can add these to your .bashrc file for some shortcuts | |
dtbs() ( dtc -I dtb -O dts -o - "$1" ) | |
dtsb() ( dtc -I dts -O dtb -o - "$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
# Install Device Tree Compiler | |
sudo apt-get install device-tree-compiler | |
# Generate a DTS file from DTB | |
dtc -I dtb -O dts -o a.dts a.dtb | |
# Can add these to your .bashrc file for some shortcuts | |
dtbs() ( dtc -I dtb -O dts -o - "$1" ) | |
dtsb() ( dtc -I dts -O dtb -o - "$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
#!/bin/bash | |
command -v htpasswd >/dev/null 2>&1 || { echo >&2 "I require htpasswd but it's not installed. Aborting."; exit 1; } | |
RAW="" | |
COUNT=10 | |
while (( "$#" )); do | |
case "$1" in | |
-r|--raw) |
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 | |
while true; do | |
inotifywait -e modify /var/local/step/site.crt | |
nginx -s reload | |
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
#!/bin/bash | |
command -v zerotier-cli >/dev/null 2>&1 || { echo >&2 "I require zerotier-cli but it's not installed. Aborting."; exit 1; } | |
command -v systemctl >/dev/null 2>&1 || { echo >&2 "I require systemctl but it's not installed. Aborting."; exit 1; } | |
# Vars for updating | |
export ZONE=domain.com | |
export HOST=zt.domain.com | |
export USE_DYNAMIC_HOSTNAME=true | |
export API=yourapikey |
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
# /etc/systemd/system/cloudflare-ddns.service | |
[Unit] | |
Description=Zerotier DDNS Client | |
Wants=network-online.target | |
After=network.target | |
[Service] | |
Type=oneshot | |
Environment=ZONE=bla.com |
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 | |
UPTIME_DAYS=$(expr `cat /proc/uptime | cut -d '.' -f1` % 31556926 / 86400) | |
UPTIME_HOURS=$(expr `cat /proc/uptime | cut -d '.' -f1` % 31556926 % 86400 / 3600) | |
UPTIME_MINUTES=$(expr `cat /proc/uptime | cut -d '.' -f1` % 31556926 % 86400 % 3600 / 60) | |
FIRST=yes | |
for iface in $(ls -A /sys/class/net | grep eth) | |
do | |
INTERFACE="`echo "$iface" | sed 's/.*/\u&/'` Address: `ifconfig $iface | grep "inet addr" | awk -F: '{print $2}' | awk '{print $1}'`" | |
if [ $FIRST == "no" ]; then |
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/bash | |
DOMAIN="$1" | |
TYPE="$2" | |
if [[ "$DOMAIN" == "" ]]; then | |
echo "No domain passed e.g. example.com" | |
exit 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
#!/bin/bash | |
YKMAN_BIN="ykman" | |
USE_PIV="NO" | |
USE_OPENPGP="YES" | |
YUBKEY_LIST=("") | |
NFC_ENABLED="" |
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 | |
COMPOSE_PATH="/usr/local/bin/docker-compose" | |
if `command -v "docker-compose" >/dev/null 2>&1`; then | |
CURRENT_VERSION=`docker-compose -v | sed 's|.*version \([0-9\.]*\).*|\1|'` | |
if [[ ! -f "$COMPOSE_PATH" ]]; then | |
echo "WARNING" | |
echo "Looks like docker-compose is not residing in $COMPOSE_PATH" | |
echo "This is OK, but make sure that your path variable has /usr/local/bin first to make sure you are running the latest" |