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
#!/usr/bin/python | |
import json | |
print json.dumps({'hello': 'world'}) |
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
[group-a:children] | |
group-b | |
# here group-c is actually a host because of the missing :children | |
[group-b] | |
group-c | |
# as a result, host-c is also a host, but doesn't belong to group-b (or group-a) | |
[group-c] | |
host-c |
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
- hosts: localhost | |
connection: local | |
tasks: | |
- npm: name="{{item}}" path="{{installdir}}/A" global=no | |
with_items: | |
- hubot | |
- coffee-script | |
- npm: name="{{item}}" path="{{installdir}}/B" global=no |
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
git checkout branch_containing_your_commit | |
git rebase f35ed8a6c0dc81 # last commit before the removal of library modules | |
git format-patch f35ed8a6c0dc81 --stdout > /tmp/patchname.patch | |
git checkout devel | |
cd lib/ansible/modules/core/ | |
git checkout -b branch_for_new_pull_request 417309a626 # this is before the module renames | |
git am -p2 /tmp/patchname.patch # -p2 here strips off the leading directory (in most cases, library) | |
git rebase devel | |
git push your_remote_for_your_fork branch_for_new_pull_request |
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
#!/usr/bin/env python | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from pandas import * | |
from pylab import figure, show | |
def trimnum(n): | |
if abs(n - int(n)) > 0.05: | |
return "%.1f" % n |
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 numpy as np | |
from pandas import * | |
import matplotlib.pyplot as plt | |
from pylab import figure, show | |
from datetime import timedelta | |
df = read_csv('training.csv', sep = ' , ', | |
names=[ 'date', 'activity', 'distance', 'duration']) | |
df['date'] = df['date'].apply(lambda x: datetime.strptime(x, '%d/%m/%Y')) |
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
hello {{ who }} |
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
[will@tangerine nohup-test]$ ansible-playbook playbook.yml --limit 127.0.0.1 | |
PLAY [all] ******************************************************************** | |
GATHERING FACTS *************************************************************** | |
ok: [127.0.0.1] | |
TASK: [run long running script] *********************************************** | |
^CTraceback (most recent call last): | |
File "/home/will/src/ansible/bin/ansible-playbook", line 268, in <module> |
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
ansible-playbook hostname.yml -e hosts=some_ansible_group -vv |
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
#!/usr/bin/env python | |
import collections | |
import json | |
import os | |
import sys | |
''' location returns the location portion of the hostname ''' | |
def location(host): |
OlderNewer