Skip to content

Instantly share code, notes, and snippets.


genzj genzj

Block or report user

Report or block genzj

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
genzj /
Created Jul 22, 2019
crop and resize images, powered by PIL
# -*- encoding: utf-8 -*-
import logging
import os.path
import sys
from PIL import Image
L = logging.getLogger(__name__)
genzj / cloudSettings
Last active Aug 16, 2019
Visual Studio Code Settings Sync Gist
View cloudSettings
genzj / dynamic-host.json
Created Feb 17, 2019
An example of an ansible dynamic inventory script in Python
View dynamic-host.json
"group001": {
"hosts": ["host001", "host002"],
"vars": {
"var1": true
"children": ["group002"]
"group002": {
"hosts": ["host003","host004"],
genzj / example-repo.log
Last active Aug 31, 2018
A git remote hook example to iterate and check each commits in a push
View example-repo.log
* commit 9b5a1a68de5df1702f59c7d309e73d7152b5c582 (HEAD -> master, new)
| Author: ZHU Jie <>
| Date: Fri Aug 31 10:52:57 2018 +0000
| update another file
* commit 6d94315602e0969e61d7f141cb3f27e567bd65f5
| Author: ZHU Jie <>
| Date: Fri Aug 31 10:52:42 2018 +0000
genzj /
Created Aug 26, 2018 — forked from DocX/
Connect to bash inside running ECS container by cluster and service name
genzj /
Created Dec 22, 2017
Rotting substitution cipher examples
# -*- encoding: utf-8 -*-
def circle_alphabet(offset='a', start='a'):
start_code = ord(start)
offset_code = ord(offset)
for i in range(offset_code, start_code + 26):
yield chr(i)
for i in range(start_code, offset_code):
yield chr(i)
genzj /
Created Sep 2, 2017
Jupyterhub use OAuth with local user
# env
# add your github oauth config to this file
# and launch the server with `sh`
# Note: Be careful to keep the client secret private. Use caution
# with version control to prevent publicly exposing the secret.
genzj /
Created Oct 24, 2016
Retrieve an unscoped token from Keystone.
if [[ $# -lt 2 ]] ; then
echo "Usage: $0 USERNAME PASSWORD"
exit 1
curl -i \
-H "Content-Type: application/json" \
-d '
genzj / .screenrc
Created Jun 14, 2016
A good screen config
View .screenrc
# GNU Screen - main configuration file
# All other .screenrc files will source this file to inherit settings.
# Author: Christian Wills -
# Allow bold colors - necessary for some reason
attrcolor b ".I"
# Tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
genzj /
Created Aug 28, 2015
Clean / unquote url encode sequences in downloaded files.
#!/usr/bin/env python
from __future__ import generators
from functools import partial
import os, os.path
from urllib import unquote
except ImportError:
from urllib.parse import unquote
You can’t perform that action at this time.