Skip to content

Instantly share code, notes, and snippets.

View tjnh05's full-sized avatar

bodhi tjnh05

  • Chongiqng
View GitHub Profile
@tjnh05
tjnh05 / fast-sc.yaml
Created April 5, 2018 13:28 — forked from elsonrodriguez/fast-sc.yaml
Superset/Caravel on Kubernetes
kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
name: fast
provisioner: kubernetes.io/gce-pd
parameters:
type: pd-ssd

Install Kuberenetes in CentOS(Standalone)

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

[virt7-docker-common-release]
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'
@tjnh05
tjnh05 / create_tenant_project_and_user.yml
Created October 31, 2018 01:15 — forked from linuxsimba/create_tenant_project_and_user.yml
openstack heat resource file - create tenant project and user
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
@tjnh05
tjnh05 / hmac-sha1.py
Created January 14, 2020 14:35 — forked from binaryatrocity/hmac-sha1.py
HMAC-SHA1 Python example
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 / hmac_sha1.py
Created January 14, 2020 14:41 — forked from heskyji/hmac_sha1.py
Generate HMAC-SHA1 Signature using Python 3
import hashlib
import hmac
import base64
def make_digest(message, key):
key = bytes(key, 'UTF-8')
message = bytes(message, 'UTF-8')
@tjnh05
tjnh05 / router.pi-2.md
Created January 27, 2020 07:30 — forked from snakevil/router.pi-2.md
使用树莓派3B打造超强路由之二:初成

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

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

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

@tjnh05
tjnh05 / mysql-analyze-all-tables.sh
Last active June 15, 2021 06:03 — forked from tony4d/mysql-analyze-all-tables.sh
Analyze all tables in a mysql database from the command line (bash)
#!/bin/bash
# To avoid doing things like putting your mysql password on the cli which is not secure
# Use mysql config editor http://dev.mysql.com/doc/refman/5.6/en/mysql-config-editor.html
database_name=ifrs17_per_biz2
for table in $(mysql --login-path=mylogins -D $database_name -Bse "show tables");
do mysql --login-path=mylogins -D $database_name -Bse "analyze table $table";
done
@tjnh05
tjnh05 / auditd.conf
Created September 1, 2021 06:39 — forked from sakalajuraj/auditd.conf
Logstash configuration for auditd messages received via syslog
# Content of the file /etc/logstash/conf.d/auditd.conf
# Tested on the CentOS 7 auditspd logs forwarded to logstash via rsyslog
input {
syslog {
type => AUDITD
port => xxxx
host => "xxx.xxx.xxx.xxx"
}
}