tag:blogger.com,1999:blog-13392307744643272502024-03-12T21:22:57.239-07:00command lines for aws and gcloudmingderwanghttp://www.blogger.com/profile/06360664550731229109noreply@blogger.comBlogger98125tag:blogger.com,1999:blog-1339230774464327250.post-54503717603978603472022-06-03T18:56:00.001-07:002022-06-03T18:56:57.076-07:00<p> </p>
<a href="https://iconscout.com/icons/metamask" target="_blank">MetaMask Icon</a> by <a href="https://iconscout.com/contributors/icon-mafia" target="_blank">Icon Mafia</a>mingderwanghttp://www.blogger.com/profile/06360664550731229109noreply@blogger.com0tag:blogger.com,1999:blog-1339230774464327250.post-8801579864265023582022-02-13T03:13:00.000-08:002022-02-13T03:13:07.111-08:00<p> </p><blockquote class="instagram-media" data-instgrm-captioned data-instgrm-permalink="https://www.instagram.com/p/CZ6O4rPvKAc/?utm_source=ig_embed&utm_campaign=loading" data-instgrm-version="14" style=" background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:540px; min-width:326px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);"><div style="padding:16px;"> <a href="https://www.instagram.com/p/CZ6O4rPvKAc/?utm_source=ig_embed&utm_campaign=loading" style=" background:#FFFFFF; line-height:0; padding:0 0; text-align:center; text-decoration:none; width:100%;" target="_blank"> <div style=" display: flex; flex-direction: row; align-items: center;"> <div style="background-color: #F4F4F4; border-radius: 50%; flex-grow: 0; height: 40px; margin-right: 14px; width: 40px;"></div> <div style="display: flex; flex-direction: column; flex-grow: 1; justify-content: center;"> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; margin-bottom: 6px; width: 100px;"></div> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; width: 60px;"></div></div></div><div style="padding: 19% 0;"></div> <div style="display:block; height:50px; margin:0 auto 12px; width:50px;"><svg width="50px" height="50px" viewBox="0 0 60 60" version="1.1" xmlns="https://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g transform="translate(-511.000000, -20.000000)" fill="#000000"><g><path d="M556.869,30.41 C554.814,30.41 553.148,32.076 553.148,34.131 C553.148,36.186 554.814,37.852 556.869,37.852 C558.924,37.852 560.59,36.186 560.59,34.131 C560.59,32.076 558.924,30.41 556.869,30.41 M541,60.657 C535.114,60.657 530.342,55.887 530.342,50 C530.342,44.114 535.114,39.342 541,39.342 C546.887,39.342 551.658,44.114 551.658,50 C551.658,55.887 546.887,60.657 541,60.657 M541,33.886 C532.1,33.886 524.886,41.1 524.886,50 C524.886,58.899 532.1,66.113 541,66.113 C549.9,66.113 557.115,58.899 557.115,50 C557.115,41.1 549.9,33.886 541,33.886 M565.378,62.101 C565.244,65.022 564.756,66.606 564.346,67.663 C563.803,69.06 563.154,70.057 562.106,71.106 C561.058,72.155 560.06,72.803 558.662,73.347 C557.607,73.757 556.021,74.244 553.102,74.378 C549.944,74.521 548.997,74.552 541,74.552 C533.003,74.552 532.056,74.521 528.898,74.378 C525.979,74.244 524.393,73.757 523.338,73.347 C521.94,72.803 520.942,72.155 519.894,71.106 C518.846,70.057 518.197,69.06 517.654,67.663 C517.244,66.606 516.755,65.022 516.623,62.101 C516.479,58.943 516.448,57.996 516.448,50 C516.448,42.003 516.479,41.056 516.623,37.899 C516.755,34.978 517.244,33.391 517.654,32.338 C518.197,30.938 518.846,29.942 519.894,28.894 C520.942,27.846 521.94,27.196 523.338,26.654 C524.393,26.244 525.979,25.756 528.898,25.623 C532.057,25.479 533.004,25.448 541,25.448 C548.997,25.448 549.943,25.479 553.102,25.623 C556.021,25.756 557.607,26.244 558.662,26.654 C560.06,27.196 561.058,27.846 562.106,28.894 C563.154,29.942 563.803,30.938 564.346,32.338 C564.756,33.391 565.244,34.978 565.378,37.899 C565.522,41.056 565.552,42.003 565.552,50 C565.552,57.996 565.522,58.943 565.378,62.101 M570.82,37.631 C570.674,34.438 570.167,32.258 569.425,30.349 C568.659,28.377 567.633,26.702 565.965,25.035 C564.297,23.368 562.623,22.342 560.652,21.575 C558.743,20.834 556.562,20.326 553.369,20.18 C550.169,20.033 549.148,20 541,20 C532.853,20 531.831,20.033 528.631,20.18 C525.438,20.326 523.257,20.834 521.349,21.575 C519.376,22.342 517.703,23.368 516.035,25.035 C514.368,26.702 513.342,28.377 512.574,30.349 C511.834,32.258 511.326,34.438 511.181,37.631 C511.035,40.831 511,41.851 511,50 C511,58.147 511.035,59.17 511.181,62.369 C511.326,65.562 511.834,67.743 512.574,69.651 C513.342,71.625 514.368,73.296 516.035,74.965 C517.703,76.634 519.376,77.658 521.349,78.425 C523.257,79.167 525.438,79.673 528.631,79.82 C531.831,79.965 532.853,80.001 541,80.001 C549.148,80.001 550.169,79.965 553.369,79.82 C556.562,79.673 558.743,79.167 560.652,78.425 C562.623,77.658 564.297,76.634 565.965,74.965 C567.633,73.296 568.659,71.625 569.425,69.651 C570.167,67.743 570.674,65.562 570.82,62.369 C570.966,59.17 571,58.147 571,50 C571,41.851 570.966,40.831 570.82,37.631"></path></g></g></g></svg></div><div style="padding-top: 8px;"> <div style=" color:#3897f0; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:550; line-height:18px;">View this post on Instagram</div></div><div style="padding: 12.5% 0;"></div> <div style="display: flex; flex-direction: row; margin-bottom: 14px; align-items: center;"><div> <div style="background-color: #F4F4F4; border-radius: 50%; height: 12.5px; width: 12.5px; transform: translateX(0px) translateY(7px);"></div> <div style="background-color: #F4F4F4; height: 12.5px; transform: rotate(-45deg) translateX(3px) translateY(1px); width: 12.5px; flex-grow: 0; margin-right: 14px; margin-left: 2px;"></div> <div style="background-color: #F4F4F4; border-radius: 50%; height: 12.5px; width: 12.5px; transform: translateX(9px) translateY(-18px);"></div></div><div style="margin-left: 8px;"> <div style=" background-color: #F4F4F4; border-radius: 50%; flex-grow: 0; height: 20px; width: 20px;"></div> <div style=" width: 0; height: 0; border-top: 2px solid transparent; border-left: 6px solid #f4f4f4; border-bottom: 2px solid transparent; transform: translateX(16px) translateY(-4px) rotate(30deg)"></div></div><div style="margin-left: auto;"> <div style=" width: 0px; border-top: 8px solid #F4F4F4; border-right: 8px solid transparent; transform: translateY(16px);"></div> <div style=" background-color: #F4F4F4; flex-grow: 0; height: 12px; width: 16px; transform: translateY(-4px);"></div> <div style=" width: 0; height: 0; border-top: 8px solid #F4F4F4; border-left: 8px solid transparent; transform: translateY(-4px) translateX(8px);"></div></div></div> <div style="display: flex; flex-direction: column; flex-grow: 1; justify-content: center; margin-bottom: 24px;"> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; margin-bottom: 6px; width: 224px;"></div> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; width: 144px;"></div></div></a><p style=" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; line-height:17px; margin-bottom:0; margin-top:8px; overflow:hidden; padding:8px 0 7px; text-align:center; text-overflow:ellipsis; white-space:nowrap;"><a href="https://www.instagram.com/p/CZ6O4rPvKAc/?utm_source=ig_embed&utm_campaign=loading" style=" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:normal; line-height:17px; text-decoration:none;" target="_blank">A post shared by Mingder Wang (develper) (@mingderwang)</a></p></div></blockquote> <script async src="//www.instagram.com/embed.js"></script>
<iframe allowtransparency="true" frameborder="0" scrolling="no" src="https://vittominacori.github.io/watch-token/detail.html?address=0xB5c64c7d6b374aD738e314eAa7bCC07AEc194B7b&network=mainnet&logo=https://vittominacori.github.io/watch-token/assets/images/base-token.png&embedded=1" style="border: none; height: 240px; max-width: 100%; overflow: hidden; width: 520px;"></iframe>mingderwanghttp://www.blogger.com/profile/06360664550731229109noreply@blogger.com0tag:blogger.com,1999:blog-1339230774464327250.post-57054437125705734822020-07-30T23:24:00.000-07:002020-07-30T23:24:38.915-07:00<br />
<iframe height="1400px" width="100%" src="https://repl.it/repls/AdeptPlushLaw?lite=true" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals"></iframe>mingderwanghttp://www.blogger.com/profile/06360664550731229109noreply@blogger.com0tag:blogger.com,1999:blog-1339230774464327250.post-85318447853633028322020-05-11T20:21:00.002-07:002020-05-11T20:24:40.903-07:00@mingderwang/sensitive-tweets-bluzelle<br />
<div data-snack-id="@mingderwang/sensitive-tweets-bluzelle" data-snack-platform="ios" data-snack-preview="true" data-snack-theme="light" style="background: rgb(250, 250, 250); border-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.08); height: 505px; overflow: hidden; width: 100%;"></div>
<script async="" src="https://snack.expo.io/embed.js"></script>mingderwanghttp://www.blogger.com/profile/06360664550731229109noreply@blogger.com0tag:blogger.com,1999:blog-1339230774464327250.post-48793047721689600712020-02-02T07:41:00.000-08:002020-02-02T07:41:06.019-08:00<div id="observablehq-7b725c00"></div>
<script type="module">
import {Runtime, Inspector} from "https://cdn.jsdelivr.net/npm/@observablehq/runtime@4/dist/runtime.js";
import define from "https://api.observablehq.com/@marcelkltnbrg/parallel-sets.js?v=3";
const inspect = Inspector.into("#observablehq-7b725c00");
(new Runtime).module(define, name => (name === "chart") && inspect());
</script>mingderwanghttp://www.blogger.com/profile/06360664550731229109noreply@blogger.com1tag:blogger.com,1999:blog-1339230774464327250.post-48142734510991609722018-01-25T18:41:00.001-08:002018-01-25T18:41:35.136-08:00test jsfiddle embedded<script async src="//jsfiddle.net/mingderwang/xf01cfnn/4/embed/"></script>mingderwanghttp://www.blogger.com/profile/06360664550731229109noreply@blogger.com0tag:blogger.com,1999:blog-1339230774464327250.post-10417192882051980582017-11-08T01:14:00.000-08:002017-11-08T01:14:32.480-08:00testExpo<div data-snack-id="@mingderwang/testexpo" data-snack-platform="ios" data-snack-preview="true" data-snack-theme="dark" style="overflow:hidden;background:#212733;border:1px solid rgba(0,0,0,.16);border-radius:4px;height:505px;width:100%"></div>
<script async src="https://snack.expo.io/embed.js"></script>mingderwanghttp://www.blogger.com/profile/06360664550731229109noreply@blogger.com1tag:blogger.com,1999:blog-1339230774464327250.post-29226587120191846642015-10-02T02:16:00.000-07:002015-10-02T02:18:34.323-07:00"Generating Go from JSON data" idea from me (ming-der wang) is already public and start implement since Aug. 3, 2015 (at least as early)I claim the following idea is already on public since I had share or public in any social networks.
"Generating Go from JSON data" is the key concept of gogetDB or my current database as service project (onion, demo-onion, ginger, pepper, chilli, and so on.)
since 2 month ago (10/1/2015) of https://hackpad.com/Project-2-Product-Description-9iPxzxUeewK
all source code are in github (before Oct. 1, 2015), start not to open in additional parts.
the concept is implemented and demo in https://prezi.com/0lrgdih96_aw/copy-of-932015-gcpugtw-free-talk-kubernetes/ on Sept. 3, 2015
also public the way to do it in https://hackpad.com/GCPUG.TW-932015-live-demo-mGYQk3BWynb
The presentation of this concept actually in Sept. 3, 2015 NTU hackathon, I already present it to public.
Also named it "Give me JSON, I will give you an EndPoint (back)"
All copyright belong to Ming-der Wang. log4analytics.com log4security.com
mingderwanghttp://www.blogger.com/profile/06360664550731229109noreply@blogger.com0tag:blogger.com,1999:blog-1339230774464327250.post-25817118770796610812015-05-22T00:33:00.004-07:002015-05-22T00:36:10.970-07:00run your docker on google container engine. Better reading on gist <a href="https://gist.github.com/mingderwang/11fdf4a48b040eabcdb7">gist</a>
$ kubectl config use-context gke_iron-potion-92209_us-central1-a_hello-world
$ kubectl create -f casandra-pod.yaml
$ kubectl create -f cassandra-service.yaml
$ kubectl get endpoints cassandra -o yaml
apiVersion: v1beta3
kind: Endpoints
metadata:
creationTimestamp: 2015-05-22T07:30:24Z
name: cassandra
namespace: default
resourceVersion: "53898"
selfLink: /api/v1beta1/endpoints/cassandra?namespace=default
uid: 694655e9-0054-11e5-815a-42010af013e9
subsets:
- addresses:
- IP: 10.40.1.5
targetRef:
kind: Pod
name: cassandra
namespace: default
resourceVersion: "53826"
uid: 2e9b73bb-0054-11e5-815a-42010af013e9
ports:
- port: 9042
protocol: TCP
$ kubectl get services
NAME LABELS SELECTOR IP PORT(S)
cassandra name=cassandra name=cassandra 10.43.254.112 9042/TCP
kube-dns k8s-app=kube-dns,kubernetes.io/cluster-service=true,name=kube-dns k8s-app=kube-dns 10.43.240.10 53/UDP
53/TCP
kubernetes component=apiserver,provider=kubernetes <none> 10.43.240.2 443/TCP
kubernetes-ro component=apiserver,provider=kubernetes <none> 10.43.240.1 80/TCP
## yaml files on https://github.com/GoogleCloudPlatform/kubernetes/tree/master/examples/cassandra
mingderwanghttp://www.blogger.com/profile/06360664550731229109noreply@blogger.com0tag:blogger.com,1999:blog-1339230774464327250.post-22686103381527475812015-05-21T03:36:00.003-07:002015-05-21T03:36:42.807-07:00first gcloud command learning by example. HOW TO GET PASSWORD AND BEARERTOKEN FROM YOUR CLUSTER$ gcloud alpha container clusters describe hello-world
clusterApiVersion: 0.17.0
containerIpv4Cidr: 10.40.0.0/14
creationTimestamp: '2015-05-21T09:23:24+00:00'
description: ming cluster 1
enableCloudLogging: true
endpoint: 23.251.150.58
masterAuth:
bearerToken: FRxE88jcslxxxtI
password: FRxE88jcslNxxxPtI
user: admin
name: hello-world
network: default
nodeConfig:
machineType: n1-standard-1
serviceAccounts:
- email: default
scopes:
- https://www.googleapis.com/auth/compute
- https://www.googleapis.com/auth/devstorage.read_only
- https://www.googleapis.com/auth/logging.write
sourceImage: https://www.googleapis.com/compute/v1/projects/google-containers/global/images/container-vm-v20150505
nodeRoutingPrefixSize: 24
numNodes: 1
selfLink: https://www.googleapis.com/container/v1beta1/projects/608411524514/zones/us-central1-a/clusters/hello-world
servicesIpv4Cidr: 10.43.240.0/20
status: running
zone: us-central1-a
mingderwanghttp://www.blogger.com/profile/06360664550731229109noreply@blogger.com0tag:blogger.com,1999:blog-1339230774464327250.post-59109537634718514212015-01-13T00:00:00.002-08:002015-01-13T00:00:40.839-08:00elasticsearch commands (example) to see the logs from logstash$ curl -gs -XGET http://localhost:9200/logstash-\*/_search\?pretty\=true<br />
<br />
{<br /> "took" : 104,<br /> "timed_out" : false,<br /> "_shards" : {<br /> "total" : 5,<br /> "successful" : 5,<br /> "failed" : 0<br /> },<br /> "hits" : {<br /> "total" : 6,<br /> "max_score" : 1.0,<br /> "hits" : [ {<br /> "_index" : "logstash-2015.01.13",<br /> "_type" : "nginx_access",<br /> "_id" : "AUrh27PSn9XFZmqFmD71",<br /> "_score" : 1.0,<br /> "_source":{"message":"172.16.255.1 - - [13/Jan/2015:05:54:33 +0000] \"GET / HTTP/1.1\" 304 0 \"-\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:34.0) Gecko/20100101 Firefox/34.0\"","@version":"1","@timestamp":"2015-01-13T05:54:33.792Z","host":"node1","path":"/var/log/nginx/access.log","type":"nginx_access","tags":["_grokparsefailure"]}<br /> }, {<br /> "_index" : "logstash-2015.01.13",<br /> "_type" : "nginx_access",<br /> "_id" : "AUrh3bkHn9XFZmqFmD75",<br /> "_score" : 1.0,<br /> "_source":{"message":"172.16.255.1 - - [13/Jan/2015:05:56:51 +0000] \"GET / HTTP/1.1\" 304 0 \"-\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:34.0) Gecko/20100101 Firefox/34.0\"","@version":"1","@timestamp":"2015-01-13T05:56:51.780Z","host":"node1","path":"/var/log/nginx/access.log","type":"nginx_access","tags":["_grokparsefailure"]}<br /> }, {<br /> "_index" : "logstash-2015.01.13",<br /> "_type" : "nginx_access",<br /> "_id" : "AUrh26y1n9XFZmqFmD70",<br /> "_score" : 1.0,<br /> "_source":{"message":"172.16.255.1 - - [13/Jan/2015:05:54:32 +0000] \"GET / HTTP/1.1\" 304 0 \"-\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:34.0) Gecko/20100101 Firefox/34.0\"","@version":"1","@timestamp":"2015-01-13T05:54:32.773Z","host":"node1","path":"/var/log/nginx/access.log","type":"nginx_access","tags":["_grokparsefailure"]}<br /> }, {<br /> "_index" : "logstash-2015.01.13",<br /> "_type" : "nginx_access",<br /> "_id" : "AUrh27PSn9XFZmqFmD72",<br /> "_score" : 1.0,<br /> "_source":{"message":"172.16.255.1 - - [13/Jan/2015:05:54:34 +0000] \"GET / HTTP/1.1\" 304 0 \"-\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:34.0) Gecko/20100101 Firefox/34.0\"","@version":"1","@timestamp":"2015-01-13T05:54:34.817Z","host":"node1","path":"/var/log/nginx/access.log","type":"nginx_access","tags":["_grokparsefailure"]}<br /> }, {<br /> "_index" : "logstash-2015.01.13",<br /> "_type" : "nginx_access",<br /> "_id" : "AUrh27PSn9XFZmqFmD73",<br /> "_score" : 1.0,<br /> "_source":{"message":"172.16.255.1 - - [13/Jan/2015:05:54:35 +0000] \"GET / HTTP/1.1\" 304 0 \"-\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:34.0) Gecko/20100101 Firefox/34.0\"","@version":"1","@timestamp":"2015-01-13T05:54:35.820Z","host":"node1","path":"/var/log/nginx/access.log","type":"nginx_access","tags":["_grokparsefailure"]}<br /> }, {<br /> "_index" : "logstash-2015.01.13",<br /> "_type" : "nginx_access",<br /> "_id" : "AUrh28f_n9XFZmqFmD74",<br /> "_score" : 1.0,<br /> "_source":{"message":"172.16.255.1 - - [13/Jan/2015:05:54:44 +0000] \"GET / HTTP/1.1\" 304 0 \"-\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:34.0) Gecko/20100101 Firefox/34.0\"","@version":"1","@timestamp":"2015-01-13T05:54:44.841Z","host":"node1","path":"/var/log/nginx/access.log","type":"nginx_access","tags":["_grokparsefailure"]}<br /> } ]<br /> }<br />}mingderwanghttp://www.blogger.com/profile/06360664550731229109noreply@blogger.com0tag:blogger.com,1999:blog-1339230774464327250.post-20178705170162541372015-01-12T22:51:00.000-08:002015-01-12T23:11:29.748-08:00Kibana: This version of Kibana requires Elasticsearch 1.4.0 or higher on all nodes. I found the following incompatible nodes in your cluster: Elasticsearch 1.1.1 @ inet[/10.0.2.15:9301] (172.16.255.250)If your Kibana 4.0 complains with your elasticsearch version 1.1.1. Even though you has install elasticsearch 1.4.2. It's because an elasticsearch running embedded in logstash 1.4.2 (under vendor/jar/elasticearch-1.1.1). You should disable it if you install another elasticsearch 1.4.2 on the same or a different node.<br />
<br />
This is a way to verify it (as follow) <br />
<br />
root@node1:~# netstat -plant | grep 9300<br />
tcp 0 0 0.0.0.0:9300 0.0.0.0:* LISTEN 18907/java<br />
tcp 0 0 10.0.2.15:48597 10.0.2.15:9300 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:9300 10.0.2.15:48598 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:9300 10.0.2.15:48602 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:48605 10.0.2.15:9300 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:48602 10.0.2.15:9300 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:48599 10.0.2.15:9300 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:9300 10.0.2.15:48638 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:9300 10.0.2.15:48639 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:9300 10.0.2.15:48628 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:48601 10.0.2.15:9300 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:9300 10.0.2.15:48595 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:9300 10.0.2.15:48604 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:9300 10.0.2.15:48633 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:48595 10.0.2.15:9300 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:48593 10.0.2.15:9300 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:48598 10.0.2.15:9300 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:9300 10.0.2.15:48596 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:9300 10.0.2.15:48593 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:48596 10.0.2.15:9300 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:9300 10.0.2.15:48635 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:48594 10.0.2.15:9300 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:9300 10.0.2.15:48631 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:9300 10.0.2.15:48600 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:9300 10.0.2.15:48632 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:9300 10.0.2.15:48597 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:9300 10.0.2.15:48627 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:9300 10.0.2.15:48629 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:9300 10.0.2.15:48605 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:9300 10.0.2.15:48637 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:9300 10.0.2.15:48630 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:9300 10.0.2.15:48636 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:48604 10.0.2.15:9300 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:9300 10.0.2.15:48601 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:9300 10.0.2.15:48603 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:9300 10.0.2.15:48599 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:9300 10.0.2.15:48594 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:9300 10.0.2.15:48634 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:48600 10.0.2.15:9300 ESTABLISHED 18907/java<br />
tcp 0 0 10.0.2.15:48603 10.0.2.15:9300 ESTABLISHED 18907/java<br />
tcp6 0 0 10.0.2.15:48639 10.0.2.15:9300 ESTABLISHED 15288/java<br />
tcp6 0 0 10.0.2.15:48636 10.0.2.15:9300 ESTABLISHED 15288/java<br />
tcp6 0 0 10.0.2.15:48634 10.0.2.15:9300 ESTABLISHED 15288/java<br />
tcp6 0 0 10.0.2.15:48633 10.0.2.15:9300 ESTABLISHED 15288/java<br />
tcp6 0 0 10.0.2.15:48637 10.0.2.15:9300 ESTABLISHED 15288/java<br />
tcp6 0 0 10.0.2.15:48631 10.0.2.15:9300 ESTABLISHED 15288/java<br />
tcp6 0 0 10.0.2.15:48628 10.0.2.15:9300 ESTABLISHED 15288/java<br />
tcp6 0 0 10.0.2.15:48629 10.0.2.15:9300 ESTABLISHED 15288/java<br />
tcp6 0 0 10.0.2.15:48632 10.0.2.15:9300 ESTABLISHED 15288/java<br />
tcp6 0 0 10.0.2.15:48627 10.0.2.15:9300 ESTABLISHED 15288/java<br />
tcp6 0 0 10.0.2.15:48630 10.0.2.15:9300 ESTABLISHED 15288/java<br />
tcp6 0 0 10.0.2.15:48635 10.0.2.15:9300 ESTABLISHED 15288/java<br />
tcp6 0 0 10.0.2.15:48638 10.0.2.15:9300 ESTABLISHED 15288/java<br />
<br />
<br />
<br />
root@node1:~# ps wwwp 18907<br />
PID TTY STAT TIME COMMAND<br />
18907 ? SLl 0:30 /usr/bin/java -server -Djava.net.preferIPv4Stack=true -Des.config=/usr/local/etc/elasticsearch/elasticsearch.yml -Xms1201m -Xmx1201m -Xss256k -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.pidfile=/usr/local/var/run/node1.pid -Des.foreground=yes -Des.path.home=/usr/local/elasticsearch -cp :/usr/local/elasticsearch/lib/*:/usr/local/elasticsearch/lib/sigar/* org.elasticsearch.bootstrap.Elasticsearch<br />
<br />
<br />
root@node1:~# ps wwwp 15288<br />
PID TTY STAT TIME COMMAND<br />
15288 ? Sl 1:41 /usr/bin/java -server -Xms400M -Xmx1201M -Djava.io.tmpdir=/opt/logstash/server/tmp/ -Xmx500m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -Djava.awt.headless=true -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -jar /opt/logstash/server/vendor/jar/jruby-complete-1.7.11.jar -I/opt/logstash/server/lib /opt/logstash/server/lib/logstash/runner.rb agent -f /opt/logstash/server/etc/conf.d --pluginpath /opt/logstash/server/lib -l /opt/logstash/server/log/logstash.log -w 1mingderwanghttp://www.blogger.com/profile/06360664550731229109noreply@blogger.com1tag:blogger.com,1999:blog-1339230774464327250.post-55107815584642858962015-01-12T22:41:00.000-08:002015-01-12T22:41:12.084-08:00Adding ELK command line examplesELK (Elasticsearch 1.4.2 + Logstash 1.4.2 + Kibana 4.0)<br />
<br />
$ curl http://localhost:9200/_nodes?pretty=true<br />
<br />
<pre>{
"cluster_name" : "elasticsearch",
"nodes" : {
"VJvlweg1TxWurCHeJAgNzA" : {
"name" : "node1",
"transport_address" : "inet[/10.0.2.15:9300]",
"host" : "node1",
"ip" : "172.16.255.250",
"version" : "1.4.2",
"build" : "927caff",
"http_address" : "inet[/10.0.2.15:9200]",
"attributes" : {
"max_local_storage_nodes" : "1"
},
"settings" : {
"index" : {
"mapper" : {
"dynamic" : "true"
}
},
"bootstrap" : {
"mlockall" : "true"
},
"client" : {
"type" : "node"
},
"gateway" : {
"expected_nodes" : "1"
},
"pidfile" : "/usr/local/var/run/node1.pid",
"node" : {
"max_local_storage_nodes" : "1",
"name" : "node1"
},
"http" : {
"port" : "9200"
},
"name" : "node1",
"action" : {
"auto_create_index" : "true",
"disable_delete_all_indices" : "true"
},
"path" : {
"data" : "/usr/local/var/data/elasticsearch",
"home" : "/usr/local/elasticsearch",
"conf" : "/usr/local/etc/elasticsearch",
"logs" : "/usr/local/var/log/elasticsearch"
},
"cloud" : {
"node" : {
"auto_attributes" : "true"
}
},
"config" : "/usr/local/etc/elasticsearch/elasticsearch.yml",
"cluster" : {
"name" : "elasticsearch"
},
"discovery" : {
"zen" : {
"minimum_master_nodes" : "1",
"ping" : {
"multicast" : {
"enabled" : "true"
}
}
}
},
"foreground" : "yes"
},
"os" : {
"refresh_interval_in_millis" : 1000,
"available_processors" : 2,
"cpu" : {
"vendor" : "Intel",
"model" : "Core(TM) i5-4260U CPU @ 1.40GHz",
"mhz" : 2009,
"total_cores" : 2,
"total_sockets" : 1,
"cores_per_socket" : 2,
"cache_size_in_bytes" : 6144
},
"mem" : {
"total_in_bytes" : 2099187712
},
"swap" : {
"total_in_bytes" : 3137335296
}
},
"process" : {
"refresh_interval_in_millis" : 1000,
"id" : 18907,
"max_file_descriptors" : 64000,
"mlockall" : true
},
"jvm" : {
"pid" : 18907,
"version" : "1.7.0_65",
"vm_name" : "OpenJDK 64-Bit Server VM",
"vm_version" : "24.65-b04",
"vm_vendor" : "Oracle Corporation",
"start_time_in_millis" : 1421130288311,
"mem" : {
"heap_init_in_bytes" : 1259339776,
"heap_max_in_bytes" : 1242955776,
"non_heap_init_in_bytes" : 24313856,
"non_heap_max_in_bytes" : 224395264,
"direct_max_in_bytes" : 1242955776
},
"gc_collectors" : [ "ParNew", "ConcurrentMarkSweep" ],
"memory_pools" : [ "Code Cache", "Par Eden Space", "Par Survivor Space", "CMS Old Gen", "CMS Perm Gen" ]
},
"thread_pool" : {
"generic" : {
"type" : "cached",
"keep_alive" : "30s",
"queue_size" : -1
},
"index" : {
"type" : "fixed",
"min" : 2,
"max" : 2,
"queue_size" : "200"
},
"bench" : {
"type" : "scaling",
"min" : 1,
"max" : 1,
"keep_alive" : "5m",
"queue_size" : -1
},
"get" : {
"type" : "fixed",
"min" : 2,
"max" : 2,
"queue_size" : "1k"
},
"snapshot" : {
"type" : "scaling",
"min" : 1,
"max" : 1,
"keep_alive" : "5m",
"queue_size" : -1
},
"merge" : {
"type" : "scaling",
"min" : 1,
"max" : 1,
"keep_alive" : "5m",
"queue_size" : -1
},
"suggest" : {
"type" : "fixed",
"min" : 2,
"max" : 2,
"queue_size" : "1k"
},
"bulk" : {
"type" : "fixed",
"min" : 2,
"max" : 2,
"queue_size" : "50"
},
"optimize" : {
"type" : "fixed",
"min" : 1,
"max" : 1,
"queue_size" : -1
},
"warmer" : {
"type" : "scaling",
"min" : 1,
"max" : 1,
"keep_alive" : "5m",
"queue_size" : -1
},
"flush" : {
"type" : "scaling",
"min" : 1,
"max" : 1,
"keep_alive" : "5m",
"queue_size" : -1
},
"search" : {
"type" : "fixed",
"min" : 6,
"max" : 6,
"queue_size" : "1k"
},
"listener" : {
"type" : "fixed",
"min" : 1,
"max" : 1,
"queue_size" : -1
},
"percolate" : {
"type" : "fixed",
"min" : 2,
"max" : 2,
"queue_size" : "1k"
},
"management" : {
"type" : "scaling",
"min" : 1,
"max" : 5,
"keep_alive" : "5m",
"queue_size" : -1
},
"refresh" : {
"type" : "scaling",
"min" : 1,
"max" : 1,
"keep_alive" : "5m",
"queue_size" : -1
}
},
"network" : {
"refresh_interval_in_millis" : 5000,
"primary_interface" : {
"address" : "10.0.2.15",
"name" : "eth0",
"mac_address" : "08:00:27:98:DC:AA"
}
},
"transport" : {
"bound_address" : "inet[/0.0.0.0:9300]",
"publish_address" : "inet[/10.0.2.15:9300]"
},
"http" : {
"bound_address" : "inet[/0.0.0.0:9200]",
"publish_address" : "inet[/10.0.2.15:9200]",
"max_content_length_in_bytes" : 104857600
},
"plugins" : [ ]
},
"oxvKUB4kTPiYkvAx_jiuRw" : {
"name" : "logstash-node1-15288-4072",
"transport_address" : "inet[/10.0.2.15:9301]",
"host" : "node1",
"ip" : "172.16.255.250",
"version" : "1.1.1",
"build" : "f1585f0",
"attributes" : {
"client" : "true",
"data" : "false"
},
"settings" : {
"path" : {
"logs" : "/opt/logstash/server/logs"
},
"cluster" : {
"name" : "elasticsearch"
},
"node" : {
"client" : "true",
"name" : "logstash-node1-15288-4072"
},
"discovery" : {
"zen" : {
"ping" : {
"unicast" : {
"hosts" : "localhost:9300,localhost:9301,localhost:9302,localhost:9303,localhost:9304,localhost:9305"
},
"multicast" : {
"enabled" : "false"
}
}
}
},
"http" : {
"enabled" : "false"
},
"name" : "logstash-node1-15288-4072"
},
"os" : {
"refresh_interval_in_millis" : 1000,
"available_processors" : 2
},
"process" : {
"refresh_interval_in_millis" : 1000,
"id" : 15288,
"max_file_descriptors" : 65550,
"mlockall" : false
},
"jvm" : {
"pid" : 15288,
"version" : "1.7.0_65",
"vm_name" : "OpenJDK 64-Bit Server VM",
"vm_version" : "24.65-b04",
"vm_vendor" : "Oracle Corporation",
"start_time_in_millis" : 1421127217161,
"mem" : {
"heap_init_in_bytes" : 419430400,
"heap_max_in_bytes" : 506855424,
"non_heap_init_in_bytes" : 24313856,
"non_heap_max_in_bytes" : 224395264,
"direct_max_in_bytes" : 506855424
},
"gc_collectors" : [ "ParNew", "ConcurrentMarkSweep" ],
"memory_pools" : [ "Code Cache", "Par Eden Space", "Par Survivor Space", "CMS Old Gen", "CMS Perm Gen" ]
},
"thread_pool" : {
"generic" : {
"type" : "cached",
"keep_alive" : "30s",
"queue_size" : -1
},
"index" : {
"type" : "fixed",
"min" : 2,
"max" : 2,
"queue_size" : "200"
},
"get" : {
"type" : "fixed",
"min" : 2,
"max" : 2,
"queue_size" : "1k"
},
"snapshot" : {
"type" : "scaling",
"min" : 1,
"max" : 1,
"keep_alive" : "5m",
"queue_size" : -1
},
"merge" : {
"type" : "scaling",
"min" : 1,
"max" : 1,
"keep_alive" : "5m",
"queue_size" : -1
},
"suggest" : {
"type" : "fixed",
"min" : 2,
"max" : 2,
"queue_size" : "1k"
},
"bulk" : {
"type" : "fixed",
"min" : 2,
"max" : 2,
"queue_size" : "50"
},
"optimize" : {
"type" : "fixed",
"min" : 1,
"max" : 1,
"queue_size" : -1
},
"warmer" : {
"type" : "scaling",
"min" : 1,
"max" : 1,
"keep_alive" : "5m",
"queue_size" : -1
},
"flush" : {
"type" : "scaling",
"min" : 1,
"max" : 1,
"keep_alive" : "5m",
"queue_size" : -1
},
"search" : {
"type" : "fixed",
"min" : 6,
"max" : 6,
"queue_size" : "1k"
},
"percolate" : {
"type" : "fixed",
"min" : 2,
"max" : 2,
"queue_size" : "1k"
},
"management" : {
"type" : "scaling",
"min" : 1,
"max" : 5,
"keep_alive" : "5m",
"queue_size" : -1
},
"refresh" : {
"type" : "scaling",
"min" : 1,
"max" : 1,
"keep_alive" : "5m",
"queue_size" : -1
}
},
"network" : {
"refresh_interval_in_millis" : 5000,
"primary_interface" : {
"address" : "",
"name" : "",
"mac_address" : ""
}
},
"transport" : {
"bound_address" : "inet[/0:0:0:0:0:0:0:0%0:9301]",
"publish_address" : "inet[/10.0.2.15:9301]"
},
"plugins" : [ ]
}
}
}
</pre>
<br />
<br />
<br />mingderwanghttp://www.blogger.com/profile/06360664550731229109noreply@blogger.com0tag:blogger.com,1999:blog-1339230774464327250.post-7170060290062029322014-09-25T08:16:00.002-07:002014-09-28T20:49:41.880-07:00CVE-2014-6271, CVE-2014-7169 Bash Vulnerability <div>
<br />
more on <a href="https://shellshocker.net/">https://shellshocker.net/</a><br />
<br />
CVE-2014-6271 remote execution code through bash.<br />
CVE-2014-7169 incomplete fix for CVE-2014-6271<br />
<ul>
<li>Ubuntu : <a href="http://people.canonical.com/~ubuntu-security/cve/2014/CVE-2014-7169.html">http://people.canonical.com/~ubuntu-security/cve/2014/CVE-2014-7169.html</a> (<span style="-webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: arial, sans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: auto; word-spacing: 0px;">4.2-2ubuntu2.3, 4.3-7ubuntu1.2)</span></li>
<li>Red Hat :<a href="https://access.redhat.com/security/cve/CVE-2014-7169">https://access.redhat.com/security/cve/CVE-2014-7169</a></li>
<li>Red Hat: <a href="https://access.redhat.com/articles/1200223">https://access.redhat.com/articles/1200223</a></li>
<li>Debian : <a href="https://security-tracker.debian.org/tracker/CVE-2014-7169">https://security-tracker.debian.org/tracker/CVE-2014-7169</a></li>
<li>CentOS: <a href="https://www.conoha.jp/blog/tech/3490.html">https://www.conoha.jp/blog/tech/3490.html</a> (Japanese)</li>
<li>CoreOS: <a href="https://coreos.com/blog/security-update-shellshock/">https://coreos.com/blog/security-update-shellshock/</a></li>
<li>Mac OS X: <a href="http://showterm.io/c96936f54f88c4475737d">http://showterm.io/c96936f54f88c4475737d</a> (need XCode)</li>
</ul>
<br />
FOR UBUNTU:<br />
<ul>
</ul>
Remarks: CVE-2014-7169 has no patches yet !!! (9/24/2014)<br />
(9/26/2014) Ubuntu patch for CVE-2014-7169 <br />
<br />
for ubuntu, just use following command to upgrade bash<br />
<br />
$ sudo apt-get update && sudo apt-get install bash<br />
<br />
## check your bash version with<br />
<br />
$ dpkg -s bash | grep Version<br />
Version: 4.2-2ubuntu2.3<br />
<br />
or<br />
<br />
<br />
$ dpkg -s bash | grep Version<br />
Version: <span style="-webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: arial, sans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: auto; word-spacing: 0px;"> 4.3-7ubuntu1.2</span><br />
<br />
<br />
<br />
<br />
if your bash is patched, you will see no "echo" for 'vulnerable' as bellow;<br />
<br />
$ <code style="font-style: normal; font-weight: normal;">env x='() { :;}; echo vulnerable' bash -c "echo this is a test"</code><br />
bash: warning: x: ignoring function definition attempt
bash: error importing function definition for `x'
this is a test<br />
<br />
<br />
FOR CENTOS<br />
<br />
CentOS7
bash-4.2.45-5.el7_0.4
CentOS6
bash-4.1.2-15.el6_5.2
CentOS5
bash-3.2-33.el5_11.4<br />
<br />
<br />
<br />
<br /></div>
mingderwanghttp://www.blogger.com/profile/06360664550731229109noreply@blogger.com0tag:blogger.com,1999:blog-1339230774464327250.post-32390152728817508772014-08-19T19:48:00.000-07:002014-08-19T19:48:10.114-07:00after you install openstack on Ubuntu 14.04 server, you can use following nova commandsroot@ssd:~# nova --os-username=admin --os-tenant-name=admin --os-auth-url="http://10.0.1.100:5000/v2.0/" usage<br />OS Password:<br />Usage from 2014-07-23 to 2014-08-21:<br />+---------+--------------+-----------+---------------+<br />| Servers | RAM MB-Hours | CPU Hours | Disk GB-Hours |<br />+---------+--------------+-----------+---------------+<br />| 2 | 556.80 | 1.09 | 1.09 |<br />+---------+--------------+-----------+---------------+<br />
<br />
root@ssd:~# nova --os-username=admin --os-tenant-name=admin --os-auth-url="http://10.0.1.100:5000/v2.0/" --version<br />2.17.0mingderwanghttp://www.blogger.com/profile/06360664550731229109noreply@blogger.com0tag:blogger.com,1999:blog-1339230774464327250.post-43642725376591893332014-08-12T01:56:00.001-07:002014-08-12T01:56:05.003-07:00no password for CoreOS to login as username: core (on AWS EC2)ming➜~/.ec2» ssh -i turboteam.pem root@54.64.18.203 [16:45:05]<br />
root@54.64.18.203's password:<br />
Permission denied, please try again.<br />
root@54.64.18.203's password:<br />
Permission denied, please try again.<br />
root@54.64.18.203's password:<br />
Connection closed by 54.64.18.203<br />
ming➜~/.ec2» ssh -i turboteam.pem root@54.64.18.203 [16:54:17]<br />
root@54.64.18.203's password:<br />
Permission denied, please try again.<br />
root@54.64.18.203's password:<br />
Permission denied, please try again.<br />
root@54.64.18.203's password:<br />
Permission denied (publickey,password,keyboard-interactive).<br />
ming➜~/.ec2» [16:54:27]<br />
ming➜~/.ec2» ssh -i turboteam.pem root@54.64.18.203 [16:54:28]<br />
root@54.64.18.203's password:<br />
<br />
ming➜~/.ec2» ssh -i turboteam.pem core@54.64.18.203 [16:54:45]<br />
CoreOS (beta)mingderwanghttp://www.blogger.com/profile/06360664550731229109noreply@blogger.com1tag:blogger.com,1999:blog-1339230774464327250.post-39083957113120461462014-08-12T00:57:00.002-07:002014-08-12T01:05:03.054-07:00A couple ways to launch an EC2 on AWS from remote.<br />
<ul>
<li>Vagrant (<a href="https://github.com/mitchellh/vagrant-aws">https://github.com/mitchellh/vagrant-aws</a>)</li>
<li>Apache Mesos (<a href="https://elastic.mesosphere.io/">https://elastic.mesosphere.io/</a>) 3-steps.</li>
<li>Vagrant + Mesos (<a href="https://github.com/everpeace/vagrant-mesos#sec2">https://github.com/everpeace/vagrant-mesos#sec2</a>)</li>
<li>using jcloud library (<a href="https://jclouds.apache.org/guides/aws-ec2/">https://jclouds.apache.org/guides/aws-ec2/</a>)</li>
<li>???</li>
</ul>
mingderwanghttp://www.blogger.com/profile/06360664550731229109noreply@blogger.com0tag:blogger.com,1999:blog-1339230774464327250.post-87531037569064375142014-07-31T02:45:00.002-07:002014-07-31T02:45:46.837-07:00install VirtualBox on uBuntu server (no test on AWS EC2)<pre style="background-color: #f3f3f3; border: 1px dashed rgb(193, 180, 150); color: #333333; font-family: UbuntuMono, courier, monospace; font-size: 13.142857551574707px; line-height: 16px; margin-bottom: 8px; padding: 4pt; vertical-align: baseline; white-space: pre-wrap; word-wrap: break-word;">sudo sh -c "echo 'deb http://download.virtualbox.org/virtualbox/debian '$(lsb_release -cs)' contrib non-free' > /etc/apt/sources.list.d/virtualbox.list" && wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add - && sudo apt-get update && sudo apt-get install virtualbox-4.3 dkms</pre>
mingderwanghttp://www.blogger.com/profile/06360664550731229109noreply@blogger.com0tag:blogger.com,1999:blog-1339230774464327250.post-15055997574077385582014-07-23T09:18:00.002-07:002014-07-23T09:18:26.263-07:00how to install docker on AWS EC2 CentOS instance.<You can still despise git within a year, but not docker.><br />
<pre style="background-color: whitesmoke; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.14902); color: #333333; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; line-height: 20px; margin-bottom: 10px; padding: 9.5px; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;">sudo yum -y install docker-io</pre>
<pre style="background-color: whitesmoke; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.14902); color: #333333; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; line-height: 20px; margin-bottom: 10px; padding: 9.5px; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;">sudo service docker start</pre>
<pre style="background-color: whitesmoke; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.14902); color: #333333; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; line-height: 20px; margin-bottom: 10px; padding: 9.5px; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;">sudo chkconfig docker on</pre>
test to create an ubuntu container<br />
<br />
<div class="p1">
sudo docker run -it ubuntu sh</div>
<br />
<div class="p1">
<br /></div>
<div class="p1">
<br /></div>
<div class="p1">
<demo></div>
<div class="p1">
[ec2-user@ip-172-31-27-45 ~]$ sudo yum -y install docker-io</div>
<div class="p1">
Loaded plugins: priorities, update-motd, upgrade-helper</div>
<div class="p1">
amzn-main/latest | 2.1 kB 00:00 </div>
<div class="p1">
amzn-updates/latest | 2.3 kB 00:00 </div>
<div class="p1">
mongodb | 951 B 00:00 </div>
<div class="p1">
Package docker-1.0.0-1.15.amzn1.x86_64 already installed and latest version</div>
<div class="p1">
</div>
<div class="p1">
Nothing to do</div>
<div class="p1">
<br /></div>
<div class="p1">
[ec2-user@ip-172-31-27-45 ~]$ sudo service docker start</div>
<div class="p1">
Starting cgconfig service: [<span class="s1"> OK </span>]</div>
<div class="p1">
Starting docker:<span class="Apple-tab-span"> </span> [<span class="s1"> OK </span>]</div>
<div class="p1">
<br /></div>
<div class="p1">
[ec2-user@ip-172-31-27-45 ~]$ sudo chkconfig docker on</div>
<div class="p1">
<br /></div>
<div class="p1">
[ec2-user@ip-172-31-27-45 ~]$ sudo docker run -it ubuntu sh</div>
<div class="p1">
Unable to find image 'ubuntu' locally</div>
<div class="p1">
Pulling repository ubuntu</div>
<div class="p1">
ba5877dc9bec: Download complete </div>
<div class="p1">
511136ea3c5a: Download complete </div>
<div class="p1">
9bad880da3d2: Download complete </div>
<div class="p1">
25f11f5fb0cb: Download complete </div>
<div class="p1">
ebc34468f71d: Download complete </div>
<div class="p1">
2318d26665ef: Download complete </div>
<div class="p1">
# uname -a</div>
<div class="p1">
Linux d5d4e7e0ea4e 3.10.38-49.136.amzn1.x86_64 #1 SMP Mon May 5 18:28:06 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux</div>
<div class="p1">
# df</div>
<div class="p1">
Filesystem 1K-blocks Used Available Use% Mounted on</div>
<div class="p1">
/dev/mapper/docker-202:1-147559-d5d4e7e0ea4e50bff40e7e53a4106e2c238066811bbebbe86020f1c7cce987dd 10190136 228364 9421100 3% /</div>
<div class="p1">
tmpfs 303460 0 303460 0% /dev</div>
<div class="p1">
shm 65536 0 65536 0% /dev/shm</div>
<div class="p1">
/dev/xvda1 8125880 7426032 599580 93% /etc/hosts</div>
<div class="p1">
tmpfs 303460 0 303460 0% /proc/kcore</div>
<div class="p1">
# exit</div>
<div class="p1">
[ec2-user@ip-172-31-27-45 ~]$ uname -a</div>
<div class="p1">
</div>
<div class="p1">
Linux ip-172-31-27-45 3.10.38-49.136.amzn1.x86_64 #1 SMP Mon May 5 18:28:06 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux</div>
<div class="p1">
<br /></div>
<div class="p1">
[ec2-user@ip-172-31-27-45 ~]$ df</div>
<div class="p1">
df: ‘/var/lib/docker/devicemapper’: Permission denied</div>
<div class="p1">
Filesystem 1K-blocks Used Available Use% Mounted on</div>
<div class="p1">
/dev/xvda1 8125880 7426012 599600 93% /</div>
<div class="p1">
devtmpfs 287060 52 287008 1% /dev</div>
<div class="p1">
</div>
<div class="p1">
tmpfs 303460 0 303460 0% /dev/shm</div>
<br />
<br />
<div class="p1">
<br /></div>
<div class="p1">
<br /></div>
mingderwanghttp://www.blogger.com/profile/06360664550731229109noreply@blogger.com0tag:blogger.com,1999:blog-1339230774464327250.post-69692243473812200152014-07-03T01:47:00.002-07:002014-07-03T01:47:15.036-07:00Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146<pre class="line-pre" style="background-color: white; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 13.4399995803833px; width: 953.5999755859375px;"><div class="line" id="file-gistfile1-txt-LC1" style="box-sizing: border-box;">
MongoDB shell version: 2.6.3</div>
<div class="line" id="file-gistfile1-txt-LC2" style="box-sizing: border-box;">
connecting to: test</div>
<div class="line" id="file-gistfile1-txt-LC3" style="box-sizing: border-box;">
2014-07-01T15:34:46.151+0800 warning: Failed to connect to 127.0.0.1:27017, reason: errno:113 No route to host</div>
<div class="line" id="file-gistfile1-txt-LC4" style="box-sizing: border-box;">
2014-07-01T15:34:46.153+0800 Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146</div>
<div class="line" id="file-gistfile1-txt-LC5" style="box-sizing: border-box;">
exception: connect failed</div>
<div class="line" id="file-gistfile1-txt-LC5" style="box-sizing: border-box;">
</div>
<div class="line" id="file-gistfile1-txt-LC5" style="box-sizing: border-box;">
</div>
<div class="line" id="file-gistfile1-txt-LC5" style="box-sizing: border-box;">
SOLUTION:</div>
<div class="line" id="file-gistfile1-txt-LC5" style="box-sizing: border-box;">
</div>
<div class="line" id="file-gistfile1-txt-LC5" style="box-sizing: border-box;">
<span style="color: #666666; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 16px; line-height: 17.920000076293945px; white-space: normal;">sudo iptables -I INPUT -p tcp -m state --state NEW,ESTABLISHED --dport 27017 -j ACCEPT</span></div>
</pre>
mingderwanghttp://www.blogger.com/profile/06360664550731229109noreply@blogger.com0tag:blogger.com,1999:blog-1339230774464327250.post-60374638915945393722014-07-02T20:36:00.001-07:002014-07-03T01:26:41.940-07:00ERROR: listen(): bind() failed errno:13 Permission denied for socket: /tmp/mongodb-27017.sockWhen you install mongoDB for CentOS on AWS EC2 and get trouble to run "mongod"<br />
You may see ERROR message as title, this is one of the way to resolve the problem.<br />
<br />
<pre class="line-pre" style="background-color: white; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 9.59999942779541px; width: 2451.428466796875px;"><div class="line" id="file-gistfile1-txt-LC1" style="box-sizing: border-box;">
# chown root:root /tmp</div>
<div class="line" id="file-gistfile1-txt-LC2" style="box-sizing: border-box;">
# chmod 1777 /tmp</div>
<div class="line" id="file-gistfile1-txt-LC2" style="box-sizing: border-box;">
</div>
<div class="line" id="file-gistfile1-txt-LC2" style="box-sizing: border-box;">
</div>
<div class="line" id="file-gistfile1-txt-LC2" style="box-sizing: border-box;">
</div>
<div class="line" id="file-gistfile1-txt-LC2" style="box-sizing: border-box;">
</div>
<div class="line" id="file-gistfile1-txt-LC2" style="box-sizing: border-box;">
error message:</div>
<div class="line" id="file-gistfile1-txt-LC2" style="box-sizing: border-box;">
<pre class="line-pre" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; width: 2451.428466796875px;"><div class="line" id="file-gistfile1-txt-LC6" style="box-sizing: border-box;">
2014-07-01T11:34:16.802+0800 ***** SERVER RESTARTED *****</div>
<div class="line" id="file-gistfile1-txt-LC7" style="box-sizing: border-box;">
2014-07-01T11:34:16.814+0800 [initandlisten] MongoDB starting : pid=27528 port=27017 dbpath=/diskZ/mongodb/data/db 64-bit host=95ad9659-ada0-40df-ade9-af531e81e9e4</div>
<div class="line" id="file-gistfile1-txt-LC8" style="box-sizing: border-box;">
2014-07-01T11:34:16.814+0800 [initandlisten] db version v2.6.3</div>
<div class="line" id="file-gistfile1-txt-LC9" style="box-sizing: border-box;">
2014-07-01T11:34:16.814+0800 [initandlisten] git version: 255f67a66f9603c59380b2a389e386910bbb52cb</div>
<div class="line" id="file-gistfile1-txt-LC10" style="box-sizing: border-box;">
2014-07-01T11:34:16.814+0800 [initandlisten] build info: Linux build12.nj1.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49</div>
<div class="line" id="file-gistfile1-txt-LC11" style="box-sizing: border-box;">
2014-07-01T11:34:16.814+0800 [initandlisten] allocator: tcmalloc</div>
<div class="line" id="file-gistfile1-txt-LC12" style="box-sizing: border-box;">
2014-07-01T11:34:16.814+0800 [initandlisten] options: { config: "/etc/mongod.conf", net: { bindIp: "127.0.0.1" }, processManagement: { fork: true, pidFilePath: "/var/run/mongodb/mongod.pid" }, storage: { dbPath: "/diskZ/mongodb/data/db" }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log" } }</div>
<div class="line" id="file-gistfile1-txt-LC13" style="box-sizing: border-box;">
2014-07-01T11:34:16.827+0800 [initandlisten] journal dir=/diskZ/mongodb/data/db/journal</div>
<div class="line" id="file-gistfile1-txt-LC14" style="box-sizing: border-box;">
2014-07-01T11:34:16.828+0800 [initandlisten] recover : no journal files present, no recovery needed</div>
<div class="line" id="file-gistfile1-txt-LC15" style="box-sizing: border-box;">
2014-07-01T11:34:16.887+0800 [initandlisten] ERROR: listen(): bind() failed errno:13 Permission denied for socket: /tmp/mongodb-27017.sock</div>
</pre>
</div>
</pre>
mingderwanghttp://www.blogger.com/profile/06360664550731229109noreply@blogger.com0tag:blogger.com,1999:blog-1339230774464327250.post-63784586368970952412014-05-11T23:27:00.002-07:002014-05-11T23:27:27.890-07:00run karaf 3.0.1 as a service (daemon) in a AWS CE2 CentOS.<span style="font-family: Arial; font-size: 13px;">karaf@root()> feature:install wrapper</span><br />
<span style="font-family: Arial; font-size: 13px;">karaf@root()> wrapper:install -s AUTO_START -n KARAF -d Karaf -D "Karaf Service"</span><br />
<span style="font-family: Arial; font-size: 13px;">Creating file: /home/ming/apache-karaf-3.0.1/bin/KARAF-wrapper</span><br />
<span style="font-family: Arial; font-size: 13px;">Creating file: /home/ming/apache-karaf-3.0.1/bin/KARAF-service</span><br />
<span style="font-family: Arial; font-size: 13px;">Creating file: /home/ming/apache-karaf-3.0.1/etc/KARAF-wrapper.conf</span><br />
<span style="font-family: Arial; font-size: 13px;">Creating file: /home/ming/apache-karaf-3.0.1/lib/libwrapper.so</span><br />
<span style="font-family: Arial; font-size: 13px;">Creating file: /home/ming/apache-karaf-3.0.1/lib/karaf-wrapper.jar</span><br />
<span style="font-family: Arial; font-size: 13px;">Creating file: /home/ming/apache-karaf-3.0.1/lib/karaf-wrapper-main.jar</span><br />
<span style="font-family: Arial; font-size: 13px;"></span><br />
<span style="font-family: Arial; font-size: 13px;">Setup complete. You may wish to tweak the JVM properties in the wrapper configuration file:</span><br />
<span style="font-family: Arial; font-size: 13px;"> /home/ming/apache-karaf-3.0.1/etc/KARAF-wrapper.conf</span><br />
<span style="font-family: Arial; font-size: 13px;">before installing and starting the service.</span><br />
<span style="font-family: Arial; font-size: 13px;"></span><br />
<span style="font-family: Arial; font-size: 13px;"></span><br />
<span style="font-family: Arial; font-size: 13px;">On Redhat/Fedora/CentOS Systems:</span><br />
<span style="font-family: Arial; font-size: 13px;"> To install the service:</span><br />
<span style="font-family: Arial; font-size: 13px;"> $ ln -s /home/ming/apache-karaf-3.0.1/bin/KARAF-service /etc/init.d/</span><br />
<span style="font-family: Arial; font-size: 13px;"> $ chkconfig KARAF-service --add</span><br />
<span style="font-family: Arial; font-size: 13px;"></span><br />
<span style="font-family: Arial; font-size: 13px;"> To start the service when the machine is rebooted:</span><br />
<span style="font-family: Arial; font-size: 13px;"> $ chkconfig KARAF-service on</span><br />
<span style="font-family: Arial; font-size: 13px;"></span><br />
<span style="font-family: Arial; font-size: 13px;"> To disable starting the service when the machine is rebooted:</span><br />
<span style="font-family: Arial; font-size: 13px;"> $ chkconfig KARAF-service off</span><br />
<span style="font-family: Arial; font-size: 13px;"></span><br />
<span style="font-family: Arial; font-size: 13px;"> To start the service:</span><br />
<span style="font-family: Arial; font-size: 13px;"> $ service KARAF-service start</span><br />
<span style="font-family: Arial; font-size: 13px;"></span><br />
<span style="font-family: Arial; font-size: 13px;"> To stop the service:</span><br />
<span style="font-family: Arial; font-size: 13px;"> $ service KARAF-service stop</span><br />
<span style="font-family: Arial; font-size: 13px;"></span><br />
<span style="font-family: Arial; font-size: 13px;"> To uninstall the service :</span><br />
<span style="font-family: Arial; font-size: 13px;"> $ chkconfig KARAF-service --del</span><br />
<span style="font-family: Arial; font-size: 13px;"> $ rm /etc/init.d/KARAF-service</span><br />
<span style="font-family: Arial; font-size: 13px;"></span><br />
<span style="font-family: Arial; font-size: 13px;">On Ubuntu/Debian Systems:</span><br />
<span style="font-family: Arial; font-size: 13px;"> To install the service:</span><br />
<span style="font-family: Arial; font-size: 13px;"> $ ln -s /home/ming/apache-karaf-3.0.1/bin/KARAF-service /etc/init.d/</span><br />
<span style="font-family: Arial; font-size: 13px;"></span><br />
<span style="font-family: Arial; font-size: 13px;"> To start the service when the machine is rebooted:</span><br />
<span style="font-family: Arial; font-size: 13px;"> $ update-rc.d KARAF-service defaults</span><br />
<span style="font-family: Arial; font-size: 13px;"></span><br />
<span style="font-family: Arial; font-size: 13px;"> To disable starting the service when the machine is rebooted:</span><br />
<span style="font-family: Arial; font-size: 13px;"> $ update-rc.d -f KARAF-service remove</span><br />
<span style="font-family: Arial; font-size: 13px;"></span><br />
<span style="font-family: Arial; font-size: 13px;"> To start the service:</span><br />
<span style="font-family: Arial; font-size: 13px;"> $ /etc/init.d/KARAF-service start</span><br />
<span style="font-family: Arial; font-size: 13px;"></span><br />
<span style="font-family: Arial; font-size: 13px;"> To stop the service:</span><br />
<span style="font-family: Arial; font-size: 13px;"> $ /etc/init.d/KARAF-service stop</span><br />
<span style="font-family: Arial; font-size: 13px;"></span><br />
<span style="font-family: Arial; font-size: 13px;"> To uninstall the service :</span><br />
<span style="font-family: Arial; font-size: 13px;"> $ rm /etc/init.d/KARAF-service</span>mingderwanghttp://www.blogger.com/profile/06360664550731229109noreply@blogger.com0tag:blogger.com,1999:blog-1339230774464327250.post-534114978508762142013-07-29T20:39:00.000-07:002013-07-29T20:39:05.845-07:00add new user and password on CentOS for Amazon AWS EC2$ useradd new_user_name<br />
$ passwd new_user_name<br />
<br />mingderwanghttp://www.blogger.com/profile/06360664550731229109noreply@blogger.com0tag:blogger.com,1999:blog-1339230774464327250.post-47872287908099966022013-07-29T20:05:00.000-07:002013-07-29T20:05:39.829-07:00how to install apache subversions on Amazon AWS EC2take a look at README under /etc/httpd/conf.d<br />
<br />
$ pwd<br />
/etc/httpd/conf.d<br />
[ec2-user@puppet conf.d]$ ls<br />
notrace.conf README subversion.conf welcome.conf<br />
[ec2-user@puppet conf.d]$ cat subversion.conf<br />
<br />
LoadModule dav_svn_module modules/mod_dav_svn.so<br />
LoadModule authz_svn_module modules/mod_authz_svn.so<br />
LoadModule dontdothat_module modules/mod_dontdothat.so<br />
<br />
#<br />
# Example configuration to enable HTTP access for a directory<br />
# containing Subversion repositories, "/var/www/svn". Each repository<br />
# must be both:<br />
#<br />
# a) readable and writable by the 'apache' user, and<br />
#<br />
# b) labelled with the 'httpd_sys_content_t' context if using<br />
# SELinux<br />
#<br />
<br />
#<br />
# To create a new repository "http://localhost/repos/stuff" using<br />
# this configuration, run as root:<br />
#<br />
# # cd /var/www/svn<br />
# # svnadmin create stuff <br />
# # chown -R apache:apache stuff<br />
# # chcon -R -t httpd_sys_content_t stuff<br />
#<br />
<br />
#<Location /repos><br />
# DAV svn<br />
# SVNParentPath /var/www/svn<br />
#<br />
# # Limit write permission to list of valid users.<br />
# <LimitExcept GET PROPFIND OPTIONS REPORT><br />
# # Require SSL connection for password protection.<br />
# # SSLRequireSSL<br />
#<br />
# AuthType Basic<br />
# AuthName "Authorization Realm"<br />
# AuthUserFile /path/to/passwdfile<br />
# Require valid-user<br />
# </LimitExcept><br />
#</Location>mingderwanghttp://www.blogger.com/profile/06360664550731229109noreply@blogger.com0tag:blogger.com,1999:blog-1339230774464327250.post-57842108748565381162013-07-29T19:45:00.001-07:002013-07-29T19:45:10.965-07:00What happen if I can't start my apache web server on Amazon aws ec2 ?$ sudo service httpd start<br />
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using puppet.katdc.com for ServerName<br />
(98)Address already in use: make_sock: could not bind to address [::]:80<br />
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80<br />
no listening sockets available, shutting down<br />
Unable to open logs<br />
[FAILED]<br />
[ec2-user@puppet init.d]$ sudo !!<br />
sudo sudo service httpd start<br />
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using puppet.katdc.com for ServerName<br />
(98)Address already in use: make_sock: could not bind to address [::]:80<br />
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80<br />
no listening sockets available, shutting down<br />
Unable to open logs<br />
[FAILED]<br />
[ec2-user@puppet init.d]$ sudo service nginx stop<br />
Stopping nginx: [ OK ]<br />
[ec2-user@puppet init.d]$ sudo sudo service httpd start<br />
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using puppet.katdc.com for ServerName<br />
[ OK ]mingderwanghttp://www.blogger.com/profile/06360664550731229109noreply@blogger.com0