Skip to content

Instantly share code, notes, and snippets.

💭
Busyman

Qquanwei

💭
Busyman
Block or report user

Report or block Qquanwei

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View install-mod.sh
modprobe br_netfilter
modprobe ip6_udp_tunnel
modprobe ip_set
modprobe ip_set_hash_ip
modprobe ip_set_hash_net
modprobe iptable_filter
modprobe iptable_nat
modprobe iptable_mangle
modprobe iptable_raw
modprobe nf_conntrack_netlink
View review.yaml
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: reviews
spec:
hosts:
- reviews
http:
- route:
- destination:
View install-docker.sh
set -xeo pipefail
apt-get update -y
apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
View clean.sh
docker rm -f $(sudo docker ps -aq);
docker volume rm $(sudo docker volume ls -q);
rm -rf /etc/ceph \
/etc/cni \
/etc/kubernetes \
/opt/cni \
/opt/rke \
/run/secrets/kubernetes.io \
/run/calico \
@Qquanwei
Qquanwei / install_container_service.sh
Last active Aug 26, 2019 — forked from carlosedp/install_container_service.sh
Install Container services (Docker/Kubernetes) on Debian/Ubuntu
View install_container_service.sh
#!/bin/bash
echo "Container Linux installation script"
echo "This will install:"
echo " - Docker Community Edition"
echo " - Docker Compose"
echo " - Kubernetes: kubeadm, kubelet and kubectl"
echo ""
set -xeo pipefail
View gist6.js
const shouldSizeMatch = compact(
itShouldProp('width', large(20), always('width should large 20')),
itShouldProp('height', large(20), always('height should large 20'))
);
of({ width: 10, height: 30})
.map(shouldSizeMatch)
.validate((success, reason) => {
// reuse rules
})
View gist5.js
function imageMatch(file) {
return readImageAsPromise(file).then(image => {
return of(image).map(itShouldProp('width', large(10), always('image width should large 10, now is ' + image.width)))
})
}
of({ filename: 'c:/fakepath/file.txt'})
.map(itShould(imageMatch, always('image not exists')))
.validate(( success, reason) => {
// async validation just fun
View gist4.js
import { of, always } from 'OverAssert';
function asyncCheckValidate(value) {
return new Promise((resolve, reject) => {
setTimeout(() => {
if (value > 10) {
resolve();
} else {
reject();
}
View gist3.js
import { of, itShouldPath, itShouldProp, equals, allPass, large, less, always } from 'OverAssert';
const data = {
user: {
name: 'Alice',
id: 200
},
expireTime: 200,
View gist2.js
import { of, itShouldProp, large, always } from 'OverAssert'
const data = {
age: 20
};
of(data)
.map(itShouldProp('age', large(10), always('age should large than 10')))
.map(itShouldProp('age', less(80), always('age should less than 80')))
.validation((success, reason) => {
You can’t perform that action at this time.