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 | |
api_key = "foo" | |
headers = { | |
'Accept': 'application/json', | |
'x-api-key': api_key | |
} | |
BASE_URL = 'https://website.com/api' |
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 argparse | |
import requests | |
import json | |
def main(): | |
parser = argparse.ArgumentParser() | |
parser.add_argument( | |
'token', type=str, help='Bearer token, grab it from the browser or something idk') | |
parser.add_argument( |
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 | |
from will.plugin import WillPlugin | |
from will.decorators import respond_to, require_settings | |
class WillTestPlugin(WillPlugin): | |
def get_user_id(self, user_id): | |
people_cache = self.load('slack_people_cache', {}) | |
for k, c in people_cache.items(): | |
if user_id == c.handle: |
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
# Based off this https://stackoverflow.com/a/51108279 | |
# A LOT of SSL Voodoo is happening here | |
# Other refs: https://github.com/pyca/pyopenssl/issues/168 | |
def verify_ocsp(self): | |
ocsp_uri = self.get_ocsp_uri(self.x509_certificate) | |
# We declare we want to use SSL v2/v3 for the context | |
# but then turn around and disable those two. This results in being able | |
# to negotiate any protocol that is NOT SSL v2/v3 | |
ssl_context = OpenSSL.SSL.Context(OpenSSL.SSL.SSLv23_METHOD) |
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
{ | |
"author": "Bob Saggett", | |
"title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit", | |
"body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto" | |
} |
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
2018/01/02 18:10:51 [INFO] Terraform version: 0.11.1 a42fdb08a43c7fabb8898fe8c286b793bbaa4835+CHANGES | |
2018/01/02 18:10:51 [INFO] Go runtime version: go1.9 | |
2018/01/02 18:10:51 [INFO] CLI args: []string{"/Users/ahmed/bin/terraform", "plan"} | |
2018/01/02 18:10:51 [DEBUG] Attempting to open CLI config file: /Users/ahmed/.terraformrc | |
2018/01/02 18:10:51 [DEBUG] File doesn't exist, but doesn't need to. Ignoring. | |
2018/01/02 18:10:51 [INFO] CLI command args: []string{"plan"} | |
2018/01/02 18:10:51 [INFO] command: empty terraform config, returning nil | |
2018/01/02 18:10:51 [DEBUG] command: no data state file found for backend config | |
2018/01/02 18:10:51 [DEBUG] New state was assigned lineage "82228462-361a-4c13-984b-669ca0f06e3d" | |
2018/01/02 18:10:51 [INFO] command: backend initialized: <nil> |
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
find /videos -name "*.mkv" -exec bash -c '~/temp/HandBrake-1.0.7/build/HandBrakeCLI -Z "Android 576p25" --input "{}" --output "/out/$(basename {}).mp4" --two-pass --turbo' \ |
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
__author__ = 'ahmed' | |
import boto3, argparse, yaml | |
from time import sleep | |
import os.path | |
def tag_instances(awsTags): | |
reservations = ec2Client.describe_instances() |
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 json | |
from botocore.exceptions import ClientError | |
import boto3 | |
import sys | |
import logging | |
logger = logging.getLogger() | |
logger.setLevel(logging.INFO) | |
from zabbix.api import ZabbixAPI |
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
change_api_keys () | |
{ | |
# Change the API keys in credentials.json | |
# If a variable with the value is provided | |
for VAR in `env` | |
do | |
case "$VAR" in | |
POKEMON_* ) | |
key_name=`echo "$VAR" | sed -e "s/^POKEMON_\(.*\)\=.*/\1/"` | |
echo "Changing value of " $key_name |
NewerOlder