I hereby claim:
- I am alertedsnake on github.
- I am alertedsnake (https://keybase.io/alertedsnake) on keybase.
- I have a public key ASCfxV4qRyhhdxbeDgbNB5_C-vSKI1qSFx2kKHXLcpDhPwo
To claim this, I am signing this object:
import getpass | |
import hashlib | |
import os | |
from base64 import urlsafe_b64encode as encode | |
def make_secret(password): | |
salt=os.urandom(4) | |
sha = hashlib.sha1(password) | |
sha.update(salt) | |
digest_salt_b64 = '{}{}'.format(sha.digest(), salt).encode('base64').strip() |
set_prompt() { | |
Last_Command=$? # Must come first! | |
Gray='\[\e[01;30m\]' | |
Blue='\[\e[01;34m\]' | |
White='\[\e[01;37m\]' | |
Purple='\[\e[0;35m\]' | |
Red='\[\e[01;31m\]' | |
Green='\[\e[01;32m\]' | |
Reset='\[\e[00m\]' | |
FancyX='\342\234\227' |
# setup python virtualenv and install nodeenv | |
virtualenv .python | |
. .python/bin/activate | |
pip install nodeenv | |
# setup nodeenv with the node of your choice, and upgrade npm to latest | |
nodeenv --node=0.10.37 --prebuilt .node | |
. .node/bin/activate | |
npm install -g npm |
import boto3 | |
def as_get_instances(client, asgroup, NextToken = None): | |
# this is downright ridiculous because boto3 sucks | |
irsp = None | |
if NextToken: | |
irsp = client.describe_auto_scaling_instances(MaxRecords=2, NextToken=NextToken) | |
else: |
start-server | |
set -g prefix C-a | |
unbind C-b | |
bind C-a send-prefix | |
set -g status-keys vi | |
setw -g mode-keys vi | |
set -g status off | |
unbind ^L | |
bind ^L refresh-client |
#!/bin/bash | |
# | |
# Note that this requires the really cool command-line tool 'jq' | |
# | |
if [ -z "$1" ]; then | |
echo "as_kill_instances [group]" | |
exit -1 | |
fi |
I hereby claim:
To claim this, I am signing this object:
Given this config file: | |
```YAML | |
credentials: | |
ftp://ftp.someserver.com: | |
user: foo | |
pass: bar | |
path: /path/to/logs | |
ftp://ftp.otherserver.com: |
ec2ip() { | |
aws ec2 describe-instances --instance-ids $* | jq '.Reservations[0].Instances[0].PrivateIpAddress' | sed 's/"//g' | |
} | |
ec2ssh() { | |
ssh $(ec2ip $1) | |
} |
#!/usr/bin/env python3 | |
""" | |
Random password generator, ala https://xkcd.com/936/ | |
The wordlist is assumed to be a list of words in the language of your choice, | |
of the sizes of your choice. I got mine out of aspell:: | |
aspell dump master | \ | |
sed -e "s/'s$//" -e '/^[A-Z]/d' -e '/^.\{4,6\}$/!d' | \ | |
sort -u > wordlist.txt |