Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am bigfei on github.
  • I am bigfei (https://keybase.io/bigfei) on keybase.
  • I have a public key whose fingerprint is AFFE 9C20 0859 366E D19C 283F 7CF1 D349 BFE8 1395

To claim this, I am signing this object:

@bigfei
bigfei / create_k8s.sh
Created January 12, 2022 12:16
pve k8s create
#!/bin/bash
VMID=$1
HOSTNAME=$2
MAC_ADDR=${3,,}
echo $MAC_ADDR
sed \
-e "s/%MAC_ADDR%/${MAC_ADDR}/" \
> /var/lib/vz/snippets/network-config-${VMID} < /var/lib/vz/snippets/network-config
sed \
@bigfei
bigfei / slapd
Created March 24, 2020 04:38 — forked from tuxfight3r/slapd
openldap proxy to AD with TLS
#file /etc/sysconfig/slapd
# OpenLDAP server configuration
# see 'man slapd' for additional information
# Where the server will run (-h option)
# - ldapi:/// is required for on-the-fly configuration using client tools
# (use SASL with EXTERNAL mechanism for authentication)
# - default: ldapi:/// ldap:///
# - example: ldapi:/// ldap://127.0.0.1/ ldap://10.0.0.1:1389/ ldaps:///
SLAPD_URLS="ldap:/// ldaps:///"
@bigfei
bigfei / make-chr.sh
Created June 27, 2019 08:40 — forked from stroebs/make-chr.sh
Install Mikrotik CHR on a Digital Ocean droplet
wget http://download2.mikrotik.com/routeros/6.40.5/chr-6.40.5.img.zip -O chr.img.zip && \
gunzip -c chr.img.zip > chr.img && \
apt-get update && \
apt install -y qemu-utils pv && \
qemu-img convert chr.img -O qcow2 chr.qcow2 && \
qemu-img resize chr.qcow2 `fdisk /dev/vda -l | head -n 1 | cut -d',' -f 2 | cut -d' ' -f 2` && \
modprobe nbd && \
qemu-nbd -c /dev/nbd0 chr.qcow2 && \
echo "Give some time for qemu-nbd to be ready" && \
sleep 2 && \
@bigfei
bigfei / index.html
Last active October 19, 2018 11:08 — forked from kirjavascript/index.html
d3 webGL force graph with PIXI.js
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<title>d3 webGL force graph with PIXI.js</title>
<meta name="description" content="">
<meta name="theme-color" content="#000000">
</head>
<body>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=default"></script>
@bigfei
bigfei / index.js
Created October 16, 2015 04:06 — forked from edokeh/index.js
佛祖保佑,永无 BUG
//
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- |||||- \
@bigfei
bigfei / e.js
Last active October 15, 2015 22:45
mongodb aggregate push
db.getCollection('test').aggregate(
{ $group:
{ _id: "$id",
articles: { $push: {dId:"$dId", time:"$time"} }
}
}
)