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_second_interface() # $1 = interface index (aws index) to set the default route | |
{ | |
route_via="$1" | |
[ "$route_via" ] || { | |
echo "Must provide interface index number which to route via" | |
return 1 | |
} |
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 | |
# JWT TOKEN signing using openssl private key RS256 | |
base64WithoutPadding() | |
{ | |
cat | openssl base64 -A | 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
openssl req -sha256 -newkey rsa:2048 -nodes -out server.csr -keyout server.key -subj "/C=US/ST=Washington/L=Seattle/O=My Company LLC/OU=Network Ops/CN=ubiquityedge.local" | |
openssl x509 -req -in server.csr -signkey server.key -out server.crt | |
cat server.crt server.key >/etc/lighttpd/server.pem | |
kill -SIGINT $(cat /var/run/lighttpd.pid) | |
/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf |
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
def twosComp(val, bitlen=None): | |
if bitlen is None: | |
bitlen = int(val).bit_length() | |
val &= ( 2 << bitlen - 1 ) - 1 | |
return '{{:0{bitlen}b}}'.format(bitlen=bitlen).format(val) |
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 | |
ssh-keygen -R github.com | |
ssh-keyscan -t rsa github.com >/tmp/github.pub && \ | |
[ "`ssh-keygen -l -f /tmp/github.pub`" = "2048 SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8 github.com (RSA)" ] && \ | |
echo yes && \ | |
cat /tmp/github.pub >> ~/.ssh/known_hosts \ | |
|| echo no |
sudo python3 -c "from cloudinit.stages import *; import pprint; import json; i=Init();i.fetch();m=Modules(i);print(json.dumps(m.cfg, indent=4))"
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 "Getting list of Availability Zones" | |
all_regions=$(aws ec2 describe-regions --output text --query 'Regions[*].[RegionName]' | sort) | |
all_az=() | |
while read -r region; do | |
az_per_region=$(aws ec2 describe-availability-zones --region $region --query 'AvailabilityZones[*].[ZoneName]' --output text | sort) | |
while read -r az; do |
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
import boto3 | |
import time | |
region = 'eu-west-1' | |
user_data_script = """#!/bin/bash | |
instanceid=$(curl http://169.254.169.254/latest/meta-data/instance-id) | |
cd / | |
mkdir moodledata | |
mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 fs-xxxxxxxxxxc.efs.eu-west-1.amazonaws.com:/ moodledata | |
tar czf mooodledata-backup-$(date +%d-%m-%Y_%H-%M).tar.gz /moodledata | |
aws s3 mv mooodledata-backup-*.tar.gz s3://xxxxxxxxx/ |
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
commit ffb37bc73c801bbdb2f29829b45a3ecee9d1ba9d | |
Author: Aron Podrigal <[email protected]> | |
Date: Thu May 10 16:02:35 2018 +0000 | |
Record route multiple | |
Do not strip `<>` | |
diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c | |
index 9d4b5f9..3270fb7 100644 |
NewerOlder