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 ( | |
"encoding/json" | |
"io/ioutil" | |
"log" | |
"net/http" | |
) | |
type test_struct struct { |
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__ = 'uolter' | |
import map_reduce | |
def mapper(input_key, input_value): | |
def cut_and_clean_value(cluster): | |
""" | |
:param cluster: string in the format <cluster>:<value> | |
:return: touple cluster and value. If value is NaN return 0 |
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__ = 'uolter' | |
""" | |
Defines a single function, map_reduce, which takes an input | |
dictionary i and applies the user-defined function mapper to each | |
(input_key,input_value) pair, producing a list of intermediate | |
keys and intermediate values. Repeated intermediate keys then | |
have their values grouped into a list, and the user-defined | |
function reducer is applied to the intermediate key and list of |
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 IPython.display import HTML | |
def hide_code(): | |
return HTML('''<script> | |
code_show=true; | |
function code_toggle() { | |
if (code_show){ | |
$("div.input").hide(); | |
} else { | |
$("div.input").show(); |
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
#--------------------------------------------------------------------- | |
# Global settings | |
#--------------------------------------------------------------------- | |
global | |
log 127.0.0.1 local2 | |
chroot /var/lib/haproxy | |
pidfile /var/run/haproxy.pid | |
maxconn 4000 | |
user haproxy |
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
# Global settings | |
#--------------------------------------------------------------------- | |
global | |
log 127.0.0.1 local2 | |
chroot /var/lib/haproxy | |
pidfile /var/run/haproxy.pid | |
maxconn 4000 | |
user haproxy | |
group haproxy |
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 boto3 | |
# Enter the region your instances are in. Include only the region without specifying Availability Zone; e.g., 'us-east-1' | |
region = 'eu-west-1' | |
filters = [{'Name':'tag:Env', 'Values':['Dev']}] | |
def lambda_handler(event, context): | |
ec2 = boto3.client('ec2', region_name=region) |
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
# Terraform | |
alias trf='terraform' | |
## Terragrunt | |
alias trg='terragrunt' | |
alias trgfmt='terragrunt hclfmt' | |
alias trglint='find . -type f -not -path "*/\.*" | grep ".hcl" | terragrunt hclfmt' | |
alias trgcleancache='find . -type d -name ".terragrunt-cache" -prune -exec rm -rf {} \;' | |
function trginitall() { |
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
const https = require('https'); | |
const fs = require('fs'); | |
const hostname = 'Todo'; | |
var outstanding_reqs = 0; | |
var got_continue = false; | |
function readTextFile() { |
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 | |
latest_tags () { | |
echo "Latest tags!" | |
git describe --tags `git rev-list --tags --max-count=3` | |
echo "Status" | |
git status -uno | |
} |