2015-10-21
- jennifer
- martym
| #!/usr/bin/env bash | |
| # | |
| # Author: Kai Xia <xiaket@corp.netease.com/xiaket@gmail.com> | |
| # Filename: 2m4b | |
| # Date created: 2014-02-27 16:52 | |
| # Last modified: 2014-02-27 16:52 | |
| # Modified by: Kai Xia <xiaket@corp.netease.com/xiaket@gmail.com> | |
| # | |
| # Description: | |
| # create an m4b audiobook file from a movie or an mp3 file. |
| import json | |
| import sys | |
| import requests | |
| AUTH ={ | |
| 'username': "xiaket", | |
| 'password': "YourPasswordHere", | |
| } |
| # For this codewar question: https://www.codewars.com/kata/54baad292c471514820000a3 | |
| import math | |
| def create_number_class(bases): | |
| base = len(bases) | |
| def __init__(self, value): | |
| self.value = value |
| #!/usr/bin/env python | |
| # encoding=utf8 | |
| """ | |
| This script will cleanup leftover resources(instance, key-pair and security group) | |
| related to an instance specified by its ipaddr or instance-id. | |
| I frequently ran out of time when I have a packer debug session open and | |
| the saml role only grant me one hour of access. So instead of manually | |
| removing the keypair and the security group, I come up with this script. | |
| """ |
| #!/usr/bin/env python | |
| import io | |
| import os | |
| import tarfile | |
| import requests | |
| import stash | |
| SITE_PACKAGES = os.path.expanduser("~/Documents/site-packages-3") |
| #!/bin/bash | |
| set -o errexit | |
| set -o nounset | |
| set -o pipefail | |
| REPO_NAME="jenkins-master" | |
| function manifest() { |
| { | |
| "rules": [ | |
| { | |
| "rulePriority": 10, | |
| "description": "For `latest` tag, keep last 5 images", | |
| "selection": { | |
| "tagStatus": "tagged", | |
| "tagPrefixList": ["latest"], | |
| "countType": "imageCountMoreThan", | |
| "countNumber": 5 |
| #!/usr/bin/env python3 | |
| class A: | |
| def dec(func): | |
| def wrapper(self, *args, **kwargs): | |
| print("Pre") | |
| func(self, *args, **kwargs) | |
| print("Post") | |
| return wrapper |
| #!/bin/bash | |
| cd $(dirname $0) ; CWD=$(pwd) | |
| PRGNAM=broadcom-wl | |
| VERSION=${VERSION:-6.30.223.271} | |
| BUILD=${BUILD:-1} | |
| TAG=${TAG:-_SBo} | |
| PKGTYPE=${PKGTYPE:-tgz} |