Skip to content

Instantly share code, notes, and snippets.

@linuxboytoo
linuxboytoo / bash_colors.sh
Created April 18, 2018 13:22
Variablized ANSI color codes
# Reset
Color_Off="\[\033[0m\]" # Text Reset
# Regular Colors
Black="\[\033[0;30m\]" # Black
Red="\[\033[0;31m\]" # Red
Green="\[\033[0;32m\]" # Green
Yellow="\[\033[0;33m\]" # Yellow
Blue="\[\033[0;34m\]" # Blue
Purple="\[\033[0;35m\]" # Purple
@linuxboytoo
linuxboytoo / Minnesota State Fields
Last active August 29, 2015 14:27
Minnesota State Fields
[{"type":"polyline","latLngs":[{"lat":45.00765,"lng":-93.163842},{"lat":44.973948,"lng":-93.224757},{"lat":44.966717,"lng":-93.165806},{"lat":45.00765,"lng":-93.163842}],"color":"#f50a00"},{"type":"polyline","latLngs":[{"lat":45.00765,"lng":-93.163842},{"lat":44.973693,"lng":-93.225453},{"lat":44.966717,"lng":-93.165806},{"lat":45.00765,"lng":-93.163842}],"color":"#eb1400"},{"type":"polyline","latLngs":[{"lat":45.00765,"lng":-93.163842},{"lat":44.973693,"lng":-93.225453},{"lat":44.966356,"lng":-93.16564},{"lat":45.00765,"lng":-93.163842}],"color":"#e01f00"},{"type":"polyline","latLngs":[{"lat":45.009242,"lng":-93.16121},{"lat":44.973693,"lng":-93.225453},{"lat":44.966356,"lng":-93.16564},{"lat":45.009242,"lng":-93.16121}],"color":"#d62900"},{"type":"polyline","latLngs":[{"lat":45.009242,"lng":-93.16121},{"lat":44.973408,"lng":-93.226883},{"lat":44.966356,"lng":-93.16564},{"lat":45.009242,"lng":-93.16121}],"color":"#cc3300"},{"type":"polyline","latLngs":[{"lat":45.009242,"lng":-93.16121},{"lat":44.972663,"lng"
ZONE=`curl http://169.254.169.254/latest/meta-data/placement/availability-zone`
VOLUME=`aws ec2 create-volume --availability-zone=$ZONE --size=100|grep 'VolumeId'|awk -F'\"' '{print $4}'`
INSTANCE=`curl http://169.254.169.254/latest/meta-data/instance-id`
sleep 5
aws ec2 attach-volume --volume-id=$VOLUME --instance-id=$INSTANCE --device=/dev/sdn
sleep 5
mkfs.ext4 /dev/xvdn
@linuxboytoo
linuxboytoo / deploy.sh
Last active August 29, 2015 14:01
Deploy Script for PocketMine on AWS
#!/bin/bash
apt-get update
apt-get -y install libgomp1 default-jre python-pip
echo "Installing AWS CLI..."
pip install awscli
export AWS_DEFAULT_REGION=us-east-1
@linuxboytoo
linuxboytoo / passwordgen.sh
Last active March 21, 2016 23:19
Bash Random Password Generator
head -n100 /dev/urandom|strings|egrep -o '([a-zA-Z0-9#%&^])'|awk '{ORS=""; print $1}'|head -c 35; echo