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:7404ab2b06635fe11ffd
Created July 19, 2014 04:03
etcd a lightweight
# start the deamon
sh-3.2$ ./bin/etcd
[etcd] Jul 19 12:01:21.172 WARNING | Using the directory ming-desktop.etcd as the etcd curation directory because a directory was not specified.
[etcd] Jul 19 12:01:21.548 INFO | Peer URLs in log: / ming-desktop (http://127.0.0.1:7001)
[etcd] Jul 19 12:01:21.550 INFO | etcd server [name ming-desktop, listen on :4001, advertised url http://127.0.0.1:4001]
[etcd] Jul 19 12:01:21.550 INFO | peer server [name ming-desktop, listen on :7001, advertised url http://127.0.0.1:7001]
[etcd] Jul 19 12:01:21.550 INFO | ming-desktop starting in peer mode
[etcd] Jul 19 12:01:21.550 INFO | ming-desktop: state changed from 'initialized' to 'follower'.
[etcd] Jul 19 12:01:21.932 INFO | ming-desktop: state changed from 'follower' to 'candidate'.
@mingder78
mingder78 / gist:b4db065bbd368fb6e68c
Created July 20, 2014 15:23
aws mongodb slave config
[ec2-user@ip-10-146-31-243 /tmp]$ cat /etc/mongodb.key
where2gopapa
[ec2-user@ip-10-146-31-243 /tmp]$ cat /etc/mongodb.conf
# mongodb.conf
keyFile = /etc/mongodb.key
# Where to store the data.
# Note: if you run mongodb as a non-root user (recommended) you may
# need to create and set permissions for this directory manually,
ntp 586 1 0 15:07 ? 00:00:00 ntpd -u ntp:ntp -p /var/run/ntpd.pid -g
root 599 368 0 15:07 ? 00:00:00 /sbin/udevd -d
root 600 368 0 15:07 ? 00:00:00 /sbin/udevd -d
root 617 1 0 15:07 ? 00:00:00 sendmail: accepting connections
smmsp 625 1 0 15:07 ? 00:00:00 sendmail: Queue runner@01:00:00 for /var/spool/clientmqueue
root 637 1 0 15:07 ? 00:00:00 /usr/sbin/sshd
root 657 1 0 15:07 ? 00:00:00 anacron -s
root 664 1 0 15:07 ? 00:00:00 /usr/sbin/atd
root 672 1 0 15:07 ? 00:00:00 crond
root 846 1 0 15:07 ? 00:00:00 /sbin/dhclient -1 -q -lf /var/lib/dhclient/dhclient-eth0.lea
@mingder78
mingder78 / gist:ea761347ad7cb5d13f82
Created July 20, 2014 15:27
error on install stackdriver agent on aws ec2
yum install stackdriver-agent
Loaded plugins: fastestmirror, security
You need to be root to perform this command.
[ec2-user@ip-10-146-31-243 /tmp]$ sudo !!
sudo yum install stackdriver-agent
Loaded plugins: fastestmirror, security
Determining fastest mirrors
* epel: ftp.iij.ad.jp
amzn | 2.1 kB 00:00
@mingder78
mingder78 / gist:c3bc2f5664e33d626e56
Created July 20, 2014 16:20
install python2 in aws ec2
1118 wget http://python.org/ftp/python/2.7/Python-2.7.tgz --no-check-certificate
1120 tar xvfz P*tgz
1121 cd Python-2.7
1122 ./configure --prefix=/opt/python2.7 --with-threads --with-ssl --enable-shared
1123 make
1124 sudo make install
1126 echo '''
alias python='/opt/python2.7/bin/python'
PATH=$PATH:/opt/python2.7/bin
@mingder78
mingder78 / gist:d163da989034bbb5c9d4
Created July 23, 2014 15:44
You can still despise git within a year, but not docker.
一年內你有可能不用 git 還沒關係, 但你不可能不用 docker
(http://docker.io). 因為它 learning curve 不陡, 最重要的也是太好用了.
如果不想自己K, 可以參加 Docker.Taipei (https://www.facebook.com/groups/docker.taipei/)
@mingder78
mingder78 / gist:e68d203752220e6f10a5
Created July 23, 2014 17:11
boot2docker on mac os x only 2GB disk space, it should be 40GB
$ boot2docker ssh [1:08:27]
docker@localhost's password:
## .
## ## ## ==
## ## ## ## ===
/""""""""""""""""\___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~
\______ o __/
\ \ __/
\____\______/
@mingder78
mingder78 / gist:4855f3ff07cf3581834f
Created September 3, 2014 10:24
can install playa-mesos on ubuntu
VMSetError: /home/vbox/vbox-4.3.14/src/VBox/VMM/VMMR3/HM.cpp(532) int HMR3Init(PVM); rc=VERR_VMX_MSR_VMXON_DISABLED
00:00:00.069126 VMSetError: VT-x is disabled in the BIOS.
00:00:00.194342 ERROR [COM]: aRC=NS_ERROR_FAILURE (0x80004005) aIID={8ab7c520-2442-4b66-8d74-4ff1e195d2b6} aComponent={Console} aText={VT-x is disabled in the BIOS. (VERR_VMX_MSR_VMXON_DISABLED)}, preserve=false
00:00:00.249977 Power up failed (vrc=VERR_VMX_MSR_VMXON_DISABLED, rc=NS_ERROR_FAILURE (0X80004005))
@mingder78
mingder78 / nginx.conf
Created September 5, 2014 09:45
nginx.conf for dokku
$ cat nginx.conf
upstream node-mysql { server 127.0.0.1:49153; }
server {
listen 80;
server_name node-mysql.dokku.me;
location / {
proxy_pass http://node-mysql;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
@mingder78
mingder78 / gist:c2cd5a79510925149751
Created September 7, 2014 13:59
how to use mediawalker2-karaf in docker.
araf@root> list
START LEVEL 30 , List Threshold: 50
ID State Blueprint Spring Level Name
[ 155] [Installed ] [ ] [ ] [ 50] Apache CXF Compatibility Bundle Jar (2.7.11)
[ 156] [Installed ] [ ] [ ] [ 50] camel-core (2.13.1)
[ 157] [Installed ] [ ] [ ] [ 50] camel-karaf-commands (2.13.1)
[ 158] [Installed ] [ ] [ ] [ 50] camel-spring (2.13.1)
[ 159] [Installed ] [ ] [ ] [ 50] camel-blueprint (2.13.1)
[ 160] [Installed ] [ ] [ ] [ 50] camel-cxf-transport (2.13.1)
[ 161] [Installed ] [ ] [ ] [ 50] camel-cxf (2.13.1)