Skip to content

Instantly share code, notes, and snippets.

@stnet253
stnet253 / README
Last active December 7, 2020 01:56
View README
sh add_hap.sh 3001
View nginx-catv.sh
#!/bin/bash
version=/etc/nginx/conf.d/version/version.conf
if [ -n "$1" ];then
for nginx in $(kubectl get pods -l app=nginx-static -o=name); do
kubectl exec -it $nginx -- cat $version |grep $1;
done
else
@stnet253
stnet253 / find_bigkey.py
Last active February 5, 2020 08:09
掃描reids instance中大於10240的key打印出來
View find_bigkey.py
#!/usr/bin/python
import sys
import redis
def check_big_key(r, k):
bigKey = False
length = 0
try:
type = r.type(k)
if type == "string":
length = r.strlen(k)
View jsmpeg
jsmpeg
==========
#### An MPEG1 Video Decoder in JavaScript ####
jsmpeg is a MPEG1 Decoder, written in JavaScript. It's "hand ported", i.e. not compiled with
emscripten or similar. This will probably make it obsolete with the advent of asmjs.
Some demos and more info: [phoboslab.org/log/2013/05/mpeg1-video-decoder-in-javascript](http://www.phoboslab.org/log/2013/05/mpeg1-video-decoder-in-javascript)
View arp-cached.sh
#!/bin/sh
arp -n | awk '{print $1}' | grep ^192 | while read ip; do arp -d $ip; done
View Apache-Kafka-cluster-install.sh
array=()
# 將傳入參數轉為 array
for i in "$@"; do
echo "$i"
array+=($i)
done
mkdir /tmp/kafka
echo ">>> Downloading kafka"
curl http://apache.stu.edu.tw/kafka/2.3.1/kafka_2.11-2.3.1.tgz -o /tmp/kafka/kafka.tgz
zookeepers=$(IFS=, ; echo "${array[*]/%/:2181}")
View bootstrap.sh
#!/bin/bash
set +e
if [ "$(podman pod ps | grep mkdev-dev | wc -l)" == "0" ] ; then
echo "> > > Starting PostgreSQL, Redis and Mattermost"
podman play kube pod.yaml
@stnet253
stnet253 / nginx-configmap.yaml
Last active December 27, 2019 08:24
k8s nginx-web
View nginx-configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: tony-nginx-conf
data:
tls.conf: |
ssl_certificate /etc/nginx/ssl/certificate.crt;
ssl_certificate_key /etc/nginx/ssl/private.key;
ssl_session_cache builtin:1000 shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;