tag:blogger.com,1999:blog-179138362024-03-13T13:16:34.974+02:00SRE cheatsheetDumping everything that can save time bulding systems :)naor-searchhttp://www.blogger.com/profile/14566462974820998502noreply@blogger.comBlogger75125tag:blogger.com,1999:blog-17913836.post-57094979624042075432022-05-17T12:26:00.007+03:002022-05-17T12:26:59.392+03:00solving error: Your current user or role does not have access to Kubernetes objects on this EKS cluster.Trying to access EKS cluster with kubectl you might get an error similar to:<br /><div><br /></div><div>Your current user or role does not have access to Kubernetes objects on this EKS cluster</div><div>This may be due to the current user or role not having Kubernetes RBAC permissions to describe cluster resources or not having an entry in the cluster’s auth config map</div><div><br /></div><div>it can happen on for example terraform created clusters or a new user joing organization.</div><div><br /></div><div><div>so what happened was that EKS being amazon product by default relies on amazon security structure for RBAC and the role you currently use was not set to access it.</div><div><br /></div><div>you can see the idenity mappings on your cluster with:</div><div><br /></div><div><i>eksctl get iamidentitymapping --cluster </i><i>YOUR_CLUSTER</i><i> --region=</i><i>YOUR_REGION</i></div><div><br /></div><div>and you can add needed role using eksctl (no need for kubectl since those are rules beforehand)</div><div><br /></div><div><i>eksctl create iamidentitymapping \</i></div><div><i> --cluster YOUR_CLUSTER\</i></div><div><i> ---region=YOUR_REGION\</i></div><div><i> --arn arn:aws:iam::123456:role/YOUR_ROLE\</i></div><div><i> --username admin \</i></div><div><i> --group system:masters</i></div></div><div><br /></div><div>and of you can delete the roles you no longer use with:</div><div><br /></div><div>eksctl delete iamidentitymapping\</div><div> --cluster <i>YOUR_CLUSTER</i>\</div><div> --region=<i>YOUR_REGION</i>\</div><div> <i>--arn arn:aws:iam::123456:role/YOUR_ROLE</i></div>Naor Whttp://www.blogger.com/profile/01896674408756848223noreply@blogger.com0tag:blogger.com,1999:blog-17913836.post-90860946593027445802020-08-26T11:22:00.002+03:002020-08-26T11:23:09.396+03:00kubeflow Istio configuration for trustworthy JWTs on rancher 2.x<h4 style="text-align: left;">Introduction:</h4><div>For some reason some of the default feature gates are not turned on in rancher. </div><div>So deploying Kubeflow or any workload that uses Istio version 1.3.1 with SDS enabled you need to enable <b>TokenRequest </b>and <b>TokenRequestProjection.</b></div><div><br /></div><h4 style="text-align: left;">Issue symptoms:</h4><div><ol style="text-align: left;"><li>istio-pilot and everything dependent will fail to start in Kubeflow deployment.</li><li>pod events / log similar to "MountVolume.SetUp failed for volume "istio-token" : failed to fetch token: the API server does not have TokenRequest endpoints enabled"</li></ol></div><h4 style="text-align: left;">How to prepare Rancher for Istio 1.3 and up (tested on 2.x)</h4><h4 style="text-align: left;">Option 1, use server configuration file (yaml edit)</h4><div><ol style="text-align: left;"><li>Login to your Rancher2.0 UI</li><li>Select relevant cluster</li><li>Click on options and edit</li><li>On cluster options choose "Cluster Options" and edit ad YAML</li><li>go to: "kube-api:"<br />and add :<br />extra_args:<br /> service-account-issuer: "kubernetes.default.svc"<br /> service-account-signing-key-file: "/etc/kubernetes/ssl/kube-service-account-token-key.pem"</li><li>Save the file / configuration</li></ol></div><div>Cluster will reconfigure. </div><div><br /></div><h4 style="text-align: left;">Option 2, feature gates flags via Rancher API</h4><div>Follow the instructions in this <a href="https://stackoverflow.com/questions/51336595/how-do-i-enable-mount-propagation-in-rancher-kubernetes-feature-gates/51373855#51373855" target="_blank">thread</a>.</div><div><br /></div><div>references:</div><div><a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#service-account-token-volume-projection" target="_blank">Kubernetes documentation</a></div><div><a href="https://istio.io/latest/blog/2019/trustworthy-jwt-sds/" target="_blank">Istio blog</a></div><div><a href="https://github.com/rancher/rancher/issues/25098" target="_blank">Rancher git issue</a></div><div><br /></div>Naor Whttp://www.blogger.com/profile/01896674408756848223noreply@blogger.com0tag:blogger.com,1999:blog-17913836.post-1619018512625659952019-11-01T10:54:00.003+02:002019-11-01T10:56:01.455+02:00mounting AWS (Amazon Web Services) EFS on Linux Ubuntu 18.04<br />
Amazon Elastic File System (Amazon EFS) is a scalable file storage for EC2 and services that run on EC2 (for example Kubernetes clusters). The device is accessible on Linux via the NFS protocol and can be used my multiple instances and pods at the same time.<br />
<a href="https://docs.aws.amazon.com/efs/latest/ug/how-it-works.html" rel="nofollow" target="_blank">For more information on EFS visit AWS documentation.</a><br />
<br />
<br />
<b>Step one: Gather information<br /><b></b></b>
In our case ti is pretty straightforward. Ubuntu instance in the same VPC as the EFS and a DNS name of the file system we want to access. The format uses following convention:<br />
<br />
<b>http://file-system-id.efs.aws-region.amazonaws.com</b><br />
<b><br /></b>
And the exact URL is available on AWS console AWS home under filesystem's DNS name or via cli<br />
<br />
<b>Step two: Install the NFS Client for Linux</b><br />
<br />
<span style="background-color: #fefdfa; color: #333333; font-family: Montserrat; font-size: 14px;">$ </span><i>sudo apt-get update</i><br />
<span style="background-color: #fefdfa; color: #333333; font-family: Montserrat; font-size: 14px;">$ </span><i>sudo apt install nfs-kernel-server</i><br />
<br />
Step three: Mount the file system on EC2 instance.<br />
Create (if you don't have already) a mount point for the EFS<br />
<br />
<span style="background-color: #fefdfa; color: #333333; font-family: Montserrat; font-size: 14px;">$ </span><i>sudo mkdir -p /mnt/efs-mount-point</i><br />
<br />
<b>Mount the EFS share on the instance</b><br />
<br />
<span style="background-color: #fefdfa; color: #333333; font-family: Montserrat; font-size: 14px;">$ </span><i>sudo mount -t nfs -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport mount-target-DNS:/ /mnt/efs-mount-point</i><br />
<br />
Now we have a mounted Amazon EFS file system on Ubuntu EC2 instance.<br />
Keep in mind that command mounted doesn't persist across reboots. if you want it to be permanently accessible you have to add it to the fstab.<br />
<br />
<br />
<b>Common error:</b><br />
<b><br /></b>
<i>efs mount.nfs: Connection timed out</i><br />
<i><br /></i>
This error can occur because either the Amazon EC2, mount target security groups or file system access are not configured properly.<br />
<br />
For more troubleshooting tips you can visit:<br />
<a href="https://docs.aws.amazon.com/efs/latest/ug/troubleshooting-efs-mounting.html">https://docs.aws.amazon.com/efs/latest/ug/troubleshooting-efs-mounting.html</a><br />
<br />Naor Whttp://www.blogger.com/profile/01896674408756848223noreply@blogger.com0tag:blogger.com,1999:blog-17913836.post-3120525273843892402019-08-08T16:46:00.001+03:002019-08-08T16:46:51.077+03:00How to Install Terraform 0.12 on Ubuntu 18.04<br />
<br />
To this day (8/8/2019) Terraform is not packaged in an official apt repository. There is an option to install it with <a href="https://snapcraft.io/" target="_blank">Snap </a>but be careful it will probably be an older version. When i checked it was v0.11.11<br />
If you do want to install it with snap, run:<br />
<br />
$ <i>snap install terraform</i><br />
<br />
<h4>
To install the latest version follow this procedure.</h4>
<br />
You might want to update your system just in case:<br />
<br />$ <i><u>sudo apt-get update</u></i><br />
<br />
Now since you are getting a Terraform binary from official Hashicorp site, you will need both <b>wget </b>and <b>unzip </b>packages unless already installed:<br />
<br />
$ <i>sudo apt-get install wget unzip</i><br /><br />Last step would be to download an unzip Terraform package (<a href="https://www.terraform.io/downloads.html" target="_blank">you can find latest here</a>).<br />
<br />
$ <i>wget https://releases.hashicorp.com/terraform/0.12.6/terraform_0.12.6_linux_amd64.zip</i><br />$ <i>sudo unzip ./terraform_0.12.6_linux_amd64.zip -d /usr/local/bin/</i><br /><br />check that it is installed:<br />
<br />
$ terraform -v<br /><br />you are all done.<br /><br />Provided by:<a href="http://www.forthscale.com/" target="_blank">Forthscale systems, cloud experts</a>Naor Whttp://www.blogger.com/profile/01896674408756848223noreply@blogger.com0tag:blogger.com,1999:blog-17913836.post-84868581361633533402019-02-26T16:16:00.001+02:002019-02-26T16:16:19.577+02:00Getting AWS EC2 instance id (instanceid) from within the ec2 instanceIn general you can get a lot of instance metadata by accessing API on<br />http://169.254.169.254/latest/meta-data/<br />
That includes instance id.<br />
<br />On generic Linux system, you can get the ID either using curl:<br />
<i>curl http://169.254.169.254/latest/meta-data/instance-id</i><br />
or wget:<br />
<i>wget -q -O - http://169.254.169.254/latest/meta-data/instance-id</i><br /><br />If you instance is based on Amazon Linux or have <b>cloud-utils</b> installed you can also run:<br />
<i>ec2-metadata -i</i><br />
for instance id.<br />
<br />more documentation on metadata is a available here:<br />
<a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html">https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html</a><br />
<br />Provided by:<a href="http://www.forthscale.com/" target="_blank">Forthscale systems, cloud experts</a>Naor Whttp://www.blogger.com/profile/01896674408756848223noreply@blogger.com0tag:blogger.com,1999:blog-17913836.post-538938955001233202018-11-19T18:20:00.000+02:002018-11-19T18:20:01.814+02:00HTTP 409 while provisioning Google Cloud SQL instanceWhile creating a new Google Cloud SQL be careful not to use instance name (master or replica) that was recently used. How recent? <a href="https://cloud.google.com/sql/docs/mysql/delete-instance" target="_blank">Up to two months</a>.<br />
<br />
errors you might encounter:<br />
ERROR: (gcloud.sql.instances.create) Resource in project [Project name] is the subject of a conflict: The instance or operation is not in an appropriate state to handle the request.<br />
HTTP 409<br />
<br />
Provided by:<a href="http://www.forthscale.com/" target="_blank">Forthscale systems, cloud experts</a>Naor Whttp://www.blogger.com/profile/01896674408756848223noreply@blogger.com0tag:blogger.com,1999:blog-17913836.post-76432233167750143752017-09-21T12:46:00.000+03:002017-09-21T12:46:46.884+03:00DevOps and Site Reliability Engineering (SRE)<br />
<br />
As we all know, the Computer Age and the Internet Age have both profoundly impacted the world of commerce. As customer experience changes, led by internet giants, IT operations change accordingly to support new processes. Not so long ago, new product development could mostly be decoupled from operations. Of course, there were some connections, factories had to retool their machinery if changes were made. Yet the nature of physical products allowed for development operations to drift apart.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-m0kCDtZ8OuE/WcOKVH9BGqI/AAAAAAAAN6s/Vq8ezsgSZ4QlRf1K4m8WvyRO4-qva0IHQCLcBGAs/s1600/bigstock-Gear-35398406.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="657" data-original-width="900" height="233" src="https://3.bp.blogspot.com/-m0kCDtZ8OuE/WcOKVH9BGqI/AAAAAAAAN6s/Vq8ezsgSZ4QlRf1K4m8WvyRO4-qva0IHQCLcBGAs/s320/bigstock-Gear-35398406.jpg" width="320" /></a></div>
<br />
<br />
With the explosion of cyber property in the last few decades, though, the product mix has changed. Digital products represent a large and growing part of global offerings. An expectation from such a product is to be always-reliable, accessible from anywhere by anyone at any time. Recent offerings from major cloud providers advertise simplicity in supporting this notion. In reality, everything is still technically grounded (servers need to physically be somewhere). To meet market expectations development has to work closely with operations.<br />
<br />
For a simple example, consider a buyer-seller connection service. In the 1970s, perhaps there was a weekly publication of sellers in a relatively small geographic area. Buyers couldn’t directly compete, because the seller could only handle one caller at a time. Today, hundreds of remote buyers can compete directly and instantly, and the seller never has to negotiate with a single one if s/he doesn’t want to. For the retail equivalent (mail order catalogues), in today’s system, there might not be a human involved between the factory and the customer’s house at all.<br />
<br />
Similar transformations abound in a plethora of industries. Cyber products are entirely new, and, because reliability and security are paramount, development simply cannot remain decoupled from operations. Moreover, simple yet powerful upgrades from development can be applied with minimal interference and downtime, so why wouldn’t operations departments cooperate with development teams to enhance the customer experience?<br />
<br />
<h3>
What is DevOps? What is SRE?</h3>
<div class="graf graf--p graf-after--h4" id="c786" name="c786" style="--baseline-multiplier: 0.179; background-color: white; color: rgba(0, 0, 0, 0.8); font-family: medium-content-serif-font, Georgia, Cambria, "Times New Roman", Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 1.58; margin-top: 6px;">
DevOps — an organizational model that encourages communication, empathy, and ownership throughout the company</div>
<div style="--baseline-multiplier: 0.179; background-color: white; color: rgba(0, 0, 0, 0.8); font-family: medium-content-serif-font, Georgia, Cambria, "Times New Roman", Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 1.58; margin-top: 29px;">
SRE — an organizational model to reconcile the opposing incentives of operations and development teams within an organization</div>
<br />
These two terms are widely used and broadly applied. Sometimes too broadly. The term Site Reliability Engineering was born at Google, the brain child of Ben Treynor. It, like DevOps, is a blend of operations and development. The most important aspects, similarly to DevOps, are automating operations processes and increasing collaboration. This is especially important in globally-scaled, always-on-demand services, because not all errors and issues can (or even should) be handled by humans. We humans have better things to do.<br />
<br />
SRE aims to provide availability, performance, change management, emergency response, and capacity planning. Each of these factors is essential to global-grade services, because the software landscape sees intense competition. A couple days of downtime can mean customers flowing to competitors. This brave new world requires new techniques.<br />
<h4>
A One-Paragraph Primer on Reliability Terminology</h4>
Any operations student would know that there are two parts to reliability. Mean Time to Repair (MTTR) and Mean Time Between Failures (MTBF). The former is how long a system is in error before it is fixed, and the latter is how long the interval is between failures. These two concepts work together, and a balance between them is a golden gold.<br />
<h4>
Traditional Operations and Development Interaction</h4>
The traditional interaction between development teams and operations teams is bipolar. On one end, the development team is tasked with creating new features and attracting customers are much as possible. New features are an attractor, and hence more new features amplifies the attraction factor. Unfortunately, this sometimes leads to development teams to publish updates and features before they are thoroughly tested. It also leads to frustrated operations teams when the service goes down.<br />
<br />
Conversely, the operations team is tasked with running the service once it has been approved and established. The ops team doesn’t want more work than is essential, so it encourages longer and more rigorous testing periods before release. This leads to long lead times and frustrated development teams who just want to push out the newest, coolest features.<br />
<h4>
Is there no middle ground?</h4>
The conflict between dev and ops can be palpable. Sometimes responsibility for code is even hidden from operations to limit fallout onto one person, which is known as information hiding. This is not an efficient or well-oiled system. How can we reconcile the seemingly opposite goals of development and of operations? In SRE, the term is “error budget”.<br />
<br />
According to the creators of SRE, a 100% reliability rate is unlikely, and maybe not even desirable. 99.9% reliability is indistinguishable from 100% for the userbase. Maybe 99% is your target. It depends on the users and what level of reliability they are willing to accept. This level is defined multilaterally (see “Moral Authority”).<br />
<br />
Whatever your target, the difference between your target and 100% is the “error budget”. The development team may produce code that has an error rate up to the budget. That means they can do less testing or roll out less stable features, as long as they don’t surpass the budgeted downtime. Once the downtime allowance is surpassed, all future launches must be blocked, including major ones, until the budget is “earned back” with performance that is better than the target reliability rate.<br />
<br />
This small but brilliant change has interesting consequences. The dev team attempts to code for low native error rates, because they want to use their budget on more interesting and fun features, not the foundational code. Furthermore, the dev team starts to self-police, because they want to conserve the budget for worthwhile launches, not consume it on errors in basic features. Finally, there is no blame or info hiding, because everyone agreed to the budget in the first place. This leads to empathy and communication between teams, replacing the sometimes hostile environment of the traditional dev-ops relationship.<br />
<h4>
Moral Authority</h4>
In an organization, especially in the tech world, it is imperative that employees believe in their leadership. A rogue team is disastrous, and sabotage is a real threat. Whence stems the moral authority for SRE? This lies in the budgeting process. Development, operations, product managers, and organizational management agree to Service Level Agreements (SLAs), which state the minimum uptime (which necessarily stipulates the maximum downtime) that is acceptable to customers.<br />
<br />
This is the foundation for the budget. If customers are willing to accept 99.5% uptime, then the budget is 0.5%. And since the development team has agreed to this level, they have no authority to challenge SRE blocking their launches if the budget is spent. Everyone agrees beforehand, so there is no political jockeying once the system is live.<br />
<h4>
Monitoring, Reliability, and Service Degradation</h4>
A public-facing system will inevitably be down sometimes. Even if the MTTR is extremely short and unnoticeable by customers, the system has still failed. This is the reason monitoring (and preferably automated monitoring) is essential.<br />
<br />
According to Treynor, there are three parts to monitoring. First is logging, which is mundane and mainly for diagnostic and research purposes later. This isn’t meant to be read continuously, only used as a tool for later review, if necessary. Then there are tickets, for which humans must take action, but maybe not immediately. Then there are alerts, such as when the service is offline for most customers — these require immediate human response, likely in the form of an emergency or crisis response team.<br />
<br />
Most error handling should be automated, and this is an area where machines fix themselves. The more machines fix themselves, the better. This quick, automatic repair is related to reliability via Mean Time to Repair (MTTR). If service problems occur but the MTTR is a few milliseconds (because computers are fixing themselves), then the users will never notice. That means dev has more available budget, a good incentive to develop automated error-handling systems.<br />
<br />
Now, what to do when the MTTR is longer than a few milliseconds. Many errors will be on back-end systems, and with replication, there may be no discernible issue for the front-end site or service. If, however, issues apparent to the consumer are inevitable, it is best to engineer for “graceful degradation”. This just means you don’t want your service blacking out completely, but maybe slowing down or lowering service quality. A complete blackout with a completely unreachable or unresponsive service will cause customer backlash. Degraded service will cause annoyance, but probably not drive them away. This can be accomplished via Microservice Architecture, as one service going down does not take down the entire service.es, the better. This quick, automatic repair is related to reliability via Mean Time to Repair (MTTR). If service problems occur but the MTTR is a few milliseconds (because computers are fixing themselves), then the users will never notice. That means dev has more available budget, a good incentive to develop automated error-handling systems.<br />
<br />
From the customer viewpoint, lots of short MTTR errors is probably better than long but infrequent errors, because short MTTR errors are often eliminated before customers even notice. On the other and, if a firm doesn’t implement a system for these errors, the exact opposite is desirable: one long outage means one long fix, not an endless stream. Hence, to reconcile this conflict, it is strongly suggested to create a system to handle issues. And when the company scales, it is all but imperative to automate, because problems will inevitably outstrip operation headcount.<br />
<h4>
Why is SRE important?</h4>
All organizations want to provide excellent service to users. All organizations have organizational structure, and sometimes that structure includes competing teams and incentives. SRE attempts to eliminate one major issue, especially in modern organizational structures. Chaos behind the scenes will eventually lead to chaos on the front-end, where customers can indirectly observe the Pyrrhic war between development and operations end in a spectacular implosion of the service (and the customer base).<br />
<h4>
How is SRE related to DevOps?</h4>
The first and most obvious way it is related is in using software techniques in operations. But that is trivial, especially in tech companies, because modern operations departments all rely on software to some degree. Both also foster inter-team communication.<br />
<br />
However, DevOps encourages communication between teams across the organization, while SRE encourages communication between the development and operations teams. DevOps is concerned with broad empathy and ownership (even involving sales and marketing), while SRE tends to focus on only development and operations. Furthermore, in DevOps, the development team will feel responsible for the life of the product, while in SRE, dev might self-police, but the ultimate operations responsibility still lies with operations.<br />
<br />
There are yet more similarities, though, such as the tendency to automate as much of the operations process as possible, including continuous delivery procedures: dev teams under an SRE model might roll out small updates to stay under the error budget, while dev teams under a DevOps model tend to make small updates for easier monitoring and bug identification. Both encourage scalability, such that products not only have solid foundations and native code, but that base product can expand with the business.<br />
<br />
As with anything in organizational management, these terms are not mutually exclusive, and they do not have to be separated. Furthermore, each company has its own unique culture and needs, so applying aspects of DevOps and aspects of SRE simultaneously is not taboo. In fact, it is viewed positively. Innovative companies always look for the best aspect of something, extract that best aspect, and adapt and apply that aspect to their own needs. Don’t be afraid to be unique, and certainly don’t be afraid to stand on the shoulders of giants.<br />
<br />
<br />
Provided by:<a href="http://www.forthscale.com/" target="_blank">Forthscale systems, cloud experts</a><br />
Also published @ <a href="https://medium.com/@forthscale/devops-and-site-reliability-engineering-sre-70b61f61b55a" target="_blank">Forthscale medium account</a>Naor Whttp://www.blogger.com/profile/01896674408756848223noreply@blogger.com0tag:blogger.com,1999:blog-17913836.post-54589647535837936462017-06-29T20:16:00.000+03:002017-06-30T20:51:50.202+03:00Petya / NotPetya<h2 style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Petya / NotPetya</span></h2>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-xLfWADBVgA4/WVU1t48sDcI/AAAAAAAAMD4/XojHsVrcp7IEs9msxXHCbhNZsyR23wcEQCLcBGAs/s1600/bigstock--D-White-People-Scientific-33516941.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="900" data-original-width="720" height="200" src="https://4.bp.blogspot.com/-xLfWADBVgA4/WVU1t48sDcI/AAAAAAAAMD4/XojHsVrcp7IEs9msxXHCbhNZsyR23wcEQCLcBGAs/s200/bigstock--D-White-People-Scientific-33516941.jpg" width="160" /></a></div>
<div>
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Just last month the WannaCry ransom-ware spread to hundreds of thousands of machines and set off a global panic. The worm-style infection relied on a leaked NSA tool (EternalBlue) that allowed it to spread rapidly across the Internet. Microsoft released a patch shortly after the attack began, even supporting systems that had long been past their patch lifetimes (Windows XP, anyone?). </span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">A mere month later, the NotPetya malware burst onto the scene. Petya has been around since early 2016, and this outbreak is not actually Petya. However, it shares many similarities, hence the preliminary label as “Petya” and subsequently “NotPetya”. The attack bears resemblance to WannaCry in that it exploits EternalBlue, which, unfortunately, has not been patched on many systems because companies and individuals have decided uptime is more important. They effectively gambled with their data, and some of them have lost. </span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">This ransomware hasn’t spread like WannaCry, but it also uses a more sophisticated infection technique and the encryption stage is more interesting as well. Essentially, NotPetya’s developers learned from WannaCry’s mistakes and made some clever enhancements. </span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">The malware has hit giants like Merck, Maersk, the advertising firm WPP, and Rosneft (the Russian energy behemoth). The way NotPetya spreads is likely a big reason major firms and big networks are targeted as opposed to just anyone.</span></div>
<b id="docs-internal-guid-f1d780a4-f4d7-22c7-c47e-63daf15cc172" style="font-weight: normal;"><br /></b>
<br />
<h4 style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Who’s Affected?</span></h4>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">The most affected are those without any type of malware protection and who skip critical OS updates for Windows. It is hard to imagine that anyone (and especially companies) hasn’t updated their systems after the carnage wreaked by WannaCry, but there are certainly people who haven’t.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Users of old protocols and techniques, like Server Message Block version 1 are highly vulnerable, as this is the main exploit for EternalBlue.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">And since this malware spreads within a network rather than jumping around the Internet, it is more likely large organizations are going to be targeted, because they have much bigger networks to infect. Furthermore, these companies have HR and customer service departments that often download attachments from unknown sources. Such activities make them prime targets for this kind of ransomware attack.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<h4 style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><b>The Infection Process</b></span></h4>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">NotPetya first attempts to use the EternalBlue security hole. It exploits Microsoft’s Server Message Block version 1 (SMBv1), which is generally used for allowing file and printer sharing and miscellaneous communications tasks. The latest version is v3, and unless there is a specific need to use SMBv1, it should not be used. EternalBlue is just one compelling reason to ditch it. However, since this vulnerability has been addressed in updates and patches, the malware has other vectors for infection. </span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Assuming the SMBv1 exploit fails, the ransomware attempts to use PSExec (to run processes on connected computers). It also scans the memory for any user credentials, which are then used in conjunction with Windows Management Instrumentation Command Line (WMIC). Using WMIC affords NotPetya the ability to infect even patched Windows 10 machines, because WMIC is a legitimate network tool for administrators.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">With that in mind, any computer that has administrator rights on a network can infect the entire network, whether it is a patched network or not. </span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<h4 style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">How it Spreads</span></h4>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">The main entry point is through a malicious file downloaded by a network user. As HR personnel tend to receive a lot of email with attachments, this is one of the identified avenues of attack. Once the malicious file is downloaded, it can use the exploits listed above to spread on the network – this is a good reason to target big companies (they have a lot more computers on their network than Jack who lives down the street).</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Another major avenue of injection is through malicious code in Microsoft Office files. Auto-running macros can download the infection whenever an offending file is opened. And not to single out any single weak point, but it has been published that the MeDoc software oft-used in the Ukraine has been an involuntary delivery system. </span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<h4 style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">The Encryption Process</span></h4>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">NotPetya not only encrypts your files, it scrambles the boot sector of your hard drive, so it isn’t even possible to boot past the ransom message. This also prevents any offline tampering (as opposed to WannaCry, which could be investigated offline), since there’s no way to even look at the encrypted files. Furthermore, it seems system logs are wiped to make it that much harder to crack the malware.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">In order to enforce the MBR (master boot record) encryption, the machine is forced to restart within an hour (otherwise it may take weeks for that part of the encryption, as many machines are powered on for weeks at a time with no restarts).</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<h4 style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><b>Prevention of the Virus</b></span></h4>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">It goes without saying that one should not be downloading random files from the Internet without knowing the sender. In certain roles, though, it can be difficult to adhere to this rule though.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Another tenet of cybersecurity is having some sort of antivirus and anti-malware software. Most of the major names in cybersecurity claim they protect against the execution of NotPetya. So having some sort of antivirus will be helpful in preventing infection.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Another very important aspect is keeping software up-to-date. Updating software from trusted vendors like Microsoft is the best way to cut off a major avenue of attack (like leveraging EternalBlue). If the update cannot be applied, networks should at least attempt to disable SMBv1 to prevent spread through that vulnerability.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<h4>
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><b>A Kill Switch? Maybe a “Vaccine”</b></span></h4>
</div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">If you have been infected or are at major risk thereof, one known “vaccine” is to create the file C:\Windows\perfc. Once the file is created, you should set it to read-only. Apparently NotPetya scans the computer for this file, and if it is found, it halts the encryption process. </span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Note, however, this is not a “kill switch” like was possible in WannaCry. This is being termed a “vaccine”, because the machine can be infected, but its data remains unscrambled. It doesn’t kill the propagation of the virus, because the virus remains on the system.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">The greatest drawback with this vaccine is the file must be created for each machine on a network for the entire network to be vaccinated. It’s a very simple fix for one machine, but can be a headache on a network with thousands of machines. Regardless, this is one possible approach to prevent your files from being locked.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<h4>
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><b>What to do if your files are encrypted</b></span></h4>
</div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">If it has come to your computer booting up with a ransom message, you only have one option to get the data back from that machine. Unfortunately, it means paying the ransom, which most expects and cyber-security defence teams advise against. Even more unfortunate for those affected, the email address provided in the ransom message has reportedly been taken offline.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">A much better solution is to have your data backed up somewhere else. If you are practising basic data maintenance, you shouldn’t lose any of your data to this attack. If your data is backed up, this is more an inconvenience than a company killer.</span><br />
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<br />
<h4>
<span style="background-color: transparent; font-family: proxima nova; font-size: 14.6667px; vertical-align: baseline; white-space: pre-wrap;">Ransomware or “Wiper”?</span></h4>
<span style="background-color: transparent; font-family: proxima nova; font-size: 14.6667px; vertical-align: baseline; white-space: pre-wrap;">Unfortunately for those that have been impacted, NotPetya seems to be a wiper and not ransomware. According to both <a href="https://securelist.com/expetrpetyanotpetya-is-a-wiper-not-ransomware/78902/" target="_blank">Kaspersky </a>and <a href="https://blog.comae.io/petya-2017-is-a-wiper-not-a-ransomware-9ea1d8961d3b?gi=7675c400f234" target="_blank">Comae Technologie</a>s, the encrypted files are not recoverable, even by the attacker. That means even if the payment is made, no key can be distributed to reverse the encryption (not that a victim could contact the attackers, because their contact email address has been disabled).
This implies the attack was meant to be destructive and not financially driven. It could be that a well-financed state actor is behind the attack, and they already have plenty of funds. Following so closely on the heels of WannaCry, the media reported the attack as ransomware and shifted the focus from a possible nation state attack to a rogue group of criminals looking for a quick financial payoff. Watch out for more info in the near future concerning a nation’s involvement.</span><span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">
</span><br />
<div>
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div>
<h4>
<span style="background-color: transparent; font-family: proxima nova; font-size: 14.6667px; vertical-align: baseline; white-space: pre-wrap;">Some More Technical Info from around the Web</span></h4>
<span style="background-color: transparent; font-family: proxima nova; font-size: 14.6667px; vertical-align: baseline; white-space: pre-wrap;"><a href="https://blog.kaspersky.com/new-ransomware-epidemics/17314/" target="_blank">Kaspersky </a>has a page with some information on the detection its software generates. There is also a short bit of advice for users.
If you are interested in exactly who has been attacked, Avira has compiled a (probably unexhaustive) <a href="https://blog.avira.com/petya-strikes-back/" target="_blank">list of user language settings</a> on compromised machines. As reported elsewhere, it is largely Russian and Ukrainian machines and disproportionately Windows 7 running Service Pack 1.
And Symantec has published an <a href="https://www.symantec.com/connect/blogs/petya-ransomware-outbreak-here-s-what-you-need-know" target="_blank">article </a>with a good overview of the infection vectors and the impacted file extensions. A not unexpected spoiler? You probably use solely these file extensions.
Finally, if you’ve decided to kill SMBv1 manually, this is <a href="https://support.microsoft.com/en-us/help/2696547/how-to-enable-and-disable-smbv1-smbv2-and-smbv3-in-windows-and-windows" target="_blank">Microsoft’s tutorial</a> for all of their OSes. </span></div>
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="background-color: transparent; font-family: "proxima nova"; font-size: 14.6667px; vertical-align: baseline; white-space: pre-wrap;"><a href="http://freports.us.checkpoint.com/petyavar/" target="_blank">Click here to see Checkpoint forensic analysis</a></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Have more questions? </span><a href="http://www.123contactform.com/form-504371/Contact-Us" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "proxima nova"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">Give us a shout.</span></a></div>
<br />
Provided by:<a href="http://www.forthscale.com/" target="_blank">Forthscale systems, cloud experts</a>Naor Whttp://www.blogger.com/profile/01896674408756848223noreply@blogger.com0tag:blogger.com,1999:blog-17913836.post-25206921760863938842016-03-16T20:32:00.000+02:002016-03-16T21:45:54.655+02:005 Essential Continuous Intergation Tools<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><a href="https://3.bp.blogspot.com/-uU55iTnRqPk/VumlBxi6u1I/AAAAAAAAAdE/CH8D2oMlyvQyUUAz2iUUgzX8frGE1qySw/s1600/5%2BEssential%2BContinuous%2BIntergation%2BTools.jpg"><img border="0" src="https://3.bp.blogspot.com/-uU55iTnRqPk/VumlBxi6u1I/AAAAAAAAAdE/CH8D2oMlyvQyUUAz2iUUgzX8frGE1qySw/s1600/5%2BEssential%2BContinuous%2BIntergation%2BTools.jpg" /></a><br /><br />A lot has been said about continuous integration. Here is our 5c. If you are just going to try it out or seriously researching going CI, you might want some points on tools you will need. So we compiled an article for you with shortlist of the most useful tools for continuous integration.</span><br />
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
</span><br />
<h2>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><a href="https://jenkins-ci.org/" target="_blank"> Jenkins</a></span></h2>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><a href="https://2.bp.blogspot.com/-gxrDSs5Ahpw/Vumlc9clPCI/AAAAAAAAAdY/2ntz2LVjtiYKdGz8iaCPcANO9L2LSHB3g/s1600/jenkins.png"><img border="0" src="https://2.bp.blogspot.com/-gxrDSs5Ahpw/Vumlc9clPCI/AAAAAAAAAdY/2ntz2LVjtiYKdGz8iaCPcANO9L2LSHB3g/s1600/jenkins.png" /></a><br />Everyone knows Jenkins. It is a hardcore, open-source continuous integration server. Mostly it is used for Java projects development. But Jenkins can also work with some .NET version control systems what makes it well-suited for .Net projects as well. With Jenkins you will enjoy a robust developer community, easy installation and more than 400 plugins for high customization.</span><br />
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
</span><br />
<h2>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><a href="https://www.jetbrains.com/teamcity/" target="_blank"> TeamCity</a></span></h2>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><a href="https://2.bp.blogspot.com/-VFwRRalHEbk/VumlczofYQI/AAAAAAAAAdU/TVf2GUrYI88LaStgR3iOj1dj6Ry-eHJqg/s1600/logo_teamcity.jpg"><img border="0" src="https://2.bp.blogspot.com/-VFwRRalHEbk/VumlczofYQI/AAAAAAAAAdU/TVf2GUrYI88LaStgR3iOj1dj6Ry-eHJqg/s1600/logo_teamcity.jpg" /></a><br />This Java-based continuous integration server allows you to develop for .Net and mobile platforms. It runs locally and has a system tray notification tool which will alert you over email if any issues happen while the build is finishing.<br /><br />Also, TeamCity has a built-in support for a project hierarchy. It allows you to build a project tree that will inherit settings and permissions. </span><br />
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
</span><br />
<h2>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><a href="https://codeship.com/" target="_blank"> Codeship</a></span></h2>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><a href="https://1.bp.blogspot.com/-2sAZeujlGog/VumlcR_lFWI/AAAAAAAAAdM/4rzfOkCXTRYAf9zSZ--sB0l8iCOf-LAvg/s1600/codeship-logo.png"><img border="0" src="https://1.bp.blogspot.com/-2sAZeujlGog/VumlcR_lFWI/AAAAAAAAAdM/4rzfOkCXTRYAf9zSZ--sB0l8iCOf-LAvg/s1600/codeship-logo.png" /></a><br />Codeship supports the most popular languages: Java, Ruby, PHP, Python. It integrates with multiple repository hosting services such as GitHub, Bitbucket, Deploy Anywhere, Engine Yard. Codeship significantly eases deployment. You just need to define a project in a UI and setting couple of parameters before making a commit. Codeship will test new code once it’s pushed and deploy it automatically.</span><br />
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
</span><br />
<h2>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><a href="https://travis-ci.org/" target="_blank"> Travis CI</a></span></h2>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><a href="https://2.bp.blogspot.com/-JavjFLeyDAM/Vumlcfs5RvI/AAAAAAAAAdQ/hGHPc6HTcmsKnjwnsMgbPEjL-CyqtPeog/s1600/Travis-CI-logo.jpg"><img border="0" src="https://2.bp.blogspot.com/-JavjFLeyDAM/Vumlcfs5RvI/AAAAAAAAAdQ/hGHPc6HTcmsKnjwnsMgbPEjL-CyqtPeog/s1600/Travis-CI-logo.jpg" /></a><br />This tool was built to test projects hosted on GitHub. Travis CI has pretty easy and straightforward setup. It requires only a.yaml configuration file to be created in the root of the desired repository. You can develop in C, C++, JavaScript, PHP, Perl and Python, all are supported.</span><br />
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
</span><br />
<h2>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><a href="http://heilihq.com/" target="_blank"> Heili</a></span></h2>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><a href="https://1.bp.blogspot.com/-WOizkRsnrJs/VumlcTvohCI/AAAAAAAAAdI/bispyxoJqaU0kCYYZ6-dQqGDGCZcyAhIw/s1600/Final-Logo.jpg"><img border="0" src="https://1.bp.blogspot.com/-WOizkRsnrJs/VumlcTvohCI/AAAAAAAAAdI/bispyxoJqaU0kCYYZ6-dQqGDGCZcyAhIw/s1600/Final-Logo.jpg" /></a><br />Heili is an AI infrastructure monitoring and management solution. Think of it as a sidekick that helps out a true devops superhero. It automatically discovers your stack in the cloud, deploys monitoring and gives you peace of mind. Heili uses Ansible for provisioning so you get tons of automation out of the box and can add your own in just few clicks. Running a stack on AWS, Google or Softlayer was never easier.<br /><br />And which tools do you use? Share with us in comments!<br /><br />Provided by:<a href="http://www.forthscale.com/">Forthscale systems, cloud experts</a></span>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-17913836.post-74423050480131924542016-02-23T16:32:00.002+02:002016-02-23T17:08:45.242+02:0010 cool tools every DevOps team needs<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-roQfCST4Xgg/VsxrbPO_B3I/AAAAAAAAAcg/aFC5JQw1kyA/s1600/10%2Bcool%2Btools%2Bevery%2BDevOps%2Bteam%2Bneeds.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://1.bp.blogspot.com/-roQfCST4Xgg/VsxrbPO_B3I/AAAAAAAAAcg/aFC5JQw1kyA/s640/10%2Bcool%2Btools%2Bevery%2BDevOps%2Bteam%2Bneeds.jpg" width="640" /></a></div>
<span style="font-family: "arial"; font-size: 14.6667px; line-height: 1.38; white-space: pre-wrap;"><br /></span>
<span style="font-family: "arial"; font-size: 14.6667px; line-height: 1.38; white-space: pre-wrap;"><br /></span>
<span style="font-family: "arial"; font-size: 14.6667px; line-height: 1.38; white-space: pre-wrap;">Everyone needs tools that will help to increase productivity. DevOps engineers need such instruments too. In this article you will find some awesome and useful tools that you will definitely love.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<h2 style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: large; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1. <a href="https://www.elastic.co/products/logstash" target="_blank">Logstash</a></span></h2>
<div>
<br /></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-sUqXO2SNX3c/VsxoIp20qyI/AAAAAAAAAcI/jFhb--pBALg/s1600/logstash.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://4.bp.blogspot.com/-sUqXO2SNX3c/VsxoIp20qyI/AAAAAAAAAcI/jFhb--pBALg/s1600/logstash.jpg" /></a></div>
<br />
<span id="goog_1744028849"></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">This tool allows teams to analyze log file information. Logstash helps to improve your product by gleaning performance and behavioral metrics.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<h2 style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: large; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">2. <a href="http://www.itinvolve.com/" target="_blank">ITinvolve</a></span></h2>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-TuijVVFbZ5A/VsxoHXbdBkI/AAAAAAAAAbw/FNbNKQs9DFo/s1600/ITinvolve.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://4.bp.blogspot.com/-TuijVVFbZ5A/VsxoHXbdBkI/AAAAAAAAAbw/FNbNKQs9DFo/s1600/ITinvolve.jpg" /></a></div>
<div>
<br /></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Productive collaboration is extremely important for every DevOps team. This tool gives you an opportunity to share tools, workspaces, diagrams and other visual information and documentation. ITinvolve is designed for IT. So every team member get at-a-glance understanding of how can something affect existing process or system.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<h2 style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: large; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">3.<a href="https://www.docker.com/" target="_blank"> Docker </a></span></h2>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://2.bp.blogspot.com/-5aiGy5Y6JmQ/VsxoH7FWYpI/AAAAAAAAAb8/RnGissmgwCA/s1600/docker.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://2.bp.blogspot.com/-5aiGy5Y6JmQ/VsxoH7FWYpI/AAAAAAAAAb8/RnGissmgwCA/s1600/docker.jpg" /></a></div>
<div>
<br /></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">There even is a verb “Dockerize”. This verb is used by DevOps teams who work with this containerization tool. Docker easies the process of pushing the code from development to production without any unavoidable hiccups. It provides standardizations that will make Ops guys happy and flexibility that allows to use almost any language or tool.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<h2 style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: large; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">4. <a href="http://www.heilihq.com/" target="_blank">Heili </a></span></h2>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://2.bp.blogspot.com/-Hq6A_VwOVL8/VsxoIF0TKCI/AAAAAAAAAcA/1wIbNoO2uQE/s1600/heili.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://2.bp.blogspot.com/-Hq6A_VwOVL8/VsxoIF0TKCI/AAAAAAAAAcA/1wIbNoO2uQE/s1600/heili.jpg" /></a></div>
<div>
<br /></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">It is a real lifechanger for DevOps. Heili is an Artificial Intelligence driven self-learning tool that will go the management work for you. It will learn your operations, increase reliability and cut performance degradation or downtime incidents duration. </span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<h2 style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: large; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5. <a href="http://jenkins-ci.org/" target="_blank">Jenkins </a></span></h2>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-MC2xI0MTtqY/VsxoIbnnJ2I/AAAAAAAAAcE/uFUpKmldvEY/s1600/jenkins.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://4.bp.blogspot.com/-MC2xI0MTtqY/VsxoIbnnJ2I/AAAAAAAAAcE/uFUpKmldvEY/s1600/jenkins.jpg" /></a></div>
<div>
<br /></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">This tool will help you to build and test your software continuously. Also, it monitors externally-run jobs that allows you to see when something is going wrong. </span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span></div>
<h2 style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: large; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">6. <a href="http://activemq.apache.org/" target="_blank">Apache ActiveMQ </a></span></h2>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-b_lUXd6w6sk/VsxoHRoDQ6I/AAAAAAAAAb4/gDgv2hZYCVk/s1600/apache.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://3.bp.blogspot.com/-b_lUXd6w6sk/VsxoHRoDQ6I/AAAAAAAAAb4/gDgv2hZYCVk/s1600/apache.jpg" /></a></div>
<div>
<br /></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Apache ActiveMQ is an open source messaging and Integration Patterns server. DevOps engineers prefer ActiveMQ because it is really fast. Also, it supports several cross language clients and protocols.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<h2 style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: large; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">7. <a href="http://www.squid-cache.org/" target="_blank">Squid </a></span></h2>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-IaEJE61h4vs/VsxoJLp1yWI/AAAAAAAAAcY/m5LvH4cXmCw/s1600/squid.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://4.bp.blogspot.com/-IaEJE61h4vs/VsxoJLp1yWI/AAAAAAAAAcY/m5LvH4cXmCw/s1600/squid.jpg" /></a></div>
<div>
<br /></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Squid will optimize web delivery by reducing bandwidth and improving response times by caching and reusing frequently-requested web page. It is supported on most available operating systems.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<h2 style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: large; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">8. <a href="https://www.snort.org/" target="_blank">Snort </a></span></h2>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://2.bp.blogspot.com/-9jXL9TtCfhE/VsxoJJz1ZrI/AAAAAAAAAcY/lB_rzlns9Jw/s1600/snort.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://2.bp.blogspot.com/-9jXL9TtCfhE/VsxoJJz1ZrI/AAAAAAAAAcY/lB_rzlns9Jw/s1600/snort.jpg" /></a></div>
<div>
<br /></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">This is a good solution for DevOps engineers who are looking for a security tool that will provide real-time traffic analysis and packet logging. Snort is able to detect variety of attacks and probes.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<h2 style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: large; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">9. <a href="https://www.ansible.com/" target="_blank">Ansible</a></span></h2>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-QlIRk2-w2ws/Vsx19tSVf5I/AAAAAAAAAcw/9svWqiyFmvc/s1600/ansible.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://3.bp.blogspot.com/-QlIRk2-w2ws/Vsx19tSVf5I/AAAAAAAAAcw/9svWqiyFmvc/s1600/ansible.jpg" /></a></div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div>
<br /></div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: arial; font-size: 14.6667px; line-height: 20.24px; white-space: pre-wrap;">It is a configuration management tool that will significantly improve your productivity. Ansible is an all-in-one instrument: app deployment, configuration, management and orchestration. </span><br />
<span style="font-family: arial; font-size: 14.6667px; line-height: 20.24px; white-space: pre-wrap;"><br /></span></div>
<h2 style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: large; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">10. <a href="https://codeclimate.com/" target="_blank">Code Climate </a></span></h2>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-XZXBqataCVU/VsxoHeI2p_I/AAAAAAAAAcY/DRCCAcChpX4/s1600/codeclimate.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://4.bp.blogspot.com/-XZXBqataCVU/VsxoHeI2p_I/AAAAAAAAAcY/DRCCAcChpX4/s1600/codeclimate.jpg" /></a></div>
<div>
<br /></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">This tool will monitor the health of your code from your command line to the cloud, </span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">so you can fix issues sooner and ship better code, faster.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Which tools do you use?</span></div>
<br />
<br />
Provided by:<a href="http://www.forthscale.com/" target="_blank">Forthscale systems, cloud experts</a>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-17913836.post-65510082712863241562015-07-06T18:06:00.000+03:002016-02-23T16:36:14.547+02:00Part 2: Using Docker<div style="text-align: center;">
<a href="https://pbs.twimg.com/media/CD6IJi1WgAAJ3h7.jpg" imageanchor="1"><img border="0" src="https://pbs.twimg.com/media/CD6IJi1WgAAJ3h7.jpg" /></a> </div>
This is second part in our Docker tutorials, we strongly suggest to <a href="http://cloud-engineering.forthscale.com/2015/06/part-1-starting-with-docker.html">Part 1</a> before continuing here.
At this point you should be familiar with basic Docker commands, how to run containers with cool random names. But you need more, to do something really useful with Docker. So today we will learn how to build basic Web application with couple of containers that will look like this at the end:<br />
<div style="text-align: center;">
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-_8JivuhElWk/VZqU4yTYRCI/AAAAAAAAANU/ZyCc923ddTk/s1600/docker_tutorial_1%2B%25281%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://3.bp.blogspot.com/-_8JivuhElWk/VZqU4yTYRCI/AAAAAAAAANU/ZyCc923ddTk/s1600/docker_tutorial_1%2B%25281%2529.png" /></a></div>
</div>
As you can see we will have lot of different solutions at the end of this tutorial. This structure is not production wise, it's just to show what Docker can do.<br />
<br />
<h3>
Docker Hub / Database</h3>
<div>
I've picked pgSQL for this tutorial, bust you must look at this more as concept, because you can do it with any DB (SQL and noneSQL).</div>
<div>
With Docker your life should be easy, you don't have to install machines and DB's anymore, you just download image you need and use it. Most of the software have images ready in Docker Hub and lot of them already have preconfigured images made by users. But what is Docker Hub? It's official public images repository - <a href="https://hub.docker.com/">https://hub.docker.com</a>. You can register and upload your images to the hub for personal and public use. If you will continue use Docker you will meet personal registries (own by companies or private people), they work same way (later in our tutorials we will even install registry server).</div>
<div>
One you logged in to Hub (but you don't have too) you can search for postgres. I've found 10 repositories - first one is official repository and 9 repositories made by users:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://joxi.ru/bmo6QZ8sLZM8ry.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://joxi.ru/bmo6QZ8sLZM8ry.png" height="182" width="400" /></a></div>
<div>
It's always suggested to take official repositories and make modifications for them, but if you're lazy and there is user repository that fit your needs (check what images include). If you're using user repository it's also important to check last update. Sometimes it's good to use old but stable versions, but sometime you need updated one.</div>
<div>
Inside the repository you will see tags information (usually tags represent versions) and how to use the repository.</div>
<div>
Now let's go to your machine and start building containers</div>
<div>
As always we will use latest image and version, just because it's tutorial and we don't really care about it :)</div>
<div>
Actually if you sure that you going to use common software you don't have to look in repository, just pull the name of it... The repository can be useful for usage, but also not must, as you can view image configuration... Anyway, let's pull our repo:</div>
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #888888;">davidg@linux-cpl8:~> docker pull postgres:latest</span>
<span style="color: #888888;">latest: Pulling from postgres</span>
<span style="color: #888888;">104de4492b99: Pull complete </span>
<span style="color: #888888;">065218d54d7d: Pull complete </span>
<span style="color: #888888;">6d342ad75f37: Pull complete </span>
<span style="color: #888888;">9433e325f9ad: Pull complete </span>
<span style="color: #888888;">7c38e9491f7e: Pull complete </span>
<span style="color: #888888;">d9a636286bd1: Pull complete </span>
<span style="color: #888888;">4020db192fff: Pull complete </span>
<span style="color: #888888;">b93ccbbdcc22: Pull complete </span>
<span style="color: #888888;">13af7ae40c45: Pull complete </span>
<span style="color: #888888;">e6826f7776c8: Pull complete </span>
<span style="color: #888888;">5c67b212f3da: Pull complete </span>
<span style="color: #888888;">1e87f75b5751: Pull complete </span>
<span style="color: #888888;">24a73f6adf68: Pull complete </span>
<span style="color: #888888;">effe3b6a83fc: Pull complete </span>
<span style="color: #888888;">65482096da78: Pull complete </span>
<span style="color: #888888;">089cc1d86ef7: Pull complete </span>
<span style="color: #888888;">d4c43025a271: Pull complete </span>
<span style="color: #888888;">41684070b967: Pull complete </span>
<span style="color: #888888;">f969e36858c2: Pull complete </span>
<span style="color: #888888;">a2c56c0927fc: Pull complete </span>
<span style="color: #888888;">7bf0ec35adaf: Already exists </span>
<span style="color: #888888;">postgres:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.</span>
<span style="color: #888888;">Digest: sha256:0b2d2e463174edacb17d976d72adc839c032bfcfdf6da6799e288014d59998f8</span>
<span style="color: #888888;">Status: Downloaded newer image for postgres:latest </span>
</pre>
</div>
And run your first Postgres container:<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #888888;">~ $ docker run --name postgres_test -e POSTGRES_PASSWORD=d0ckerul3z -d postgres</span>
<span style="color: #888888;">415a2a8734845a8d9188e959bb7acf90ecf21da1479f8213a6df4e2ac096430a</span>
<span style="color: #888888;">~ $ docker ps -a</span>
<span style="color: #888888;">CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES</span>
<span style="color: #888888;">415a2a873484 postgres:latest "/docker-entrypoint. 5 minutes ago Up 5 minutes 5432/tcp postgres_test</span>
</pre>
</div>
So now we have DB with default database, let's connect to it! But how? 'postgres_test' is name of the container but not DNS name. How does Docker network works?<br />
I'll short the explanation of the network in few words. If you will run <i>ifconfig</i> you will notice new device:<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #888888;">~ $ ifconfig</span>
<span style="color: #888888;">docker0 Link encap:Ethernet HWaddr 56:84:7A:FE:97:99 </span>
<span style="color: #888888;"> inet addr:172.17.42.1 Bcast:0.0.0.0 Mask:255.255.0.0</span>
<span style="color: #888888;"> inet6 addr: fe80::5484:7aff:fefe:9799/64 Scope:Link</span>
<span style="color: #888888;"> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1</span>
<span style="color: #888888;"> RX packets:4 errors:0 dropped:0 overruns:0 frame:0</span>
<span style="color: #888888;"> TX packets:35 errors:0 dropped:0 overruns:0 carrier:0</span>
<span style="color: #888888;"> collisions:0 txqueuelen:0 </span>
<span style="color: #888888;"> RX bytes:304 (304.0 b) TX bytes:6496 (6.3 Kb)</span>
</pre>
</div>
Device docker0 is created when docker service is started and it's Virtual Ethernet Bridge. All you containers traffic goes through it, it's the gateway. This mean we can connect to container via it's IP:<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #888888;">~ $ docker inspect postgres_test | grep IPAddress</span>
<span style="color: #888888;"> "IPAddress": "172.17.0.1",</span>
</pre>
</div>
If you will run '<i>docker inspect [CONTAINER_NAME]</i>' without the '<i>grep</i>' you will all the info about the container, try doing it. When you done let's connect to our DB:<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #888888;">~ $ psql -h 172.17.0.1 -U postgres postgres</span>
<span style="color: #888888;">Password for user postgres: d0ckerul3z</span>
<span style="color: #888888;">psql (9.3.6, server 9.4.4)</span>
<span style="color: #888888;">WARNING: psql major version 9.3, server major version 9.4.</span>
<span style="color: #888888;"> Some psql features might not work.</span>
<span style="color: #888888;">Type "help" for help.</span>
<span style="color: #888888;">postgres=# </span>
</pre>
</div>
Now you have container with fully functioned DB<br />
<br />
<h3>
Application Container</h3>
<div>
Next part is to create an application that will connect to our DB and use it.<br />
I'm using simple flask application for the basic things, but it can be anything you want:<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #008800; font-weight: bold;">import</span> <span style="color: #0e84b5; font-weight: bold;">psycopg2</span>
<span style="color: #008800; font-weight: bold;">import</span> <span style="color: #0e84b5; font-weight: bold;">psycopg2.extras</span>
<span style="color: #008800; font-weight: bold;">import</span> <span style="color: #0e84b5; font-weight: bold;">sys</span>
<span style="color: #008800; font-weight: bold;">from</span> <span style="color: #0e84b5; font-weight: bold;">flask</span> <span style="color: #008800; font-weight: bold;">import</span> Flask
app <span style="color: #333333;">=</span> Flask(__name__)
<span style="color: #555555; font-weight: bold;">@app.route</span>(<span style="background-color: #fff0f0;">"/"</span>)
<span style="color: #008800; font-weight: bold;">def</span> <span style="color: #0066bb; font-weight: bold;">test</span>():
con <span style="color: #333333;">=</span> <span style="color: #007020;">None</span>
result <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">'<h1>The Guardians of the Galaxy</h1><table border="1"><tr><th>&nbsp;</th><th>Character</th><th>Real Name</th></tr>'</span>
<span style="color: #008800; font-weight: bold;">try</span>:
con <span style="color: #333333;">=</span> psycopg2<span style="color: #333333;">.</span>connect(<span style="background-color: #fff0f0;">"host='postgres_test' dbname='postgres' user='postgres' password='d0ckerul3z'"</span>)
cursor <span style="color: #333333;">=</span> con<span style="color: #333333;">.</span>cursor(cursor_factory<span style="color: #333333;">=</span>psycopg2<span style="color: #333333;">.</span>extras<span style="color: #333333;">.</span>DictCursor)
cursor<span style="color: #333333;">.</span>execute(<span style="background-color: #fff0f0;">"SELECT * FROM guardians"</span>)
rows <span style="color: #333333;">=</span> cursor<span style="color: #333333;">.</span>fetchall()
<span style="color: #008800; font-weight: bold;">for</span> row <span style="color: black; font-weight: bold;">in</span> rows:
<span style="color: #008800; font-weight: bold;">if</span> row[<span style="background-color: #fff0f0;">'teamleader'</span>]:
result <span style="color: #333333;">+=</span> <span style="background-color: #fff0f0;">"<tr><td></span><span style="background-color: #eeeeee;">%s</span><span style="background-color: #fff0f0;"></td><td><b></span><span style="background-color: #eeeeee;">%s</span><span style="background-color: #fff0f0;"></b></td><td><b></span><span style="background-color: #eeeeee;">%s</span><span style="background-color: #fff0f0;"></b></td></tr>"</span> <span style="color: #333333;">%</span> (row[<span style="background-color: #fff0f0;">"id"</span>], row[<span style="background-color: #fff0f0;">"character"</span>], row[<span style="background-color: #fff0f0;">"realname"</span>])
<span style="color: #008800; font-weight: bold;">else</span>:
result <span style="color: #333333;">+=</span> <span style="background-color: #fff0f0;">"<tr><td></span><span style="background-color: #eeeeee;">%s</span><span style="background-color: #fff0f0;"></td><td></span><span style="background-color: #eeeeee;">%s</span><span style="background-color: #fff0f0;"></td><td></span><span style="background-color: #eeeeee;">%s</span><span style="background-color: #fff0f0;"></td></tr>"</span> <span style="color: #333333;">%</span> (row[<span style="background-color: #fff0f0;">"id"</span>], row[<span style="background-color: #fff0f0;">"character"</span>], row[<span style="background-color: #fff0f0;">"realname"</span>])
result <span style="color: #333333;">+=</span> <span style="background-color: #fff0f0;">'</table>'</span>
<span style="color: #008800; font-weight: bold;">except</span> psycopg2<span style="color: #333333;">.</span>DatabaseError, e:
result <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">'Error </span><span style="background-color: #eeeeee;">%s</span><span style="background-color: #fff0f0;">'</span> <span style="color: #333333;">%</span> e
<span style="color: #008800; font-weight: bold;">finally</span>:
<span style="color: #008800; font-weight: bold;">if</span> con:
con<span style="color: #333333;">.</span>close()
<span style="color: #008800; font-weight: bold;">return</span> result
<span style="color: #008800; font-weight: bold;">if</span> __name__ <span style="color: #333333;">==</span> <span style="background-color: #fff0f0;">"__main__"</span>:
db_data <span style="color: #333333;">=</span> (
(<span style="background-color: #fff0f0;">'Adam Warlock'</span>, <span style="background-color: #fff0f0;">'Him'</span>, <span style="background-color: #fff0f0;">'false'</span>),
(<span style="background-color: #fff0f0;">'Drax the Destroyer'</span>, <span style="background-color: #fff0f0;">'Arthur Sampson Douglas'</span>, <span style="background-color: #fff0f0;">'false'</span>),
(<span style="background-color: #fff0f0;">'Gamora'</span>, <span style="background-color: #fff0f0;">'Gamora'</span>, <span style="background-color: #fff0f0;">'false'</span>),
(<span style="background-color: #fff0f0;">'Quasar a.k.a. Martyr'</span>, <span style="background-color: #fff0f0;">'Phyla-Vell'</span>, <span style="background-color: #fff0f0;">'false'</span>),
(<span style="background-color: #fff0f0;">'Rocket Raccoon'</span>, <span style="background-color: #fff0f0;">'Rocket Raccoon'</span>, <span style="background-color: #fff0f0;">'true'</span>),
(<span style="background-color: #fff0f0;">'Star-Lord'</span>, <span style="background-color: #fff0f0;">'Peter Quill'</span>, <span style="background-color: #fff0f0;">'true'</span>),
(<span style="background-color: #fff0f0;">'Groot'</span>, <span style="background-color: #fff0f0;">'Groot'</span>, <span style="background-color: #fff0f0;">'false'</span>),
(<span style="background-color: #fff0f0;">'Mantis'</span>, <span style="background-color: #fff0f0;">'Mantis'</span>, <span style="background-color: #fff0f0;">'false'</span>),
(<span style="background-color: #fff0f0;">'Major Victory'</span>, <span style="background-color: #fff0f0;">'Vance Astro'</span>, <span style="background-color: #fff0f0;">'false'</span>),
(<span style="background-color: #fff0f0;">'Bug'</span>, <span style="background-color: #fff0f0;">'Bug'</span>, <span style="background-color: #fff0f0;">'false'</span>),
(<span style="background-color: #fff0f0;">'Jack Flag'</span>, <span style="background-color: #fff0f0;">'Jack Harrison'</span>, <span style="background-color: #fff0f0;">'false'</span>),
(<span style="background-color: #fff0f0;">'Cosmo the Spacedog'</span>, <span style="background-color: #fff0f0;">'Cosmo'</span>, <span style="background-color: #fff0f0;">'false'</span>),
(<span style="background-color: #fff0f0;">'Moondragon'</span>, <span style="background-color: #fff0f0;">'Heather Douglas'</span>, <span style="background-color: #fff0f0;">'false'</span>),
)
con <span style="color: #333333;">=</span> <span style="color: #007020;">None</span>
<span style="color: #008800; font-weight: bold;">try</span>:
con <span style="color: #333333;">=</span> psycopg2<span style="color: #333333;">.</span>connect(<span style="background-color: #fff0f0;">"host='postgres_test' dbname='postgres' user='postgres' password='d0ckerul3z'"</span>)
cur <span style="color: #333333;">=</span> con<span style="color: #333333;">.</span>cursor()
cur<span style="color: #333333;">.</span>execute(<span style="background-color: #fff0f0;">"DROP TABLE IF EXISTS Guardians"</span>)
cur<span style="color: #333333;">.</span>execute(<span style="background-color: #fff0f0;">"CREATE TABLE Guardians(Id SERIAL PRIMARY KEY, Character TEXT, RealName TEXT, TeamLeader BOOLEAN)"</span>)
query <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"INSERT INTO Guardians (Character, RealName, TeamLeader) VALUES (</span><span style="background-color: #eeeeee;">%s</span><span style="background-color: #fff0f0;">, </span><span style="background-color: #eeeeee;">%s</span><span style="background-color: #fff0f0;">, </span><span style="background-color: #eeeeee;">%s</span><span style="background-color: #fff0f0;">)"</span>
cur<span style="color: #333333;">.</span>executemany(query, db_data)
con<span style="color: #333333;">.</span>commit()
<span style="color: #008800; font-weight: bold;">except</span> psycopg2<span style="color: #333333;">.</span>DatabaseError, e:
<span style="color: #008800; font-weight: bold;">if</span> con:
con<span style="color: #333333;">.</span>rollback()
<span style="color: #008800; font-weight: bold;">print</span> <span style="background-color: #fff0f0;">'Error </span><span style="background-color: #eeeeee;">%s</span><span style="background-color: #fff0f0;">'</span> <span style="color: #333333;">%</span> e
sys<span style="color: #333333;">.</span>exit(<span style="color: #0000dd; font-weight: bold;">1</span>)
<span style="color: #008800; font-weight: bold;">finally</span>:
<span style="color: #008800; font-weight: bold;">if</span> con:
con<span style="color: #333333;">.</span>close()
app<span style="color: #333333;">.</span>run(host<span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">'0.0.0.0'</span>)
</pre>
</div>
<br />
And now for the interesting part, get this to container! You can always start simple CentOS container and copy files there and start them, but why use Docker for this?</div>
In Docker we make it simpler and more automatic - we make and image, just like image you just downloaded!<br />
How do we do it? Lets start with making new directory where new image files will be stored:<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #888888;">~ $ mkdir docker_image_1</span>
<span style="color: #888888;">~ $ cd docker_image_1/</span>
<span style="color: #888888;">~/docker_image_1 $ </span>
</pre>
</div>
Save the code as '<i>guardians.py</i>'.
Create new file called '<i>Dockerfile</i>' with you favorite editor and insert this:<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #996633;">FROM</span> <span style="color: #0e84b5; font-weight: bold;">centos</span>:latest
<span style="color: #996633;">MAINTAINER</span> <span style="color: #996633;">David</span> <span style="color: #996633;">Golovan</span>
<span style="color: #996633;">LABEL</span> <span style="color: #996633;">Description</span><span style="color: #333333;">=</span><span style="background-color: #fff0f0;">"guardians:1 - WebApp to print Guardians list"</span> <span style="color: #996633;">Vendor</span><span style="color: #333333;">=</span><span style="background-color: #fff0f0;">"Forthscale"</span> <span style="color: #996633;">Version</span><span style="color: #333333;">=</span><span style="background-color: #fff0f0;">"1.0"</span>
<span style="color: #996633;">RUN</span> yum <span style="color: #333333;">-</span>y update <span style="color: #333333;">&&</span> yum <span style="color: #333333;">-</span>y install epel<span style="color: #333333;">-</span>release
<span style="color: #996633;">RUN</span> yum <span style="color: #333333;">-</span>y install python<span style="color: #333333;">-</span>pip gcc postgresql postgresql<span style="color: #333333;">-</span>devel python<span style="color: #333333;">-</span>devel
<span style="color: #996633;">RUN</span> pip install flask psycopg2
<span style="color: #996633;">COPY</span> guardians.py <span style="color: #333333;">/</span>opt<span style="color: #333333;">/</span>guardians<span style="color: #333333;">/</span>
<span style="color: #996633;">CMD</span> [<span style="background-color: #fff0f0;">"python"</span>, <span style="background-color: #fff0f0;">"/opt/guardians/guardians.py"</span>]
</pre>
</div>
Save the scripts to the new directory and before we proceed, what we are doing here?<br />
<br />
<ul>
<li><i>FROM</i> - Image name + tag. This is the image on which our image is based, so it will contain everything from it.</li>
<li><i>MAINTAINER</i> - Just info about image owner if it goes public</li>
<li><i>LABEL</i> - Information about the image and it's version</li>
<li><i>RUN</i> - Execute shell command. We are executing yum install and pip install for packages, but it can be any command</li>
<li><i>ADD</i> - Copy file/directory from local server to the image. We are coping our scripts to /root/ of the image</li>
<li><i>CMD</i> - Command to execute once container is running. When this commands stops(error or just exit) the container will also stop, so always make sure to run here commands that don't exit :)</li>
</ul>
<div>
Build our image and we can start containers using it. Note: I've not pulled CentOS images before so our image build will pull on first build:</div>
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #888888;">~/docker_image_1 $ docker build -t forthscale/guardians:1.0 .</span>
<span style="color: #888888;">Sending build context to Docker daemon 5.632 kB</span>
<span style="color: #888888;">Sending build context to Docker daemon </span>
<span style="color: #888888;">Step 0 : FROM centos:latest</span>
<span style="color: #888888;">latest: Pulling from centos</span>
<span style="color: #888888;">f1b10cd84249: Pull complete </span>
<span style="color: #888888;">c852f6d61e65: Pull complete </span>
<span style="color: #888888;">7322fbe74aa5: Already exists </span>
<span style="color: #888888;">centos:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.</span>
<span style="color: #888888;">Digest: sha256:a4627c43bafc86705af2e8a5ea1f0ed34fbf27b6e7a392e5ee45dbd4736627cc</span>
<span style="color: #888888;">Status: Downloaded newer image for centos:latest</span>
<span style="color: #888888;"> ---> 7322fbe74aa5</span>
<span style="color: #888888;">Step 1 : MAINTAINER David Golovan <davidg@forthscale.com></span>
<span style="color: #888888;"> ---> Running in cded0075df8b</span>
<span style="color: #888888;"> ---> b582a22635b5</span>
<span style="color: #888888;">Removing intermediate container cded0075df8b</span>
<span style="color: #888888;">Step 2 : LABEL Description "guardians:1 - WebApp to print Guardians list" Vendor "Forthscale" Version "1.0"</span>
<span style="color: #888888;"> ---> Running in e8ba10cb9536</span>
<span style="color: #888888;"> ---> 3779b4331b2e</span>
<span style="color: #888888;">Removing intermediate container e8ba10cb9536</span>
<span style="color: #888888;">Step 3 : RUN yum -y update && yum -y install epel-release</span>
<span style="color: #888888;"> ---> Running in 2bab13a17bf5</span>
<span style="color: #888888;">Loaded plugins: fastestmirror</span>
<span style="color: #888888;">Determining fastest mirrors</span>
<span style="color: #888888;">.....</span>
<span style="color: #888888;"> ---> b7207970f3b8</span>
<span style="color: #888888;">Removing intermediate container 841af65c665a</span>
<span style="color: #888888;">Step 4 : RUN yum -y install python-pip gcc postgresql postgresql-devel python-devel</span>
<span style="color: #888888;"> ---> Running in ffbb682e8747</span>
<span style="color: #888888;">Loaded plugins: fastestmirror</span>
<span style="color: #888888;">.......</span>
<span style="color: #888888;"> </span>
<span style="color: #888888;"> ---> 534c270b560b</span>
<span style="color: #888888;">Removing intermediate container ffbb682e8747</span>
<span style="color: #888888;">Step 5 : RUN pip install flask psycopg2</span>
<span style="color: #888888;"> ---> Running in 7f380d6f374c</span>
<span style="color: #888888;">Downloading/unpacking flask</span>
<span style="color: #888888;">....... </span>
<span style="color: #888888;">Downloading/unpacking psycopg2</span>
<span style="color: #888888;">Successfully installed flask psycopg2 Werkzeug Jinja2 itsdangerous markupsafe</span>
<span style="color: #888888;">Cleaning up...</span>
<span style="color: #888888;"> ---> a7038e07d3fc</span>
<span style="color: #888888;">Removing intermediate container b066cc5e4b21</span>
<span style="color: #888888;">Step 6 : COPY guardians.py /opt/guardians/</span>
<span style="color: #888888;"> ---> a98ee8d4bc21</span>
<span style="color: #888888;">Removing intermediate container ffb5d8030f25</span>
<span style="color: #888888;">Step 7 : CMD python /opt/guardians/guardians.py</span>
<span style="color: #888888;"> ---> Running in c2c8da611dca</span>
<span style="color: #888888;"> ---> 70df63860b6e</span>
<span style="color: #888888;">Removing intermediate container c2c8da611dca</span>
<span style="color: #888888;">Successfully built 70df63860b6e</span>
</pre>
</div>
Our image is ready!<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #888888;">~/docker_image_1 $ docker images</span>
<span style="color: #888888;">REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE</span>
<span style="color: #888888;">forthscale/guardians 1.0 70df63860b6e About a minute ago 379.2 MB</span>
<span style="color: #888888;">centos latest 7322fbe74aa5 2 weeks ago 172.2 MB</span>
<span style="color: #888888;">postgres latest 7bf0ec35adaf 2 weeks ago 213.9 MB</span>
<span style="color: #888888;">ubuntu latest 6d4946999d4f 3 weeks ago 188.3 MB</span>
<span style="color: #888888;">ubuntu trusty 6d4946999d4f 3 weeks ago 188.3 MB</span>
<span style="color: #888888;">ubuntu 14.04 6d4946999d4f 3 weeks ago 188.3 MB</span>
</pre>
</div>
You can use it same way as any other containers, but we need to let it know about the DB container. On previous step we found the IP manually and it's not good for production environment, specially when the address are random. To handle this problem Docker allow to link containers on same host (and actually on different hosts using <a href="https://docs.docker.com/articles/ambassador_pattern_linking/">Ambassador</a>) by just using flags. Second problem is that usually all Docker container ports are closed to public and we need to open it (if you look at postgres container you will see it opened 5432/tcp port):<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #888888;">~/docker_image_1 $ docker run -p 8080:5000 --link postgres_test:postgres_test --name guardian -d forthscale/guardians:1.0</span>
<span style="color: #888888;">fb2d7143af007fccdad3bf74c500a55562757c4a0fedc4ecdd9e9b35d6c22b99</span>
</pre>
</div>
<br />
<ul>
<li><i>-p 8080:5000</i> - Open port and redirect it. 80 is public port and 5000 is port our application is listening (default flask port)</li>
<li><i>--link</i> - Linking to container. First write container name (that's why it's important to name your containers) and second write what name to use for it inside the container (I prefer to use same name).</li>
</ul>
<div>
Open your browser and go to <a href="http://localhost:8080/">http://localhost:8080</a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-TX5uOoIc_Zw/VZqJyn02prI/AAAAAAAAANE/G3XtCRHYf4k/s1600/blog1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="295" src="https://2.bp.blogspot.com/-TX5uOoIc_Zw/VZqJyn02prI/AAAAAAAAANE/G3XtCRHYf4k/s320/blog1.png" width="320" /></a></div>
<div>
<br /></div>
<br />
But wait, that's not all, you can make even more! We can have shared directory for all the containers and for example server static files from there.<br />
In the Dockerfile add this lines before the CMD:<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #996633;">RUN</span> mkdir <span style="color: #333333;">/</span>opt<span style="color: #333333;">/</span>guardians<span style="color: #333333;">/</span>static
<span style="color: #996633;">VOLUME</span> [<span style="background-color: #fff0f0;">"/opt/guardians/static"</span>]
</pre>
</div>
Change this lines in guradians.py<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;">app <span style="color: #333333;">=</span> Flask(__name__)
result <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">'<h1>The Guardians of the Galaxy</h1><table border="1"><tr><th>&nbsp;</th><th>Character</th><th>Real Name</th></tr>'</span>
</pre>
</div>
To<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;">app <span style="color: #333333;">=</span> Flask(__name__, static_url_path <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"/static"</span>, static_folder <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"static"</span>)
result <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">'<img src="static/small_h.png" /><br /><h1>The Guardians of the Galaxy</h1><table border="1"><tr><th>&nbsp;</th><th>Character</th><th>Real Name</th></tr>'</span>
</pre>
</div>
Build the image again, now you can use 1.1 tag:<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #888888;">~/docker_image_1 $ docker build -t forthscale/guardians:1.1</span>
</pre>
</div>
Remove old container and run it again with new flag:<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #888888;">~/docker_image_1 $ docker stop guardian && docker rm guardian </span>
<span style="color: #888888;">~/docker_image_1 $ docker build -t forthscale/guardians:1.1 .</span>
</pre>
</div>
Now create the shared directory and put Docker logo there:<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #888888;">~/docker_image_1 $ mkdir /tmp/guardians</span>
<span style="color: #888888;">~/docker_image_1 $ wget -P /tmp/guardians https://www.docker.com/sites/default/files/legal/small_h.png</span>
</pre>
</div>
And start new container:<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #888888;">~/docker_image_1 $ docker run -p 8080:5000 --link postgres_test:postgres_test -v /tmp/guardians:/opt/guardians/static --name guardian -d forthscale/guardians:1.1</span>
</pre>
</div>
Test your page again :) You can start another container with same image, just make sure they have different ports, and they will use same DB and same directory for static image. Here is explanation what you did in this steps:<br />
<br />
<ul>
<li>In the Docker file you've added command to create new folder and make read/write with VOLUME command</li>
<li>In guardins.py you've allowed static files in flask and their location and added HTML tag to show the image</li>
<li>Build image was fast because it use cache for most of the parts of the file</li>
<li>In <i>docker run</i> command flag -v allow to map any local directory to any read/write directory of the image. When running <i>docker inspect [CONTAINER]</i> it will list volumes with read/write permissions that you can rewrite.</li>
</ul>
<div>
<br /></div>
<div>
Now you can build much more advanced containers for you applications</div>
<br />
<br />
Provided by:<a href="http://www.forthscale.com/" target="_blank">Forthscale systems, cloud experts</a>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-17913836.post-22137259130016656932015-06-29T13:10:00.000+03:002015-07-07T10:57:14.949+03:00Part 1: Starting with Docker<div class="separator" style="clear: both; text-align: center;">
<a href="https://pbs.twimg.com/media/CD6IJi1WgAAJ3h7.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="166" src="https://pbs.twimg.com/media/CD6IJi1WgAAJ3h7.jpg" width="400" /></a></div>
<h1 dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 10pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">If you haven’t heard about Docker by now, you are probably hanging out with the wrong crowd. As we speak, Docker is next thing after Cloud computing and if you don’t understand yet how significant they are, <a href="https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&es_th=1&ie=UTF-8#q=docker+unicorn+club&tbm=nws">last April they joined the Unicorn Club</a>.</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">And what this post is all about? It is a first in a series of posts about Docker usage. I’ll start with how to start using Docker (YA newbie tutorial) in a common infrastructure. Next posts will concentrate on more advanced Docker usage.</span></div>
<b id="docs-internal-guid-5be02ec6-3e8f-aa04-fe99-28f0a47d2ba6" style="font-weight: normal;"><br /></b>
<br />
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 10pt;">
<span style="background-color: transparent; color: black; font-family: 'Trebuchet MS'; font-size: 17.333333333333332px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Basics. What is Docker?</span></h2>
<blockquote class="tr_bq" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span style="color: #666666;">Docker is an open platform for building, shipping and running distributed applications. It gives programmers, development teams and operations engineers the common toolbox they need to take advantage of the distributed and networked nature of modern applications</span></span></blockquote>
<blockquote class="tr_bq" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span style="color: #999999;"><a href="http://www.docker.io/">Docker.io</a></span></span></blockquote>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Basically Docker allows to use application packaged in containers on machine to simplify deployment. More simple explanation is that you can run virtual OS on any Linux and soon Microsoft powered machine. This not exact explanation, since container is not a real VM, you just receive ready to use virtual environment. What is a Container? Container is a Linux Kernel level virtual environment. Sort of evolution of chroot jail environments.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">If you want to compare LXC/Docker to any other VM that you can run on your computer that the biggest difference will be the lightweight of the containers. Each VM need it’s own disk space and run full OS on it while the containers use shared OS and layered FS(AuFS). So it’s lighter, faster and easier. </span></div>
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 10pt;">
<span style="background-color: transparent; color: black; font-family: 'Trebuchet MS'; font-size: 17.333333333333332px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Why Docker?</span></h2>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">The news that docker worth more than 1B$ is not the reason to use, but the Moby Dock whale logo may just be :). Seriously, Docker is open source platform and if you’re at this blog you know the benefits of it. They are not the first to make the service, but they are working on it for two years and at this point Docker leadership become a de-facto standard. Docker can run on any Linux OS and it’s has native support of big cloud providers - <a href="http://aws.amazon.com/">AWS</a>, <a href="https://cloud.google.com/">Google Engine</a>, <a href="https://www.openstack.org/">OpenStack</a>, <a href="https://www.profitbricks.com/">ProfitBricks</a> and more are joining every day. Deploying Docker is really easy, I’ve started using Docker while I was going on train with bad WiFi and after 1 hour I had small application cloud with web server and DB.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Actually that’s the main reason we’ve chosen to use Docker to deploy our own infrastructure manager - <a href="http://www.heilihq.com/">Heili</a> :) But there are few other products that might have similar functionality but they are not as advanced, neither solid as Docker.</span></div>
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 10pt;">
<span style="background-color: transparent; color: black; font-family: 'Trebuchet MS'; font-size: 17.333333333333332px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Let’s start</span></h2>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Let`s leave theory here, if you want to know more check Docker site or Google.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Let’s start and build containers! As I already said Docker can run on a lot of different OS’s and it doesn’t really matter what OS you run once you installed it, that’s why I decided not to explain how to install it and just send you to <a href="https://docs.docker.com/installation">official guide for installation</a>: </span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Now, once you have Docker installed let’s make a first container, but first we need to have OS. Docker has ready images of common OS and we will use Ubuntu for this tutorial</span></div>
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #888888;">~ $ docker pull ubuntu:14.04</span>
<span style="color: #888888;">14.04: Pulling from ubuntu</span>
<span style="color: #888888;">428b411c28f0: Pull complete</span>
<span style="color: #888888;">435050075b3f: Pull complete </span>
<span style="color: #888888;">9fd3c8c9af32: Pull complete </span>
<span style="color: #888888;">6d4946999d4f: Pull complete </span>
<span style="color: #888888;">ubuntu:14.04: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.</span>
<span style="color: #888888;">Digest: sha256:59662c823007a7a6fbc411910b472cf4ed862e8f74603267ddfe20d5af4f9d79</span>
<span style="color: #888888;">Status: Downloaded newer image for ubuntu:14.04</span>
</pre>
</div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Let’s see what this command does:</span></div>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: italic; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">pull</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> - Pull image from repository(by default Docker Hub)</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: italic; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ubuntu</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> - Image name</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: italic; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:14.04</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> - Image tag, in this case it’s OS version</span></div>
</li>
</ul>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">After sometime (depends on your internet connection speed) you will have Ubuntu 14.04 image ready for use. And now you can start the container :)</span></div>
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #888888;">~ $ docker run -t -i ubuntu:14.04</span>
<span style="color: #c65d09; font-weight: bold;">root@eb029641a22c:/#</span>
</pre>
</div>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: italic; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">run - </span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Run a command in new container</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: italic; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-t - </span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Allocate pseudo terminal, so we will see the output</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: italic; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-i -</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Interactive, you will be able to use STDIN</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: italic; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ubuntu:14.04</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> - Image name</span></div>
</li>
</ul>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">That’s all, you have running container with Ubuntu! Of course that’s not the way we use container, because we don’t want them to be another kind of VM, we want the container to run command/application, that’s why we have </span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">run</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> command in Docker. So how do we do it?</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">The command </span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">docker run</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> also expect to receive a command to run once the container is running:</span></div>
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #888888;">~ $ docker run -t -i ubuntu:14.04 echo “Hello World”</span>
<span style="color: #888888;">Hello World</span>
<span style="color: #888888;">~ $</span>
</pre>
</div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Cool! our container printed “Hello World” and we are back to our original OS, But why?</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Docker container is designed to run </span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">one</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> command and once this command is done the container is closed. So how can we run something and keep container running? Just execute command that will never exit, until something happens, in our case simple loop (press Ctrl+C to stop it):</span></div>
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #888888;">~ $ docker run -t -i ubuntu:14.04 sh -c "while :; do echo \"Hello World\"; sleep 10; done"</span>
<span style="color: #888888;">Hello World</span>
<span style="color: #888888;">Hello World</span>
<span style="color: #888888;">^C~ $</span>
</pre>
</div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">So we have simple bash loop that will run until the world collapse but we don’t want to see the output all the time, because if we do, why do we need to use container? This mode is really helpful for debug for image(more explanation in the next posts) and our production container will be demonized:</span></div>
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #888888;">~ $ docker run -d ubuntu:14.04 sh -c "while :; do echo \"Hello World\"; sleep 10; done"</span>
<span style="color: #888888;">dde9009d78b7b6f58a57eb7737bea01913552164c2f4125bb1e9fe6e8336b0db</span>
<span style="color: #888888;">~ $</span>
</pre>
</div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Voila! Something happened and we have now long strange string, but where is the container? Is it running? Docker has command that allow us to see all containers, let’s check if we can see something with it’s help:</span></div>
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; display: block; overflow: auto; overflow: auto; overflow: auto; padding: .2em .6em; padding: .2em .6em; width: auto; width: auto; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #888888;">~ $ docker ps -a</span>
<span style="color: #888888;">CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES</span>
<span style="color: #888888;">46671d396781 ubuntu:14.04 "\"sh -c 'while :; d 5 minutes ago Exited (130) 5 minutes ago mad_thompson </span>
<span style="color: #888888;">4460b0b7a5f7 ubuntu:14.04 "echo “Hello World 8 minutes ago Exited (0) 8 minutes ago gloomy_pasteur </span>
<span style="color: #888888;">50292108ff3b ubuntu:14.04 "/bin/bash" 12 minutes ago Exited (0) 12 minutes ago silly_lumiere </span>
<span style="color: #888888;">dde9009d78b7 ubuntu:14.04 "\"sh -c 'while :; d 3 minutes ago Up 3 minutes cranky_turing</span>
</pre>
</div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Let’s start with the command:</span></div>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: italic; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ps</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> - List containers </span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: italic; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-a</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> - Show all containers, without this flag we will see only running containers</span></div>
</li>
</ul>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">And what we have at the output?</span></div>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Container ID - Each container receive unique ID once it started, for easy management. The string we received earlier is the full ID and here we can see the shorter ID</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Image - Name of the image that has been used by this container</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Command - Command that was executed on this container</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Created - How long it’s here?</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Status - What is the current status and how long is this status</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Ports - What ports are open(explanation in the next post)</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Names - Each container can have a unique name, so we will not have to use the ID all the time. If name is not provided, Docker will generate random name for us(this is the 1st Docker issue submitted on Git)</span></div>
</li>
</ul>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">We have here “mad” Ken Thompson(Unix and C inventor), “gloomy” Louis Pasteur(vaccination discoverer), “silly” Lumiere brothers(first film makers) and “cranky” Alan Truing(founder father of computer since, also spotted as Sherlock) - sounds like the Avengers(probably you have another team members). You can keep using this cool <a href="https://github.com/docker/docker/blob/master/pkg/namesgenerator/names-generator.go">name generator</a> or next time when you run the container give --name flag with desired unique name.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">We see that our latest container is up and running but we also can see 3 container that are exited. This are the container that we used on previous steps, you can see it by the command. This containers are exist, so this mean that this names are reserved, so if you use random names you’re alright, but if you have your own unique name, you can use it again. To be able to use it again we need to remove the stopped containers:</span></div>
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #888888;">~ $ docker rm mad_thompson gloomy_pasteur silly_lumiere</span>
</pre>
</div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">or</span></div>
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #888888;">~ $ docker rm $(docker ps -q -f status=exited)</span>
<span style="color: #888888;">46671d396781</span>
<span style="color: #888888;">4460b0b7a5f7</span>
<span style="color: #888888;">50292108ff3b</span>
<span style="color: #888888;">~ $ docker ps -a</span>
<span style="color: #888888;">CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES</span>
<span style="color: #888888;">dde9009d78b7 ubuntu:14.04 "\"sh -c 'while :; d 5 minutes ago Up 5 minutes cranky_turing</span>
</pre>
</div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Turing is alone now, it’s it should print “Hello World” in loop for 5 minutes, every 10 seconds = 30 messages. Let’s check the output of the container (make sure to change to your container name):</span></div>
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #888888;">~ $ docker logs cranky_turing</span>
<span style="color: #888888;">Hello World</span>
<span style="color: #888888;">Hello World</span>
<span style="color: #888888;">Hello World</span>
<span style="color: #888888;">Hello World</span>
<span style="color: #888888;">...</span>
<span style="color: #888888;">Hello World</span>
<span style="color: #888888;">~ $</span>
</pre>
</div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">As you can see our container is running as expected. To stop just execute:</span></div>
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #888888;">~ $ docker stop cranky_turing</span>
</pre>
</div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">And delete the container</span></div>
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #888888;">~ $ docker rm cranky_turing</span>
</pre>
</div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">This is the basics of using the Docker containers, you can play more with it while the next post is written.</span></div>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">The next part will explain more advanced containers usage, containers network and how to build small web application on Docker container!</span></div>
<div>
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
Provided by:<a href="http://www.forthscale.com/" target="_blank">Forthscale systems, cloud experts</a>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-17913836.post-19010540148024610582015-01-23T17:20:00.000+02:002015-01-23T17:20:32.048+02:00ProfitBricks Has Released a New Data Center Management Tool<br />
<h4>
ProfitBricks, our partner, has released DCD R2 - unique and cloud computing industry-leading data center management tool.</h4>
<div>
Over the years ProfitBricks' teams have continued to push the envelope in performance, keeping the lowest prices in the indusrty. They wanted to create a better public cloud platform because the future of cloud needed it.</div>
<div>
<br /></div>
<div>
As a result ProfitBricks has enhanced the user experience to provide the most effortless cloud computing design and management tool the industry have ever seen.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-H8h0DJ4FBCk/VMJjGLOLSPI/AAAAAAAAATQ/I-zrTdnyEng/s1600/ProfitBricks-Data-Center-Designer-R2-1024x613.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-H8h0DJ4FBCk/VMJjGLOLSPI/AAAAAAAAATQ/I-zrTdnyEng/s1600/ProfitBricks-Data-Center-Designer-R2-1024x613.png" height="237" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h3 style="clear: both; text-align: left;">
What's New with the Data Center Designer R2?</h3>
<div>
DCD R2, a complete rewrite of game-changing visual infrastructure management tool, enables even easier design and management of data centers in the cloud. It is included with every account so you are able to test it out.</div>
<div>
<br /></div>
<div>
A new visual drag-and-drop interface lets businesses completely re-imagine the data center. DCD R2 is very intuitive as a data center management tool so even non-technical employees will be able to use it. This tool helps to free organisations from the limited and inflexible choices provided by first generation cloud computing industry incumbents. </div>
<div>
<br /></div>
<h4>
ProfitBricks provides a better and "unbound" cloud experience that delivers on the true promise of cloud computing.</h4>
<div>
<br /></div>
Watch video below to learn how easy designing, configuring and managin the cloud can be with ProfitBricks' new data center management tool. Also, you can see it for yourself with a free live demo or by signing up for a free 14-days trial.<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="270" src="https://www.youtube.com/embed/1PK-GUqIKcw" width="480"></iframe>
</div>
<div>
<br /></div>
Provided by:<a href="http://www.forthscale.com/" target="_blank">Forthscale systems, cloud experts</a>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-17913836.post-11168408732600731542015-01-08T12:37:00.001+02:002015-07-06T15:31:19.838+03:00How to select cloud provider. <div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-lB1iwyHX0_o/VK5drS1YDwI/AAAAAAAAAS8/h1jNyEyfqZQ/s1600/HiRes.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-lB1iwyHX0_o/VK5drS1YDwI/AAAAAAAAAS8/h1jNyEyfqZQ/s1600/HiRes.jpg" /></a></div>
<div>
<br /></div>
<br />
<h1 style="background-color: white; border: 0px; box-sizing: border-box; color: #333333; font-family: Helvetica, Arial, sans-serif; font-size: 28px; font-stretch: inherit; font-weight: normal; line-height: 34px; margin: 0px 0px 30px; padding: 0px; vertical-align: baseline;">
<em style="border: 0px; box-sizing: border-box; font-family: inherit; font-stretch: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">So we choose the cloud provider for the project. What I would</em><br style="box-sizing: border-box;" /><em style="border: 0px; box-sizing: border-box; font-family: inherit; font-stretch: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">recommend and for whom:</em></h1>
<div style="background-color: white; border: 0px; box-sizing: border-box; color: #4d4f51; font-family: Helvetica, Arial, sans-serif; font-size: 16px; font-stretch: inherit; line-height: 24px; margin-bottom: 30px; padding: 0px; vertical-align: baseline;">
1. For a project that starts from scratch with a single server. Where<br />
the project will be some time in development, and the load will<br />
increase gradually. I recommend <strong style="border: 0px; box-sizing: border-box; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><a href="https://www.digitalocean.com/" rel="nofollow" style="border: 0px; box-sizing: border-box; color: #7b539d; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;" target="_blank">Digital Ocean.</a></strong> 30 GB SSD drive and 1GB<br />
RAM is cheap, fast and enough to deploy the project. Very simple and<br />
intuitive interface make it easy to go to the schema with an service<br />
per instance when load increases. Simple clone the original droplet<br />
and leave just one or part service on new droplet. The main advantages<br />
in this case lowest price and easy of deployment.<br />
<br style="box-sizing: border-box;" />
2. If you plan to transfer to the cloud the complex, high loaded<br />
project from multiple servers, you should pay attention to <a href="http://aws.amazon.com/" rel="nofollow" style="border: 0px; box-sizing: border-box; color: #7b539d; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;" target="_blank">Amazon.</a><br />
Greater flexibility, a large selection of OS images. Allow easier and<br />
faster to transfer existing services. A wide range of additional<br />
services to reduce the cost and simplify the operation of the project<br />
as compared to the "bare metal" solution. Among the many services<br />
Amazon you will find easy replacement of each of the components of<br />
your project.<br />
<br style="box-sizing: border-box;" />
3. If you start from scratch to develop highly loaded<br />
service(application). If you need a flexible multi-functional<br />
environment. With the ability to deploy services in one click. You can<br />
pay attention to the <a href="https://cloud.google.com/compute/" rel="nofollow" style="border: 0px; box-sizing: border-box; color: #7b539d; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;" target="_blank">GCE.</a> In this case, the ability to deploy virtual<br />
machines rather secondary. Compared with possibility for developers<br />
and resources provided by Google App Engine. It is extremely<br />
inexpensive to operate a solution "application as service". The<br />
project can be built in such a way that each user will pay for itself<br />
the resources used.<br />
<br style="box-sizing: border-box;" />
Please note it's my own (DevOps) view of question. Each case requires<br />
a individual approach. If you have any questions you can connect to <a href="http://www.123contactform.com/form-504371/Contact-Us" rel="nofollow" style="border: 0px; box-sizing: border-box; color: #7b539d; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;" target="_blank"><strong style="border: 0px; box-sizing: border-box; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">our team of cloud experts.</strong></a> We provide:</div>
<ul style="background-color: white; border: 0px; box-sizing: border-box; color: #4d4f51; font-family: Helvetica, Arial, sans-serif; font-size: 16px; font-stretch: inherit; line-height: 24px; margin: 0px 0px 30px 40px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; box-sizing: border-box; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px 0px 5px; padding: 0px; vertical-align: baseline;"><em style="border: 0px; box-sizing: border-box; font-family: inherit; font-stretch: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Cloud Consulting</em></li>
<li style="border: 0px; box-sizing: border-box; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px 0px 5px; padding: 0px; vertical-align: baseline;"><em style="border: 0px; box-sizing: border-box; font-family: inherit; font-stretch: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">DevOps services</em></li>
<li style="border: 0px; box-sizing: border-box; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px 0px 5px; padding: 0px; vertical-align: baseline;"><em style="border: 0px; box-sizing: border-box; font-family: inherit; font-stretch: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Fully Managed Infrastructure</em></li>
<li style="border: 0px; box-sizing: border-box; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px 0px 5px; padding: 0px; vertical-align: baseline;"><em style="border: 0px; box-sizing: border-box; font-family: inherit; font-stretch: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Cloud inventorying</em></li>
<li style="border: 0px; box-sizing: border-box; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px 0px 5px; padding: 0px; vertical-align: baseline;"><em style="border: 0px; box-sizing: border-box; font-family: inherit; font-stretch: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Monitoring & Crash Prevention</em></li>
</ul>
Author: <a href="https://www.linkedin.com/profile/view?id=99550194&authType=name&authToken=nVZj&trk=pulse-det-athr_prof-art_hdr">Ilya Shevyrev</a><br />
Provided by:<a href="http://www.forthscale.com/">Forthscale systems, cloud experts</a>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-17913836.post-40455145354611304022014-12-05T15:01:00.000+02:002015-01-08T12:38:15.057+02:00How To Install DenyHosts on Ubuntu <span style="font-family: Arial, Helvetica, sans-serif;"><b>What is DenyHosts?</b></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">This is a python-script for the protection of ssh server, like fail2ban, but consumes </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">far less memory. The script parses the log file and finds failed login attempts and </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">prohibits login from these IP addresses.</span><br />
<br />
<h3>
<span style="font-family: Arial, Helvetica, sans-serif;">Installation steps.</span></h3>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">Installation process is simple and contains some steps:</span><br />
<br />
<b><span style="font-family: Arial, Helvetica, sans-serif;">1. Retrieve new lists of packages</span></b><br />
<br />
<span style="font-family: Courier New, Courier, monospace;">sudo apt-get update</span><br />
<br />
<b><span style="font-family: Arial, Helvetica, sans-serif;">2. Installation DenyHosts:</span></b><br />
<br />
<span style="font-family: Courier New, Courier, monospace;">sudo apt-get install denyhosts</span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">If the process is successfully completed, you will see the information of the screen:</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-zyz2XZEvKvw/VIGsW3q_fZI/AAAAAAAAASY/yCeq3CP0u7Q/s1600/111.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-zyz2XZEvKvw/VIGsW3q_fZI/AAAAAAAAASY/yCeq3CP0u7Q/s1600/111.jpg" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;">After installation you can add your IP address in whitelist:</span></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<span style="font-family: Courier New, Courier, monospace;">sudo nano /etc/hosts.allow</span></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;">and insert following string:</span></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<span style="font-family: Courier New, Courier, monospace;">sshd: 12.34.45.678</span></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;">Where “12.34.45.678” – your IP address</span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;">And restart denyhost:</span></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<span style="font-family: Courier New, Courier, monospace;">sudo service denyhosts restart</span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<h3 style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;">Configuration denyhosts.</span></h3>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;">After the installation process, the DenyHosts is ready to work, but some </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;">configuration options are noteworthy. All configuration values are in the file </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Courier New, Courier, monospace;">/etc/denyhosts.conf</span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;"><b>1. PURGE_DENY</b>: removed HOSTS_DENY entries that are older than this </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;">time.</span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;">Default value is empty and all listed ip-addresses remain in the file </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;">/etc/hosts.deny forever.</span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;"><b>2. BLOCK_SERVICE</b>: the service name that should be blocked in </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;">HOSTS_DENY</span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;">Default value = sshd, By default, the service protects only ssh server, but it </span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;">can be customized to other services.</span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;"><b>3. ADMIN_EMAIL</b>: if you would like to receive report from denyhosts.</span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;">Default value = root@localhost, but you can change this value to your email.</span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;">After changing the settings, you should restart the DenyHosts again:</span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Courier New, Courier, monospace;">sudo service denyhosts restart</span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both;">
</div>
<div class="separator" style="clear: both;">
<span style="font-family: Arial, Helvetica, sans-serif;">The result of DenyHosts you can see in the file: </span><span style="font-family: Courier New, Courier, monospace;"> /etc/hosts.deny</span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-PDoFG5YVjVQ/VIGsppxjb1I/AAAAAAAAASg/bmXKIpW57ck/s1600/444.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-PDoFG5YVjVQ/VIGsppxjb1I/AAAAAAAAASg/bmXKIpW57ck/s1600/444.jpg" /></a></div>
<div class="separator" style="clear: both;">
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both;">
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Arial, Helvetica, sans-serif;"><b><br /></b></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Arial, Helvetica, sans-serif;"><b>Provided by:<a href="http://www.forthscale.com/" target="_blank">Forthscale systems, cloud experts</a></b></span></div>
Anonymousnoreply@blogger.com1tag:blogger.com,1999:blog-17913836.post-65579981159773311462014-09-01T21:48:00.000+03:002014-09-01T21:48:10.884+03:00Backup to AWS S3 with duply on Ubuntu <br />
1. Install duply and dependences (as root).<br />
<i>sudo apt-get install duplicity duply python-boto</i><br />
<br />
2. Create backup profile (as root). <br />
<i>sudo duply bck_profile create</i><br />
<br />
3. Edit profile /root/.duply/bck_profile/conf like as:<br />
GPG_PW='___YOUR GENERATED PASSWORD____'<br />
TARGET='s3://s3-endpoint-name.amazonaws.com/bucket-name/directory/for/backup/'<br />
TARGET_USER='AWS_KEY_ID'<br />
TARGET_PASS='AWS_SECRET_KEY'<br />
SOURCE='/'<br />
MAX_AGE=6M<br />
#MAX_FULL_BACKUPS=1<br />
#VERBOSITY=5<br />
TEMP_DIR=/content<br />
#DUPL_PARAMS="$DUPL_PARAMS --time-separator _ "<br />
#DUPL_PARAMS="$DUPL_PARAMS --short-filenames "<br />
MAX_FULLBKP_AGE=1W<br />
DUPL_PARAMS="$DUPL_PARAMS --full-if-older-than $MAX_FULLBKP_AGE "<br />
VOLSIZE=200<br />
DUPL_PARAMS="$DUPL_PARAMS --volsize $VOLSIZE "<br />
<br />
4. Edit <i>/root/.duply/bck_profile/excludes</i> to include the list of non wanted directories such as:<br />
- /dev<br />
- /home/*/.cache<br />
- /home/*/.ccache<br />
- /lost+found<br />
- /media<br />
- /mnt<br />
- /proc<br />
- /root/.cache<br />
- /root/.ccache<br />
- /run<br />
- /selinux<br />
- /sys<br />
- /tmp<br />
- /var/cache/*/*<br />
- /var/log<br />
- /var/run<br />
- /var/tmp<br />
<br />
5. Tun a full backup test:<br />
<i>sudo duply bck_profile backup</i><br />
<br />
6. Configure crone for daily backup:<br />
<i>sudo crontab -e </i><br />
and add:<br />
0 2 * * * duply bck_profile backup<br />
<br />
7. Some useful commands to operate your backup:<br />
<b>To get current list of present backups.</b><br />
<i>sudo duply status</i><br />
<b>To restore all files from last backup to /target_dir</b><br />
<i>sudo duply restore /target_dir</i><br />
<b>To restore directory etc from last backup to /target_dir</b><br />
<i>sudo duply fetch etc /target_dir</i><br />
<br />
Note:<br />
All backups early than MAX_FULLBKP_AGE=1W will be incremental, every MAX_FULLBKP_AGE=1W will create full backup.<br />
<div>
<br /></div>
<br />
Provided by:<a href="http://www.forthscale.com/" target="_blank">Forthscale systems, cloud experts</a>Naor Whttp://www.blogger.com/profile/01896674408756848223noreply@blogger.com0tag:blogger.com,1999:blog-17913836.post-53125343917195379752014-08-12T17:18:00.002+03:002014-08-12T17:18:20.453+03:00Creating a RAID device on Amazon AWS Elastic Following procedure is for creating a software (OS managed) RAID disk devices.<br />
EBS (Amazon web services elastic block storage) does not provide any RAID abilities by itself.<br />
But you can use Linux SW raid option to increase either speed or device redundancy.<br />
This tutorial will show you how.<br />
<h3>
First install RAID management tool on target EC2 instances</h3>
<br />
<b>For Debian based (Debian, Ubuntu) execute: </b><br />
<i>apt-get install mdadm</i><br />
<b>For Red Hat based (RHEL, Oracle linux, CentOS) execute:</b><br />
<i>yum install mdadm</i><br />
<b>For Gentoo execute:</b><br />
<i>emerge mdadm</i><br />
<br />
<h3>
Now prepare the EBS devices.</h3>
Create desired EBS volume<br />
Attach new EBS volumes to EC2 instance and write down the device name (for example xvdf and xvdg)<br />
<br />
<h3>
Now you can create the RAID device from them.</h3>
<br />
<b>Set up RAID 0 on this EBS instance with the following command:</b><br />
<i> mdadm --create --verbose --auto=yes /dev/md0 --chunk=256 --level=0 --raid-devices=2 /dev/xvdf /dev/xvdg</i><br />
<i> blockdev --setra 65536 /dev/md0</i><br />
<br />
<b>Now verify that the raid device /dev/md0 exists</b><br />
<i>cat /proc/mdstat</i><br />
<br />
Next step is to add devices to the <b>mdadm.conf</b> file (main sw raid configuration file)<br />
<i>echo DEVICE /dev/xvdf /dev/xvdg | sudo tee /etc/mdadm/mdadm.conf</i><br />
<br />
Add the other device info about /dev/md0 to the mdadm.conf file so that it comes back on reboot<br />
<i>mdadm --detail --scan | sudo tee -a /etc/mdadm/mdadm.conf</i><br />
<br />
<h3>
Filesystem</h3>
One RAID is set up , you can create a file-system on it, we usually propose XFS, but you can use any file system (ext3/4, zfs or reiserfs)<br />
<br />
<b>To create XFS file system, you will need to install support for it first.</b><br />
<b>For Debian based (Debian, Ubuntu) execute: </b><br />
<i>apt-get install xfsprogs</i><br />
<b>For Red Hat based (RHEL, CentOS) execute:</b><br />
<i>yum install xfsprogs</i><br />
<b>For Oracle Linux:</b><br />
Log in to ULN, and subscribe your system to the ol6_x86_64_latest channel.<br />
Then run:<br />
<i>yum install xfsprogs xfsdump </i><br />
<b>For Gentoo execute:</b><br />
<i>emerge </i><i>xfsprogs </i><br />
<i><br /></i>
<b>Once installed, execute</b><br />
<i>mkfs.xfs -f /dev/md0</i><br />
to create an actual filesystem on your new RAID device.<br />
<br />
Now you can mount the file system<br />
<i>mkdir /MOUNTPOINT </i>(for example /raid)<br />
<i>mount /dev/md0 /MOUNTPOINT </i>(for example /raid)<br />
<br />
Verify the volume exists and the size you expected<br />
<i>df -h </i><br />
<br />
Edit <b>/etc/fstab</b> to make sure mount point comes back on reboot<br />
/dev/md0 /raid xfs noatime,noexec,nodiratime 0 0<br />
<br />
You have the new RAID based partition in your system.<br />
<b>Same procedure will work on both public EC2 cloud and VPC.</b><br />
<br />
Provided by:<a href="http://www.forthscale.com/" target="_blank">Forthscale systems, cloud experts</a>Naor Whttp://www.blogger.com/profile/01896674408756848223noreply@blogger.com0tag:blogger.com,1999:blog-17913836.post-35050492896323724302014-07-31T20:41:00.003+03:002014-07-31T20:42:19.267+03:00Started telling our story in a comics way<br />
We at <a href="http://forthscale.com/index.php/team" target="_blank">#teamforthscale</a> know how to work and know how to have fun. this is our story and we stick to it. Part one :<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div id="fb-root">
</div>
<script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script>
<br />
<div class="fb-post" data-href="https://www.facebook.com/forthscale/photos/a.355908461107077.85996.303084439722813/785313734833212/?type=1" data-width="466">
<div class="fb-xfbml-parse-ignore">
<a href="https://www.facebook.com/forthscale/photos/a.355908461107077.85996.303084439722813/785313734833212/?type=1">Post</a> by <a href="https://www.facebook.com/forthscale">Forthscale: cloud, scalability and high performance infrastructure experts</a>.</div>
</div>
<br />Naor Whttp://www.blogger.com/profile/01896674408756848223noreply@blogger.com0tag:blogger.com,1999:blog-17913836.post-1702691854471611232014-03-02T17:08:00.001+02:002014-03-02T17:08:11.266+02:00Fixing Fujitsu LIFEBOOK UH572 Touchpad on OpenSuSE 13.1<br />
1. open a terminal or change to /etc/default/ in a file manager<br />
2. run # edit as a superuser file /etc/default/grub<br />
3. go to the line containing: GRUB_CMDLINE_LINUX<br />
4. add "i8042.notimeout i8042.nomux" to the string in quotes<br />
5. save and exit<br />
6. run # sudo grub2-mkconfig -o /boot/grub2/grub.cfg<br />
7. init 6 (reboot)<br />
<br />
Provided by:<a href="http://www.forthscale.com/" target="_blank">Forthscale systems, cloud experts</a>Naor Whttp://www.blogger.com/profile/01896674408756848223noreply@blogger.com0tag:blogger.com,1999:blog-17913836.post-51323067322926391212014-02-24T10:35:00.001+02:002014-02-24T10:35:28.755+02:00Fixing Can't locate object method "new" via package "Gnome2::Vte::Terminal" in pac-manager on opensuse<br />
Perl updates in OpenSuSE can interfere with libraries provided in Pac-manager itself.<br />
As a symptom you will not be able to connect to sessions and can see error message in console similar to:<br />
"<b>Can't locate object method "new" via package "Gnome2::Vte::Terminal"</b>"<br />
you need to clean those using:<br />
<b>find /usr/share/pac-manager/ -name "Vte.so*" -exec rm {} +</b><br />
and it start pac manager normally.<br />
<br />
Provided by:<a href="http://www.forthscale.com/" target="_blank">Forthscale systems, cloud experts</a>Naor Whttp://www.blogger.com/profile/01896674408756848223noreply@blogger.com0tag:blogger.com,1999:blog-17913836.post-69250292988326314072013-12-11T14:57:00.002+02:002013-12-12T15:44:11.138+02:00PPTP server on AWS Ubuntu instance<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<span style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Simple VPN server configuration for easy VPN access to AWS using built in Windows VPN client.</span></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<b style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><br /></b></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<span style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">First to install pptp server package.</span></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<b style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">sudo apt-get install pptpd</b></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<br /></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
Now to configuration:</div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<br /></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
edit /etc/pptpd.conf</div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<br /></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<i style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">option /etc/ppp/pptpd-options</i></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<i style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">logwtmp</i></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<i style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">localip 172.20.0.1 </i></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<i style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">remoteip 172.20.0.10-50</i></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<br /></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
edit /etc/ppp/pptpd-options</div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<br /></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<i style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">refuse-pap</i></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<i style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">refuse-chap</i></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<i style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">refuse-mschap</i></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<i style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">require-mschap-v2</i></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<i style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">require-mppe-128</i></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<i style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">ms-dns 8.8.8.8</i></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<i style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">ms-dns 8.8.4.4</i></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<i style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">proxyarp</i></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<i style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">nodefaultroute</i></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<i style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">lock</i></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<i style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">nobsdcomp</i></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<i style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">mtu 1420</i></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<i style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">mru 1420</i></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<br /></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<span style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; line-height: normal; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="line-height: 18px;">edit</span><span style="line-height: 18px;"> </span>/etc/ppp/chap-secrets </span></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<span style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; line-height: normal; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><br /></span></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<i style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; line-height: normal; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"># client server secret IP addresses</span></i></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<i style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; line-height: normal; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">client1 pptpd secret1 *</span></i></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<span style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; line-height: normal; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><i style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">client2 pptpd secret2 *</i></span></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<br /></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
Add to /etc/rc.local</div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<br /></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<i style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE</i></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<i style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">iptables -t mangle -A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu</i></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<i style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">iptables -t mangle -A OUTPUT -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu</i></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<br /></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
Run:</div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<br /></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<b style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">/etc/rc.local</b></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<b style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">service pptpd restart</b></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
<br /></div>
<div style="background-color: white; border: 0px; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; outline: 0px; padding: 0px; vertical-align: baseline; word-break: normal; word-wrap: break-word;">
Done.</div>
<br />
Provided by:<a href="http://www.forthscale.com/" target="_blank">Forthscale systems, cloud experts</a>Naor Whttp://www.blogger.com/profile/01896674408756848223noreply@blogger.com2tag:blogger.com,1999:blog-17913836.post-65616514151864603592013-12-08T13:53:00.000+02:002013-12-08T13:53:10.288+02:00fixing missing apt-add-repository command<br />
You might need to use apt-add-repository script and will get a missing command error. For example:<br />
<i>sudo: apt-add-repository: command not found</i><br />
<div>
<br /></div>
<div>
in order to fix that you nred to install python-software-properties package</div>
<i># apt-get install python-software-properties</i><br />
<br />
That's it.<br />
<br />
Provided by:<a href="http://www.forthscale.com/" target="_blank">Forthscale systems, cloud experts</a>Naor Whttp://www.blogger.com/profile/01896674408756848223noreply@blogger.com0tag:blogger.com,1999:blog-17913836.post-30842697394605472952013-11-28T16:48:00.001+02:002013-11-28T16:48:11.635+02:00How to disable network manager Red Hat 6 based distributions (RHEL, CentOS, Oracle Linux)To stop Network Manger ( for example then using pacemaker cluster) execute as root:<br />
# <i>service NetworkManager stop</i><br />
To prevent Network Manager Service from starting at boot execute as root:<br />
#<i> chkconfig NetworkManager off</i><br />
<br />
Keep in mind that you now need to manually configure your network interfaces.<br />
<br />
Provided by:<a href="http://www.forthscale.com/" target="_blank">Forthscale systems, cloud experts</a>Naor Whttp://www.blogger.com/profile/01896674408756848223noreply@blogger.com0tag:blogger.com,1999:blog-17913836.post-48104063553067952252013-11-27T13:22:00.001+02:002013-11-27T13:22:48.697+02:00How to turn off SELINUX in Red - Hat based distributions including CentOS, Oracle Linux and Fedora?<br />
To check if SELinux is running execute following command:<br />
# <i>getenforce</i><br />
<br />
To disable it, execute the following command:<br />
# <i>setenforce Permissive</i><br />
<br />
This will put selinux in a passive (allow all) mode and last until the machine is rebooted.<br />
To permanently disable it, change SELINUX= line in: <i>/etc/sysconfig/selinux</i>.<br />
<br />
<br />
Provided by:<a href="http://www.forthscale.com/" target="_blank">Forthscale systems, cloud experts</a>Naor Whttp://www.blogger.com/profile/01896674408756848223noreply@blogger.com0tag:blogger.com,1999:blog-17913836.post-72674214662304845502013-11-09T22:53:00.000+02:002013-12-02T17:15:45.321+02:00working and tested USB install procedure for RH 6 based distributions (RHEL 6.x, CentOS 6.x, Oracle Linux 6.x and others)We needed to install CentOS 6.4 machines with USB and got into absolute madness. All RHEL cones have no working procedure and workarounds consisted of using FAT32 partition with 3rd party tools (problematic with install ISO files greater than 4GB) or multiple partitions and remounts. Until we found a very simple solution that did not work as well and fixed it.<br />
<br />
<b>To create the USB You will need:</b><br />
<ul>
<li>Red hat based distribution to create the USB (in our case <i>CentOS-6.4-x86_64-bin-DVD1.iso)</i>. </li>
<li>Actual CD iso image </li>
<li>Fedora<a href="https://fedoraproject.org/wiki/Livecd-iso-to-disk" target="_blank"> livecd-iso-to-disk</a> script</li>
</ul>
<b>Steps are very simple:</b><br />
Insert the USB stick to the port. <br />
You need to find out the device name (for ex. <i>/dev/sdb1</i> )<br />
On systems with auto-mount just run <i>df -h</i> or plug it in and run <i>dmesg | tail -20</i><br />
<br />
<b>Install livecd tools:</b><br />
<i>yum install livecd-tools</i><br />
<br />
<b>Make sure it is bootable (for ex. <i>/dev/sdb1, via editing it`s parent - sdb</i> ):</b><br />
<i>/sbin/parted /dev/sdb</i><br />
(parted)<i> toggle 1 boot</i><br />
(parted) <i>quit</i><br />
<br />
<b>Format it with ext3 (does not support ext4)</b><br />
<i>mkfs.ext3 /dev/sdb1</i><br />
<br />
<b>Prepare the USB (for example using CentOS 6.4):</b><br />
<i>livecd-iso-to-disk --reset-mbr CentOS-6.4-x86_64-bin-DVD1.iso /dev/sdb1</i><br />
<br />
Your USB is ready, it will boot but fail to install since it is missing install root, so we need to fix it.<br />
<b>Edit exlinux.conf, you will see something similar to:</b><br />
append initrd=initrd.img stage2=hd:UUID=791fc126-638c-4f28-8837-f3c2eae31e57:/images/install.img repo=hd:UUID=791fc126-638c-4f28-8837-f3c2eae31e57:/<br />
<br />
<b>what is mising is directive "</b><i><span style="color: red;">root=</span><b>"</b></i><b> so you need to switch the line to something similar to: </b><br />
append initrd=initrd.img root=UUID=2cd71b0d-09a0-47b6-97ef-02c3fa90e9d3 repo=hd:UUID=2cd71b0d-09a0-47b6-97ef-02c3fa90e9d3:/<br />
<br />
save the file and boot fro USB. It will install your OS.<br />
<br />
Provided by: <a href="http://www.forthscale.com/" target="_blank">Forthscale systems, cloud experts</a>Naor Whttp://www.blogger.com/profile/01896674408756848223noreply@blogger.com0