This file contains hidden or 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
| { | |
| "master_config" : "true", | |
| "system" : { | |
| "management_host" : "put_chaosmonkey_hostname_here", | |
| "management_ip" : "put_chaosmonkey_ip_here", | |
| "environment" : "environment_type_here", | |
| "rabbit_user" : "chaos", | |
| "rabbit_pass" : "allthechaos" | |
| }, | |
| "hosts" : { |
This file contains hidden or 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
| from sqlalchemy import create_engine, MetaData, Table, select, func | |
| engine = create_engine('postgresql+psycopg2://postgres:postgres@localhost:5432/cm', convert_unicode=True) | |
| metadata = MetaData(bind=engine) | |
| db = engine.connect() | |
| hosts = Table('hosts', metadata, autoload=True) | |
| results = db.execute(select({hosts})) | |
| json_results = json.dumps([dict(r) for r in results]) | |
| results = db.execute(select({hosts})) |
This file contains hidden or 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
| echo -n | openssl s_client -connect packagecloud.io:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee '/usr/local/share/ca-certificates/chef_ca.crt' |
This file contains hidden or 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
| package go_learn | |
| import ( | |
| fmt | |
| io/ioutil | |
| m "math" | |
| net/http | |
| strconv | |
| ) |
This file contains hidden or 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 | |
| # Mike Lloyd, used for increasing ring buffers on CentOS/RHEL. To utilise, just have a local servers.txt file. | |
| clear | |
| echo -e "declaring arrays for in-memory storage." | |
| declare -A {rmem_default,rmem_max,wmem_default,wmem_max,optmem_max} | |
| #rmem defaults. |
This file contains hidden or 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 requests | |
| #http://docs.python-requests.org/en/latest/ | |
| def downloader(url,file): | |
| with open(file,'wb') as f: | |
| request = requests.get(url, stream=True) | |
| for chunk in request.iter_content(chunk_size=1024): | |
| if chunk: | |
| f.write(chunk) | |
| f.flush() |
This file contains hidden or 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
| urls = { "filename": "http://url" } | |
| ftp_urls = { "filename": "ftp://url" } | |
| def pull_files(): | |
| for file in ftp_urls: | |
| urllib.urlretrieve(file) | |
| for key, value in urls.items(): | |
| with open(key, 'wb') as handle: | |
| response = requests.get(value, stream=True) | |
| if not response.ok: |
This file contains hidden or 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
| from sqlalchemy.engine import create_engine | |
| from sqlalchemy.orm import sessionmaker, mapper | |
| from sqlalchemy import MetaData, Table, Column, String | |
| import json | |
| import os | |
| import requests | |
| import gc | |
| # to run, go to http://api.imgur.com/oauth2/addclient and | |
| # request an anonymous user API key. then the script will |
This file contains hidden or 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
| { | |
| "data": [ | |
| { | |
| "id": "WGDuAc9", | |
| "title": "Just found a goddamn bomb in my house! IT'S TICKING!!", | |
| "description": null, | |
| "datetime": 1442403040, | |
| "type": "image/jpeg", | |
| "animated": false, | |
| "width": 2322, |
This file contains hidden or 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
| package main | |
| import ( | |
| "flag" | |
| "github.com/Sirupsen/logrus" | |
| "io" | |
| "net/http" | |
| "os" | |
| ) |
OlderNewer