View keydeploy.sh
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
# Linux | |
wget -O - https://github.com/hostmaster.keys >>~/.ssh/authorized_keys |
View log.yml
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: build-servers | |
remote_user: root | |
tasks: | |
- name: read lines | |
command: tail -n 10 /var/log/messages | |
register: logfile | |
- name: print |
View gist:9827790
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
### signal the start of configuration | |
- hosts: localhost | |
tasks: | |
- irc: | |
channel={{ irc_channel }} server={{ irc_server }} msg="Preparing to update the servers" | |
### configure each webserver | |
- hosts: webservers |
View btsync.py
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 | |
from lxml import html | |
tree = html.fromstring(open("btsync.html").read()) | |
for e in tree.xpath("//li[contains(@class, 'dl-link')]"): | |
print(e.text_content().encode('utf-8')) |
View daemon.conf
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
# ~/.pulse/daemon.conf | |
default-sample-format = s24le | |
default-sample-rate = 44100 | |
alternate-sample-rate = 96000 |
View human_log.py
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
def human_log(res): | |
fields = ['cmd', 'command', 'start', 'end', 'delta', 'msg', 'stdout', 'stderr'] | |
for field in fields: | |
if field in res: | |
print '\n{0}:\n{1}'.format(field, res[field]) | |
class CallbackModule(object): | |
def on_any(self, *args, **kwargs): | |
pass |
View init.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
#define _XOPEN_SOURCE 700 | |
#include <signal.h> | |
#include <unistd.h> | |
int main() | |
{ | |
sigset_t set; | |
int status; | |
if (getpid() != 1) return 1; |
View deploy-github-pub-keys.yml
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
# github_pub_keys: | |
# - username1 | |
# - username2 | |
- shell: curl -s "https://github.com/{{ item }}.keys" | |
with_items: github_pub_keys | |
register: pub_keys | |
changed_when: False | |
tags: keys |
View nginx-reload.log
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
[root@dev:~]# lsb_release -a | |
No LSB modules are available. | |
Distributor ID: Ubuntu | |
Description: Ubuntu 12.04.4 LTS | |
Release: 12.04 | |
Codename: precise | |
[root@dev:~]# cat /var/run/nginx.pid | |
23616 | |
[root@dev:~]# pgrep nginx |
View .bashrc
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
# Call virtualenvwrapper's "workon" if .venv exists. This is modified from-- | |
# http://justinlilly.com/python/virtualenv_wrapper_helper.html | |
# which is linked from-- | |
# http://virtualenvwrapper.readthedocs.org/en/latest/tips.html#automatically-run-workon-when-entering-a-directory | |
check_virtualenv() { | |
if [ -e .venv ]; then | |
env=`cat .venv` | |
if [ "$env" != "${VIRTUAL_ENV##*/}" ]; then | |
echo "Found .venv in directory. Calling: workon ${env}" | |
workon $env |
OlderNewer