<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Thiago Vinhas</title>
    <description>Thoughts on DevOps, cloud architecture, coding and random geekiness</description>
    <link>http://www.vinhas.net//</link>
    <atom:link href="http://www.vinhas.net//feed.xml" rel="self" type="application/rss+xml" />
    <pubDate>Wed, 30 May 2018 20:44:42 -0400</pubDate>
    <lastBuildDate>Wed, 30 May 2018 20:44:42 -0400</lastBuildDate>
    <generator>Jekyll v3.8.2</generator>
    
      <item>
        <title>Self-monitoring Chef using Sensu</title>
        <description>&lt;p&gt;Chef is one of the most popular tools for DevOps awesomeness, and you won&amp;#39;t believe what&amp;#39;s one of the biggest causes of chef-server unavailability: &lt;strong&gt;disk full&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yep, you read that right. In 2017, there&amp;#39;s still a LOT of people who don&amp;#39;t have all their systems being carefully monitored by a trustworthy application. That means that if that logrotate is not really rotating all your logs, or if postgresql is misbehaving and generating a lot of data, sooner or later your system will crash &lt;strong&gt;badly&lt;/strong&gt;. Recovering a database after it crashes for lack of disk space is not fun, and you can&amp;#39;t be 100% sure you won&amp;#39;t have any data loss.&lt;/p&gt;

&lt;p&gt;My grandpa used to say &lt;strong&gt;&amp;quot;it&amp;#39;s better safe than sorry&amp;quot;&lt;/strong&gt;, and this should be every SysOps/CloudOps/SRE/DevOps Engineer mantra.&lt;/p&gt;

&lt;p&gt;I&amp;#39;ll show bellow how to easily set up &lt;strong&gt;&lt;a href=&quot;https://sensuapp.org/&quot;&gt;Sensu&lt;/a&gt;&lt;/strong&gt; to monitor the disk space and the overall status of your Chef Server.&lt;br&gt;
You &lt;em&gt;can&lt;/em&gt; have sensu installed on the same server as chef-server, but it&amp;#39;s highly discouraged. Come on, CPU power and memory are extremely cheap these days and it&amp;#39;s not worth the risk to be cheap on this area. A small AWS instance will cost about the same as a couple frappuccinos from Starbucks.&lt;/p&gt;

&lt;p&gt;If you don&amp;#39;t have Sensu installed, go ahead and read this &lt;a href=&quot;https://sensuapp.org/docs/0.29/quick-start/the-five-minute-install.html&quot;&gt;Five Minute Install&lt;/a&gt; document. I won&amp;#39;t cover Sensu&amp;#39;s installation here, but basically you&amp;#39;ll have to add the EPEL repository (if using RHEL/CentOS, &lt;code&gt;sudo yum install epel-release -y&lt;/code&gt;), add the sensu repository to yum and install Redis, sensu and uchiwa (optional). There is something though, that the documentation doesn&amp;#39;t make clear. You&amp;#39;ll have to edit &lt;code&gt;/etc/redis.conf&lt;/code&gt; and comment out the line that starts with &lt;code&gt;bind&lt;/code&gt;, and change the line &lt;code&gt;protected-mode yes&lt;/code&gt; to &lt;code&gt;protected-mode no&lt;/code&gt; in order for your clients to be able to communicate with the sensu server. Don&amp;#39;t forget to start the services and set them to start on boot time.&lt;/p&gt;

&lt;p&gt;Once you set it up, you&amp;#39;ll be able to check the dashboard on &lt;a href=&quot;http://your-ip:3000&quot;&gt;http://your-ip:3000&lt;/a&gt;. You should have the sensu-client started up so you can see it listed on the dashboard.&lt;/p&gt;

&lt;h3&gt;&lt;strong&gt;Set up the checks on the Sensu server&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;Sensu has a unique way to setup its checks and that&amp;#39;s what makes it so versatile. For this example, you&amp;#39;ll need two checks and one handler, that will send you an email in case of a failure.&lt;/p&gt;

&lt;h4&gt;&lt;strong&gt;Bellow are the two checks that you&amp;#39;ll need on your sensu server&lt;/strong&gt;&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;I saved this one as /etc/sensu/conf.d/checks/check-chef-server.rb. Notice that the command has to be run with sudo, because it actually uses &lt;code&gt;chef-server-ctl&lt;/code&gt; for the checks.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot; data-lang=&quot;json&quot;&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;checks&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;chef-server&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;handlers&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;default&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;email&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;command&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;sudo -u root /opt/sensu/embedded/bin/ruby /etc/sensu/plugins/check-chef-server.rb&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;interval&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;60&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;subscribers&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;chef-server&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;And this one as /etc/sensu/conf.d/checks/disk.json:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot; data-lang=&quot;json&quot;&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;checks&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;check_disk&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;handlers&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;default&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;email&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;command&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/etc/sensu/plugins/check-disk-usage.rb -w 93 -c 96 -W 93 -K 96&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;interval&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;60&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;subscribers&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;all&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;For the handlers, you can save the contents bellow on /etc/sensu/conf.d/handlers/email.json&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot; data-lang=&quot;json&quot;&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;handlers&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;email&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;type&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;pipe&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;command&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;mail -s 'sensu alert' thiago@vinhas.org&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now let&amp;#39;s go to the next step...&lt;/p&gt;

&lt;h4&gt;&lt;strong&gt;Set up sensu-client on your Chef Server&lt;/strong&gt;&lt;/h4&gt;

&lt;p&gt;Here, all you have to do is add the sensu repository by running the command bellow and then run &lt;code&gt;yum install sensu -y&lt;/code&gt;. If you get a 404 error, you&amp;#39;re probably using Amazon Linux, so replace $releasever to 6 and try again.&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'[sensu]
name=sensu
baseurl=https://sensu.global.ssl.fastly.net/yum/$releasever/$basearch/
gpgcheck=0
enabled=1'&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;sudo tee&lt;/span&gt; /etc/yum.repos.d/sensu.repo
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You&amp;#39;ll now need a /etc/sensu/config.json with the following content:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot; data-lang=&quot;json&quot;&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;redis&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;host&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;sensu-server.myhost.org&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;port&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;6379&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;transport&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;redis&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
       &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;reconnect_on_error&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you start your sensu client now, you&amp;#39;ll see in a few seconds that your chef server will be added to the dashboard. The only check available there though is be keepalive, but we really want to be able to see a problem before the whole server blows up, right?&lt;br&gt;
I&amp;#39;ll show you how to check for disk usage, and for the results of &lt;code&gt;chef-server-ctl status&lt;/code&gt;, so you get alerted by email in case any of these fail. Sensu can also be integrated with Pagerduty, Opsgenie, ServiceNow, JIRA, Slack, Hipchat and many others.&lt;/p&gt;

&lt;p&gt;So what you have to do on your chef-server is add the sensu repo as showed above, run &lt;code&gt;yum install sensu -y&lt;/code&gt; and add the two plugins bellow on your /etc/sensu/plugins:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /etc/sensu/plugins
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;wget https://raw.githubusercontent.com/sensu-plugins/sensu-plugins-disk-checks/master/bin/check-disk-usage.rb
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;wget https://raw.githubusercontent.com/sensu-plugins/sensu-plugins-chef/master/bin/check-chef-server.rb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The check-disk-usage has a ruby gem dependency, and since we don&amp;#39;t want to mess with Chef&amp;#39;s ruby gems (and even on non-chef systems you want to be a client, it&amp;#39;s prudent to use Sensu&amp;#39;s embedded ruby), we&amp;#39;re going to run:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;/opt/sensu/embedded/bin/gem &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;sys-filesystem
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You can test the plugin now by running &lt;code&gt;/opt/sensu/embedded/bin/ruby check-disk-usage.rb&lt;/code&gt; (include the full path if you&amp;#39;re not on the plugins/ directory)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add the /etc/sensu/config.json file so your sensu client knows how to report to its master, just like you did above.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now start all the services and set them to start on boot, and you&amp;#39;re good to go.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On your Sensu server:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;service sensu-server start
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;service sensu-api start
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;service sensu-client start
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;service uchiwa start
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;systemctl &lt;span class=&quot;nb&quot;&gt;enable &lt;/span&gt;sensu-server sensu-api sensu-client
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;On your Chef server:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;service sensu-client start
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;systemctl &lt;span class=&quot;nb&quot;&gt;enable &lt;/span&gt;sensu-cliente
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You should now install a dashboard like &lt;a href=&quot;https://uchiwa.io&quot;&gt;Uchiwa&lt;/a&gt; to see your monitored servers/services and its alerts.&lt;br&gt;
You&amp;#39;re just a &lt;code&gt;yum -y install uchiwa ; service uchiwa&lt;/code&gt; away. Now just access &lt;a href=&quot;http://your-server:3000&quot;&gt;http://your-server:3000&lt;/a&gt; to check out Uchiwa&amp;#39;s dashboard.&lt;/p&gt;

&lt;p&gt;That&amp;#39;s all folks!&lt;/p&gt;
</description>
        <pubDate>Fri, 12 May 2017 09:45:00 -0400</pubDate>
        <link>http://www.vinhas.net//self-monitoring-chef/</link>
        <guid isPermaLink="true">http://www.vinhas.net//self-monitoring-chef/</guid>
        
        <category>devops</category>
        
        <category>development</category>
        
        <category>chef</category>
        
        <category>sensu</category>
        
        <category>monitoring</category>
        
        
        <category>chef</category>
        
        <category>sensu</category>
        
        <category>development</category>
        
        <category>linux</category>
        
      </item>
    
      <item>
        <title>Creating a local Chef repository with Pulp</title>
        <description>&lt;p&gt;It&amp;#39;s very common these days to leave part, or even your whole farm, on an air gapped environment. It will definitely make it harder for malicious visitors to gain unauthorized access, but you&amp;#39;ll have some other things to worry about regarding the management of that infrastructure.&lt;/p&gt;

&lt;p&gt;Chef is one of the most popular orchestration tools around, and if you need to bootstrap servers on a airgapped environment, it&amp;#39;s important that you keep a local repository at least with the products your company use.&lt;/p&gt;

&lt;p&gt;Unfortunately, Chef&amp;#39;s rpm packages are made using omnibus, and that means every single dependency of that software will be declared in the package, making the repository&amp;#39;s yum metadata HUGE (currently it has about 2.1 GB).&lt;/p&gt;

&lt;p&gt;Here is a simple way to create a local copy of the packages, and then creating a local repository using Pulp, the best tool around for creating and managing repositories:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Create a local user, let&amp;#39;s say &lt;code&gt;yum&lt;/code&gt; with all the defaults and add it to your /etc/sudoers file and login using that user&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;And then:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;yum &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;wget createrepo
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;setenforce 0 &lt;span class=&quot;c&quot;&gt;# I won't cover SELinux permissions here&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;chmod &lt;/span&gt;o+x &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# You'll need execute permission in your home directory to serve http&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You&amp;#39;ll have to create the directories where your repo will be located, and run the wonderful &lt;code&gt;wget&lt;/code&gt; tool for mirroring the packages:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; repos/chef &lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;repos/chef
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;wget &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-N&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-np&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-nH&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--cut-dirs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;3  https://packages.chef.io/repos/yum/stable/el/7/x86_64/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Brace yourself because there&amp;#39;s a LOT of packages to download and it will take a while. The good thing here is that this command will only download new/changed files, so it&amp;#39;s safe to add it to your crontab and let it run every night.&lt;br&gt;
Be aware that Chef imposes a transfer limit per IP, so if you abuse you&amp;#39;ll be temporarily blacklisted. Use wget to fetch the packages to a single central location, and redistribute from there internally as needed.&lt;/p&gt;

&lt;p&gt;Once done, you&amp;#39;ll need to run:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;createrepo /home/&lt;span class=&quot;nv&quot;&gt;$USER&lt;/span&gt;/repos/chef/el/7/x86_64
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now follow Pulp&amp;#39;s &lt;strong&gt;&lt;a href=&quot;http://docs.pulpproject.org/user-guide/installation/f23-.html#repositories&quot;&gt;documentation&lt;/a&gt;&lt;/strong&gt; to successfully install it, and then change the &lt;code&gt;verify_ssl&lt;/code&gt; parameter to &lt;code&gt;false&lt;/code&gt; on /etc/pulp/server.conf.&lt;br&gt;
Run the following commands so Pulp creates your repository:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;pulp-admin login &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; admin &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; admin
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;pulp-admin rpm repo create &lt;span class=&quot;nt&quot;&gt;--repo-id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;chef &lt;span class=&quot;nt&quot;&gt;--serve-http&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--serve-https&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
 &lt;span class=&quot;nt&quot;&gt;--relative-url&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;chef &lt;span class=&quot;nt&quot;&gt;--description&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Chef Software Repo'&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
 &lt;span class=&quot;nt&quot;&gt;--display-name&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Chef Software Repo'&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--feed&lt;/span&gt; file:///home/&lt;span class=&quot;nv&quot;&gt;$USER&lt;/span&gt;/repos/chef/el/7/x86_64/
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;pulp-admin rpm repo &lt;span class=&quot;nb&quot;&gt;sync &lt;/span&gt;run &lt;span class=&quot;nt&quot;&gt;--repo-id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;chef &lt;span class=&quot;c&quot;&gt;# This will probably take a while&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;pulp-admin rpm repo &lt;span class=&quot;nb&quot;&gt;sync &lt;/span&gt;schedules create &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; 2017-04-12T12:00:00Z/P1DT  &lt;span class=&quot;nt&quot;&gt;--repo-id&lt;/span&gt; chef
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now you can access your own local Chef repository at:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;http://ip-address/pulp/repos/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;That&amp;#39;s it! Hope this helps you.&lt;/p&gt;
</description>
        <pubDate>Mon, 01 May 2017 07:00:00 -0400</pubDate>
        <link>http://www.vinhas.net//local-chef-repo/</link>
        <guid isPermaLink="true">http://www.vinhas.net//local-chef-repo/</guid>
        
        <category>devops</category>
        
        <category>development</category>
        
        <category>chef</category>
        
        <category>yum</category>
        
        <category>repository</category>
        
        <category>pulp</category>
        
        
        <category>chef</category>
        
        <category>development</category>
        
        <category>linux</category>
        
      </item>
    
      <item>
        <title>Automated Cassandra Cluster on AWS</title>
        <description>&lt;p&gt;Cassandra has grown a lot the past few years and now is one of the most used NoSQL (hate this term) database for all kinds of projects.&lt;br&gt;
A while ago I worked on a quick project to create a script to automatically launch and setup Cassandra clusters on AWS, with zero human iteration. I decided to share my work in case someone needs to achieve something similar.&lt;/p&gt;

&lt;p&gt;All you really need to do is save the script bellow and make sure you have a working python environment and install the following 2 python dependencies:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;pip &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;boto3 argparse&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;If you want to understand everything that is done, which is always the recommended approach, take a look at my &lt;a href=&quot;https://github.com/tvinhas/cassandra-cluster&quot;&gt;cassandra-cluster&lt;/a&gt; Github repository.&lt;br&gt;
Make sure you edit the credentials and any other relevant details you want, and then run the script bellow:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;c&quot;&gt;#!/usr/bin/env python&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#######################################################&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#                                                     #&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#  Cassandra cluster launcher                         #&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#  Developed by Thiago Vinhas &amp;lt;thiago@vinhas.org&amp;gt;     #&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#                                                     #&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#######################################################&lt;/span&gt;

&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;boto3&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;argparse&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;##############################################&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;####           AWS Credentials            ####&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;##############################################&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;conn&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;'aws_access_key_id'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'AKIABLAHBLAHBLAHBLAH'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;'aws_secret_access_key'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'x2oU/+Kns2fKGiERKyWXopin6NoFE4dJ1RpcHvkF'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;'region_name'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'us-east-1'&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;userdata&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;#!/bin/bash &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; aws s3 cp s3://my-script-bucket/cassandra-userdata.sh .&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; bash cassandra-userdata.sh&quot;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'tvinhas'&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;securitygroup&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'sg-7d256706'&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;instanceprofile&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'arn:aws:iam::686787828286:instance-profile/cassandra'&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;parser&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;argparse&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ArgumentParser&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'You are fine with the defaults...'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;parser&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_argument&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'-a'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'--ami'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;store&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dest&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;ami&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;ami-6869aa05&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;help&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Define the AMI to be used&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;parser&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_argument&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'-s'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'--subnet'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;store&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dest&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;subnet&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;subnet-23dc877b&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;help&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Define the subnet to be used&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;parser&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_argument&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'-i'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'--instancetype'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;store&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dest&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;instancetype&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;t2.large&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;help&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Define the instance type&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;args&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;parser&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;parse_args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;ami&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ami&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;subnet&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;subnet&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;instancetype&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;instancetype&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;##############################################&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;####           Launch Instance 1          ####&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;##############################################&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Launching Instance cassandra1...&quot;&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;ec2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;boto3&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;resource&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'ec2'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;**&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;conn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;create_instance&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ec2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;create_instances&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;ImageId&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ami&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;MinCount&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;MaxCount&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;KeyName&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;key&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;InstanceType&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;instancetype&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;SecurityGroupIds&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;securitygroup&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;UserData&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;userdata&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;IamInstanceProfile&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;'Arn'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;instanceprofile&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;SubnetId&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;subnet&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;instanceid&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;create_instance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;instance&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;create_instance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;instance&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;wait_until_running&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Tag instance&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;client&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;boto3&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;client&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'ec2'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;**&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;conn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;create_tags&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;Resources&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;instanceid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;Tags&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[{&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Key&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Name&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Value&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;cassandra1&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}]&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;instance&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;load&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Created new instance with id &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;s&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;instanceid&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;IP Address: &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;s&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;instance&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;public_ip_address&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Instance Type: &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;instancetype&lt;/span&gt;


&lt;span class=&quot;c&quot;&gt;##############################################&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;####           Launch Instance 2          ####&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;##############################################&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Launching Instance cassandra2...&quot;&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;ec2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;boto3&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;resource&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'ec2'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;**&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;conn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;create_instance&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ec2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;create_instances&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;ImageId&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ami&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;MinCount&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;MaxCount&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;KeyName&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;key&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;InstanceType&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;instancetype&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;SecurityGroupIds&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;securitygroup&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;UserData&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;userdata&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;IamInstanceProfile&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;'Arn'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;instanceprofile&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;SubnetId&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;subnet&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;instanceid&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;create_instance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;instance&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;create_instance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;instance&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;wait_until_running&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Tag instance&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;client&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;boto3&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;client&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'ec2'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;**&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;conn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;create_tags&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;Resources&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;instanceid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;Tags&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[{&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Key&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Name&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Value&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;cassandra2&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}]&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;instance&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;load&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Created new instance with id &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;s&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;instanceid&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;IP Address: &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;s&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;instance&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;public_ip_address&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Instance Type: &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;instancetype&lt;/span&gt;


&lt;span class=&quot;c&quot;&gt;##############################################&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;####           Launch Instance 3          ####&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;##############################################&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Launching Instance cassandra3...&quot;&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;ec2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;boto3&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;resource&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'ec2'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;**&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;conn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;create_instance&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ec2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;create_instances&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;ImageId&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ami&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;MinCount&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;MaxCount&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;KeyName&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;key&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;InstanceType&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;instancetype&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;SecurityGroupIds&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;securitygroup&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;UserData&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;userdata&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;IamInstanceProfile&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;'Arn'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;instanceprofile&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;SubnetId&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;subnet&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;instanceid&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;create_instance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;instance&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;create_instance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;instance&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;wait_until_running&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Tag instance&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;client&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;boto3&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;client&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'ec2'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;**&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;conn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;create_tags&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;Resources&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;instanceid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;Tags&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[{&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Key&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Name&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Value&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;cassandra3&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}]&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;instance&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;load&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Created new instance with id &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;s&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;instanceid&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;IP Address: &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;s&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;instance&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;public_ip_address&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Instance Type: &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;instancetype&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
        <pubDate>Wed, 19 Apr 2017 04:20:00 -0400</pubDate>
        <link>http://www.vinhas.net//cassandra-aws-cluster/</link>
        <guid isPermaLink="true">http://www.vinhas.net//cassandra-aws-cluster/</guid>
        
        <category>devops</category>
        
        <category>development</category>
        
        <category>chef</category>
        
        <category>cassandra</category>
        
        <category>aws</category>
        
        
        <category>aws</category>
        
        <category>chef</category>
        
        <category>development</category>
        
      </item>
    
      <item>
        <title>The ultimate development machine</title>
        <description>&lt;p&gt;Back in the day I used to use several VM&amp;#39;s on a Linux desktop to be able to do my work efficiently. One VM for each different linux distribution I had to deal with, one VM for each different Windows Server I had to support, and all my coding/scripting/tooling on linux, shared to the VM&amp;#39;s using Samba.&lt;/p&gt;

&lt;p&gt;As I mentioned &lt;a href=&quot;/uninstalling-windows10-crapware/&quot;&gt;here&lt;/a&gt;, after over a decade using Linux as my desktop, I started using Windows 10 a couple years ago, after my terrible experience with MacOS after my employer got me a Macbook Pro. Until last year, pretty much all the cool engineers had Macs for their work and mostly because it was easier to use &lt;code&gt;brew&lt;/code&gt; to install all sorts of linux/unix tools on the Unix terminal that MacOS runs on. Dealing with all the desktop limitations, poor interface and the despicable keyboard.&lt;/p&gt;

&lt;p&gt;I&amp;#39;ll try to show on this post how a hardcore linux guy can take the most of Windows 10 in a way you won&amp;#39;t even believe that can be happy using Windows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install the Windows Subsystem for Linux (aka bash)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When I started using Windows after so many years, I&amp;#39;ve installed and got pretty addicted to &lt;a href=&quot;https://www.cygwin.org&quot;&gt;cygwin&lt;/a&gt;. It&amp;#39;s fast and has pretty much every linux command-line tool you&amp;#39;ll ever need. The only problem is that it&amp;#39;s still Windows, so you are stuck with all the crazy path names like &lt;code&gt;c:\\Users\\tvinhas\\My\ Documents&lt;/code&gt;.&lt;br&gt;
Starting with November 2016&amp;#39;s release of Windows (Anniversary Update), hell has frozen over and Microsoft introduced the &lt;em&gt;Windows Subsystem for Linux (aka bash)&lt;/em&gt; that is basically a full-featured linux shell on Windows. It&amp;#39;s different than cygwin because you&amp;#39;re actually running native linux ELF binaries on Windows. It&amp;#39;s kinda like the reverse of what Wine does on linux. To install &lt;em&gt;bash&lt;/em&gt; on Windows, you&amp;#39;ll have to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the app &lt;em&gt;Settings -&amp;gt; Windows &amp;amp; security -&amp;gt; For developers&lt;/em&gt;, and click on the &lt;em&gt;Deveoper mode&lt;/em&gt; box.&lt;/li&gt;
&lt;li&gt;Open the &lt;em&gt;Command Prompt&lt;/em&gt; as &lt;em&gt;Administrator&lt;/em&gt; and run &lt;code&gt;powershell -command Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Install&lt;/strong&gt; &lt;strong&gt;&lt;a href=&quot;https://conemu.github.io&quot;&gt;ConEmu&lt;/a&gt;&lt;/strong&gt; &lt;strong&gt;for the best console experience&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ConEmu is the best terminal application you&amp;#39;ll find, and it supports any shell available. Spend some time configuring it as you like.&lt;br&gt;
&lt;strong&gt;&lt;em&gt;Protip&lt;/em&gt;&lt;/strong&gt;: To have ConEmu starting with bash and directly into your home directory, open its settings and go to &lt;strong&gt;Tasks&lt;/strong&gt;. Create a new task and paste this as the command, adjusting the path to reflect your login: &lt;code&gt;%windir%\system32\bash.exe -cur_console:p -new_console:d:C:\Users\tvinhas\AppData\Local\lxss\home\tvinhas\&lt;/code&gt;.&lt;br&gt;
Now make sure you have that task set as default and start it. Edit your &lt;code&gt;.bashrc&lt;/code&gt; and add &lt;code&gt;cd ~&lt;/code&gt; to its very end.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Enable eternal bash history&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Every good linux guy is lazy and re-typing long commands sucks. With this tip, you can have every single command you ever typed on your terminal available thru ctrl+r. First comment out the following lines:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;c&quot;&gt;#HISTSIZE=1000&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#HISTFILESIZE=2000&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;And then add this to your .bashrc:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;HISTFILESIZE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;HISTSIZE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;HISTTIMEFORMAT&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;[%F %T] &quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;HISTFILE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;~/.bash_eternal_history
&lt;span class=&quot;nv&quot;&gt;PROMPT_COMMAND&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;history -a; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$PROMPT_COMMAND&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;&lt;strong&gt;Install&lt;/strong&gt; &lt;strong&gt;&lt;a href=&quot;https://atom.io&quot;&gt;Atom&lt;/a&gt;&lt;/strong&gt; &lt;strong&gt;or your favorite IDE/editor&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you&amp;#39;re used to &lt;a href=&quot;https://www.sublimetext.com&quot;&gt;Sublime Text&lt;/a&gt; or Notepad++, give &lt;a href=&quot;https://atom.io&quot;&gt;Atom&lt;/a&gt; a shot. You won&amp;#39;t regret.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Enable Hyper-V and forget about Virtualbox&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I was (still am) a big VMware fan, but there&amp;#39;s absolutely no reason for you to install VMware or Virtualbox on Windows 10 since it already has Hyper-V embedded and it&amp;#39;s free.&lt;br&gt;
To install it, open &lt;em&gt;Powershell&lt;/em&gt; as &lt;em&gt;Administrator&lt;/em&gt; and run:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-powershell&quot; data-lang=&quot;powershell&quot;&gt;&lt;span class=&quot;nb&quot;&gt;Enable-WindowsOptionalFeature&lt;/span&gt; -Online -FeatureName Microsoft-Hyper-V -All&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;&lt;strong&gt;Install&lt;/strong&gt; &lt;strong&gt;&lt;a href=&quot;https://www.docker.io&quot;&gt;Docker&lt;/a&gt;&lt;/strong&gt; &lt;strong&gt;and make your terminal talk directly with it&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Docker for Windows is free and 100% compatible with what you use on Linux. It uses Hyper-V with a tiny linux VM it creates to do its magic, so you&amp;#39;ll have to enable Hyper-V and that means no VMware and no Virtualbox (Hyper-V can&amp;#39;t work together with other hypervisors and vice versa).&lt;br&gt;
&lt;strong&gt;&lt;em&gt;Protip&lt;/em&gt;&lt;/strong&gt;: If you&amp;#39;re really a console guy, you&amp;#39;ll want to run docker from your shiny new bash. To do that, make sure you install docker on Linux by typing &lt;code&gt;apt install docker.io&lt;/code&gt; and then add the following somewhere in your &lt;code&gt;.bashrc&lt;/code&gt; file:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;DOCKER_HOST&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;tcp://0.0.0.0:2375&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Now run &lt;code&gt;docker run hello-world&lt;/code&gt; on your linux terminal to test your installation (make sure you ran &lt;code&gt;source .bashrc&lt;/code&gt; or that you opened a new terminal)&lt;/p&gt;

&lt;p&gt;That&amp;#39;s all for today. I hope you enjoy!&lt;/p&gt;
</description>
        <pubDate>Mon, 20 Feb 2017 07:20:00 -0500</pubDate>
        <link>http://www.vinhas.net//dev-machine/</link>
        <guid isPermaLink="true">http://www.vinhas.net//dev-machine/</guid>
        
        <category>windows</category>
        
        <category>devops</category>
        
        <category>development</category>
        
        <category>bash</category>
        
        <category>docker</category>
        
        <category>hyperv</category>
        
        <category>vagrant</category>
        
        
      </item>
    
      <item>
        <title>Uninstalling unnecessary apps from Windows 10</title>
        <description>&lt;p&gt;MacOS quickly became the standard for development and sysadmin work, and after over 10 years using a handful of Linux desktops as my primary computer, that sounded like the natural upgrade for me. My past employer got me my first Macbook Pro a couple years ago, and after 6 months hating every single bit of it, I decided to give Windows 10 a try and had it installed using bootcamp. I&amp;#39;m pretty sure that hating the Mac had some sort of psychological effect, because I absolutely loved Windows 10 and I have been using it since then.&lt;/p&gt;

&lt;p&gt;Living in the 3rd world for as long I did, I got obsessed in shaving every piece of unnecessary software and services from the OS, so I could get the most of the crappy hardware I had available. Even though running Windows 10 on a Surface Book with Intel i7 and 16GB of Memory is already as smooth as you could want, I still keep this habit, so bellow are the first steps I take after a brand new Windows 10 install:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open Powershell as Administrator and run&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-powershell&quot; data-lang=&quot;powershell&quot;&gt;&lt;span class=&quot;nb&quot;&gt;get-appxpackage&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;messaging&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;remove-appxpackage
get-appxpackage&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;sway&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;remove-appxpackage
get-appxpackage&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;commsphone&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;remove-appxpackage
get-appxpackage&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;windowsphone&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;remove-appxpackage
get-appxpackage&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;people&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;remove-appxpackage
get-appxpackage&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;zunemusic&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;remove-appxpackage
get-appxpackage&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;zunevideo&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;remove-appxpackage
get-appxpackage&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;bingfinance&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;remove-appxpackage
get-appxpackage&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;bingnews&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;remove-appxpackage
get-appxpackage&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;bingsports&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;remove-appxpackage
get-appxpackage&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;onenote&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;remove-appxpackage
get-appxpackage&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;alarms&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;remove-appxpackage
get-appxpackage&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;camera&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;remove-appxpackage
get-appxpackage&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;soundrecorder&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;remove-appxpackage
get-appxpackage&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;xbox&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;remove-appxpackage
get-appxpackage&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;officehub&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;remove-appxpackage
get-appxpackage&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;skypeapp&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;remove-appxpackage
get-appxpackage&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;getstarted&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;remove-appxpackage
get-appxpackage&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;3dbuilder&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;remove-appxpackage&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ul&gt;
&lt;li&gt;Now from the Command Prompt (as Administrator):&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-powershell&quot; data-lang=&quot;powershell&quot;&gt;taskkill /f /im OneDrive.exe
%SystemRoot%\SysWOW64\OneDriveSetup.exe /uninstall
&lt;span class=&quot;nb&quot;&gt;rd&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;%UserProfile%\OneDrive&quot;&lt;/span&gt; /Q /S
&lt;span class=&quot;nb&quot;&gt;rd&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;%LocalAppData%\Microsoft\OneDrive&quot;&lt;/span&gt; /Q /S
&lt;span class=&quot;nb&quot;&gt;rd&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;%ProgramData%\Microsoft OneDrive&quot;&lt;/span&gt; /Q /S
&lt;span class=&quot;nb&quot;&gt;rd&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;C:\OneDriveTemp&quot;&lt;/span&gt; /Q /S
REG Delete &lt;span class=&quot;s2&quot;&gt;&quot;HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}&quot;&lt;/span&gt; /f
REG Delete &lt;span class=&quot;s2&quot;&gt;&quot;HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}&quot;&lt;/span&gt; /f&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;There are a few other things you might wanna check, like running &lt;code&gt;taskmgr&lt;/code&gt; going to the &lt;em&gt;Startup&lt;/em&gt; tab and disabling anything you don&amp;#39;t really need to be running just after Windows starts.&lt;/p&gt;
</description>
        <pubDate>Wed, 15 Feb 2017 07:00:00 -0500</pubDate>
        <link>http://www.vinhas.net//uninstalling-windows10-crapware/</link>
        <guid isPermaLink="true">http://www.vinhas.net//uninstalling-windows10-crapware/</guid>
        
        <category>windows</category>
        
        
        <category>windows</category>
        
      </item>
    
  </channel>
</rss>
