$ sudo apt-get install unattended-upgrades
$ sudo nano /etc/apt/apt.conf.d/10periodic
# The adding logic seems to dictate the result. So if you start with 1 ball each (differnt colors / odd), | |
# you end up with red. | |
blue_balls = Array.new(17, 'blue') | |
red_balls = Array.new(17, 'red') | |
balls = red_balls + blue_balls | |
balls.shuffle! | |
puts "Starting Ball List: #{balls}" |
# filename: install-nvm-npm-node | |
# author: Lex Sheehan | |
# purpose: To cleanly install NVM, NODE and NPM | |
# dependencies: brew | |
NOW=$(date +%x\ %H:%M:%S) | |
CR=$'\n' | |
REV=$(tput rev) | |
OFF=$(tput sgr0) |
ls -1 ~/.atom/packages
README.md
Sublime-Style-Column-Selection
atom-beautify
atom-material-syntax
atom-material-syntax-dark
atom-material-ui
[Unit] | |
Description=TeamCity Build Agent | |
After=network.target | |
[Service] | |
Type=forking | |
PIDFile=$AGENT_HOME/logs/buildAgent.pid | |
ExecStart=/usr/bin/sudo -u teamcity $AGENT_HOME/bin/agent.sh start | |
ExecStop=/usr/bin/sudo -u teamcity $AGENT_HOME/bin/agent.sh stop |
LSCOLORS="exfxFxBxcxbxdxabagacad" |
wget http://stedolan.github.io/jq/download/linux64/jq | |
aws ec2 describe-instances --filters "Name=tag:Name,Values=$NAME" \ | |
"Name=instance-state-name,Values=running" \ | |
| jq -r \ | |
".Reservations[] | .Instances[] | .InstanceId" \ | |
aws ec2 describe-volumes --filters \ | |
"Name=status,Values=available" \ | |
| jq -r ".Volumes[] | .VolumeId" \ |
>>> c.connect() | |
>>> c.request('GET', '/job/test-dsl/17/api/json', headers={'Accept': 'text/json'}) | |
>>> resp = c.getresponse() | |
>>> jsondata = resp.read() | |
>>> data = json.loads(jsondata.decode()) | |
>>> print(data['duration']) |
This documentation aims at being a quick-straight-to-the-point-hands-on AWS resources manipulation with [boto3][0].
First of all, you'll need to install [boto3][0]. Installing it along with [awscli][1] is probably a good idea as
import boto3 | |
import botocore | |
from random import randint | |
from time import sleep | |
def client_throttle(action, **kwargs): | |
while True: | |
try: | |
return action(**kwargs) | |
except botocore.exceptions.ClientError as e: |