Skip to content

Instantly share code, notes, and snippets.

View mingderwang's full-sized avatar
:bowtie:
On chain, building L2

Ming-der Wang mingderwang

:bowtie:
On chain, building L2
View GitHub Profile
@mose
mose / k8sandbox-remote.md
Last active January 19, 2018 14:37
kubesandbox remote access

As I was testing around with https://bitnami.com/stack/kubernetes-sandbox I wanted to remotely access it

First find the token, by getting on the server, which is configured to trust any local user to be cluster admin with kubectl

TOKEN=$(kubectl get secrets -n kube-system | grep default-token | awk '{print $2}')
kubectl describe secret $TOKEN -n kube-system | grep token:

Now give that default user the cluster admin role

kubectl create clusterrolebinding admin-role --clusterrole=cluster-admin --serviceaccount=kube-system:default
@justincjahn
justincjahn / 10-cisco-elasticsearch.conf
Last active August 9, 2024 22:37
Logstash: Processing Cisco Logs
#
# INPUT - Logstash listens on port 8514 for these logs.
#
input {
udp {
port => "8514"
type => "syslog-cisco"
}
@mingderwang
mingderwang / index.html
Last active June 12, 2016 14:43
Untitled benchmark #jsbench #jsperf (http://jsbench.github.io/#f7e90da0eec030236ddc78b7a6656568) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Untitled benchmark #jsbench #jsperf</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@vasanthk
vasanthk / System Design.md
Last active April 19, 2025 20:36
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@gbranchaudrubenovitch
gbranchaudrubenovitch / ansible-hash-objects-sample
Last active December 22, 2016 09:35
Some ansible hash-objects samples...
# in your group vars
HOST_SUFFIX: "dev.apps"
SERVICE_LIST:
- {serviceName: "my_service1", destinationUrl: "http://some-random-dev-machine:5555/"}
- {serviceName: "admin.my_service1", destinationUrl: "http://some-random-dev-machine:5556/"}
- {serviceName: "other-service2", destinationUrl: "http://another-machine-another-port:4279/"}
# in your playbook's yaml
...
roles:
@prehensile
prehensile / kube-resources.py
Last active October 8, 2015 04:48
Various Kubernetes / Google Container Engine tools
#!/usr/bin/env python
##
# kube-resources.py
# Collate and report Kubernetes pod usages vs. node limits.
#
# Assumes `kubectl` is installed and available.
#
# Author: Henry Cooke, [email protected]
# Version: 20150816
@leonklingele
leonklingele / openssl.cnf
Last active February 9, 2018 22:22
Useful openssl commands
[ req ]
default_bits = 4096
default_md = sha256
default_keyfile = private.key
distinguished_name = req_distinguished_name
attributes = req_attributes
x509_extensions = v3_user_req
req_extensions = v3_user_req
[ req_distinguished_name ]
@mingderwang
mingderwang / gist:5555c5cfe671464e9e93
Last active August 29, 2015 14:12
If you got error "Failed to get D-Bus connection: No connection to service manager" when you install ZeroTier One in ububtu on DigitalOcean,
Failed to get D-Bus connection: No connection to service manager
->
change ZeroTierOneInstaller-linux-x64 line 17 to [ -d /run/systemd/system ]
it works fine.
@ReedD
ReedD / ec2-startup.sh
Last active December 30, 2024 20:52
User data for EC2 to set up Docker and Compose (Fig) for ec2-user
#!/bin/sh
export PATH=/usr/local/bin:$PATH;
yum update
yum install docker -y
service docker start
# Docker login notes:
# - For no email, just put one blank space.
# - Also the private repo protocol and version are needed for docker
# to properly setup the .dockercfg file to work with compose
@wdullaer
wdullaer / install.sh
Last active April 3, 2025 19:08
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"