Skip to content

Instantly share code, notes, and snippets.

Avatar

bodhi tjnh05

  • Chongiqng
View GitHub Profile
@tjnh05
tjnh05 / router.pi-2.md
Created Jan 27, 2020 — forked from snakevil/router.pi-2.md
使用树莓派3B打造超强路由之二:初成
View router.pi-2.md

使用树莓派3B打造超强路由之二:初成

通过第一篇《使用树莓派3B打造超强路由之一:初装》的努力,树莓派3B已经可以作为一台超低能耗、随身携带的开发用服务器来使用了。但这对于目标——打造超强路由而言,才刚刚开始。接下来,我们需要将其打磨成一台基本的无线路由器。

WARNING 本文所有指令均仅供参考,切勿无脑复制粘贴!

@tjnh05
tjnh05 / hmac_sha1.py
Created Jan 14, 2020 — forked from heskyji/hmac_sha1.py
Generate HMAC-SHA1 Signature using Python 3
View hmac_sha1.py
import hashlib
import hmac
import base64
def make_digest(message, key):
key = bytes(key, 'UTF-8')
message = bytes(message, 'UTF-8')
@tjnh05
tjnh05 / hmac-sha1.py
Created Jan 14, 2020 — forked from binaryatrocity/hmac-sha1.py
HMAC-SHA1 Python example
View hmac-sha1.py
from sys import argv
from base64 import b64encode
from datetime import datetime
from Crypto.Hash import SHA, HMAC
def create_signature(secret_key, string):
""" Create the signed message from api_key and string_to_sign """
string_to_sign = string.encode('utf-8')
hmac = HMAC.new(secret_key, string_to_sign, SHA)
return b64encode(hmac.hexdigest())
@tjnh05
tjnh05 / create_tenant_project_and_user.yml
Created Oct 31, 2018 — forked from linuxsimba/create_tenant_project_and_user.yml
openstack heat resource file - create tenant project and user
View create_tenant_project_and_user.yml
heat_template_version: 2015-04-30
description: Create a new Project. Assign a user and user-role pair.
parameters:
demo_project_name:
type: string
description: project name
demo_user_role:
type: string
View Migrate flavors from one Openstack Cloud to another
nova flavor-list | grep True | awk -F "|" '{print "nova flavor-create --ephemeral 1 --swap 0 --rxtx-factor 1.0 --is-public True" $3 $2 $4 $5 $8";"}' | sed -e 's/ / /g'
View kubernetes_in_centos.md

Install Kuberenetes in CentOS(Standalone)

yum install -y etcd
# vim /etc/yum.repos.d/virt7-docker-common-release.repo

[virt7-docker-common-release]
@tjnh05
tjnh05 / fast-sc.yaml
Created Apr 5, 2018 — forked from elsonrodriguez/fast-sc.yaml
Superset/Caravel on Kubernetes
View fast-sc.yaml
kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
name: fast
provisioner: kubernetes.io/gce-pd
parameters:
type: pd-ssd