<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[shuklapraveen - Medium]]></title>
        <description><![CDATA[Hacker | DevOps | Systems | Rubyist - Medium]]></description>
        <link>https://medium.com/praveen-shukl?source=rss----341d705169c5---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>shuklapraveen - Medium</title>
            <link>https://medium.com/praveen-shukl?source=rss----341d705169c5---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 22:36:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/praveen-shukl" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Logging and Monitoring in k8s]]></title>
            <link>https://medium.com/praveen-shukl/logging-and-monitoring-in-k8s-672fb76fa934?source=rss----341d705169c5---4</link>
            <guid isPermaLink="false">https://medium.com/p/672fb76fa934</guid>
            <dc:creator><![CDATA[Praveen Shukla]]></dc:creator>
            <pubDate>Thu, 23 Nov 2017 06:41:00 GMT</pubDate>
            <atom:updated>2017-11-23T06:40:59.329Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FuA0BzDxbkhqKi-afPNWeg.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=672fb76fa934" width="1" height="1" alt=""><hr><p><a href="https://medium.com/praveen-shukl/logging-and-monitoring-in-k8s-672fb76fa934">Logging and Monitoring in k8s</a> was originally published in <a href="https://medium.com/praveen-shukl">shuklapraveen</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[strace hello world]]></title>
            <link>https://medium.com/praveen-shukl/strace-hello-world-e52eea4d6411?source=rss----341d705169c5---4</link>
            <guid isPermaLink="false">https://medium.com/p/e52eea4d6411</guid>
            <category><![CDATA[ruby]]></category>
            <dc:creator><![CDATA[Praveen Shukla]]></dc:creator>
            <pubDate>Thu, 23 Nov 2017 06:39:37 GMT</pubDate>
            <atom:updated>2017-11-23T06:39:37.106Z</atom:updated>
            <content:encoded><![CDATA[<p>strace is a handy command line tool which allows you to see which system calls a particular user application is hitting, the arguments passed passed in, and the return values.</p><p>For example:</p><p>hello.c:</p><blockquote>#include &lt;stdio.h&gt;</blockquote><blockquote>int main (int argc, char *argv[] )<br>{<br> <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html">printf</a>(“hi!\n“);<br> return 0;<br>}</blockquote><p>Command to trace all system calls when running above c program.</p><p><strong>compile C code</strong></p><p>gcc hello.c</p><p><strong>print output</strong></p><p>./a.out</p><p><strong>strace command</strong></p><p>strace ./a.out</p><blockquote>execve(“./a.out”, [“./a.out”], [/* 16 vars */]) = 0<br>brk(0) = 0xded000<br>access(“/etc/ld.so.nohwcap”, F_OK) = -1 ENOENT (No such file or directory)<br>mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fee7ee84000<br>access(“/etc/ld.so.preload”, R_OK) = -1 ENOENT (No such file or directory)<br>open(“/etc/ld.so.cache”, O_RDONLY|O_CLOEXEC) = 3<br>fstat(3, {st_mode=S_IFREG|0644, st_size=27523, …}) = 0<br>mmap(NULL, 27523, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fee7ee7d000<br>close(3) = 0<br>a</blockquote><p>hello.rb</p><blockquote>#!/usr/bin/ruby<br>puts “hi!”</blockquote><p>Command to trace all system calls when running above ruby program.</p><p><strong>run ruby code</strong></p><p>ruby hello.rb</p><p><strong>strace command</strong></p><p>strace .ruby hello.rb</p><blockquote>execve(“/usr/bin/ruby”, [“ruby”, “hello.rb”], [/* 16 vars */]) = 0<br>brk(0) = 0xaad000<br>access(“/etc/ld.so.nohwcap”, F_OK) = -1 ENOENT (No such file or directory)<br>mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f205afd2000<br>access(“/etc/ld.so.preload”, R_OK) = -1 ENOENT (No such file or directory)<br>open(“/etc/ld.so.cache”, O_RDONLY|O_CLOEXEC) = 3<br>fstat(3, {st_mode=S_IFREG|0644, st_size=27523, …}) = 0<br>mmap(NULL, 27523, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f205afcb000<br>close(3) = 0</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e52eea4d6411" width="1" height="1" alt=""><hr><p><a href="https://medium.com/praveen-shukl/strace-hello-world-e52eea4d6411">strace hello world</a> was originally published in <a href="https://medium.com/praveen-shukl">shuklapraveen</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lets Get Started with Terraform]]></title>
            <link>https://medium.com/praveen-shukl/lets-get-started-with-terraform-6dcff60457bc?source=rss----341d705169c5---4</link>
            <guid isPermaLink="false">https://medium.com/p/6dcff60457bc</guid>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Praveen Shukla]]></dc:creator>
            <pubDate>Thu, 23 Nov 2017 06:34:27 GMT</pubDate>
            <atom:updated>2017-11-23T06:34:27.172Z</atom:updated>
            <content:encoded><![CDATA[<p>Terraform is an open source tool that allows you to define infrastructure for a variety of cloud providers (e.g. AWS, Azure, Google Cloud, DigitalOcean, etc) using a simple, declarative programming language and to deploy and manage that infrastructure using a few CLI commands.</p><p>Why we use IAS in mostly all the software companies ?</p><ul><li>fear of downtime</li><li>fear of accidental misconfiguration</li><li>fear of slow and fragile deployments, and fear of what would happen if the sysadmins fell to the dark side (i.e. took a vacation)</li></ul><p>Advantages:</p><ul><li>automate entire process which is more reliable and fast as compare to manual process.</li><li>store source files which has the infrastructure stage and anyone can read and understand it.</li><li>store infrastructure code in version control which makes easier for commit logs, rollback, code reviews and automated tests</li><li>You can create reusable, documented, battle-tested <a href="https://medium.com/@gruntwork/gruntwork-infrastructure-packages-7434dc77d0b1">infrastructure packages</a> that make it easier to scale and evolve your infrastructure.</li><li>Happy developers</li></ul><p>before getting into why terraform and their benefits lets discuss few basics things. If you search for IAC tools on google you will get lots of tools like chef, ansible, puppet, cloudFormation, terraform backed by huge community support.</p><p>Now question is which one is better ?</p><p>End goal of all IAC tools will going to be same, but when you start comparing tools which fulfil your same need at the end of day then you start thinking in terms of trade-offs and priorities.</p><p>So below are some trade-offs and priorities for choosing IAC tools:</p><ul><li>Configuration Management vs Orchestration</li><li>configuration management is like you have a server and you want to provision it.</li><li>Orchestration is like you have to provision your own server.</li><li>Mutable Infrastructure vs Immutable Infrastructure</li><li>Chef, Puppet, Ansible, and SaltStack typically default to a mutable infrastructure paradigm. If you tell chef to install a new version of VIM, it will run the software update on existing server and the changes will be happen in-place. Over the time as you apply new changes to VIM each server will have its own history of changes. This often leads to a phenomenon known as <em>configuration drift</em>, where each server becomes slightly different than all the others, leading to subtle configuration bugs that are difficult to diagnose and nearly impossible to reproduce.</li><li>Procedural vs Declarative</li><li>Precedural: Like chef and ansible you just have to defile all setup to provision any server</li><li>Declarative: Like terraform you have to define what you need and let terraform figure out how to achieve required result.</li><li>Client/Server Architecture vs Client-Only Architecture</li><li>Client/Server Architecture: Like chef</li><li>Client-Only Architecture: Like ansible and terraform</li></ul><p>For more details: <a href="https://blog.gruntwork.io/why-we-use-terraform-and-not-chef-puppet-ansible-saltstack-or-cloudformation-7989dad2865c">https://blog.gruntwork.io/why-we-use-terraform-and-not-chef-puppet-ansible-saltstack-or-cloudformation-7989dad2865c</a></p><p>Now we are in a state of defining why we chose terraform, Lets dig deeper into it</p><p>Why Terraform ?</p><p>As we discussed above like about trade-offs and priorities, choosing terraform came form that discussion.</p><p>An Introduction to terraform:</p><ul><li>The <a href="https://www.terraform.io/intro/getting-started/install.html">official Terraform Getting Started documentation</a> has a very good documentation you must go though once if you really wants to be terraform pro :P.</li></ul><p>We’ll walk you through the entire process, step-by-step:</p><ol><li>Set up your AWS account</li><li>Install Terraform</li><li>Deploy a single server</li><li>Deploy a single web server</li><li>Deploy a cluster of web servers</li><li>Deploy a load balancer</li><li>Clean up</li></ol><p>REferences:</p><ul><li><a href="https://blog.gruntwork.io/how-to-manage-terraform-state-28f5697e68fa">https://blog.gruntwork.io/how-to-manage-terraform-state-28f5697e68fa</a></li><li><a href="https://blog.gruntwork.io/how-to-create-reusable-infrastructure-with-terraform-modules-25526d65f73d">https://blog.gruntwork.io/how-to-create-reusable-infrastructure-with-terraform-modules-25526d65f73d</a></li></ul><p>To Be Continued …</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6dcff60457bc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/praveen-shukl/lets-get-started-with-terraform-6dcff60457bc">Lets Get Started with Terraform</a> was originally published in <a href="https://medium.com/praveen-shukl">shuklapraveen</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Topology Of a DataCenter]]></title>
            <link>https://medium.com/praveen-shukl/the-topology-of-a-datacenter-62389bb7c125?source=rss----341d705169c5---4</link>
            <guid isPermaLink="false">https://medium.com/p/62389bb7c125</guid>
            <dc:creator><![CDATA[Praveen Shukla]]></dc:creator>
            <pubDate>Thu, 23 Nov 2017 06:33:13 GMT</pubDate>
            <atom:updated>2017-11-23T06:33:12.941Z</atom:updated>
            <content:encoded><![CDATA[<ul><li>Tens of <strong>machines</strong> are placed in a <strong>rack</strong>.</li><li><strong>Racks</strong> stand in a <strong>row</strong>.</li><li>One or more <strong>rows</strong> form a <strong>cluster</strong>.</li><li>Usually a <strong>datacenter</strong> building houses <strong>multiple</strong> <strong>clusters</strong>.</li><li>Multiple <strong>datacenter</strong> building that are located close together form a <strong>campus</strong>.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62389bb7c125" width="1" height="1" alt=""><hr><p><a href="https://medium.com/praveen-shukl/the-topology-of-a-datacenter-62389bb7c125">The Topology Of a DataCenter</a> was originally published in <a href="https://medium.com/praveen-shukl">shuklapraveen</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[12 factor App]]></title>
            <link>https://medium.com/praveen-shukl/12-factor-app-72d254a7771f?source=rss----341d705169c5---4</link>
            <guid isPermaLink="false">https://medium.com/p/72d254a7771f</guid>
            <dc:creator><![CDATA[Praveen Shukla]]></dc:creator>
            <pubDate>Sun, 29 Jan 2017 08:35:07 GMT</pubDate>
            <atom:updated>2017-03-05T14:16:57.243Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>1. CodeBase</strong><br>* Codebase must be tracked in version control<br>* One codebase per app<br>* Extract libraries for common code used in different codebases<br><strong>2 Dependency</strong><br>* Never rely on system wide package<br>* Declare and isolate dependency<br><strong>3 Configuration</strong><br>* Config which is varries across deploys<br>* config should be separate from app<br><strong>4 Back Services</strong><br>* Resouces which your app consumes<br>* they are attached to your app both should treated as same.<br>* you can attach and deattached any any point of time<br><strong>5 Build, release and run</strong><br>* Build: Complex: Task of converting code to runnable code<br>* Release: Combines code to config<br>* Run: Runs your app<br><strong>6. Processes</strong><br>* suppose to be stateless<br>* use filesystem/localhost cache for temprary store<br>* storage persistance data in stateful backing storage<br>* No sticky sessions<br><strong>7. Port Binding</strong><br>* export service via port binding<br>* app binds to http port<br>* most software server can use port binding<br>* One app == backing service for another<br><strong>8. Concurrency</strong><br>* Can be achived via multiple processes.<br>* adding more concurrency should be very simple and reliable process.<br><strong>9. Disposability</strong><br>* process should be disposable to other machines easlily<br>* start fast and shutdown gracefully<br><strong>10. Dev/Prod parity</strong><br>* all the tools and framework should consists of same package and version<br><strong>11. Logs</strong><br>* Stream of events that we need to combine to single location so that we can index and analyse later.<br><strong>12. Admin Processes</strong><br>* Process that should be trigger run against all new packages.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72d254a7771f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/praveen-shukl/12-factor-app-72d254a7771f">12 factor App</a> was originally published in <a href="https://medium.com/praveen-shukl">shuklapraveen</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy Node.js Application on S3]]></title>
            <link>https://medium.com/praveen-shukl/deploy-node-js-application-on-s3-51aeb2cfb75b?source=rss----341d705169c5---4</link>
            <guid isPermaLink="false">https://medium.com/p/51aeb2cfb75b</guid>
            <dc:creator><![CDATA[Praveen Shukla]]></dc:creator>
            <pubDate>Sun, 16 Oct 2016 10:46:50 GMT</pubDate>
            <atom:updated>2017-03-05T14:16:33.259Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>S3 Side configuration:</strong><br>1. Setup user for staging and production<br>2. Attach policy<br>3. Generate s3_key and s3_secret<br>4. create bucket with the same name specficied in the aws.json file in Node.js project.</p><p><strong>Node.js project Side:</strong><br>1. npm install<br>2. npm test: For running the unit tests in the browser (requires Google Chrome).<br>3. npm run build: For creating the dist files.<br>4. npm run deploy — s3key=[AWS_KEY] — s3secret=[AWS_SECRET]<br>For uploading to S3<br>5. npm run api-domain-init — apiDomain=[API_DOMAIN]<br>For configuring fetch-application API domain</p><p><strong>Dependency:</strong><br>1.Add NodeJs ppa<br>sudo apt-get install python-software-properties<br>curl -sL <a href="https://deb.nodesource.com/setup_6.x">https://deb.nodesource.com/setup_6.x</a> | sudo -E bash -<br>2. Install Node.js and NPM<br>apt-get install nodejs (npm will install with nodejs)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51aeb2cfb75b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/praveen-shukl/deploy-node-js-application-on-s3-51aeb2cfb75b">Deploy Node.js Application on S3</a> was originally published in <a href="https://medium.com/praveen-shukl">shuklapraveen</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Let’s Get Started with Zookeeper and Kafka:]]></title>
            <link>https://medium.com/praveen-shukl/lets-get-started-with-zookeeper-and-kafka-de9a8cfc822e?source=rss----341d705169c5---4</link>
            <guid isPermaLink="false">https://medium.com/p/de9a8cfc822e</guid>
            <dc:creator><![CDATA[Praveen Shukla]]></dc:creator>
            <pubDate>Sun, 16 Oct 2016 10:44:16 GMT</pubDate>
            <atom:updated>2017-03-05T14:17:11.497Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Zookeeper: </strong><em>Zookeeper is mainly used to track status of nodes present in Kafka cluster and also to keep track of Kafka topics, messages, etc.</em></p><p><strong>Kafka: </strong><em>Kafka is a distributed publish-subscribe messaging system that is designed to be fast, scalable, and durable</em>.</p><p><strong>Using 2 separate Boxes for zookeeper and kafka</strong><br><strong>1. Zookeeper Box (IP: 192.168.10.100)</strong><br>* Install Java<br>* Download zookeeper: wget <a href="http://apache.org/dist/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz">http://apache.org/dist/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz</a><br>* Untar the download file: tar -zxvf zookeeper-3.4.6.tar.gz<br>* Go to zookeeper-3.4.6/conf<br>* cp zoo_sample.cfg zoo.cfg<br>* change dataDir path to store zookeeper all data about kafka<br>* start zookeeper server: bin/zkServer.sh start conf/zoo.cfg</p><p><strong>2. Kafka Box (IP 192.168.10.101)</strong><br>* Install java<br>* Download kafka: wget <a href="http://mirror.fibergrid.in/apache/kafka/0.10.0.1/kafka_2.10-0.10.0.1.tgz">http://mirror.fibergrid.in/apache/kafka/0.10.0.1/kafka_2.10-0.10.0.1.tgz</a><br>* Untar the downloaded file: tar -zxvf kafka_2.10–0.10.0.1.tgz<br>* Command to start kafka server: bin/kafka-server-start.sh config/server.properties</p><p><strong>* Create topic:</strong></p><pre>root@kafka-cluster:~/kafka_2.10-0.10.0.1# bin/kafka-topics.sh --create --zookeeper 192.168.10.100:2181 --replication-factor 1 --partitions 1 --topic data</pre><p><strong>* List all topics:</strong></p><pre>root@kafka-cluster:~/kafka_2.10-0.10.0.1# bin/kafka-topics.sh --list --zookeeper 192.168.10.100:2181</pre><p><strong>* Producer:</strong></p><pre>root@kafka-cluster:~/kafka_2.10-0.10.0.1# bin/kafka-console-producer.sh --broker-list 192.168.10.101:9092 --topic data</pre><p><strong>* Consumer:</strong></p><pre>root@kafka-cluster:~/kafka_2.10-0.10.0.1# bin/kafka-console-consumer.sh --zookeeper 192.168.10.100:2181 --topic data --from-beginning</pre><p><strong>* Delete Topic:</strong></p><pre>root@kafka-cluster:~/kafka_2.10-0.10.0.1# bin/kafka-topics.sh  --zookeeper 192.168.10:2181 --delete  --topic test</pre><p><strong>* Hardware configuration required for Kafka:</strong></p><p>Kafka is a sequential message queue — there aren’t any random reads and writes. This means that it can take heavy advantage of disk read-ahead, disk buffering, and linux kernel/filesystem optimizations. A typical hard disk doing sequential reads/writes is easily able to saturate a gigabit link, and so is Kafka with any decent CPU made in the last 5 years. This means that you can get by with big, cheap, slow disks.</p><p><strong>* Hardware configuration required for Zookeeper:</strong></p><p><strong>Note:</strong> If you are using HDD then High RAM is required or if you are using SSD then high CPU is required.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de9a8cfc822e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/praveen-shukl/lets-get-started-with-zookeeper-and-kafka-de9a8cfc822e">Let’s Get Started with Zookeeper and Kafka:</a> was originally published in <a href="https://medium.com/praveen-shukl">shuklapraveen</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Test Driven infrastructure with chef]]></title>
            <link>https://medium.com/praveen-shukl/test-driven-infrastructure-with-chef-8bbdabfe7cf?source=rss----341d705169c5---4</link>
            <guid isPermaLink="false">https://medium.com/p/8bbdabfe7cf</guid>
            <dc:creator><![CDATA[Praveen Shukla]]></dc:creator>
            <pubDate>Sat, 03 Sep 2016 18:14:42 GMT</pubDate>
            <atom:updated>2017-03-05T14:16:37.228Z</atom:updated>
            <content:encoded><![CDATA[<p>Coming from the development side of the product building to DevOps expecting every line of code should have descent amount of test around it. But Traditionally, much of infrastructure is managed.</p><p>manually or using scripts. This inconsistency causes many issues in infrastructure.<br>As we all know that test driven development (TDD) is well known for increasing code quality, improving overall design, and allowing safe refactoring throughout a project.</p><p>So, I am going to explain about the how and why we should test our code and what are tools are available to test our infrastructure code.<br>Before Getting into actual usage of tool we should understand the phases of<br>1. Pre-convergence: Testing phase that does not require any node to run the test.<br>2. Convergence: Chef runs and make changes to the system on node.<br>3. Post-convergence: Node finishes running Chef, also verifying that node is in the desired state.</p><p><strong>Principles of TDI:</strong><br>Paul Duvall of Stelligent has written about a 5-step process of automating environments for continuous delivery: document, test, script, version, and continuous.<br>These 5 steps can be taken as the basic principles for Test-Driven Infrastructure.<br>Each principle is described in more detail below:</p><p><strong>1. Document:</strong> Identify and record the high-level details of the system, and what needs to be accomplished.<br><strong>2. Test:</strong> Write tests that describe the desired behavior or outcome.<br><strong>3. Script:</strong> Write code to implement the processes that will produce the behavior or outcome.<br><strong>4. Version:</strong> Use version control to track changes and make collaboration easier.<br><strong>5. Continuous:</strong> Whenever changes are made, test everything. Be sure that the system as a whole still behaves properly.</p><p><strong>Type of Testing:</strong><br><strong>1. Unit Testing</strong><br>The intent of unit testing is to confirm that recipes yields the expected output.<br>Unit testing Chef cookbooks is done with ChefSpec</p><p><strong>For example:</strong></p><blockquote>it “installs the httpd package” do<br>expect(chef_run).to install_package(“httpd”)<br>end</blockquote><blockquote>package “httpd” do<br>action :install<br>end</blockquote><p><strong>2. Integration Testing</strong><br>The intent of integration testing is to confirm the end-to-end functionality.<br>Integration testing Chef cookbooks is often performed in Test Kitchen.</p><p><strong>Common Chef Testing Tools</strong><br><strong>1. RuboCop</strong><br>Rubocop is a Ruby command-line tool that performs lint and style checks based on the community driven Ruby Style Guide.</p><p><strong>2. Foodcritic</strong><br>Foodcritic is a Ruby command-line tool to perform lint checking against Chef cookbooks</p><p><strong>3. ChefSpec</strong><br>ChefSpec is a unit testing framework for Chef cookbooks.</p><p><strong>4. Serverspec</strong><br>Serverspec is an “outside-in” integration test framework.</p><p><strong>5. Test Kitchen</strong><br>Test Kitchen is an integration tool for developing and testing infrastructure code and software on isolated target platforms.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8bbdabfe7cf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/praveen-shukl/test-driven-infrastructure-with-chef-8bbdabfe7cf">Test Driven infrastructure with chef</a> was originally published in <a href="https://medium.com/praveen-shukl">shuklapraveen</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Design Principles]]></title>
            <link>https://medium.com/praveen-shukl/design-principles-6455122b7140?source=rss----341d705169c5---4</link>
            <guid isPermaLink="false">https://medium.com/p/6455122b7140</guid>
            <dc:creator><![CDATA[Praveen Shukla]]></dc:creator>
            <pubDate>Wed, 18 May 2016 17:34:21 GMT</pubDate>
            <atom:updated>2017-03-05T14:17:16.057Z</atom:updated>
            <content:encoded><![CDATA[<p>+ SRP</p><p>+ Express Intent</p><p>+ Simple English Model</p><p>+ State and behavior</p><p>+ DRY</p><p>+ One authoritative source of truth</p><p>+ No magic literals</p><p>+ Tell, Don’t ask</p><p>+ Job of the class</p><p>+ Always inject dependencies</p><p>+ YAGNI</p><p>+ Use the customer’s language</p><p>+ Ask the customer</p><p>+ Value Immutability</p><p>+ KISS</p><p>+ Branch on Type. No branch no type. Usually, these will be separate entities.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6455122b7140" width="1" height="1" alt=""><hr><p><a href="https://medium.com/praveen-shukl/design-principles-6455122b7140">Design Principles</a> was originally published in <a href="https://medium.com/praveen-shukl">shuklapraveen</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Code Smells: how to refactor]]></title>
            <link>https://medium.com/praveen-shukl/code-smells-how-to-refactor-db06d6b0bedf?source=rss----341d705169c5---4</link>
            <guid isPermaLink="false">https://medium.com/p/db06d6b0bedf</guid>
            <dc:creator><![CDATA[Praveen Shukla]]></dc:creator>
            <pubDate>Sat, 30 Apr 2016 15:50:44 GMT</pubDate>
            <atom:updated>2017-03-05T14:17:16.415Z</atom:updated>
            <content:encoded><![CDATA[<p>In this post I am going to explain about <strong>code smells</strong> and how to remove to those code smells from your code base</p><p>What is <strong>code smells</strong>: A <em>code smell</em> is a hint that something has gone wrong somewhere in your code</p><p><strong>Kent back’s rule of simple design</strong><br>design code should<br>1. run all the specs(successfully pass)<br>2. contains no duplicate code<br>3. express intent should be present<br>4. minimize class and methods size(SRP).<br><strong>code smells</strong>:<br><strong> 1. Long Method</strong><br>refactor: break down onto short methods<br>why ?<br>easy to write test<br>more descriptive name<br>easy to understand whats going inside the method<br>one line method (holy grail)<br><strong>2. large class: breaking the SRP</strong></p><p>Problems:<br>large class have too many instance variable<br>too many method<br>refactor: Obey SRP</p><p><strong>3. Primitive Obsession</strong> : using primitive data types to represent domain ideas<br>refactor: ValueObject in place of the primitive data<br>what is value Object: Examples of value objects are things like numbers, dates, monies and strings.</p><p><strong>4. Data clump:</strong> set of data that always used together but are not organized together<br>refactor: Whenever two or three values are gathered together — turn them into a object.<br><strong>5. Poor Name:</strong><br>refactor: Name should be descriptive<br>use standard term<br>be unambiguous<br>describe side effect<br>be longer when scope is large</p><p>References: <a href="http://c2.com/">http://c2.com/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db06d6b0bedf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/praveen-shukl/code-smells-how-to-refactor-db06d6b0bedf">Code Smells: how to refactor</a> was originally published in <a href="https://medium.com/praveen-shukl">shuklapraveen</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>