Skip to content

Instantly share code, notes, and snippets.

View yimeng's full-sized avatar
😀
I may be slow to respond.

yimeng yimeng

😀
I may be slow to respond.
View GitHub Profile
/etc/systemd/system/consul.service
[Unit]
Description=Consul service discovery agent
Requires=network-online.target
After=network-online.target
[Service]
EnvironmentFile=-/etc/sysconfig/consul
Restart=on-failure
/etc/salt/master.d/api.conf
rest_cherrypy:
port: 8000
ssl_crt: /etc/pki/tls/certs/localhost.crt
ssl_key: /etc/pki/tls/certs/localhost.key
/etc/salt/master.d/auth.conf
external_auth:
pam:
@yimeng
yimeng / gist:0ae8cf27bec099af9fd52979fd7616d0
Created June 3, 2022 14:16
cloud-init-python-http-api
from flask import Flask, jsonify, render_template
app = Flask(__name__)
@app.route("/")
def index():
return render_template('index.html')
@app.route("/user-data")
sudo docker run --detach \
--hostname hostname \
--publish 443:443 --publish 80:80 --publish 2222:22 \
--name gitlab \
--volume /data/gitlab/config:/etc/gitlab \
--volume /data/gitlab/logs:/var/log/gitlab \
--volume /data/gitlab/data:/var/opt/gitlab \
gitlab/gitlab-ce:latest
export KUBECONFIG=~/.kube/a:~/.kube/b
kubectl config view --flatten
curl -s 'http://domain.com/api/graphql' -H 'Content-Type: application/json; charset=utf-8' --data-binary \
$'{"variables":
{"duration": {"start":"2019-05-28","end":"2019-05-28","step":"DAY"}},
"query":"
query Dashboard($duration: Duration\u21) {
getGlobalBrief(duration: $duration) {numOfService numOfEndpoint numOfDatabase numOfCache numOfMQ }
}
"}' --compressed | jq .
yum install dropbear -y
rm -rf /etc/dropbear/
mkdir /etc/dropbear/
dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
dropbear -p 8080
export LDFLAGS="-L/usr/local/opt/sqlite/lib"
export CPPFLAGS="-I/usr/local/opt/sqlite/include"
@yimeng
yimeng / gist:318a09651546660b7bcba67d50c165ae
Created April 24, 2018 07:26
docker smokeping run command
docker run \
--name smokeping \
-p 8888:80 \
-v /data/smokeping/data:/data \
-v /data/smokeping/config:/config \
-e TZ=Asia/Shanghai \
-d linuxserver/smokeping
@yimeng
yimeng / gist:ab094d9431efc456b1b58a8e435dbb03
Last active March 15, 2018 03:25
JR Risk control docker files
FROM alpine
COPY requirements.txt /
RUN apk update && apk add gcc cmake gdb python py2-pip cython-dev build-base openblas-dev --no-cache && \
ln -s /usr/include/locale.h /usr/include/xlocale.h && \
pip install -r requirements.txt --no-cache-dir
numpy == 1.11.2
pandas == 0.19.0
scipy == 0.18.1