Skip to content

Instantly share code, notes, and snippets.

View mingder78's full-sized avatar

Ming-der Wang mingder78

View GitHub Profile
@mingder78
mingder78 / gist:6c9ac50a45ad6cbfd2c6
Created November 13, 2015 11:50
why mem.py only show 276.6MB but actually memory used 3.6GB
sudo python mem.py
Private + Shared = RAM used Program
136.0 KiB + 40.0 KiB = 176.0 KiB startpar
188.0 KiB + 41.0 KiB = 229.0 KiB acpid
244.0 KiB + 76.5 KiB = 320.5 KiB cron
308.0 KiB + 60.5 KiB = 368.5 KiB init
352.0 KiB + 143.0 KiB = 495.0 KiB rpcbind
276.0 KiB + 289.0 KiB = 565.0 KiB sleep (3)
while true;do curl -X GET --header "content-type: application/json" http://api.log4security.com:30819/kube ;done
@mingder78
mingder78 / gist:47cbe3a1c627de0680fd
Created November 5, 2015 10:52
can't run kubectl command.
If you can't run kubectl command in google cloud shell or your local workstation, run
$ gcloud container clusters get-credentials <CLUSTER_NAME>
➜ ~ history | grep fabric
6953 kubectl expose rc fabric8 --type=LoadBalancer --port=80 --target-port=9376
6957 curl 104.155.203.240:9376/api/v1/proxy/namespaces/default/services/fabric8/
6960 kubectl expose rc fabric8 --type=LoadBalancer --port=80 --target-port=9090
6964 kubectl expose rc fabric8 --type=LoadBalancer --port=80 --target-port=80
6973 curl http://104.155.203.240/api/v1/proxy/namespaces/default/services/fabric8
6974 curl http://104.155.192.3`/api/v1/proxy/namespaces/default/services/fabric8\nOAOA\n\n\n\n'\n'
6975 curl https://104.155.192.31/api/v1/proxy/namespaces/default/services/fabric8
6976 curl http://104.155.192.31/api/v1/proxy/namespaces/default/services/fabric8
6979 docker pull fabric8/hawtio-kubernetes
@mingder78
mingder78 / kubernetes.json
Last active September 11, 2015 10:00
json for fabirc8 console
//refer to http://fabric8.io/guide/getStarted/gke.html
// kc create -f http://central.maven.org/maven2/io/fabric8/apps/console-kubernetes/2.2.19/console-kubernetes-2.2.19-kubernetes.json
{
"apiVersion": "v1",
"items": [
{
"apiVersion": "v1",
"imagePullSecrets": [
],
@mingder78
mingder78 / boser.json
Created June 22, 2015 02:19
bower.json for polymer-firebase-chat
{
"name": "polymer-firebase-qa",
"version": "1.0.0",
"dependencies": {
"core-elements": "Polymer/core-elements#~0.5.0",
"paper-elements": "Polymer/paper-elements#~0.5.0",
"pvc-globals": "Divshot/pvc-globals",
"firebase-element": "Polymer/firebase-element#~0.5.0",
"app-router": "~2.0.2"
},
@mingder78
mingder78 / gist:e94178e06631b7881fd4
Created June 13, 2015 23:27
to gen private key
$ openssl pkcs12 -in key.p12 -out key.pem -nodes
<%{POSINT:syslog_pri}>%{SYSLOGTIMESTAMP:syslog_timestamp} %{DATA:syslog_hostname} %{DATA:syslog_program}: %{POSINT:syslog_pid}: %{GREEDYDATA:syslog_message}
@mingder78
mingder78 / gist:9fdc2eb1068bb98a1f4b
Created March 20, 2015 12:10
cannot load such file -- jekyll-sitemap (LoadError) -> sudo gem install jekyll-sitemap
$ jekyll serve
Configuration file: /Users/mwang/src/zone/61/log4analytics.com/mingderwang.github.io.source/_config.yml
/usr/local/Cellar/ruby/2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- jekyll-sitemap (LoadError)
from /usr/local/Cellar/ruby/2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /usr/local/lib/ruby/gems/2.2.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:29:in `block in require_gems'
from /usr/local/lib/ruby/gems/2.2.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:26:in `each'
from /usr/local/lib/ruby/gems/2.2.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:26:in `require_gems'
from /usr/local/lib/ruby/gems/2.2.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:19:in `conscientious_require'
from /usr/local/lib/ruby/gems/2.2.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:79:in `setup'
from /usr/local/lib/ruby/gems/2.2.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:41:in `initialize'
➜ chef-client ls
Vagrantfile chef-validator.pem
➜ chef-client vu node2
Bringing machine 'node2' up with 'virtualbox' provider...
==> node2: Importing base box 'phusion/ubuntu-14.04-amd64'...
==> node2: Matching MAC address for NAT networking...
==> node2: Checking if box 'phusion/ubuntu-14.04-amd64' is up to date...
==> node2: Setting the name of the VM: chef-client_node2_1426853090304_55807
==> node2: Clearing any previously set forwarded ports...
==> node2: Clearing any previously set network interfaces...