tag:blogger.com,1999:blog-8162525198449052782024-03-13T22:41:36.538+05:30L E A R N I N G SLearningshttp://www.blogger.com/profile/11717619302144339377noreply@blogger.comBlogger154125tag:blogger.com,1999:blog-816252519844905278.post-22017644914778330912019-06-17T22:38:00.003+05:302019-06-17T22:38:59.759+05:30AnsibleError: Unable to create local directories(/home/ubuntu/.ansible/tmp)<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Ansible Error: </span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="background-color: #fce5cd; font-family: "arial" , "helvetica" , sans-serif;">AnsibleError: Unable to create local directories(/home/ubuntu/.ansible/tmp): [Errno 13] Permission denied: '/home/ubuntu/.ansible/tmp'</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">When I do ls -al I see the .ansible directory is owned by root. </span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="background-color: #fce5cd; font-family: "arial" , "helvetica" , sans-serif;">drwx------ 3 root root 4096 Jun 14 09:09 .ansible</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><b>So either run Ansible using sudo</b> </span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"> OR </span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><b>Change permissions of this directory to allow the logged in user to create files. </b></span></div>
Learningshttp://www.blogger.com/profile/11717619302144339377noreply@blogger.com0tag:blogger.com,1999:blog-816252519844905278.post-5707611801053296972019-06-17T22:32:00.002+05:302019-06-17T22:32:39.926+05:30ERROR! Unexpected Exception, this is probably a bug: 'PlaybookCLI' object has no attribute 'options<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">Error when running Ansible Playbook </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="background-color: #f6b26b;"><span style="font-family: Arial, Helvetica, sans-serif;">ERROR! Unexpected Exception, this is probably a bug: 'PlaybookCLI' object has no attribute 'options</span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">Haven't been able to solve it yet. Looks like some Ansible version compatability. </span></div>
Learningshttp://www.blogger.com/profile/11717619302144339377noreply@blogger.com0tag:blogger.com,1999:blog-816252519844905278.post-74409600746500016902019-06-14T17:21:00.002+05:302019-06-14T18:45:13.165+05:30POD showing status Init:ImagePullBackOff<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">I'm trying to install Redis using Helm... It goes through all the steps fine but when I try to see the POD's I see the status as Init:ImagePullBackOff. </span></div>
<div style="text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Not sure what this really is. Have you come across such status for PODS? </span></div>
<div style="text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div style="text-align: left;">
<span style="background-color: #f3f3f3; font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">ubuntu@ip-10-0-64-140:~/$ kubectl get po --namespace platform-svcs</span></div>
<div style="text-align: left;">
<span style="background-color: #f3f3f3; font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">NAME READY STATUS RESTARTS AGE</span></div>
<div style="text-align: left;">
<span style="background-color: #f3f3f3; font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">session-store-redis-ha-server-0 0/2 <b>Init:ImagePullBackOff</b> 0 17s</span></div>
<div style="text-align: left;">
<span style="background-color: #f3f3f3; font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">ubuntu@ip-10-0-64-140:~/$ </span><br />
<br /></div>
<div style="height: 0px; text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Used the following command to get to events: </span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="background-color: #cccccc; font-family: "arial" , "helvetica" , sans-serif;">kubectl describe pod session-store-redis-ha-server-0 --namespace platform-svcs</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">This pointed me to the problem that I do not have access to the repo having Redis image. </span></div>
</div>
Learningshttp://www.blogger.com/profile/11717619302144339377noreply@blogger.com0tag:blogger.com,1999:blog-816252519844905278.post-26175551595615378402018-08-03T18:56:00.001+05:302018-08-04T15:53:55.214+05:30error: the server doesn't have resource type “svc”<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div style="background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
ere is what I did to work it through.... 1. Enabled verbose to make sure config files are read properly.</div>
<blockquote style="background-color: cornsilk; border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(255, 235, 142); border-left-style: solid; border-right-color: initial; border-right-style: initial; border-top-color: initial; border-top-style: initial; border-width: 0px 0px 0px 2px; box-sizing: inherit; color: #242729; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin: 0px 0px 10px; padding: 10px; quotes: none; vertical-align: baseline;">
<div style="border: 0px; box-sizing: inherit; clear: both; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; padding: 0px; vertical-align: baseline;">
kubectl get svc --v=10</div>
</blockquote>
<ol start="2" style="background-color: white; border: 0px; box-sizing: inherit; color: #242729; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1em 30px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; word-wrap: break-word;">Modified the file as below:</li>
</ol>
<div>
<span style="color: #242729; font-family: Arial, Helvetica Neue, Helvetica, sans-serif;"><span style="font-size: 15px;"><br /></span></span></div>
<div>
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; color: #fff0a5; background-color: #13773d}
span.s1 {font-variant-ligatures: no-common-ligatures}
</style>
<div class="p1">
<span class="s1">apiVersion: v1</span></div>
<div class="p1">
<span class="s1">clusters:</span></div>
<div class="p1">
<span class="s1">- cluster:</span></div>
<div class="p1">
<span class="s1"><span class="Apple-converted-space"> </span>server: XXXXXXXXXXXXX</span></div>
<div class="p1">
<span class="s1"><span class="Apple-converted-space"> </span>certificate-authority-data: XXXXXXXXXX</span></div>
<div class="p1">
<span class="s1"><span class="Apple-converted-space"> </span>name: my-eks</span></div>
<div class="p1">
<span class="s1">contexts:</span></div>
<div class="p1">
<span class="s1">- context:</span></div>
<div class="p1">
<span class="s1"><span class="Apple-converted-space"> </span>cluster: my-eks</span></div>
<div class="p1">
<span class="s1"><span class="Apple-converted-space"> </span>user: aws</span></div>
<div class="p1">
<span class="s1"><span class="Apple-converted-space"> </span>name: aws</span></div>
<div class="p1">
<span class="s1">current-context: aws</span></div>
<div class="p1">
<span class="s1">kind: Config</span></div>
<div class="p1">
<span class="s1">preferences: {}</span></div>
<div class="p1">
<span class="s1">users:</span></div>
<div class="p1">
<span class="s1">- name: aws</span></div>
<div class="p1">
<span class="s1"><span class="Apple-converted-space"> </span>user:</span></div>
<div class="p1">
<span class="s1"><span class="Apple-converted-space"> </span>exec:</span></div>
<div class="p1">
<span class="s1"><span class="Apple-converted-space"> </span>apiVersion: client.authentication.k8s.io/v1alpha1</span></div>
<div class="p1">
<span class="s1"><span class="Apple-converted-space"> </span>command: aws-iam-authenticator</span></div>
<div class="p1">
<span class="s1"><span class="Apple-converted-space"> </span>args:</span></div>
<div class="p1">
<span class="s1"><span class="Apple-converted-space"> </span>- "token"</span></div>
<div class="p1">
<span class="s1"><span class="Apple-converted-space"> </span>- "-i"</span></div>
<div class="p1">
<span class="s1"><span class="Apple-converted-space"> </span>- "my-eks"</span></div>
<div class="p1">
<span class="s1"><span class="Apple-converted-space"> </span># - "-r"</span></div>
<div class="p1">
<span class="s1"><span class="Apple-converted-space"> </span># - "<role-arn>"</span></div>
<div class="p1">
<span class="s1"><span class="Apple-converted-space"> </span>env:</span></div>
<div class="p1">
<span class="s1"><span class="Apple-converted-space"> </span>- name: AWS_PROFILE</span></div>
<div class="p1">
<span class="s1"><span class="Apple-converted-space"> </span>value: "aws"</span></div>
<span style="color: #242729; font-family: Arial, Helvetica Neue, Helvetica, sans-serif;"><span style="font-size: 15px;"></span></span></div>
</div>
Learningshttp://www.blogger.com/profile/11717619302144339377noreply@blogger.com0tag:blogger.com,1999:blog-816252519844905278.post-51470929137116999592018-05-20T13:15:00.000+05:302018-05-20T13:15:21.142+05:30How to run two container websites on a single port in Docker?<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
There is no out of the box solution for this because it is not a valid design using dockers. However you can go about installing & configuring a reverse proxy which sits in front of your docker containers.<br />
<br />
See this article for details on configuring ngnix as a reverse proxy for docker containers https://www.thepolyglotdeveloper.com/2017/03/nginx-reverse-proxy-containerized-docker-applications/ </div>
Learningshttp://www.blogger.com/profile/11717619302144339377noreply@blogger.com0tag:blogger.com,1999:blog-816252519844905278.post-39257491963142985592018-05-20T12:53:00.000+05:302018-05-20T12:53:08.032+05:30How to manage files & space in Docker<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="-webkit-text-stroke-width: 0px; color: #373737; font-family: Lato, Avenir, sans-serif; font-size: 18px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: 0.5px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-stroke-width: 0px; color: #373737; font-family: Lato, Avenir, sans-serif; font-size: 18px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: 0.5px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
There are three main ways docker stores files:</div>
<div style="-webkit-text-stroke-width: 0px; color: #373737; font-family: Lato, Avenir, sans-serif; font-size: 18px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: 0.5px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<ul style="-webkit-text-stroke-width: 0px; color: #373737; font-family: Lato, Avenir, sans-serif; font-size: 18px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: 0.5px; list-style: disc; margin: 0px 0px 0px 2em; orphans: 2; padding: 0px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<li>By default, everything you save to disk inside the container is saved in the aufs layer. This doesn’t create problems if you clean up unused containers and images.</li>
<li>If you mount a file or directory from the host (using<span> </span><code>docker run -v /host/path:/container/path …</code>) the files are stored in the host filesystem, so it’s easy to track them and there is no problem also.</li>
<li>The third way are docker volumes. Those are special paths that are mapped to a special directory in<span> </span><code>/var/lib/docker/volumes/</code><span> </span>path on the host. A lot of images use volumes to share files between containers (using the<span> </span><code>volumes-from</code><span> </span>option) or persist data so you won’t lose them after the process exits (the data-only containers pattern).</li>
</ul>
<div style="-webkit-text-stroke-width: 0px; color: #373737; font-family: Lato, Avenir, sans-serif; font-size: 18px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: 0.5px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-stroke-width: 0px; color: #373737; font-family: Lato, Avenir, sans-serif; font-size: 18px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: 0.5px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
Since there is no tool to list volumes and their state, it’s easy to leave them on disk even after all processes exited and all containers are removed.</div>
<div style="-webkit-text-stroke-width: 0px; color: #373737; font-family: Lato, Avenir, sans-serif; font-size: 18px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: 0.5px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-stroke-width: 0px; color: #373737; font-family: Lato, Avenir, sans-serif; font-size: 18px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: 0.5px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
You can use below script to cleanup all the things: </div>
<div style="-webkit-text-stroke-width: 0px; color: #373737; font-family: Lato, Avenir, sans-serif; font-size: 18px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: 0.5px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<table class="highlight tab-size js-file-line-container" data-tab-size="8" style="-webkit-text-stroke-width: 0px; background: rgb(255, 255, 255); border-collapse: collapse; border: 0px; color: #333333; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 12px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: 0.5px; line-height: 1.4; margin: 0px; orphans: 2; padding: 0px; text-align: left; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><tbody>
<tr><td class="blob-code blob-code-inner js-file-line" id="file-cleanup-docker-sh-LC1" style="background: rgba(0, 0, 0, 0); border: 0px; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding-bottom: 1px !important; padding-left: 10px !important; padding-right: 10px !important; padding-top: 4px; position: relative; text-align: left; vertical-align: top; white-space: pre; word-wrap: normal;"><span class="pl-c" style="color: #6a737d;"><span class="pl-c" style="color: #6a737d;">#!</span>/bin/bash</span></td></tr>
<tr><td class="blob-num js-line-number" data-line-number="2" id="file-cleanup-docker-sh-L2" style="background: rgba(0, 0, 0, 0); color: rgba(27, 31, 35, 0.3); cursor: pointer; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: inherit; padding: 1px 10px !important; text-align: right; user-select: none; vertical-align: top; white-space: nowrap; width: 15px;"><br /></td><td class="blob-code blob-code-inner js-file-line" id="file-cleanup-docker-sh-LC2" style="background: rgba(0, 0, 0, 0); border: 0px; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding: 1px 10px !important; position: relative; text-align: left; vertical-align: top; white-space: pre; word-wrap: normal;">
</td></tr>
<tr><td class="blob-num js-line-number" data-line-number="3" id="file-cleanup-docker-sh-L3" style="background: rgba(0, 0, 0, 0); color: rgba(27, 31, 35, 0.3); cursor: pointer; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: inherit; padding: 1px 10px !important; text-align: right; user-select: none; vertical-align: top; white-space: nowrap; width: 15px;"><br /></td><td class="blob-code blob-code-inner js-file-line" id="file-cleanup-docker-sh-LC3" style="background: rgba(0, 0, 0, 0); border: 0px; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding: 1px 10px !important; position: relative; text-align: left; vertical-align: top; white-space: pre; word-wrap: normal;"><span class="pl-c" style="color: #6a737d;"><span class="pl-c" style="color: #6a737d;">#</span> remove exited containers:</span></td></tr>
<tr><td class="blob-num js-line-number" data-line-number="4" id="file-cleanup-docker-sh-L4" style="background: rgba(0, 0, 0, 0); color: rgba(27, 31, 35, 0.3); cursor: pointer; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: inherit; padding: 1px 10px !important; text-align: right; user-select: none; vertical-align: top; white-space: nowrap; width: 15px;"><br /></td><td class="blob-code blob-code-inner js-file-line" id="file-cleanup-docker-sh-LC4" style="background: rgba(0, 0, 0, 0); border: 0px; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding: 1px 10px !important; position: relative; text-align: left; vertical-align: top; white-space: pre; word-wrap: normal;">docker ps --filter status=dead --filter status=exited -aq <span class="pl-k" style="color: #d73a49;">|</span> xargs -r docker rm -v</td></tr>
<tr><td class="blob-num js-line-number" data-line-number="5" id="file-cleanup-docker-sh-L5" style="background: rgba(0, 0, 0, 0); color: rgba(27, 31, 35, 0.3); cursor: pointer; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: inherit; padding: 1px 10px !important; text-align: right; user-select: none; vertical-align: top; white-space: nowrap; width: 15px;"><br /></td><td class="blob-code blob-code-inner js-file-line" id="file-cleanup-docker-sh-LC5" style="background: rgba(0, 0, 0, 0); border: 0px; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding: 1px 10px !important; position: relative; text-align: left; vertical-align: top; white-space: pre; word-wrap: normal;"> </td></tr>
<tr><td class="blob-num js-line-number" data-line-number="6" id="file-cleanup-docker-sh-L6" style="background: rgba(0, 0, 0, 0); color: rgba(27, 31, 35, 0.3); cursor: pointer; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: inherit; padding: 1px 10px !important; text-align: right; user-select: none; vertical-align: top; white-space: nowrap; width: 15px;"><br /></td><td class="blob-code blob-code-inner js-file-line" id="file-cleanup-docker-sh-LC6" style="background: rgba(0, 0, 0, 0); border: 0px; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding: 1px 10px !important; position: relative; text-align: left; vertical-align: top; white-space: pre; word-wrap: normal;"><span class="pl-c" style="color: #6a737d;"><span class="pl-c" style="color: #6a737d;">#</span> remove unused images:</span></td></tr>
<tr><td class="blob-num js-line-number" data-line-number="7" id="file-cleanup-docker-sh-L7" style="background: rgba(0, 0, 0, 0); color: rgba(27, 31, 35, 0.3); cursor: pointer; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: inherit; padding: 1px 10px !important; text-align: right; user-select: none; vertical-align: top; white-space: nowrap; width: 15px;"><br /></td><td class="blob-code blob-code-inner js-file-line" id="file-cleanup-docker-sh-LC7" style="background: rgba(0, 0, 0, 0); border: 0px; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding: 1px 10px !important; position: relative; text-align: left; vertical-align: top; white-space: pre; word-wrap: normal;">docker images --no-trunc <span class="pl-k" style="color: #d73a49;">|</span> grep <span class="pl-s" style="color: #032f62;"><span class="pl-pds" style="color: #032f62;">'</span><none><span class="pl-pds" style="color: #032f62;">'</span></span> <span class="pl-k" style="color: #d73a49;">|</span> awk <span class="pl-s" style="color: #032f62;"><span class="pl-pds" style="color: #032f62;">'</span>{ print $3 }<span class="pl-pds" style="color: #032f62;">'</span></span> <span class="pl-k" style="color: #d73a49;">|</span> xargs -r docker rmi</td></tr>
<tr><td class="blob-num js-line-number" data-line-number="8" id="file-cleanup-docker-sh-L8" style="background: rgba(0, 0, 0, 0); color: rgba(27, 31, 35, 0.3); cursor: pointer; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: inherit; padding: 1px 10px !important; text-align: right; user-select: none; vertical-align: top; white-space: nowrap; width: 15px;"><br /></td><td class="blob-code blob-code-inner js-file-line" id="file-cleanup-docker-sh-LC8" style="background: rgba(0, 0, 0, 0); border: 0px; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding: 1px 10px !important; position: relative; text-align: left; vertical-align: top; white-space: pre; word-wrap: normal;">
</td></tr>
<tr><td class="blob-num js-line-number" data-line-number="9" id="file-cleanup-docker-sh-L9" style="background: rgba(0, 0, 0, 0); color: rgba(27, 31, 35, 0.3); cursor: pointer; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: inherit; padding: 1px 10px !important; text-align: right; user-select: none; vertical-align: top; white-space: nowrap; width: 15px;"><br /></td><td class="blob-code blob-code-inner js-file-line" id="file-cleanup-docker-sh-LC9" style="background: rgba(0, 0, 0, 0); border: 0px; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding: 1px 10px !important; position: relative; text-align: left; vertical-align: top; white-space: pre; word-wrap: normal;"><span class="pl-c" style="color: #6a737d;"><span class="pl-c" style="color: #6a737d;">#</span> remove unused volumes:</span></td></tr>
<tr><td class="blob-num js-line-number" data-line-number="10" id="file-cleanup-docker-sh-L10" style="background: rgba(0, 0, 0, 0); color: rgba(27, 31, 35, 0.3); cursor: pointer; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: inherit; padding: 1px 10px !important; text-align: right; user-select: none; vertical-align: top; white-space: nowrap; width: 15px;"><br /></td><td class="blob-code blob-code-inner js-file-line" id="file-cleanup-docker-sh-LC10" style="background: rgba(0, 0, 0, 0); border: 0px; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding: 1px 10px !important; position: relative; text-align: left; vertical-align: top; white-space: pre; word-wrap: normal;">find <span class="pl-s" style="color: #032f62;"><span class="pl-pds" style="color: #032f62;">'</span>/var/lib/docker/volumes/<span class="pl-pds" style="color: #032f62;">'</span></span> -mindepth 1 -maxdepth 1 -type d <span class="pl-k" style="color: #d73a49;">|</span> grep -vFf <span class="pl-s" style="color: #032f62;"><span class="pl-pds" style="color: #032f62;"><(</span></span></td></tr>
<tr><td class="blob-num js-line-number" data-line-number="11" id="file-cleanup-docker-sh-L11" style="background: rgba(0, 0, 0, 0); color: rgba(27, 31, 35, 0.3); cursor: pointer; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: inherit; padding: 1px 10px !important; text-align: right; user-select: none; vertical-align: top; white-space: nowrap; width: 15px;"><br /></td><td class="blob-code blob-code-inner js-file-line" id="file-cleanup-docker-sh-LC11" style="background: rgba(0, 0, 0, 0); border: 0px; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding: 1px 10px !important; position: relative; text-align: left; vertical-align: top; white-space: pre; word-wrap: normal;"><span class="pl-s" style="color: #032f62;"> docker ps -aq <span class="pl-k" style="color: #d73a49;">|</span> xargs docker inspect <span class="pl-k" style="color: #d73a49;">|</span> jq -r <span class="pl-s" style="color: #032f62;"><span class="pl-pds" style="color: #032f62;">'</span>.[] | .Mounts | .[] | .Name | select(.)<span class="pl-pds" style="color: #032f62;">'</span></span></span></td></tr>
<tr><td class="blob-num js-line-number" data-line-number="12" id="file-cleanup-docker-sh-L12" style="background: rgba(0, 0, 0, 0); color: rgba(27, 31, 35, 0.3); cursor: pointer; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: inherit; padding: 1px 10px !important; text-align: right; user-select: none; vertical-align: top; white-space: nowrap; width: 15px;"><br /></td><td class="blob-code blob-code-inner js-file-line" id="file-cleanup-docker-sh-LC12" style="background: rgba(0, 0, 0, 0); border: 0px; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding: 1px 10px !important; position: relative; text-align: left; vertical-align: top; white-space: pre; word-wrap: normal;"><span class="pl-s" style="color: #032f62;"><span class="pl-pds" style="color: #032f62;">)</span></span> <span class="pl-k" style="color: #d73a49;">|</span> xargs -r rm -fr</td></tr>
</tbody></table>
<div style="-webkit-text-stroke-width: 0px; color: #373737; font-family: Lato, Avenir, sans-serif; font-size: 18px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: 0.5px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
</div>
Learningshttp://www.blogger.com/profile/11717619302144339377noreply@blogger.com0tag:blogger.com,1999:blog-816252519844905278.post-13633866801698214712017-10-20T22:47:00.003+05:302017-10-20T22:47:20.210+05:30org.hibernate.HibernateException: Error accessing stax stream<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="p1">
<span class="s1">Couple of things you should check: </span></div>
<div class="p1">
</div>
<ul style="text-align: left;">
<li>If you are using Eclipse IDE make sure that it is not giving you any error indicators for hibernate.cfg.xml file. </li>
<li>Make sure to close the<span class="s1" style="-webkit-text-stroke: rgb(36, 39, 41); color: #242729;"> tag </span><span class="s4" style="-webkit-text-stroke: rgb(36, 39, 41); color: #242729;"><hibernate-configuration></span></li>
<li>Missing !<span class="s1" style="-webkit-text-stroke: rgb(36, 39, 41); color: #242729;">character in the </span><span class="s4" style="-webkit-text-stroke: rgb(36, 39, 41); color: #242729;">DOCTYPE</span></li>
<li>Not able to access<span class="s1" style="-webkit-text-stroke: rgb(36, 39, 41); color: #242729;">hibernate-configuration-3.0.dtd from the url provided.</span></li>
<li>Space before <span class="s1" style="-webkit-text-stroke: rgb(48, 51, 54); color: #303336;"><?xml version=</span><span class="s6" style="-webkit-text-stroke-width: initial;">'1.0'</span><span class="s1" style="-webkit-text-stroke: rgb(48, 51, 54); color: #303336;"> encoding=</span><span class="s6" style="-webkit-text-stroke-width: initial;">'utf-8'</span><span class="s1" style="-webkit-text-stroke: rgb(48, 51, 54); color: #303336;">?></span></li>
</ul>
<br />
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 21.0px; font: 18.0px Arial; color: #000000; -webkit-text-stroke: #000000}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 21.0px; font: 18.0px Arial; color: #242729; -webkit-text-stroke: #242729}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 21.0px; font: 18.0px Courier; color: #242729; -webkit-text-stroke: #242729}
p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 21.0px; font: 18.0px Arial; color: #303336; -webkit-text-stroke: #303336}
span.s1 {font-kerning: none; background-color: #ffffff}
span.s2 {font-kerning: none}
span.s3 {font-kerning: none; color: #000000; background-color: #ffffff; -webkit-text-stroke: 0px #000000}
span.s4 {font: 18.0px Courier; font-kerning: none; background-color: #ffffff}
span.s5 {font-kerning: none; color: #242729; background-color: #ffffff; -webkit-text-stroke: 0px #242729}
span.s6 {font-kerning: none; color: #7d2727; background-color: #ffffff; -webkit-text-stroke: 0px #7d2727}
</style>
</div>
Learningshttp://www.blogger.com/profile/11717619302144339377noreply@blogger.com2tag:blogger.com,1999:blog-816252519844905278.post-5478809269752327632017-10-20T17:07:00.004+05:302017-10-20T17:07:41.350+05:30Docker: Error: Unauthorized: incorrect username or password on mac OS<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;">Getting the following error when I run anything... </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000; background-color: #ffffff}
span.s1 {font-variant-ligatures: no-common-ligatures}
</style>
<br />
<div class="p1">
<span class="s1"><span style="font-family: Arial, Helvetica, sans-serif; font-size: small;"><b>docker: Error response from daemon: Get https://registry-1.docker.io/v2/library/mysql/manifests/latest: unauthorized: incorrect username or password</b></span></span></div>
<div class="p1">
<br /></div>
<div class="p1">
<span class="s1"><span style="font-family: Arial, Helvetica, sans-serif; font-size: small;">Here is how I solved it: </span></span></div>
<div class="p1">
</div>
<ul style="text-align: left;">
<li><span style="font-family: Arial, Helvetica, sans-serif; font-size: small;">Login into www.docker.com with my username and password</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif; font-size: small;">Note down the docker ID which is different than your loginID/email </span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif; font-size: small;">In Terminal now enter the command "docker login" it will ask you to enter your user and password</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif; font-size: small;">If the login is successfull you should get the following message: </span></li>
</ul>
<br />
<div class="p1">
<span class="s1"><span style="font-family: Arial, Helvetica, sans-serif; font-size: small;">Password:<span class="Apple-converted-space"> </span></span></span></div>
<div class="p1">
<span class="s1"><span style="font-family: Arial, Helvetica, sans-serif; font-size: small;">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000; background-color: #ffffff}
span.s1 {font-variant-ligatures: no-common-ligatures}
</style>
</span></span></div>
<div class="p1">
<span class="s1"><span style="font-family: Arial, Helvetica, sans-serif; font-size: small;">Login Succeeded</span></span></div>
<div class="p1">
<span class="s1"><span style="font-family: Arial, Helvetica, sans-serif; font-size: small;"><br /></span></span></div>
<div class="p1">
<span class="s1"><span style="font-family: Arial, Helvetica, sans-serif; font-size: small;">Now you can run the commands and they should run fine. </span></span></div>
<div class="p1">
<span class="s1"><br /></span></div>
</div>
Learningshttp://www.blogger.com/profile/11717619302144339377noreply@blogger.com0tag:blogger.com,1999:blog-816252519844905278.post-60277453941546302392017-10-18T18:46:00.000+05:302017-10-18T18:54:17.458+05:30What is Hibernate? <div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">It is an ORM Framework to develop persistence logic. It is: </span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<br />
<ul style="text-align: left;">
<li>Opensource </li>
<li>Lightweight</li>
<li>Provides abstraction over JDBC</li>
<li>No need for any containers (jsp, servlet etc etc). </li>
<li>Supports POJO and POJI model programming</li>
<li>Can be used individually as well as other technologies like Spring etc </li>
<li>Does not require you to implement any Hibernate API interfaces & neither it requires you to extend any hibernate clases. Hence we can say it is a loosely coupled framework</li>
<li>Allows us to develop Object Based Persistence logic and hence it is called ORM framework</li>
<li>Can change from one DB software to another without having to change any Objects etc</li>
<li>Transaction management, locking, caching etc is all in-built. </li>
</ul>
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
</div>
Learningshttp://www.blogger.com/profile/11717619302144339377noreply@blogger.com0tag:blogger.com,1999:blog-816252519844905278.post-57758967367334120172017-10-18T17:57:00.001+05:302017-10-18T17:57:42.539+05:30JDBC Limitations or Problems<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<ul style="text-align: left;">
<li><span style="font-family: Arial, Helvetica, sans-serif;">Changing DB Software is too complex since JDBC code is Database software dependent and is not at all portable. </span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">Programmers need to convert Object notations to DB columns and visa versa. </span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">Exception handling is mandatory and nothing is in built</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">Versioning and time stamping are not provided out of the box. Need to program and handle them manually. </span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">No proper transaction management support. </span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">Does not support Object level relationships like we have table relationships.</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">Too much boiler plate code (repeated code) needs to be written. </span></li>
</ul>
<br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<br /></div>
Learningshttp://www.blogger.com/profile/11717619302144339377noreply@blogger.com1tag:blogger.com,1999:blog-816252519844905278.post-46868558933705807052017-10-14T12:38:00.002+05:302017-10-14T12:38:38.322+05:30Concepts of Coding in AWS Lambda<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><b>Languages supported (as on Oct 2017):</b> </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">C#, Java 8, Node.js (4.3 & 6.10), Python (2.7 & 3.6). </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><b>Coding Pattern/Syntax:</b> There are 4 main components we need to remember</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<div style="text-align: left;">
<b style="font-family: Arial, Helvetica, sans-serif;"><span class="topcom">Handler</span> –</b><span style="font-family: Arial, Helvetica, sans-serif;"> This is your main function which will be called by AWS Lambda when execution starts. All of the event data is been passed to this handler function as the first parameter. The handler processes the event data and may invoke other methods or functions in your code. </span><br /><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span><b style="font-family: Arial, Helvetica, sans-serif;"><span class="topcom">Context</span> –</b><span style="font-family: Arial, Helvetica, sans-serif;"> This is the second object passed to the lambda function. This is used by our code to interact with AWS Lambda. For e.g., you can figure out the execution time that remains. In node.js there are additional methods available that allows callback. </span><br /><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span><b style="font-family: Arial, Helvetica, sans-serif;"><span class="topcom">Logging</span> –</b><span style="font-family: Arial, Helvetica, sans-serif;"> AWS Lambda writes logs to CloudWatch</span><br /><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span><b style="font-family: Arial, Helvetica, sans-serif;"><span class="topcom">Exceptions</span> – </b><span style="font-family: Arial, Helvetica, sans-serif;">You can throw or raise exceptions which AWS lambda will pass on to the caller.</span></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
Learningshttp://www.blogger.com/profile/11717619302144339377noreply@blogger.com0tag:blogger.com,1999:blog-816252519844905278.post-86966119423696557472017-10-14T00:10:00.000+05:302017-10-14T00:10:20.936+05:30AWS Cognito: ErrorNotAuthorizedException: Unable to verify secret hash for client 7cakk6gknpt4cvqifdfbt9qm91<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
To get rid of this Error uncheck "Generate Client Secrets" when you create the App Client in AWS Cognito. That should solve the problem. Atleast that solves it for me. </div>
Learningshttp://www.blogger.com/profile/11717619302144339377noreply@blogger.com0tag:blogger.com,1999:blog-816252519844905278.post-66324241184657976062016-03-21T12:22:00.003+05:302016-03-21T12:22:36.892+05:30How to Install and Configure Ansible on ubuntu 14.04? <div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">Ansible builds for ubuntu are available in PPA. That means all you need to do is add PPA to you repo's and then use ubuntu's default package installer (apt-get). </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="background-color: white; color: #404040; line-height: 24px;"><span style="font-family: Arial, Helvetica, sans-serif;">To configure the PPA on your machine and install ansible run these commands:</span></span><br />
<pre style="background-color: white; box-sizing: border-box; line-height: 1.5; overflow: auto; padding: 12px;"><span style="color: #38761d; font-family: Arial, Helvetica, sans-serif;">$ sudo apt-get install software-properties-common
$ sudo apt-add-repository ppa:ansible/ansible
$ sudo apt-get update
$ sudo apt-get install ansible</span></pre>
<pre style="background-color: white; box-sizing: border-box; overflow: auto; padding: 12px;"><span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 24px;">You can also install via pip as below: </span></span></pre>
<pre style="background-color: white; box-sizing: border-box; overflow: auto; padding: 12px;"><span style="font-family: Arial, Helvetica, sans-serif; line-height: 1.5;"><span style="color: #38761d;">$ sudo pip install ansible</span></span></pre>
</div>
Learningshttp://www.blogger.com/profile/11717619302144339377noreply@blogger.com0tag:blogger.com,1999:blog-816252519844905278.post-9574255825968177032016-03-21T12:12:00.003+05:302016-03-21T12:12:31.563+05:30What are Ansible Raw modules? Where and when they are used? <div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">Ansible’s raw modules are generally used to executing
commands on managed machines which does not have basic requirements for Ansible
on it. </span></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">For e.g., Running Ansible requires Python 2.4 with python-simplejson on
the remote machine. If none of these are available on remote machines then how
would you run Ansible on those hosts? The solution is to use Ansible’s Raw
module to first install python and python-simplejson on the managed machine and
then you can use all other Ansible modules/features.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">Example of running a Raw module:<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;"><b><span style="background-color: orange;"><span class="pre"><span style="font-size: 9pt;">ansible</span></span><span class="apple-converted-space"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-size: 9pt;"> </span></span><span class="pre"><span style="font-size: 9pt;"><span style="box-sizing: border-box;">myhost</span></span></span><span class="apple-converted-space"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-size: 9pt;"> </span></span><span class="pre"><span style="font-size: 9pt;"><span style="box-sizing: border-box;">--sudo</span></span></span><span class="apple-converted-space"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-size: 9pt;"> </span></span><span class="pre"><span style="font-size: 9pt;"><span style="box-sizing: border-box;">-m</span></span></span><span class="apple-converted-space"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-size: 9pt;"> </span></span><span class="pre"><span style="font-size: 9pt;"><span style="box-sizing: border-box;">raw</span></span></span><span class="apple-converted-space"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-size: 9pt;"> </span></span><span class="pre"><span style="font-size: 9pt;"><span style="box-sizing: border-box;">-a</span></span></span><span class="apple-converted-space"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-size: 9pt;"> </span></span><span class="pre"><span style="font-size: 9pt;"><span style="box-sizing: border-box;">"yum</span></span></span><span class="apple-converted-space"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-size: 9pt;"> </span></span><span class="pre"><span style="font-size: 9pt;"><span style="box-sizing: border-box;">install</span></span></span><span class="apple-converted-space"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-size: 9pt;"> </span></span><span class="pre"><span style="font-size: 9pt;"><span style="box-sizing: border-box;">-y</span></span></span><span class="apple-converted-space"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-size: 9pt;"> </span></span><span class="pre"><span style="font-size: 9pt;"><span style="box-sizing: border-box;">python2</span></span></span><span class="apple-converted-space"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-size: 9pt;"> </span></span><span class="pre"><span style="font-size: 9pt;"><span style="box-sizing: border-box;">python-simplejson"</span></span></span></span><o:p></o:p></b></span></div>
<br />
<div class="MsoNormal">
<br /></div>
</div>
Learningshttp://www.blogger.com/profile/11717619302144339377noreply@blogger.com0tag:blogger.com,1999:blog-816252519844905278.post-45659972708861952902016-03-21T12:07:00.003+05:302016-03-21T12:07:39.501+05:30What is SELinux? <div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">SELinux is a flexible but mandatory enterprise grade
security implementations (from NSA) in Linux kernel itself. This provides
support for enforcing different but mandatory access control policies. </span></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">You can
see /etc/selinux/config file to see if SELinux is enabled or not for your
system. The variable SELINUX in this file defines the mode (3 modes) in which
SELinux has been operation. These 3 different modes of SELinux are namely:</span></div>
<div class="MsoNormal">
</div>
<ul style="text-align: left;">
<li><span style="font-family: Arial, Helvetica, sans-serif;"><span style="text-indent: -24px;"><b>Disabled: </b></span><span style="text-indent: -24px;">Completely disables the SELinux.</span></span></li>
<li><span style="text-indent: -24px;"><span style="font-family: Arial, Helvetica, sans-serif;"><b>Permissive: </b>enables the SELinux code, but causes it to operate in a mode where accesses that would be denied by policy are permitted but audited</span></span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><span style="text-indent: -24px;"><b>Enforcement:</b> </span><span style="text-indent: -24px;">Enables the SELinux code and causes it to enforce access denials as well as auditing them.</span></span></li>
</ul>
<br />
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">SELinux was the NSA's attempt at porting the Orange Book
requirements to Linux. There are other popular solutions as well for
implementing access controls in linux like AppArmor, GrSecurity etc.</span></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;"><o:p></o:p></span></div>
<br />
<div class="MsoNormal">
<br /></div>
</div>
Learningshttp://www.blogger.com/profile/11717619302144339377noreply@blogger.com0tag:blogger.com,1999:blog-816252519844905278.post-74361957386393907372015-10-04T17:43:00.001+05:302015-10-04T17:43:15.405+05:30Troubleshooting Best Practices<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
<div style="border-width: 100%; direction: ltr;">
<div style="direction: ltr; margin-left: 0in; margin-top: 0in; width: 6.5854in;">
<div style="direction: ltr; margin-left: 0in; margin-top: 0in; width: 6.5854in;">
<ul style="direction: ltr; margin-bottom: 0in; margin-left: .2902in; margin-top: 0in; unicode-bidi: embed;"><ul style="direction: ltr; margin-bottom: 0in; margin-left: 0in; margin-top: 0in; unicode-bidi: embed;" type="disc">
<li style="color: #8b8b8b; margin-bottom: 0; margin-bottom: 6pt; margin-top: 0; margin-top: 4pt; vertical-align: middle;"><span style="font-family: "Calisto MT"; font-size: 20.0pt;">No reboots first - Come out of this mindset ASAP.</span></li>
<li style="color: #8b8b8b; margin-bottom: 0; margin-bottom: 6pt; margin-top: 0; margin-top: 4pt; vertical-align: middle;"><span style="font-family: "Calisto MT"; font-size: 20.0pt;">Divide the problem into smaller logical parts</span></li>
<li style="color: #8b8b8b; margin-bottom: 0; margin-bottom: 6pt; margin-top: 0; margin-top: 4pt; vertical-align: middle;"><span style="font-family: "Calisto MT"; font-size: 20.0pt;">Understand the systems you are going to troubleshoot
carefully</span></li>
<li style="color: #8b8b8b; margin-bottom: 0; margin-bottom: 6pt; margin-top: 0; margin-top: 4pt; vertical-align: middle;"><span style="font-family: "Calisto MT"; font-size: 20.0pt;">Refer problem history to see if something similar
occurred in the past too for which we already have a solution. </span></li>
<li style="color: #8b8b8b; margin-bottom: 0; margin-bottom: 6pt; margin-top: 0; margin-top: 4pt; vertical-align: middle;"><span style="font-family: "Calisto MT"; font-size: 20.0pt;">Generally first thing we should look at is “What
changed recently?”</span></li>
<li style="color: #8b8b8b; margin-bottom: 0; margin-bottom: 6pt; margin-top: 0; margin-top: 4pt; vertical-align: middle;"><span style="font-family: "Calisto MT"; font-size: 20.0pt;">Document each and every Problem and steps you take to
solve it</span></li>
<li style="color: #8b8b8b; margin-bottom: 0; margin-bottom: 6pt; margin-top: 0; margin-top: 4pt; vertical-align: middle;"><span style="font-family: "Calisto MT"; font-size: 20.0pt;">Communicate and do not shy away in involving other team
members for help.</span></li>
</ul>
</ul>
</div>
</div>
</div>
</div>
Learningshttp://www.blogger.com/profile/11717619302144339377noreply@blogger.com0tag:blogger.com,1999:blog-816252519844905278.post-44795971924699007902014-12-10T12:15:00.000+05:302014-12-10T12:15:02.732+05:30Fix "ValueError: unknown locale: UTF-8" when running AWS CLI<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;">I was getting following error when running AWS CLI.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="background-color: #f4cccc; font-family: Arial, Helvetica, sans-serif;">MacBook-Pro:python sgoswami$ aws ec2 describe-instances</span><br />
<span style="background-color: #f4cccc; font-family: Arial, Helvetica, sans-serif;">Traceback (most recent call last):</span><br />
<span style="background-color: #f4cccc; font-family: Arial, Helvetica, sans-serif;"> File "/usr/local/bin/aws", line 15, in <module></span><br />
<span style="background-color: #f4cccc; font-family: Arial, Helvetica, sans-serif;"> import awscli.clidriver</span><br />
<span style="background-color: #f4cccc; font-family: Arial, Helvetica, sans-serif;"> File "/Library/Python/2.7/site-packages/awscli/clidriver.py", line 31, in <module></span><br />
<span style="background-color: #f4cccc; font-family: Arial, Helvetica, sans-serif;"> from awscli.help import ProviderHelpCommand</span><br />
<span style="background-color: #f4cccc; font-family: Arial, Helvetica, sans-serif;"> File "/Library/Python/2.7/site-packages/awscli/help.py", line 20, in <module></span><br />
<span style="background-color: #f4cccc; font-family: Arial, Helvetica, sans-serif;"> from docutils.core import publish_string</span><br />
<span style="background-color: #f4cccc; font-family: Arial, Helvetica, sans-serif;"> File "/Library/Python/2.7/site-packages/docutils/core.py", line 20, in <module></span><br />
<span style="background-color: #f4cccc; font-family: Arial, Helvetica, sans-serif;"> from docutils import frontend, io, utils, readers, writers</span><br />
<span style="background-color: #f4cccc; font-family: Arial, Helvetica, sans-serif;"> File "/Library/Python/2.7/site-packages/docutils/frontend.py", line 41, in <module></span><br />
<span style="background-color: #f4cccc; font-family: Arial, Helvetica, sans-serif;"> import docutils.utils</span><br />
<span style="background-color: #f4cccc; font-family: Arial, Helvetica, sans-serif;"> File "/Library/Python/2.7/site-packages/docutils/utils/__init__.py", line 20, in <module></span><br />
<span style="background-color: #f4cccc; font-family: Arial, Helvetica, sans-serif;"> import docutils.io</span><br />
<span style="background-color: #f4cccc; font-family: Arial, Helvetica, sans-serif;"> File "/Library/Python/2.7/site-packages/docutils/io.py", line 18, in <module></span><br />
<span style="background-color: #f4cccc; font-family: Arial, Helvetica, sans-serif;"> from docutils.utils.error_reporting import locale_encoding, ErrorString, ErrorOutput</span><br />
<span style="background-color: #f4cccc; font-family: Arial, Helvetica, sans-serif;"> File "/Library/Python/2.7/site-packages/docutils/utils/error_reporting.py", line 47, in <module></span><br />
<span style="background-color: #f4cccc; font-family: Arial, Helvetica, sans-serif;"> locale_encoding = locale.getlocale()[1] or locale.getdefaultlocale()[1]</span><br />
<span style="background-color: #f4cccc; font-family: Arial, Helvetica, sans-serif;"> File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 496, in getdefaultlocale</span><br />
<span style="background-color: #f4cccc; font-family: Arial, Helvetica, sans-serif;"> return _parse_localename(localename)</span><br />
<span style="background-color: #f4cccc; font-family: Arial, Helvetica, sans-serif;"> File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 428, in _parse_localename</span><br />
<span style="background-color: #f4cccc; font-family: Arial, Helvetica, sans-serif;"> raise ValueError, 'unknown locale: %s' % localename</span><br />
<span style="background-color: #f4cccc; font-family: Arial, Helvetica, sans-serif;">ValueError: unknown locale: UTF-8</span><br />
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"><b>All that I did to fix it was: </b></span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"><b><br /></b></span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"><b>export LC_ALL=en_US.UTF-8</b></span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"><b>export LANG=en_US.UTF-8</b></span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<br /></div>
</div>
Learningshttp://www.blogger.com/profile/11717619302144339377noreply@blogger.com0tag:blogger.com,1999:blog-816252519844905278.post-12476034080776340392014-05-11T14:15:00.001+05:302014-05-11T14:15:08.327+05:30What are manifest and site.pp files?<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="font-style: oblique;">Manifest </span>is puppet’s term for files containing configuration information. Manifest files have a suffix of .pp.
the puppet language is written into these files.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">The site.pp file tells Puppet where and what configuration to load for our clients. These are stored in a
directory called manifests under the /etc/puppet directory. </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">You can easily change the name and location of manifest directory and site.pp file by defining/changing the "manifestdir" and "manifest" configuration item in puppet.conf file. These can be found in the [main] are of puppet.conf file. </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: TheSansMonoConNormal; font-size: 9pt;"><br /></span></div>
Learningshttp://www.blogger.com/profile/11717619302144339377noreply@blogger.com0tag:blogger.com,1999:blog-816252519844905278.post-73689909926916053692014-05-11T13:44:00.000+05:302014-05-11T13:44:44.477+05:30How to generate puppet.conf file? <div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
<pre><span style="background-color: #f4cccc; font-size: 9pt;"><span style="font-family: Arial, Helvetica, sans-serif;">$ cd /etc/puppet/
$ puppet master --genconfig > puppet.conf
</span></span></pre>
<pre><span style="font-size: 9pt;"><span style="font-family: Arial, Helvetica, sans-serif;">
</span></span></pre>
<pre><span style="font-size: 9pt;"><span style="font-family: Arial, Helvetica, sans-serif;">The above command will generate the puppet.conf file automatically. </span></span></pre>
<pre><span style="font-size: 9pt;"><span style="font-family: Arial, Helvetica, sans-serif;">
</span></span></pre>
<pre><span style="font-family: 'TheSansMonoConNormal'; font-size: 9.000000pt;">The puppet.conf file is like an INI-style file and divided into various sections namely, [agent], [master], [main]. </span></pre>
</div>
Learningshttp://www.blogger.com/profile/11717619302144339377noreply@blogger.com0tag:blogger.com,1999:blog-816252519844905278.post-61970582955168148032014-04-29T10:28:00.000+05:302014-04-29T10:28:50.052+05:30How to upgrade from JDK 1.6 to 1.7 on ubuntu?<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">Its simple... Use the command </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="background-color: #f4cccc;"><span style="font-family: Arial, Helvetica, sans-serif;">sudo apt-get install openjdk-7-jre</span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">This will install JDK 1.7 on your ubuntu box. But there is a catch.. if you still run java -version, it will tell you that it is still using JDK 1.6. </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">So your system has actually been updated with JDK 1.7 but it is still not in use. There is a special script in ubuntu which allows you to check different versions present on the system and let's you choose the correct one you want to activate. </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">Here is how you can update that: </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="background-color: #f4cccc;"><span style="font-family: Arial, Helvetica, sans-serif;">sudo update-alternatives --config java</span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">This command will give you an output similar to below.. and asking you to choose which one you want to use.. </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">There are 2 choices for the alternative java (providing /usr/bin/java).</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="background-color: #fce5cd; font-family: Arial, Helvetica, sans-serif;"> Selection Path Priority Status</span><br />
<span style="background-color: #fce5cd; font-family: Arial, Helvetica, sans-serif;">------------------------------------------------------------</span><br />
<span style="background-color: #fce5cd; font-family: Arial, Helvetica, sans-serif;">* 0 /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java 1061 auto mode</span><br />
<span style="background-color: #fce5cd; font-family: Arial, Helvetica, sans-serif;"> 1 /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java 1061 manual mode</span><br />
<span style="background-color: #fce5cd; font-family: Arial, Helvetica, sans-serif;"> 2 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1051 manual mode</span><br />
<span style="background-color: #fce5cd; font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="background-color: #fce5cd;"><span style="font-family: Arial, Helvetica, sans-serif;"></span></span><br />
<span style="background-color: #fce5cd; font-family: Arial, Helvetica, sans-serif;">Press enter to keep the current choice[*], or type selection number:</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">Simple.. Isn't it? </span></div>
Learningshttp://www.blogger.com/profile/11717619302144339377noreply@blogger.com0tag:blogger.com,1999:blog-816252519844905278.post-89201807031457851952014-04-07T16:11:00.000+05:302014-04-07T16:11:05.435+05:30Puppet server hostname does not match certificate - can't authenticate.<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<div class="p1">
<b><span style="font-family: Arial, Helvetica, sans-serif;">err: Could not retrieve catalog from remote server: Server hostname 'puppet' did not match server certificate; expected master</span></b></div>
<div class="p2">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<br />
<div class="p1">
<span style="font-family: Arial, Helvetica, sans-serif;">The agent configuration file seems to be communicating with a different server (master) name than that for which the puppet master has the certificate for. The only way to solve this is by re-generating the puppetmaster server certificate with the correct hostname as that defined in the agent configuration file.</span></div>
<div class="p1">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="p1">
<span style="font-family: Arial, Helvetica, sans-serif;">To quickly test, another way is to change /etc/hosts file of agent and map the hostname and IP of the puppetmaster server.</span></div>
</div>
Learningshttp://www.blogger.com/profile/11717619302144339377noreply@blogger.com0tag:blogger.com,1999:blog-816252519844905278.post-40735272699408124422014-04-07T13:56:00.001+05:302014-04-07T13:56:45.449+05:30Exiting; no certificate found and waitforcert is disabled<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;">When running command:</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<b><span style="font-family: Arial, Helvetica, sans-serif;">sudo puppet agent --test</span></b><br />
<b><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></b>
<b><span style="font-family: Arial, Helvetica, sans-serif;">Exiting; no certificate found and waitforcert is disabled</span></b><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">To solve this follow below instructions: </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">1. Login to the puppetmaster. </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">2. Run command "sudo puppet cert --list". It will list down your agent machine who have requested a certificate.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">3. Sign the requests using command "sudo puppet cert --sign "ip-10-134-174-211.ap-southeast-1.compute.internal"" Where the IP-10.... is the hostname of you agent machine. </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">This should all be needed to resolve the issue. </span></div>
Learningshttp://www.blogger.com/profile/11717619302144339377noreply@blogger.com0tag:blogger.com,1999:blog-816252519844905278.post-90962442811958475092014-04-07T13:47:00.003+05:302014-04-07T13:47:30.527+05:30err: Could not request certificate: Connection timed out - connect(2)<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;">When running below command on the agent machine:</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<b><span style="font-family: Arial, Helvetica, sans-serif;">sudo puppet agent --test</span></b><br />
<b><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></b>
<b><span style="font-family: Arial, Helvetica, sans-serif;">err: Could not request certificate: Connection timed out - connect(2)</span></b><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">Points to the problem that the Ports used for communication between the agent and master are not Open. Please open port 8140 TCP and check it again. </span><br />
<br /></div>
Learningshttp://www.blogger.com/profile/11717619302144339377noreply@blogger.com0tag:blogger.com,1999:blog-816252519844905278.post-18826468783826250882014-04-06T21:47:00.002+05:302014-04-06T21:47:17.324+05:30Recovering a Locked forgot administrator password for Windows EC2 Instance<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">Its simple... </span><br />
<ol class="ol1">
<li class="li2"><span style="font-family: Arial, Helvetica, sans-serif;">Create a new scratch EC2 instance running 2003 server, and log into it.</span></li>
<li class="li2"><span style="font-family: Arial, Helvetica, sans-serif;">Get a note of volume attached to it and Shut down your lost instance (the one you can't log into) from the AWS console.</span></li>
<li class="li2"><span style="font-family: Arial, Helvetica, sans-serif;">On the EC2 console, go to Elastic Block Store/Volumes and find the volume you find in step 2 and Detach it.</span></li>
<li class="li2"><span style="font-family: Arial, Helvetica, sans-serif;">On that same volume, attach it to your new 2k3 EC2 instance. You can see it appear in Disk Manager and you'll get a new drive letter.</span></li>
<li class="li2"><span style="font-family: Arial, Helvetica, sans-serif;">Go to NewDriveLetter:\Program Files\Amazon\Ec2ConfigService\Settings\ and edit config.xml with notepad</span></li>
<li class="li2"><span style="font-family: Arial, Helvetica, sans-serif;">The first setting in the file is for the Ec2SetPassword plugin; change the State field from Disabledto Enabled. Save & close.</span></li>
<li class="li2"><span style="font-family: Arial, Helvetica, sans-serif;">On the AWS console, Detach the volume from the new instance</span></li>
<li class="li2"><span style="font-family: Arial, Helvetica, sans-serif;">Attach the volume to your original lost instance, as /dev/sda1 (Root volume)</span></li>
<li class="li2"><span style="font-family: Arial, Helvetica, sans-serif;">Start the instance. After a few minutes, run the Get Windows Password function which will have the newly generated password.</span></li>
</ol>
<br />
<div class="p3">
<span style="font-family: Arial, Helvetica, sans-serif;">Now if you have mapped that instance to C-name remember to change the corresponding URL because the ec2-url will change after the restart.</span></div>
</div>
Learningshttp://www.blogger.com/profile/11717619302144339377noreply@blogger.com0tag:blogger.com,1999:blog-816252519844905278.post-64110709162793680582014-04-06T21:45:00.000+05:302014-04-06T21:45:11.223+05:30An interesting thing about AWS ELB's<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">In last couple of days I discovered that ELB's are not designed to handle sudden spikes in traffic. What was most disturbing was that: </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><b>1. </b> When there is a sudden spike, the ELB breaks down. An returns HTTP 404 messages. </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><b>2.</b> The ELB gets into a bad state and remains like that for about 90 minutes. </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><b>3.</b> The solution to this suggested by AWS Support team was to simply move out of ELB and have your own load balancer. </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><b>4.</b> If it is just a testing spike, AWS can prewarm the ELB to handle that load but just for few weeks. </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">HAproxy or Nginx seems to be my obvious choice now if I have to move away from ELB. Doing High availability with HAProxy or even Nginx seems to be a little tricky but that's Okay if we have to move away from ELB. </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<br /></div>
Learningshttp://www.blogger.com/profile/11717619302144339377noreply@blogger.com0