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 structlog | |
def _add_log_level_upper(logger, method_name, event_dict): | |
event_dict["level"] = method_name.upper()[0] | |
return event_dict | |
level_styles = structlog.dev.ConsoleRenderer.get_default_level_styles() | |
new_styles = {} |
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 hashlib | |
import optparse | |
import paramiko | |
from Crypto.PublicKey import RSA | |
def insert_char_every_n_chars(string, char='\n', every=64): | |
return char.join( |
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
from troposphere import \ | |
AWSHelperFn, Base64, Cidr, Condition, Equals, GetAtt, Join, Not, Output, Parameter, Ref, \ | |
Region, Select, Split, StackName, Sub, Tags, Template | |
from troposphere.autoscaling import \ | |
AutoScalingGroup, LaunchTemplateSpecification, LifecycleHookSpecification | |
from troposphere.awslambda import \ | |
Code, Function, Permission | |
from troposphere.ec2 import \ | |
CreditSpecification, IamInstanceProfile, InternetGateway, LaunchTemplate, LaunchTemplateData, \ | |
Route, RouteTable, SecurityGroup, SecurityGroupRule, Subnet, SubnetRouteTableAssociation, VPC, \ |
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
#!/bin/bash | |
# https://gist.github.com/gcchaan/ad8fd83a68467503ec3e6392ebbd519a | |
set -ef -o pipefail | |
function message(){ | |
echo 🍣 "$1" | |
} | |
function help(){ |
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
{ | |
"AWSEBDockerrunVersion": "1", | |
"Authentication": { | |
"Bucket": "bucket_name", | |
"Key": "docker/dockercfg" | |
}, | |
"Image": { | |
"Name": "company/<image>" | |
}, | |
"Ports": [ |
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
javascript: (function (){ var scripts = document.getElementsByTagName('script'); var friendsList; for (var i = 0; i < scripts.length; i++) { var script = scripts[i]; if (script.innerHTML.indexOf('InitialChatFriendsList') > -1) { var friendsListString = script.innerHTML.split('"InitialChatFriendsList",[],{"list":')[1].split(',"groups"')[0]; friendsList = JSON.parse(friendsListString); console.log('friendsList:', friendsList); break; } } var html = friendsList.map(function(id, i){ id = id = id.split('-')[0]; var url = 'http://graph.facebook.com/' + id + '/picture?type=normal'; return '<a target="_blank" href="https://www.facebook.com/' + id + '"><img src="' + url + '"></a>'; }).join('\n'); var css = '<style> a { display: inline-block; margin: 7px; } img { max-width: 70px; max-height: 70px; vertical-align: top; } </style>'; open('data:text/html, <html>' + css + html + '</html>'); }()); |
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 | |
# Of course, the author does not guarantee safety. | |
# I did my best by using SQLite's online backup API. | |
from __future__ import print_function | |
import sys, ctypes | |
from ctypes.util import find_library | |
SQLITE_OK = 0 | |
SQLITE_ERROR = 1 | |
SQLITE_BUSY = 5 |