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
from geventwebsocket.handler import WebSocketHandler | |
from gevent.pywsgi import WSGIServer | |
from flask import Flask, request, render_template | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
return render_template('index.html') |
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
echo -e "\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 )) ;sleep 0.05; done|awk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}' |
Use my fork of the Wiring-Pi Python library which checks out the WiringOP fork of the WiringPi library as a submodule to build everything. yes that's a little confusing
The WiringPI library is the original C library that RaspGPIO is somewhat based on. WiringPi was built to replicate arduino GPIO functions
In Raspberry Pi Land there are 2 normal python paths for GPIO. One is Raspi.GPIO and the other is WiringPI
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/fail2ban/filter.d/traefik-auth.conf | |
[Definition] | |
failregex = ^<HOST> \- \S+ \[\] \"(GET|POST|HEAD) .+\" 401 .+$ |
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 | |
# Example - to set the logs retention policy for your default AWS account in region eu-west-1 to 5 days, execute the command: | |
# set-retention.sh default eu-west-1 5 | |
export AWS_PROFILE=$1 | |
export AWS_REGION=$2 | |
RETENTION_DAYS=${3:-30} | |
echo "AWS_PROFILE=$AWS_PROFILE, AWS_REGION=$AWS_REGION, RETENTION_DAYS=$RETENTION_DAYS" | |
while read -r i; | |
do (aws logs put-retention-policy --region "$AWS_REGION" --log-group-name "$i" --retention-in-days "$RETENTION_DAYS" ); | |
done < <(aws logs describe-log-groups --region "$AWS_REGION" --query 'logGroups[*].[logGroupName]' | grep / | sed 's/"//g') |