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
#Handy functions for .bashrc loading. | |
# | |
# $ atoi 192.168.1.1 | |
# 3232235777 | |
# $ itoa 3232235777 | |
# 192.168.1.1 | |
function atoi | |
{ |
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 | |
# | |
# this script will attempt to detect any ephemeral drives on an EC2 node and create a RAID-0 stripe | |
# mounted at /mnt. It should be run early on the first boot of the system. | |
# | |
# Beware, This script is NOT fully idempotent. | |
# | |
METADATA_URL_BASE="http://169.254.169.254/2012-01-12" |
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
winrm quickconfig -q -force | |
Enable-psremoting –force | |
Set-executionpolicy bypass –force | |
winrm set winrm/config/service/Auth '@{Basic="true"}' | |
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="1024"}' | |
winrm set winrm/config/client '@{TrustedHosts="*"}' | |
# Configuration Warning: |
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
# Example: | |
# $ python argparse_dict_argument.py --env a=b --env aa=bb | |
# Namespace(env={'a': 'b', 'aa': 'bb'}) | |
import argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument('--env', action = type('', (argparse.Action, ), dict(__call__ = lambda a, p, n, v, o: getattr(n, a.dest).update(dict([v.split('=')])))), default = {}) # anonymously subclassing argparse.Action | |
print(parser.parse_args()) |