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
| xxx |
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
| tmp |
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 | |
| if [ x"$#" != x"1" ]; then | |
| echo "$0 hostname" | |
| exit 1 | |
| fi | |
| hostname=$1; shift | |
| json=$(aws ec2 describe-instances) | |
| echo "${json}" | jq -r '.Reservations[].Instances[] | select(.PrivateDnsName == "'${hostname}'") | .Tags | from_entries | .Name' |
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
| #!/usr/bin/python | |
| import json | |
| import sys | |
| input_path = sys.argv[1] | |
| print("* " + input_path) | |
| f = open(input_path, 'r') | |
| data = json.load(f) |
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
| esc=$(printf '\033'); tail -f /var/log/containers/nova/nova-compute.log | sed -e "s/d7ed6fe9-e0fb-4ccb-8d80-85bd80cf367a/${esc}[33md7ed6fe9-e0fb-4ccb-8d80-85bd80cf367a${esc}[0m/g" |
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
| #!/usr/bin/env python | |
| import csv | |
| import sys | |
| import requests | |
| import subprocess | |
| import urllib.parse | |
| from pprint import pprint | |
| from lxml import html | |
| from argparse import ArgumentParser |
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 | |
| # This script is an example for calling OpenStack Rest API with cURL. | |
| # First, gets project-scoped token, then gets instance information with the token. | |
| # Prereq: jq | |
| # Note that before running this script, ensure to set some environment variables. | |
| # e.g. | |
| # source ~/keystonerc_admin | |
| # or |
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
| #!/usr/bin/python | |
| import socket | |
| import struct | |
| import sys | |
| #value = 191041708 | |
| def to_ipaddr(value): | |
| packed = socket.ntohl(value) | |
| x = struct.pack('!I', packed) |
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
| define server_list | |
| set var $s = (*dnsmasq_daemon)->servers | |
| echo \n | |
| echo struct server *:\n | |
| print $s | |
| while $s | |
| echo .domain:\n | |
| print $s.domain |
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
| #!/usr/bin/env python | |
| # Prereq: PyCrypto | |
| # Validation: https://www.samltool.com/decrypt.php | |
| # Usage: ./decrypt_saml_response.py --key PRIVATE_KEY --pretty-print RESPONSE_XML | |
| import sys | |
| import optparse | |
| import base64 |