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
bash-4.3# cat /proc/1/cpuset | |
/docker/13f8c221656e202db979d1e607c9c902282d8719ab70715978dd04ee6069d61e | |
bash-4.3# DOCKER_CID=$(cat /proc/1/cpuset | cut -c9-) | |
bash-4.3# echo $DOCKER_CID | |
13f8c221656e202db979d1e607c9c902282d8719ab70715978dd04ee6069d61e |
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 | |
AWS_COMMAND="aws --profile ion" | |
SERVICE="$1" | |
if [ "x$SERVICE" = "x" ]; then | |
SERVICE=bunsen | |
echo "INFO: Using default service [$SERVICE]" | |
fi | |
echo "Looking up service [$SERVICE]" |
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 | |
# Amazon Key Fingerprint util - calculate the fin gerprint of an SSH .pem | |
# keypair the way Amazon/AWS does. | |
# private key file, e.g. EC2KeyPair.pem | |
PRIVKEY_FILE="$1" | |
if [ "x$PRIVKEY_FILE" = "x" ]; then | |
>&2 echo "usage: ${0##*/} <file.pem>" | |
exit 2 |
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 os, sys | |
import json | |
from pprint import pprint | |
def objects_size(repo_dir): | |
return len(os.listdir(os.path.join(repo_dir, 'objects'))) | |
def is_objects_empty(repo_dir): | |
return ( | |
objects_size(repo_dir) == 2 and |
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 | |
tarsnap -c -f var-lib-gitolite-$(date +%Y%m%d-%H%M%S) /var/lib/gitolite3 |
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 boto3 | |
import base64 | |
if __name__ == '__main__': | |
session = boto3.session.Session() | |
kms = session.client('kms') | |
encrypted_password = 'AQECAHjgTiiE7TYRGp5Irf8jQ3HzlaQaHGYgsUJDaavnHcFm0gAAAGswaQYJKoZIhvcNAQcGoFwwWgIBADBVBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDDwxVQuG0oVwpkU7nQIBEIAoVGk1/wpserb+GVUOzE7PiL/Nr9fTDFKZfpKpF0ip2ct4B2q0Wn6ZZw==' | |
binary_data = base64.b64decode(encrypted_password) |
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
a.out | |
*.xml |
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 os | |
import sys | |
import math | |
import random | |
NSECONDS = 5*3600 | |
NNODES = 4000 |