<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Software Development Archives - Tech Chronicles</title>
	<atom:link href="http://kostacipo.stream/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>https://kostacipo.stream/category/development/</link>
	<description>Ramblings of a Tech Dude</description>
	<lastBuildDate>Tue, 16 Feb 2021 21:34:22 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.2</generator>

<image>
	<url>https://kostacipo.stream/wp-content/uploads/2019/12/cropped-profile-32x32.jpg</url>
	<title>Software Development Archives - Tech Chronicles</title>
	<link>https://kostacipo.stream/category/development/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>What is DevOps?</title>
		<link>http://kostacipo.stream/what-is-devops/</link>
					<comments>http://kostacipo.stream/what-is-devops/#respond</comments>
		
		<dc:creator><![CDATA[Majordomo]]></dc:creator>
		<pubDate>Tue, 16 Feb 2021 21:34:22 +0000</pubDate>
				<category><![CDATA[DevOps]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[ci/cd]]></category>
		<category><![CDATA[devops]]></category>
		<guid isPermaLink="false">http://kostacipo.stream/?p=2045</guid>

					<description><![CDATA[<p>DevOps is the simplification or automation of established IT processes. Here&#8217;s a brief tutorial to understand and get started with DevOps. DevOps… CI/CD… Docker… Kubernetes… I&#8217;m sure you&#8217;ve been bombarded with these words a lot the past year. Seems like the entire world is talking about it. The rate at which this segment is progressing, [&#8230;]</p>
<p>The post <a href="http://kostacipo.stream/what-is-devops/">What is DevOps?</a> appeared first on <a href="http://kostacipo.stream">Tech Chronicles</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3>DevOps is the simplification or automation of established IT processes.</h3>
<h5>Here&#8217;s a brief tutorial to understand and get started with DevOps.</h5>
<p data-selectable-paragraph="">DevOps… CI/CD… Docker… Kubernetes… I&#8217;m sure you&#8217;ve been bombarded with these words a lot the past year. Seems like the entire world is talking about it. The rate at which this segment is progressing, it won&#8217;t be long before we reach the stage of NoOps. It&#8217;s about time we break down what DevOps really is.</p>
<p data-selectable-paragraph="">The objective of this article is to set a solid foundation for you to build on top of. So let&#8217;s start with the obvious question.</p>
<h2 data-selectable-paragraph="">What is DevOps?</h2>
<blockquote>
<p data-selectable-paragraph="">DevOps is the simplification or automation of <strong>established IT processes.</strong></p>
</blockquote>
<p data-selectable-paragraph="">I&#8217;ve seen so many people start this journey to adopt DevOps to only find themselves lost. There seems to be a pattern to this.</p>
<p data-selectable-paragraph="">It usually starts with a video on how a fancy tech startup has automated its release cycle. Deployments happen automatically once all the tests pass. Rollbacks, in case of failures, is automatic. Thousands of simultaneous A/B test is driving up customer engagement.</p>
<p data-selectable-paragraph="">We all are tired of releasing a new version like it&#8217;s a rollercoaster ride.</p>
<figure>
<div tabindex="0"><img decoding="async" class="fr-fic fr-dib lazyloaded" src="https://dzone.com/storage/temp/14354587-devops-rollercoaster.png" alt="The DevOps rollercoaster" data-image="true" data-new="false" data-sizeformatted="179.5 kB" data-mimetype="image/png" data-creationdate="1611506359500" data-creationdateformatted="01/24/2021 04:39 PM" data-type="temp" data-url="/storage/temp/14354587-devops-rollercoaster.png" data-modificationdate="null" data-size="179456" data-name="devops-rollercoaster.png" data-id="14354587" data-src="/storage/temp/14354587-devops-rollercoaster.png" /></div>
</figure>
<p data-selectable-paragraph="">Unfortunately, DevOps doesn&#8217;t work that way. DevOps isn&#8217;t a magic wand that can solve all your problems in an instant.</p>
<p data-selectable-paragraph="">Instead, it is a systematic process of choosing the right tools and technology to get the job done.</p>
<h3 data-selectable-paragraph="">All of This Starts With a Process</h3>
<p data-selectable-paragraph="">It doesn&#8217;t matter what the process is. It could be simplifying the deployment of your app or automate testing. Whatever your process is, the act of making your life easier is what DevOps is all about.</p>
<p data-selectable-paragraph="">But you always need to start with a process.</p>
<p data-selectable-paragraph="">In fact, <em>if your process cannot be done manually (on a smaller scale), you should probably re-examine your process.</em></p>
<p data-selectable-paragraph="">I mean it.</p>
<p data-selectable-paragraph="">Enough talking. Let&#8217;s take a real-world example to understand things better.</p>
<h2 data-selectable-paragraph="">Let&#8217;s Take a Real DevOps Example</h2>
<p data-selectable-paragraph="">Let&#8217;s take a simple example of <em>making a </em><a href="https://nodejs.org/en/" target="_blank" rel="noopener nofollow"><em>Nodejs</em></a><em> app live on a VM in the cloud</em>.</p>
<h3 data-selectable-paragraph="">The Process</h3>
<p data-selectable-paragraph="">Here&#8217;s what our process looks like:</p>
<ul>
<li data-selectable-paragraph=""><strong>Start with the source code:</strong> This is our source of truth. We can run our process from anywhere as long as we have access to the source code.</li>
<li data-selectable-paragraph=""><strong>Build an Artifact:</strong> We then package our source code to build an <a href="https://en.wikipedia.org/wiki/Artifact_(software_development)" target="_blank" rel="noopener nofollow">Artifact</a>. In the case of a compiled language, the compiled output (JAR file, in the case of JAVA) would be our artifact. In our case, our source code itself is the artifact to be released.</li>
<li data-selectable-paragraph=""><strong>Publish to an Artifact Repository:</strong> Next, we push our artifact to a repository. This is a location from where our target environment can pull the artifact from. We could stick with something like <a href="https://github.com/" target="_blank" rel="noopener nofollow">Github</a> since we are working with source code here.</li>
<li data-selectable-paragraph=""><strong>Pull and run your app:</strong> Finally, we pull the artifact onto our VM and schedule a Nodejs process by running <code>npm start</code>.</li>
</ul>
<figure>
<div tabindex="0"><img decoding="async" class="fr-fic fr-dib lazyloaded" src="https://dzone.com/storage/temp/14354591-devops-deploy-node-app-on-vm.png" alt="process diagram" data-image="true" data-new="false" data-sizeformatted="52.5 kB" data-mimetype="image/png" data-creationdate="1611506405487" data-creationdateformatted="01/24/2021 04:40 PM" data-type="temp" data-url="/storage/temp/14354591-devops-deploy-node-app-on-vm.png" data-modificationdate="null" data-size="52531" data-name="devops-deploy-node-app-on-vm.png" data-id="14354591" data-src="/storage/temp/14354591-devops-deploy-node-app-on-vm.png" /></div>
</figure>
<p data-selectable-paragraph="">It&#8217;s okay if you do things a slightly different way. We are here to focus on the journey and not the destination.</p>
<h2 data-selectable-paragraph="">Our First DevOps Project</h2>
<p data-selectable-paragraph="">Let&#8217;s not do anything fancy here.</p>
<p data-selectable-paragraph="">The easiest way to automate this process would be to write a simple <a href="https://en.wikipedia.org/wiki/Shell_script" target="_blank" rel="noopener nofollow">shell script</a> to run all the commands in sequence.</p>
<p data-selectable-paragraph=""><strong>Congratulations!!! That&#8217;s our first DevOps project!!!</strong></p>
<p data-selectable-paragraph="">I know shell scripts sounds too simple to be taken seriously. I suspect you already have such scripts in place. But believe me, that&#8217;s DevOps!</p>
<p data-selectable-paragraph="">Don’t worry; we will get to the fancy stuff in a minute. But it&#8217;s important to understand that this is how DevOps works.</p>
<h2 data-selectable-paragraph="">Importance of Repeatability</h2>
<p data-selectable-paragraph="">Let me ask you one question. Which one of these would you prefer?</p>
<ul>
<li data-selectable-paragraph="">An automated deployments pipeline which works 60% of the time, or,</li>
<li data-selectable-paragraph="">A boring shell script that gets the job done every time it&#8217;s executed.</li>
</ul>
<p data-selectable-paragraph="">If you have dealt with production failures in the middle of the night, you&#8217;ll choose the shell script.</p>
<p data-selectable-paragraph="">The reason is simple.</p>
<p data-selectable-paragraph=""><strong>Reliability is far more critical than the degree of automation.</strong></p>
<p data-selectable-paragraph="">In other words,</p>
<blockquote>
<p data-selectable-paragraph="">A DevOps process must be able to produce consistent results every time it&#8217;s run.</p>
</blockquote>
<h3 data-selectable-paragraph="">Making Our Process Repeatable</h3>
<p data-selectable-paragraph="">Let&#8217;s take the example of our shell script.</p>
<p data-selectable-paragraph="">Currently, our shell script depends on Node.js to be installed on the VM we want to deploy the app to.</p>
<p data-selectable-paragraph="">What would happen if the Nodejs runtime was missing? These days, an incorrect version of the runtime is enough to break our application.</p>
<p data-selectable-paragraph="">This problem only gets worse in <a href="https://en.wikipedia.org/wiki/Polyglot_(computing)" target="_blank" rel="noopener nofollow">polyglot environments</a> where we deal with multiple programming languages.</p>
<p data-selectable-paragraph="">A simple solution would be to <em>archive the Nodejs runtime along with our source code</em> in a zip file. The zip file can then be sent to the VM. This way, the VM can use the local Nodejs runtime present in the archive to run our app.</p>
<p data-selectable-paragraph="">Luckily, there is a tool to make our lives easier.</p>
<h2 data-selectable-paragraph="">In Comes Docker and Containers</h2>
<p data-selectable-paragraph="">If you are new to this, think of <a href="https://www.docker.com/" target="_blank" rel="noopener nofollow">Docker</a> as a way to package your artifact along with all its OS dependencies, including Nodejs, into a container image.</p>
<p data-selectable-paragraph="">Using containers, we can deploy any application on a VM which has Docker installed.</p>
<p data-selectable-paragraph="">With Docker, our flow will look something like this:</p>
<figure>
<div tabindex="0"><img decoding="async" class="fr-fic fr-dib lazyloaded" src="https://dzone.com/storage/temp/14354592-devops-deployment-process-with-docker.png" alt="Docker flow should look something like this." data-image="true" data-new="false" data-sizeformatted="59.4 kB" data-mimetype="image/png" data-creationdate="1611506421880" data-creationdateformatted="01/24/2021 04:40 PM" data-type="temp" data-url="/storage/temp/14354592-devops-deployment-process-with-docker.png" data-modificationdate="null" data-size="59437" data-name="devops-deployment-process-with-docker.png" data-id="14354592" data-src="/storage/temp/14354592-devops-deployment-process-with-docker.png" /></div>
</figure>
<p data-selectable-paragraph="">There is a lot more to containers than just this. However, this was one of the reasons why containers got so popular.</p>
<h3 data-selectable-paragraph="">Docker Vs. Containers</h3>
<p data-selectable-paragraph="">Let me clarify this. Docker and containers are not the same things anymore.</p>
<blockquote>
<p data-selectable-paragraph="">Docker is a set of utility tools to build and ship container images which container runtimes like <a href="https://containerd.io/" target="_blank" rel="noopener nofollow">containerd</a> use to make and run containers.</p>
</blockquote>
<p data-selectable-paragraph="">Many are concerned about the future of Docker, given the <a href="https://kubernetes.io/blog/2020/12/02/dont-panic-kubernetes-and-docker/" target="_blank" rel="noopener nofollow">recent events</a> which have taken place.</p>
<p data-selectable-paragraph="">It is important to understand that Docker is not going anywhere anytime soon. It <em>provides the best DX</em> and will <em>continue to play a major role in building and shipping container images</em>.</p>
<h2 data-selectable-paragraph="">Getting Serious With DevOps</h2>
<p data-selectable-paragraph="">We have made some serious progress already. Hopefully, we understand how Docker fits into the DevOps process.</p>
<p data-selectable-paragraph="">It&#8217;s time to take things to the next level.</p>
<h3 data-selectable-paragraph="">Triggering Deployment Based on Events</h3>
<p data-selectable-paragraph="">Our script looks pretty solid, but it&#8217;s still triggered manually.</p>
<figure>
<div tabindex="0"><img decoding="async" class="fr-fic fr-dib lazyloaded" src="https://dzone.com/storage/temp/14354593-devops-trigger-automation-manual.png" alt="Developer &gt; Shell Script &gt; VM" data-image="true" data-new="false" data-sizeformatted="49.5 kB" data-mimetype="image/png" data-creationdate="1611506443799" data-creationdateformatted="01/24/2021 04:40 PM" data-type="temp" data-url="/storage/temp/14354593-devops-trigger-automation-manual.png" data-modificationdate="null" data-size="49537" data-name="devops-trigger-automation-manual.png" data-id="14354593" data-src="/storage/temp/14354593-devops-trigger-automation-manual.png" /></div>
</figure>
<p data-selectable-paragraph="">Wouldn&#8217;t it be great if we could trigger this script automatically whenever someone pushes code on GitHub? In other words, we want to trigger this script on an event.</p>
<p data-selectable-paragraph="">GitHub can <a href="https://docs.github.com/en/developers/webhooks-and-events" target="_blank" rel="noopener nofollow">invoke webhooks</a> on a certain set of events.</p>
<p data-selectable-paragraph="">To achieve this, we need to make a simple HTTP server that executes our shell script whenever its endpoint is hit. We can configure GitHub to hit our endpoint on the <a href="https://docs.github.com/en/developers/webhooks-and-events/github-event-types#pushevent" target="_blank" rel="noopener nofollow">Push Event</a>.</p>
<p data-selectable-paragraph="">Let&#8217;s call this server <em>Colorful Daemons</em> or <em>CD</em>.</p>
<p data-selectable-paragraph="">Our new flow will look something like this:</p>
<figure>
<div tabindex="0"><img decoding="async" class="fr-fic fr-dib lazyloaded" src="https://dzone.com/storage/temp/14354594-devops-trigger-automation-cd.png" alt="Source Code to Server diagram" data-image="true" data-new="false" data-sizeformatted="62.4 kB" data-mimetype="image/png" data-creationdate="1611506463327" data-creationdateformatted="01/24/2021 04:41 PM" data-type="temp" data-url="/storage/temp/14354594-devops-trigger-automation-cd.png" data-modificationdate="null" data-size="62420" data-name="devops-trigger-automation-cd.png" data-id="14354594" data-src="/storage/temp/14354594-devops-trigger-automation-cd.png" /></div>
</figure>
<p data-selectable-paragraph="">Congratulations! You just set up what we call a <em>CD pipeline</em>.</p>
<p data-selectable-paragraph="">And no… I don&#8217;t mean Colorful Daemons. I&#8217;m talking about <a href="https://en.wikipedia.org/wiki/Continuous_deployment" target="_blank" rel="noopener nofollow">Continous Deployments</a>.</p>
<blockquote>
<p data-selectable-paragraph="">Continuous Deployments is a piece of software responsible for taking your app from something like GitHub all the way to your target environment where it finally gets deployed.</p>
</blockquote>
<p data-selectable-paragraph="">This is basically the CI/CD stuff you keep hearing about. When people talk about tools like Jenkins and CircleCI, they are usually referring to CI/CD.</p>
<p data-selectable-paragraph="">What we just made with Colorful Daemons was a continuous deployments pipeline. Don&#8217;t confuse it with continuous integration or delivery. We&#8217;ll get to those some other day.</p>
<h2 data-selectable-paragraph="">The DevOps Pattern</h2>
<p data-selectable-paragraph="">I guess you&#8217;ve already found a pattern here. We start with a process, find a section we aren’t happy with and then introduce some software component to simplify or automate it.</p>
<p data-selectable-paragraph="">That&#8217;s getting the <em>dev in ops</em>. And that&#8217;s all that there is to it.</p>
<p data-selectable-paragraph="">This is the real answer to the question, &#8216;<em>What is DevOps?.&#8217;</em></p>
<h2 data-selectable-paragraph="">Introducing Container Orchestration</h2>
<p data-selectable-paragraph="">Let&#8217;s finish up by making one small improvement.</p>
<p data-selectable-paragraph="">Till now, we have been dealing with deploying our app to a single VM or a single node. What if we wanted to <em>deploy our app to multiple nodes?</em></p>
<p data-selectable-paragraph="">The easiest way to achieve this would be to modify our CD server to ssh into all the VMs and deploy our container to each one of them.</p>
<figure>
<div tabindex="0"><img decoding="async" class="fr-fic fr-dib lazyloaded" src="https://dzone.com/storage/temp/14354596-devops-deploy-to-multiple-vms-cd.png" alt="Deployment from Github" data-image="true" data-new="false" data-sizeformatted="69.4 kB" data-mimetype="image/png" data-creationdate="1611506491877" data-creationdateformatted="01/24/2021 04:41 PM" data-type="temp" data-url="/storage/temp/14354596-devops-deploy-to-multiple-vms-cd.png" data-modificationdate="null" data-size="69429" data-name="devops-deploy-to-multiple-vms-cd.png" data-id="14354596" data-src="/storage/temp/14354596-devops-deploy-to-multiple-vms-cd.png" /></div>
</figure>
<p data-selectable-paragraph="">While this method works, <strong>we&#8217;ll need to change our script every time our infrastructure changes</strong>. In a world where <em>applications are always autoscaling,</em> and <em>VMs are considered disposable</em>, this is unacceptable.</p>
<p data-selectable-paragraph="">A better way would be to make another HTTP server to track infrastructure changes. We can call this server <em>&#8216;</em><em>Pilot.&#8217;</em></p>
<p data-selectable-paragraph="">This server will be responsible for performing health checks on the various VMs in our cluster to maintain a list of active VMs. It could even communicate with the cloud vendor to make things more robust.</p>
<figure>
<div tabindex="0"><img decoding="async" class="fr-fic fr-dib lazyloaded" src="https://dzone.com/storage/temp/14354597-devops-deploy-to-multiple-vms-pilot.png" alt="Pilot diagram" data-image="true" data-new="false" data-sizeformatted="65.2 kB" data-mimetype="image/png" data-creationdate="1611506510994" data-creationdateformatted="01/24/2021 04:41 PM" data-type="temp" data-url="/storage/temp/14354597-devops-deploy-to-multiple-vms-pilot.png" data-modificationdate="null" data-size="65214" data-name="devops-deploy-to-multiple-vms-pilot.png" data-id="14354597" data-src="/storage/temp/14354597-devops-deploy-to-multiple-vms-pilot.png" /></div>
</figure>
<p data-selectable-paragraph="">Pilot will expose an endpoint as well to accept the details of the container to spawn. It can then talk to the various VMs to get the job done.</p>
<p data-selectable-paragraph="">Now, our CD server can simply request Pilot instead of talking to each VM individually.</p>
<p data-selectable-paragraph="">Our new flow will look something like this:</p>
<figure>
<div tabindex="0"><img decoding="async" class="fr-fic fr-dib lazyloaded" src="https://dzone.com/storage/temp/14354598-devops-deploy-to-multiple-vms-process.png" alt="Another new flow, to two servers!" data-image="true" data-new="false" data-sizeformatted="84.0 kB" data-mimetype="image/png" data-creationdate="1611506532707" data-creationdateformatted="01/24/2021 04:42 PM" data-type="temp" data-url="/storage/temp/14354598-devops-deploy-to-multiple-vms-process.png" data-modificationdate="null" data-size="83976" data-name="devops-deploy-to-multiple-vms-process.png" data-id="14354598" data-src="/storage/temp/14354598-devops-deploy-to-multiple-vms-process.png" /></div>
</figure>
<p data-selectable-paragraph="">The second server, Pilot, is called a container orchestrator. That&#8217;s what <a href="https://kubernetes.io/" target="_blank" rel="noopener nofollow">Kubernetes</a> is!</p>
<p data-selectable-paragraph="">You just designed a mini version of Kubernetes!</p>
<p data-selectable-paragraph="">Also, Kubernetes is greek for Pilot. Isn&#8217;t that a pleasant co-incidence?</p>
<h2 data-selectable-paragraph="">Where to Start?</h2>
<p data-selectable-paragraph="">We covered quite a few tools together. This brings me to my last point. Ever wondered why the DevOps space is so fragmented?</p>
<p data-selectable-paragraph="">If you think about it, there are so many tools out there, making it hard to decide: what&#8217;s the right choice or where you should even start?</p>
<figure>
<div tabindex="0"><img decoding="async" class="fr-fic fr-dib lazyloaded" src="https://dzone.com/storage/temp/14354599-devops-landscape.png" alt="Where do you start? Roadmap" data-image="true" data-new="false" data-sizeformatted="97.4 kB" data-mimetype="image/png" data-creationdate="1611506544158" data-creationdateformatted="01/24/2021 04:42 PM" data-type="temp" data-url="/storage/temp/14354599-devops-landscape.png" data-modificationdate="null" data-size="97371" data-name="devops-landscape.png" data-id="14354599" data-src="/storage/temp/14354599-devops-landscape.png" /></div>
</figure>
<p data-selectable-paragraph="">Every organisation has its own way, its own process to do things. And since their paths are different, the tools they need to use are different.</p>
<p data-selectable-paragraph="">Your job is not to find which tool is the best. <em>Your job is to find what process works for you best.</em> Once you have that figured out, the tools are just a google search away.</p>
<p data-selectable-paragraph="">So now you know where to start. It&#8217;s not with the tools out there.</p>
<blockquote>
<p data-selectable-paragraph="">Start by understanding how your company and teams do things.</p>
</blockquote>
<p data-selectable-paragraph="">I&#8217;m literally asking you to open up a Word document and copy-paste the commands you need to run to do stuff.</p>
<h2 data-selectable-paragraph="">Wrapping Up</h2>
<p data-selectable-paragraph="">I hope this post has been helpful in understanding how the DevOps field is arranged and how different tools depend and coexist with each other.</p>
<p data-selectable-paragraph="">I&#8217;d like to add:</p>
<blockquote>
<p data-selectable-paragraph="">Your DevOps process is only as strong as its foundation.</p>
</blockquote>
<p data-selectable-paragraph="">So work on the underlying process. It&#8217;s okay if you need to tweak your current process a bit.</p>
<p data-selectable-paragraph="">An excellent foundation to build upon could be using tools like <a href="https://spaceuptech.com/" target="_blank" rel="noopener nofollow">SpaceCloud</a>. Space Cloud is a Kubernetes-based serverless platform that helps you develop, deploy and secure cloud-native applications.</p>
<p data-selectable-paragraph="">In a nutshell, SpaceCloud gives you <em>an excellent starting point to build your DevOps practices on top of</em>. It makes performing rolling upgrades, canary deployments, and autoscaling your applications easy. You can configure everything using the <code>space-cli</code> or REST APIs.</p>
<p>The post <a href="http://kostacipo.stream/what-is-devops/">What is DevOps?</a> appeared first on <a href="http://kostacipo.stream">Tech Chronicles</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://kostacipo.stream/what-is-devops/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Git Commands to Live By &#8211; Beyond Git basics</title>
		<link>http://kostacipo.stream/git-commands-to-live-by-beyond-git-basics/</link>
					<comments>http://kostacipo.stream/git-commands-to-live-by-beyond-git-basics/#respond</comments>
		
		<dc:creator><![CDATA[Majordomo]]></dc:creator>
		<pubDate>Tue, 12 Jan 2021 12:59:13 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[git commands]]></category>
		<guid isPermaLink="false">http://kostacipo.stream/?p=2006</guid>

					<description><![CDATA[<p>Note:&#160;The linked resources will often mention slightly different, often more concise versions of the commands listed here for newer versions of Git. So if you want the latest and greatest, be sure to give them a look. A quick note on syntax []: Optional content &#60;&#62;: Should be replaced by the actual value when running [&#8230;]</p>
<p>The post <a href="http://kostacipo.stream/git-commands-to-live-by-beyond-git-basics/">Git Commands to Live By &#8211; Beyond Git basics</a> appeared first on <a href="http://kostacipo.stream">Tech Chronicles</a>.</p>
]]></description>
										<content:encoded><![CDATA[<section class="fc fd fe ff fg">
<div class="n p">
<div class="ab ac ae af ag fh ai aj">
<blockquote>
<p id="f38d" class="jr js fk jt b gi ju jv jw gl jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km fc cg" data-selectable-paragraph=""><span style="font-size: 10pt;">Note:&nbsp;The linked resources will often mention slightly different, often more concise versions of the commands listed here for newer versions of Git. So if you want the latest and greatest, be sure to give them a look.</span></p>
</blockquote>
<h2 id="ff50" class="ks kt fk au ku kv kw gk kx ky kz gn la go lb gq lc gr ld gt le gu lf gw lg lh cg" data-selectable-paragraph="">A quick note on syntax</h2>
<ul class="">
<li id="b872" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km ls lt lu cg" data-selectable-paragraph=""><code class="jg kn ko kp kq b">[]</code>: Optional content</li>
<li id="10b0" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><code class="jg kn ko kp kq b">&lt;&gt;</code>: Should be replaced by the actual value when running the command</li>
</ul>
</div>
</div>
</section>
<div class="n p gy ma mb mc" role="separator">&nbsp;</div>
<section class="fc fd fe ff fg">
<div class="n p">
<div class="ab ac ae af ag fh ai aj">
<h1 id="e221" class="mh kt fk au ku mi mj jv kx mk ml jy la mm mn mo lc mp mq mr le ms mt mu lg mv cg" data-selectable-paragraph="">Check Out Remote Branches</h1>
<p id="3789" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km fc cg" data-selectable-paragraph="">We’re probably all familiar with&nbsp;<code class="jg kn ko kp kq b">git pull</code>&nbsp;to bring our local branches up to speed with their remote counterparts. However, if this is our first time working with the remote branch — i.e., it isn’t being tracked by any branch in our local repository — we first need to set that up.</p>
<p id="1487" class="jr js fk jt b gi ju jv jw gl jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km fc cg" data-selectable-paragraph=""><strong class="jt kr">Note:&nbsp;</strong>It’s a good idea to run&nbsp;<code class="jg kn ko kp kq b">git fetch&nbsp;</code>to make sure we’re working with the most up to date version of&nbsp;<code class="jg kn ko kp kq b">remote</code>.</p>
<ul class="">
<li id="067b" class="jr js fk jt b gi ju jv jw gl jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Command:&nbsp;</strong><code class="jg kn ko kp kq b">git checkout [-b &lt;new-local-branch-name&gt;] -t &lt;remote&gt;/&lt;branch&gt;</code></li>
<li id="568c" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Example:&nbsp;</strong><code class="jg kn ko kp kq b">git checkout -t origin/my-awesome-feature</code></li>
<li id="102a" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Explanation:</strong>&nbsp;This will pull&nbsp;<code class="jg kn ko kp kq b">origin/my-awesome-feature</code>&nbsp;into a new local branch of the same name and set it up to track&nbsp;<code class="jg kn ko kp kq b">origin/my-awesome-feature</code>.&nbsp;<code class="jg kn ko kp kq b">-b</code>&nbsp;will do the same thing, except that the local branch’s name will be set to the one specified.</li>
</ul>
<h4 id="a5a7" class="ks kt fk au ku kv kw gk kx ky kz gn la go lb gq lc gr ld gt le gu lf gw lg lh cg">Resources</h4>
<ul class="">
<li id="8ce1" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km ls lt lu cg" data-selectable-paragraph=""><a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://stackoverflow.com/a/1783426/4348037" rel="noopener nofollow">“How do I check out a remote Git branch?” | Stack Overflow</a></li>
</ul>
</div>
</div>
</section>
<section class="fc fd fe ff fg">
<div class="n p">
<div class="ab ac ae af ag fh ai aj">
<h1 data-selectable-paragraph="">&nbsp;</h1>
<h1 id="d201" class="mh kt fk au ku mi mj jv kx mk ml jy la mm mn mo lc mp mq mr le ms mt mu lg mv cg" data-selectable-paragraph="">Delete Remote Branches</h1>
<p id="78ec" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km fc cg" data-selectable-paragraph="">Deleting a local branch is as simple as writing&nbsp;<code class="jg kn ko kp kq b">git branch -d &lt;branch&gt;</code>. But a different command is needed to delete remote branches.</p>
<ul class="">
<li id="e72d" class="jr js fk jt b gi ju jv jw gl jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Command:</strong><code class="jg kn ko kp kq b">git push &lt;remote&gt; -d &lt;branch&gt;</code>&nbsp;or&nbsp;<code class="jg kn ko kp kq b">git push &lt;remote&gt; :&lt;branch&gt;</code></li>
<li id="92c3" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Example:</strong>&nbsp;<code class="jg kn ko kp kq b">git push origin :my-awesome-feature</code></li>
</ul>
<h4 id="430a" class="ks kt fk au ku kv kw gk kx ky kz gn la go lb gq lc gr ld gt le gu lf gw lg lh cg">
Resources</h4>
<ul class="">
<li id="7fa4" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km ls lt lu cg" data-selectable-paragraph=""><a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://stackoverflow.com/a/2003515/4348037" rel="noopener nofollow">“How do I delete a Git branch locally and remotely?” | Stack Overflow</a></li>
</ul>
</div>
</div>
</section>
<section class="fc fd fe ff fg">
<div class="n p">
<div class="ab ac ae af ag fh ai aj">
<h1 data-selectable-paragraph="">&nbsp;</h1>
<h1 id="1ef3" class="mh kt fk au ku mi mj jv kx mk ml jy la mm mn mo lc mp mq mr le ms mt mu lg mv cg" data-selectable-paragraph="">Change Remote URL</h1>
<p id="7863" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km fc cg" data-selectable-paragraph="">This is for whenever you need to change the URL&nbsp;<code class="jg kn ko kp kq b">&lt;remote&gt;</code>&nbsp;actually points to. For example, if you change your repository’s name, Git will ask you to do this. Here’s how.</p>
<ul class="">
<li id="ec35" class="jr js fk jt b gi ju jv jw gl jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Command:</strong>&nbsp;<code class="jg kn ko kp kq b">git remote set-url &lt;remote&gt; &lt;newurl&gt;</code></li>
<li id="35f8" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Example:</strong>&nbsp;<code class="jg kn ko kp kq b">git remote set-url origin github.com/myusername/my-repo</code></li>
</ul>
<h4 id="189f" class="ks kt fk au ku kv kw gk kx ky kz gn la go lb gq lc gr ld gt le gu lf gw lg lh cg">
Resources</h4>
<ul class="">
<li id="ccac" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km ls lt lu cg" data-selectable-paragraph=""><a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://git-scm.com/docs/git-remote" rel="noopener nofollow">git-remote | Git</a></li>
</ul>
</div>
</div>
</section>
<section class="fc fd fe ff fg">
<div class="n p">
<div class="ab ac ae af ag fh ai aj">
<h1 data-selectable-paragraph="">&nbsp;</h1>
<h1 id="6a0c" class="mh kt fk au ku mi mj jv kx mk ml jy la mm mn mo lc mp mq mr le ms mt mu lg mv cg" data-selectable-paragraph="">Stash Individual Files</h1>
<p id="59cf" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km fc cg" data-selectable-paragraph=""><code class="jg kn ko kp kq b">git stash</code>&nbsp;is used frequently to momentarily set aside all<strong class="jt kr">&nbsp;</strong>uncommitted changes and reset the branch to the most recent commit. But what if you only want to stash specific files?</p>
<ul class="">
<li id="2f70" class="jr js fk jt b gi ju jv jw gl jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Command:&nbsp;</strong><code class="jg kn ko kp kq b">git stash push -- &lt;filepath(s)&gt;</code></li>
<li id="bce4" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Example:&nbsp;</strong><code class="jg kn ko kp kq b">git stash push -- src/index.js README.md</code></li>
</ul>
<h4 id="19d4" class="ks kt fk au ku kv kw gk kx ky kz gn la go lb gq lc gr ld gt le gu lf gw lg lh cg">
Resources</h4>
<ul class="">
<li id="3431" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km ls lt lu cg" data-selectable-paragraph=""><a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://stackoverflow.com/questions/3040833/stash-only-one-file-out-of-multiple-files-that-have-changed-with-git#comment78345399_3040833" rel="noopener nofollow">“Stash only one file out of multiple files that have changed with Git?” | Stack Overflow</a></li>
</ul>
</div>
</div>
</section>
<section class="fc fd fe ff fg">
<div class="n p">
<div class="ab ac ae af ag fh ai aj">
<h1 data-selectable-paragraph="">&nbsp;</h1>
<h1 id="203c" class="mh kt fk au ku mi mj jv kx mk ml jy la mm mn mo lc mp mq mr le ms mt mu lg mv cg" data-selectable-paragraph="">Show Content of Most Recent Stash</h1>
<p id="5555" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km fc cg" data-selectable-paragraph="">This one’s useful if you’d like to view the changes a stash would apply before applying them.</p>
<ul class="">
<li id="fae4" class="jr js fk jt b gi ju jv jw gl jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Command:&nbsp;</strong><code class="jg kn ko kp kq b">git stash show -p [stash@{&lt;n&gt;}]</code></li>
<li id="9591" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Explanation:<br />
</strong><code class="jg kn ko kp kq b">-p</code>&nbsp;says that we want to see the actual content of the stash. Omitting it will show only the file names.<br />
<code class="jg kn ko kp kq b"><a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://git-scm.com/docs/git-stash#Documentation/git-stash.txt-ltstashgt" rel="noopener nofollow">stash@{&lt;n&gt;}</a></code>&nbsp;allows us to specify a certain stash, denoted by&nbsp;<code class="jg kn ko kp kq b">n</code>&nbsp;(0 being the most recent one).</li>
<li id="452c" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Example:&nbsp;</strong><code class="jg kn ko kp kq b">git stash show -p stash@{1}</code></li>
<li id="fae7" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Effect:&nbsp;</strong>shows the content of the second latest stash</li>
</ul>
<h4 id="90a6" class="ks kt fk au ku kv kw gk kx ky kz gn la go lb gq lc gr ld gt le gu lf gw lg lh cg">
Resources</h4>
<ul class="">
<li id="fe22" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km ls lt lu cg" data-selectable-paragraph=""><a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://stackoverflow.com/a/10726185/4348037" rel="noopener nofollow">“See what’s in a stash without applying it” | Stash Overflow</a></li>
<li id="d5e1" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://git-scm.com/docs/git-stash#Documentation/git-stash.txt-ltstashgt" rel="noopener nofollow">git-stash | Git</a></li>
</ul>
</div>
</div>
</section>
<section class="fc fd fe ff fg">
<div class="n p">
<div class="ab ac ae af ag fh ai aj">
<h1 data-selectable-paragraph="">&nbsp;</h1>
<h1 id="bde6" class="mh kt fk au ku mi mj jv kx mk ml jy la mm mn mo lc mp mq mr le ms mt mu lg mv cg" data-selectable-paragraph="">Apply a Stash Without Deleting It From the Stash List</h1>
<p id="7f59" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km fc cg" data-selectable-paragraph="">Speaking of applying stashes,&nbsp;<code class="jg kn ko kp kq b">git stash pop</code>&nbsp;is usually the go-to command for this and, which will apply the first stash on the stash list (viewed with&nbsp;<code class="jg kn ko kp kq b">git stash list</code>). The side effect, though, is that the stash is removed from the list in the process. But if you’d like to keep it, Git has you covered.</p>
<ul class="">
<li id="a3a0" class="jr js fk jt b gi ju jv jw gl jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Command:&nbsp;</strong><code class="jg kn ko kp kq b">git stash apply</code></li>
<li id="74ca" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Effect:&nbsp;</strong>Applies the first stash on the list without removing it</li>
<li id="9672" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Tip:&nbsp;</strong>Just as with&nbsp;<code class="jg kn ko kp kq b">git stash show</code>, you can specify which stash to apply by appending&nbsp;<code class="jg kn ko kp kq b">stash@{&lt;n&gt;}</code></li>
</ul>
<h4 id="e416" class="ks kt fk au ku kv kw gk kx ky kz gn la go lb gq lc gr ld gt le gu lf gw lg lh cg">
Resources</h4>
<ul class="">
<li id="4f7b" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km ls lt lu cg" data-selectable-paragraph=""><a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://git-scm.com/docs/git-stash#Documentation/git-stash.txt-apply--index-q--quietltstashgt" rel="noopener nofollow">git-stash | Git</a></li>
</ul>
</div>
</div>
</section>
<section class="fc fd fe ff fg">
<div class="n p">
<div class="ab ac ae af ag fh ai aj">
<h1 data-selectable-paragraph="">&nbsp;</h1>
<h1 id="5036" class="mh kt fk au ku mi mj jv kx mk ml jy la mm mn mo lc mp mq mr le ms mt mu lg mv cg" data-selectable-paragraph="">Check Out File From Another Branch</h1>
<p id="cba5" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km fc cg" data-selectable-paragraph=""><code class="jg kn ko kp kq b">git checkout &lt;branch&gt;</code>&nbsp;is no stranger to most Git users. It does exactly what it says, in that it, well, checks out a specific branch. But if needed, the very same command can also be used to check out a single file.</p>
<ul class="">
<li id="603e" class="jr js fk jt b gi ju jv jw gl jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Command:</strong>&nbsp;<code class="jg kn ko kp kq b">git checkout &lt;branch&gt; -- &lt;path(s)&gt;</code></li>
<li id="7d7a" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Example:&nbsp;</strong><code class="jg kn ko kp kq b">git checkout my-awesome-feature src/lasers.js</code></li>
<li id="1770" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Effect:&nbsp;</strong>Checks out&nbsp;<code class="jg kn ko kp kq b">src/lasers.js</code>&nbsp;from&nbsp;<code class="jg kn ko kp kq b">my-awesome-feature</code></li>
<li id="a7bc" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Tip:&nbsp;</strong>You may also be familiar with&nbsp;<code class="jg kn ko kp kq b">git checkout &lt;commit&gt;</code>. This variant can be used in the same way to check out a file from a specific commit rather than a specific branch.</li>
</ul>
<h4 id="bf43" class="ks kt fk au ku kv kw gk kx ky kz gn la go lb gq lc gr ld gt le gu lf gw lg lh cg">
Resources</h4>
<ul class="">
<li id="60d8" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km ls lt lu cg" data-selectable-paragraph=""><a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://jasonrudolph.com/blog/2009/02/25/git-tip-how-to-merge-specific-files-from-another-branch/" rel="noopener nofollow">“Git tip: How to ‘merge’ specific files from another branch</a>”</li>
</ul>
</div>
</div>
</section>
<section class="fc fd fe ff fg">
<div class="n p">
<div class="ab ac ae af ag fh ai aj">
<h1 data-selectable-paragraph="">&nbsp;</h1>
<h1 id="df30" class="mh kt fk au ku mi mj jv kx mk ml jy la mm mn mo lc mp mq mr le ms mt mu lg mv cg" data-selectable-paragraph="">Work With Multiple Branches Simultaneously</h1>
<p id="e81b" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km fc cg" data-selectable-paragraph="">If you find yourself often having to checkout a specific branch, for example to use as a reference while working on another branch,&nbsp;<code class="jg kn ko kp kq b">git worktree</code>&nbsp;offers a better alternative.</p>
<ul class="">
<li id="9245" class="jr js fk jt b gi ju jv jw gl jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Command:&nbsp;</strong><code class="jg kn ko kp kq b">git worktree add &lt;path&gt; &lt;branch&gt;</code><br />
And when you no longer need it, run:<br />
<code class="jg kn ko kp kq b">git worktree remove [-f] &lt;path&gt;</code></li>
<li id="58cb" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Example:<br />
</strong>1.<code class="jg kn ko kp kq b">git worktree add my-other-awesome-feature ../my-other-awesome-feature</code><br />
2.&nbsp;<code class="jg kn ko kp kq b">git worktree remove ../my-other-awesome-feature</code></li>
<li id="93e4" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Explanation:&nbsp;</strong>Creates a&nbsp;<a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://git-scm.com/docs/git-worktree#_description" rel="noopener nofollow">linked working tree</a>&nbsp;(i.e., another directory on the file system associated with the repo) called&nbsp;<code class="jg kn ko kp kq b">my-other-awesome-feature</code>, one level above your current working directory, with the specified branch checked out.<br />
You could then, for example, open this directory in another code editor instance or open individual files from it in the current instance.<br />
Once you’re done with the linked working tree, removing it with<br />
<code class="jg kn ko kp kq b">-f</code>&nbsp;will force-remove working trees with uncommitted changes.</li>
</ul>
<h4 id="70ef" class="ks kt fk au ku kv kw gk kx ky kz gn la go lb gq lc gr ld gt le gu lf gw lg lh cg">
Resources</h4>
<ul class="">
<li id="bd87" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km ls lt lu cg" data-selectable-paragraph=""><a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://stackoverflow.com/a/30186843/4348037" rel="noopener nofollow">“git working on two branches simultaneously” | Stack Overflow</a></li>
<li id="994f" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://git-scm.com/docs/git-worktree" rel="noopener nofollow">git-worktree | Git</a></li>
</ul>
</div>
</div>
</section>
<section class="fc fd fe ff fg">
<div class="n p">
<div class="ab ac ae af ag fh ai aj">
<h1 data-selectable-paragraph="">&nbsp;</h1>
<h1 id="80a5" class="mh kt fk au ku mi mj jv kx mk ml jy la mm mn mo lc mp mq mr le ms mt mu lg mv cg" data-selectable-paragraph="">Show Commit Content</h1>
<p id="1b14" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km fc cg" data-selectable-paragraph="">Somewhat similar to&nbsp;<code class="jg kn ko kp kq b">git stash show</code>, it’s often useful to see the changes introduced by a specific commit.</p>
<ul class="">
<li id="5d38" class="jr js fk jt b gi ju jv jw gl jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Command:</strong>&nbsp;<code class="jg kn ko kp kq b">git show &lt;commit&gt;</code><br />
Alternatively, to see the changes between two specific commits run<br />
<code class="jg kn ko kp kq b">git diff &lt;commit-a&gt; &lt;commit-b&gt;</code></li>
<li id="898b" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Example:&nbsp;</strong><code class="jg kn ko kp kq b">git diff HEAD~ HEAD</code></li>
<li id="feee" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Effect:&nbsp;</strong>Shows the difference between&nbsp;<code class="jg kn ko kp kq b">HEAD</code>&nbsp;and its immediate ancestor, which is equivalent to&nbsp;<code class="jg kn ko kp kq b">git show</code></li>
</ul>
<h4 id="43ed" class="ks kt fk au ku kv kw gk kx ky kz gn la go lb gq lc gr ld gt le gu lf gw lg lh cg">
Resources</h4>
<ul class="">
<li id="06e3" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km ls lt lu cg" data-selectable-paragraph=""><a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://stackoverflow.com/questions/17563726/how-to-see-the-changes-in-a-git-commit/" rel="noopener nofollow">“How to see the changes in a Git commit?” | Stack Overflow</a></li>
<li id="ce97" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://github.blog/2020-12-17-commits-are-snapshots-not-diffs" rel="noopener nofollow">“Commits are snapshots, not diffs” | The GitHub Blog</a></li>
<li id="2dc2" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://git-scm.com/docs/git-log" rel="noopener nofollow">git-log | Git</a></li>
<li id="39de" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://git-scm.com/book/en/v2/Git-Basics-Viewing-the-Commit-History" rel="noopener nofollow">“Git Basics — Viewing the Commit History” | Git</a></li>
</ul>
</div>
</div>
</section>
<section class="fc fd fe ff fg">
<div class="n p">
<div class="ab ac ae af ag fh ai aj">
<h1 data-selectable-paragraph="">&nbsp;</h1>
<h1 id="e2ef" class="mh kt fk au ku mi mj jv kx mk ml jy la mm mn mo lc mp mq mr le ms mt mu lg mv cg" data-selectable-paragraph="">Compare Files Between Branches/Commits</h1>
<p id="d87f" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km fc cg" data-selectable-paragraph="">The power of&nbsp;<code class="jg kn ko kp kq b">git diff</code>&nbsp;isn’t just exclusive to whole commits, as we just saw, but can be used to target individual files.</p>
<ul class="">
<li id="f21c" class="jr js fk jt b gi ju jv jw gl jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Command:&nbsp;</strong><code class="jg kn ko kp kq b">git diff &lt;commit-a&gt; &lt;commit-b&gt; -- &lt;path(s)&gt;</code></li>
<li id="dffa" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Example:&nbsp;</strong><code class="jg kn ko kp kq b">git diff 0659bdc e6c7c0d -- src/flair.py</code></li>
<li id="68b4" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Effect:&nbsp;</strong>Shows how the file at one commit differs from the other.<br />
Branch names can also be used here instead of commits to compare the file across branches.</li>
<li id="2559" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Tip:&nbsp;</strong>To compare different files, use<br />
<code class="jg kn ko kp kq b">git diff &lt;commit-a&gt;:&lt;path-a&gt; &lt;commit-b&gt;:&lt;path-b&gt;</code></li>
</ul>
<h4 id="c2d9" class="ks kt fk au ku kv kw gk kx ky kz gn la go lb gq lc gr ld gt le gu lf gw lg lh cg">
Resources</h4>
<ul class="">
<li id="0e0f" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km ls lt lu cg" data-selectable-paragraph=""><a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://stackoverflow.com/questions/4099742/how-to-compare-files-from-two-different-branches" rel="noopener nofollow">“How to compare files from two different branches?” | Stack Overflow</a></li>
</ul>
</div>
</div>
</section>
<section class="fc fd fe ff fg">
<div class="n p">
<div class="ab ac ae af ag fh ai aj">
<h1 data-selectable-paragraph="">&nbsp;</h1>
<h1 id="691a" class="mh kt fk au ku mi mj jv kx mk ml jy la mm mn mo lc mp mq mr le ms mt mu lg mv cg" data-selectable-paragraph="">Reset a Single File to Most Recent Commit</h1>
<p id="c5c8" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km fc cg" data-selectable-paragraph=""><code class="jg kn ko kp kq b">git reset --hard</code>&nbsp;is a godsend when you need to go back to the last stable state, for example after some unwanted or unintended changes, but it affects the whole working tree. The command to achieve the same effect but localized to a file should come as no stranger, though.</p>
<ul class="">
<li id="685a" class="jr js fk jt b gi ju jv jw gl jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Command:&nbsp;</strong><code class="jg kn ko kp kq b">git checkout [&lt;commit&gt;] -- &lt;path(s)&gt;</code></li>
<li id="5839" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Example:&nbsp;</strong><code class="jg kn ko kp kq b">git checkout -- README.md</code></li>
<li id="83dc" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Effect:&nbsp;</strong>This will reset&nbsp;<code class="jg kn ko kp kq b">README.md</code>&nbsp;to the version in the most recent commit (or a specific commit if one is specified)</li>
</ul>
<h4 id="089e" class="ks kt fk au ku kv kw gk kx ky kz gn la go lb gq lc gr ld gt le gu lf gw lg lh cg">
Resources</h4>
<ul class="">
<li id="606a" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km ls lt lu cg" data-selectable-paragraph=""><a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://stackoverflow.com/questions/7147270/hard-reset-of-a-single-file" rel="noopener nofollow">“Hard reset of a single file” | Stack Overflow</a></li>
</ul>
</div>
</div>
</section>
<section class="fc fd fe ff fg">
<div class="n p">
<div class="ab ac ae af ag fh ai aj">
<h1 data-selectable-paragraph="">&nbsp;</h1>
<h1 id="a59f" class="mh kt fk au ku mi mj jv kx mk ml jy la mm mn mo lc mp mq mr le ms mt mu lg mv cg" data-selectable-paragraph="">Change Last Commit Message</h1>
<p id="36c0" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km fc cg" data-selectable-paragraph="">Ever committed changes only to later want to edit the commit message?</p>
<ul class="">
<li id="dcbd" class="jr js fk jt b gi ju jv jw gl jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Command:&nbsp;</strong><code class="jg kn ko kp kq b">git commit --amend [-m '&lt;message&gt;']</code><br />
If the old commit had already been pushed, you’ll need to additionally run<br />
<code class="jg kn ko kp kq b">git push --force-with-lease &lt;remote&gt; &lt;branch&gt;</code>.<code class="jg kn ko kp kq b"><br />
</code><strong class="jt kr">Note:&nbsp;</strong>As a general rule, and especially if you’re working with others, it’s important to be careful when making any changes to already pushed commits.</li>
<li id="4899" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Effect:&nbsp;</strong>Adds any staged changes to the last commit. If a message is included with the&nbsp;<code class="jg kn ko kp kq b">-m</code>&nbsp;option, the last commit’s message is replaced. Otherwise, this opens the editor at the last commit message.</li>
<li id="9e37" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Tip:&nbsp;</strong>As you can probably already tell,&nbsp;<code class="jg kn ko kp kq b">git commit --amend</code>&nbsp;can be used to change more than just the commit’s message. For example, making changes and committing them with the&nbsp;<code class="jg kn ko kp kq b">--amend</code>&nbsp;option will cause these changes to be added to the last commit rather than creating a new one.</li>
</ul>
<h4 id="58cc" class="ks kt fk au ku kv kw gk kx ky kz gn la go lb gq lc gr ld gt le gu lf gw lg lh cg">
Resources</h4>
<ul class="">
<li id="4ebd" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km ls lt lu cg" data-selectable-paragraph=""><a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://stackoverflow.com/a/15772171/4348037" rel="noopener nofollow">git-commit | Git</a></li>
<li id="622e" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://stackoverflow.com/a/8981216/4348037" rel="noopener nofollow">“Changing git commit message after push (given that no one pulled from remote)” | Stack Overflow</a></li>
</ul>
</div>
</div>
</section>
<section class="fc fd fe ff fg">
<div class="n p">
<div class="ab ac ae af ag fh ai aj">
<h1 data-selectable-paragraph="">&nbsp;</h1>
<h1 id="8065" class="mh kt fk au ku mi mj jv kx mk ml jy la mm mn mo lc mp mq mr le ms mt mu lg mv cg" data-selectable-paragraph="">Change a Specific Commit Message</h1>
<p id="ab85" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km fc cg" data-selectable-paragraph="">What about changing a specific<strong class="jt kr">&nbsp;</strong>commit message?</p>
<ul class="">
<li id="ee08" class="jr js fk jt b gi ju jv jw gl jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Command:&nbsp;</strong><code class="jg kn ko kp kq b">git rebase -i &lt;commit&gt;</code></li>
<li id="9010" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Example (see demo below):&nbsp;</strong><code class="jg kn ko kp kq b">git rebase -i HEAD~3</code></li>
<li id="c39b" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Effect:&nbsp;</strong>Opens an editor listing commits, starting from the one specified up to the current one. In the example above, this list will be made up of the last three commits.<br />
Replacing&nbsp;<code class="jg kn ko kp kq b">pick</code>&nbsp;with&nbsp;<code class="jg kn ko kp kq b">reword</code>&nbsp;for those commits where you wish to change the message and saving will allow you to do just that.<br />
<strong class="jt kr">Note:&nbsp;</strong>The actual changes are made in the next step. Changing the messages at this point will have no effect!</li>
</ul>
</div>
</div>
<div class="iw">&nbsp;</div>
<div class="n p">
<div class="ab ac ae af ag fh ai aj">
<h4 id="d1d6" class="ks kt fk au ku kv kw gk kx ky kz gn la go lb gq lc gr ld gt le gu lf gw lg lh cg">Resources</h4>
<ul class="">
<li id="a846" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km ls lt lu cg" data-selectable-paragraph=""><a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://stackoverflow.com/questions/1884474/change-old-commit-message-on-git" rel="noopener nofollow">“Change old commit message on Git” | Stack Overflow</a></li>
</ul>
</div>
</div>
</section>
<section class="fc fd fe ff fg">
<div class="n p">
<div class="ab ac ae af ag fh ai aj">
<h1 data-selectable-paragraph="">&nbsp;</h1>
<h1 id="708c" class="mh kt fk au ku mi mj jv kx mk ml jy la mm mn mo lc mp mq mr le ms mt mu lg mv cg" data-selectable-paragraph="">Delete Last Commit but Keep the Changes</h1>
<p id="e4de" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km fc cg" data-selectable-paragraph="">You’ve committed changes that you’d like to keep, but for whatever reason, you don’t want the commit itself. Fret not!</p>
<ul class="">
<li id="631f" class="jr js fk jt b gi ju jv jw gl jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Command:&nbsp;</strong><code class="jg kn ko kp kq b">git reset HEAD^<br />
</code><strong class="jt kr">Note:&nbsp;</strong>The warning about making changes to already pushed commits holds here too!</li>
<li id="273a" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Effect:&nbsp;</strong>Moves&nbsp;<code class="jg kn ko kp kq b">HEAD</code>&nbsp;to point to the previous commit without making any file changes, effectively removing the current commit</li>
<li id="898d" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Tip:&nbsp;</strong>An alternative to this approach is to wait till you’re ready for your next commit and instead of doing so with the usual&nbsp;<code class="jg kn ko kp kq b">git commit</code>, using our old friend&nbsp;<code class="jg kn ko kp kq b">git commit --amend</code>. This will have the same intended effect.</li>
</ul>
<h4 id="3e4a" class="ks kt fk au ku kv kw gk kx ky kz gn la go lb gq lc gr ld gt le gu lf gw lg lh cg">
Resources</h4>
<ul class="">
<li id="947b" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km ls lt lu cg" data-selectable-paragraph=""><a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://stackoverflow.com/a/15772171/4348037" rel="noopener nofollow">“Can I delete a git commit but keep the changes?” | Stack Overflow</a></li>
</ul>
</div>
</div>
</section>
<section class="fc fd fe ff fg">
<div class="n p">
<div class="ab ac ae af ag fh ai aj">
<h1 data-selectable-paragraph="">&nbsp;</h1>
<h1 id="07ff" class="mh kt fk au ku mi mj jv kx mk ml jy la mm mn mo lc mp mq mr le ms mt mu lg mv cg" data-selectable-paragraph="">Unstage a File</h1>
<p id="071d" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km fc cg" data-selectable-paragraph="">What’s the opposite of&nbsp;<code class="jg kn ko kp kq b">git add</code>? I’ll give you a hint. It’s not&nbsp;<code class="jg kn ko kp kq b">git remove</code>.</p>
<ul class="">
<li id="5927" class="jr js fk jt b gi ju jv jw gl jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Command:&nbsp;</strong><code class="jg kn ko kp kq b">git reset HEAD &lt;path&gt;</code></li>
<li id="4e18" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Effect:&nbsp;</strong>Removes the given file from the index. This is useful for when you’re preparing your next commit and decide a file you’d previously staged with&nbsp;<code class="jg kn ko kp kq b">git add</code>&nbsp;should no longer be part of it. This&nbsp;<em class="ni">doesn’t</em>&nbsp;affect the file itself. So you don’t have to worry about breaking anything.</li>
</ul>
<h4 id="d657" class="ks kt fk au ku kv kw gk kx ky kz gn la go lb gq lc gr ld gt le gu lf gw lg lh cg">
Resources:</h4>
<ul class="">
<li id="f41c" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km ls lt lu cg" data-selectable-paragraph=""><a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://docs.gitlab.com/ee/university/training/topics/unstage.html" rel="noopener nofollow">Unstage | GitLab</a></li>
<li id="64c3" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://git-scm.com/book/en/v2/Git-Tools-Reset-Demystified" rel="noopener nofollow">“Git Tools — Reset Demystified” | Git</a></li>
</ul>
</div>
</div>
</section>
<section class="fc fd fe ff fg">
<div class="n p">
<div class="ab ac ae af ag fh ai aj">
<h1 data-selectable-paragraph="">&nbsp;</h1>
<h1 id="9807" class="mh kt fk au ku mi mj jv kx mk ml jy la mm mn mo lc mp mq mr le ms mt mu lg mv cg" data-selectable-paragraph="">Remove Ignored Files From Remote</h1>
<p id="f04a" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km fc cg" data-selectable-paragraph="">If you’ve pushed files and later decided to&nbsp;<code class="jg kn ko kp kq b">.gitignore</code>&nbsp;them, the files will nevertheless persist in your remote repository. To remedy this,&nbsp;<code class="jg kn ko kp kq b">git rm</code>&nbsp;is the tool for the job.</p>
<ul class="">
<li id="f742" class="jr js fk jt b gi ju jv jw gl jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Command:&nbsp;</strong><code class="jg kn ko kp kq b">git rm [-r] [-n] --cached &lt;path(s)&gt;</code>.<br />
Then, simply&nbsp;<code class="jg kn ko kp kq b">add</code>,&nbsp;<code class="jg kn ko kp kq b">commit</code>, and&nbsp;<code class="jg kn ko kp kq b">push</code>.</li>
<li id="3260" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Explanation:</strong><br />
<code class="jg kn ko kp kq b">--cached</code>&nbsp;ensures the files remain in the working tree.<br />
<code class="jg kn ko kp kq b">-n</code>&nbsp;performs a dry run, essentially a sanity check that allows you to first see which files will be affected before actually executing the command. If you’re happy with the results, simply run the command again without it.<br />
<code class="jg kn ko kp kq b">-r</code>&nbsp;is used in case folders are being removed to allow for recursive removal.</li>
<li id="a25b" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Example:<br />
</strong>(1)&nbsp;<code class="jg kn ko kp kq b">git rm -r -n --cached .</code>&nbsp;(check files affected)<br />
(2)&nbsp;<code class="jg kn ko kp kq b">git rm -r --cached .</code><br />
(3)&nbsp;<code class="jg kn ko kp kq b">git add .</code><br />
(4)&nbsp;<code class="jg kn ko kp kq b">git commit -m "Remove ignored files"</code><br />
(5)&nbsp;<code class="jg kn ko kp kq b">git push</code></li>
<li id="5380" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Effect:&nbsp;</strong>This is an aggressive but useful form of the command. The result is that your repo will be purged of any files contained in your&nbsp;<code class="jg kn ko kp kq b">.gitignore</code>&nbsp;without you having to explicitly list every single one.</li>
</ul>
<h4 id="6aa0" class="ks kt fk au ku kv kw gk kx ky kz gn la go lb gq lc gr ld gt le gu lf gw lg lh cg">
Resources</h4>
<ul class="">
<li id="0443" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km ls lt lu cg" data-selectable-paragraph=""><a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://stackoverflow.com/questions/1274057/how-to-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore" rel="noopener nofollow">“How to make Git ‘forget’ about a file that was tracked but is now in .gitignore?” | Stack Overflow</a></li>
<li id="bb72" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://www.codeblocq.com/2016/01/Untrack-files-already-added-to-git-repository-based-on-gitignore" rel="noopener nofollow">“Untrack files already added to git repository based on .gitignore” | CodeBlocQ</a></li>
<li id="292b" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://stackoverflow.com/questions/5798930/git-rm-cached-x-vs-git-reset-head-x" rel="noopener nofollow">“‘git rm &#8211;cached x’ vs ‘git reset head &#8212; x’?” | Stack Overflow</a></li>
</ul>
</div>
</div>
</section>
<section class="fc fd fe ff fg">
<div class="n p">
<div class="ab ac ae af ag fh ai aj">
<h1 data-selectable-paragraph="">&nbsp;</h1>
<h1 id="c0f6" class="mh kt fk au ku mi mj jv kx mk ml jy la mm mn mo lc mp mq mr le ms mt mu lg mv cg" data-selectable-paragraph="">Create GitHub Releases</h1>
<p id="68d7" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km fc cg" data-selectable-paragraph="">Finally, this one’s not strictly a Git command per se but one offered by the GitHub CLI. So you’ll first have to <a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://cli.github.com/" rel="noopener nofollow">download</a>&nbsp;it if you haven’t already.</p>
<ul class="">
<li id="16d1" class="jr js fk jt b gi ju jv jw gl jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Command:&nbsp;</strong><code class="jg kn ko kp kq b">gh release create &lt;version&gt;</code></li>
<li id="7972" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Example (see demo below):&nbsp;</strong><code class="jg kn ko kp kq b">gh release create v0.3</code></li>
<li id="789c" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Effect:</strong>&nbsp;This will open up an interactive command-line menu guiding you through the process of creating your release. The result will be a GitHub release created from the provided version&nbsp;<a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://git-scm.com/book/en/v2/Git-Basics-Tagging" rel="noopener nofollow">tag</a>&nbsp;(a new tag will be created if no such tag exists in your repo).</li>
</ul>
</div>
</div>
<div class="iw">&nbsp;</div>
<div class="n p">
<div class="ab ac ae af ag fh ai aj">
<ul class="">
<li id="e419" class="jr js fk jt b gi ju jv jw gl jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km ls lt lu cg" data-selectable-paragraph=""><strong class="jt kr">Tip:&nbsp;</strong>At the&nbsp;<code class="jg kn ko kp kq b">Release notes</code><em class="ni">&nbsp;</em>prompt<em class="ni">,&nbsp;</em>choose&nbsp;<code class="jg kn ko kp kq b">Write using commit log as template</code>&nbsp;to have a nice starting point for meaningful release notes. It’s a good idea to run&nbsp;<code class="jg kn ko kp kq b">git fetch --all --tags</code>&nbsp;beforehand to ensure that only commits since the last tag are included in the template.<br />
If an editor other than your default is opened, use&nbsp;<code class="jg kn ko kp kq b">gh config set editor &lt;editor&gt;</code>&nbsp;to set it to one of your choosing — e.g.,&nbsp;<code class="jg kn ko kp kq b">gh config set editor nano</code>.</li>
</ul>
<h4 id="de5b" class="ks kt fk au ku kv kw gk kx ky kz gn la go lb gq lc gr ld gt le gu lf gw lg lh cg">
Resources</h4>
<ul class="">
<li id="44fb" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km ls lt lu cg" data-selectable-paragraph=""><a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://cli.github.com/manual/gh_release_create" rel="noopener nofollow">gh release create | GitHub CLI</a></li>
<li id="cd65" class="jr js fk jt b gi lv jv jw gl lw jy jz ka lx kc kd ke ly kg kh ki lz kk kl km ls lt lu cg" data-selectable-paragraph=""><a class="cm jq md-opjjpmhoiojifppkkcdabiobhakljdgm_doc" href="https://cli.github.com/manual/gh_config_set" rel="noopener nofollow">gh config set | GitHub CLI</a></li>
</ul>
</div>
</div>
</section>
<section class="fc fd fe ff fg">
<div class="n p">
<div class="ab ac ae af ag fh ai aj">
<h1 id="98ee" class="mh kt fk au ku mi mj jv kx mk ml jy la mm mn mo lc mp mq mr le ms mt mu lg mv cg" data-selectable-paragraph="">Conclusion</h1>
<p id="1b0d" class="jr js fk jt b gi ln jv jw gl lo jy jz ka lp kc kd ke lq kg kh ki lr kk kl km fc cg" data-selectable-paragraph="">How many of these commands did you know off the top of your head, and what are some other lesser-known yet powerful commands that you use?</p>
</div>
</div>
</section>
<p>The post <a href="http://kostacipo.stream/git-commands-to-live-by-beyond-git-basics/">Git Commands to Live By &#8211; Beyond Git basics</a> appeared first on <a href="http://kostacipo.stream">Tech Chronicles</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://kostacipo.stream/git-commands-to-live-by-beyond-git-basics/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>10 Visual Studio Code Shortcuts that will boost your productivity</title>
		<link>http://kostacipo.stream/10-visual-studio-code-shortcuts-that-will-boost-your-productivity/</link>
					<comments>http://kostacipo.stream/10-visual-studio-code-shortcuts-that-will-boost-your-productivity/#respond</comments>
		
		<dc:creator><![CDATA[Majordomo]]></dc:creator>
		<pubDate>Tue, 17 Nov 2020 17:35:53 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[visual studio]]></category>
		<guid isPermaLink="false">http://www.kostacipo.stream/?p=1889</guid>

					<description><![CDATA[<p>1. Command Palette The command palette is one of the most foundational of all VS Code shortcuts. It’s the shortcut that gives you access to all of the functionality of VS Code. MacOS: Command + Shift + P Windows: Ctrl + Shift + P 2. Duplicate Line Down/Up This is a shortcut I use a [&#8230;]</p>
<p>The post <a href="http://kostacipo.stream/10-visual-studio-code-shortcuts-that-will-boost-your-productivity/">10 Visual Studio Code Shortcuts that will boost your productivity</a> appeared first on <a href="http://kostacipo.stream">Tech Chronicles</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3>1. Command Palette</h3>
<p>The command palette is one of the most foundational of all VS Code shortcuts. It’s the shortcut that gives you access to all of the functionality of VS Code.</p>
<figure class="textcenter"><img decoding="async" class="gm-loaded gm-observing gm-observing-cb" src="https://travismedia.gumlet.io/content/images/2019/12/vs-code-shortcuts-command-palette-comp.gif?w=800&amp;dpr=1.0" alt="vs code shortcuts command palette comp"></figure>
<p class="has-background"><strong>MacOS:</strong> Command + Shift + P<br />
<strong>Windows:</strong> Ctrl + Shift + P</p>
<h3>2. Duplicate Line Down/Up</h3>
<p>This is a shortcut I use a lot in my workflow to boost productivity. Basically, you can take a line of code and duplicate it on the line above or below. This is helpful with single lines like &lt;li&gt; tags and also with whole blocks of code like a CSS block or JS function.</p>
<figure class="textcenter"><img decoding="async" class="gm-loaded gm-observing gm-observing-cb" src="https://travismedia.gumlet.io/content/images/2019/12/vs-code-shortcuts-duplicate-line-comp.gif?w=800&amp;dpr=1.0" alt="vs code shortcuts duplicate line comp"></figure>
<p class="has-background"><strong>MacOS:</strong> Shift + Option + Up / Shift + Option + Down<br />
<strong>Windows:</strong> Shift + Alt + Up /&nbsp;Shift + Alt + Down</p>
<h3>3. Move Line Down/Up</h3>
<p>Similar to the shortcut above, but this moves the line of code up or down. Again helpful with single lines like reordering &lt;li&gt; tags as well as blocks of code.</p>
<figure class="textcenter"><img decoding="async" class="gm-loaded gm-observing gm-observing-cb" src="https://travismedia.gumlet.io/content/images/2019/12/vs-code-shortcuts-move-line-comp.gif?w=800&amp;dpr=1.0" alt="vs code shortcuts move line comp"></figure>
<p class="has-background"><strong>MacOS:</strong> Option + Up / Option + Down<br />
<strong>Windows:</strong> Alt + Up / Alt + Down</p>
<h3>4. Indent / Outdent Line</h3>
<p>Another of the very helpful VS Code shortcuts and one to memorize. When you copy and paste something in Visual Studio Code, it doesn’t always line up right (actually it rarely does). This shortcut allows you to indent or outdent a line or even an entire block of code.&nbsp;</p>
<figure class="textcenter"><img decoding="async" class="gm-loaded gm-observing gm-observing-cb" src="https://travismedia.gumlet.io/content/images/2019/12/vs-code-shortcuts-indent-comp.gif?w=800&amp;dpr=1.0" alt="vs code shortcuts indent comp"></figure>
<p class="has-background"><strong>MacOS:</strong> Command + ] / Command + [<br />
<strong>Windows:</strong>&nbsp;Ctrl + ] / Ctrl + [</p>
<h3>5. Multi-Select Selection</h3>
<p>So you decide to change all of the H3 tags on your template to H4 tags. So you go through and select each one and change it? No. You multi-select them all and change them all in one take.</p>
<p>In that example you would highlight just one H3 tag, and as you hit the shortcut below it goes through and selects the other instaces of that tag, providing you an active cursor with each one.</p>
<p>Of all the VS Code shortcuts this is one of my favorites and will boost your productivity.</p>
<figure class="textcenter"><img decoding="async" class="gm-loaded gm-observing gm-observing-cb" src="https://travismedia.gumlet.io/content/images/2019/12/vs-code-shortcuts-multiselect-comp.gif?w=800&amp;dpr=1.0" alt="vs code shortcuts multiselect comp"></figure>
<p class="has-background"><strong>MacOS:</strong> Command + D (to select next occurrence(s) after you make an initial selection)<br />
<strong>Windows:</strong>&nbsp;Ctrl + D (to select next occurrence(s) after you make an initial selection).<br />
* There is a shortcut to select ALL occurrences, but I like to go through them one by one to be sure I want to change that one.</p>
<figure class="textcenter"></figure>
<h3>6. Multi-Select Cursor</h3>
<p>Similar to the above, but instead of selecting the next occurrences of a selection, you can place your cursor in multiple locations, and make edits to all and one time.</p>
<figure class="textcenter"><img decoding="async" class="gm-loaded gm-observing gm-observing-cb" src="https://travismedia.gumlet.io/content/images/2019/12/vs-code-shortcuts-multi-select-cursor-comp.gif?w=800&amp;dpr=1.0" alt="vs code shortcuts multi select cursor comp"></figure>
<p class="has-background"><strong>MacOS:</strong> Option + Click<br />
<strong>Windows:</strong>&nbsp;Alt + Click</p>
<h3>7. Toggle Line Comment</h3>
<p>So we use line comments to “disable” a line or block of code or HTML or CSS right?</p>
<p>This Visual Studio Code shortcut allows you to disable a line or block of code by commenting it out. You can also use it again to re-enable that line or block of code by removing the comment markup.</p>
<figure class="textcenter"><img decoding="async" class="gm-loaded gm-observing gm-observing-cb" src="https://travismedia.gumlet.io/content/images/2019/12/vs-code-shortcuts-comment-disable-comp.gif?w=800&amp;dpr=1.0" alt="vs code shortcuts comment disable comp"></figure>
<p class="has-background"><strong>MacOS:</strong> Command + /<br />
<strong>Windows:</strong>&nbsp;Ctrl + /</p>
<h3>8. Show / Hide Terminal</h3>
<p>I almost exclusively use the VS Code Integrated terminal and rarely ever the OS Terminal. So of all the VS Code shortcuts, this is especially useful for me and for you if you do the same.</p>
<figure class="textcenter"><img decoding="async" class="gm-loaded gm-observing gm-observing-cb" src="https://travismedia.gumlet.io/content/images/2019/12/vs-code-shortcuts-toggle-terminal-comp.gif?w=800&amp;dpr=1.0" alt="vs code shortcuts toggle terminal comp"></figure>
<p class="has-background"><strong>MacOS:</strong> Control + ̀<br />
<strong>Windows:</strong>&nbsp;Ctrl + ̀</p>
<h3>9. Add Line Comment</h3>
<p>Adding a line comment to HTML and CSS is somewhat cumbersome to type out.&nbsp;</p>
<p>Thankfully VS Code has a shortcut to pop it in there for you. Use your right hand to hit the K and left to this the C while holding Command.</p>
<figure class="textcenter"><img decoding="async" class="wp-image-6710 gm-loaded gm-observing gm-observing-cb" src="https://travismedia.gumlet.io/content/images/2019/12/vs-code-shortcuts-comments-comp.gif?w=800&amp;dpr=1.0" alt="vs code shortcuts comments comp"></figure>
<p class="has-background"><strong>MacOS:</strong> Command + K Command + C<br />
<strong>Windows:</strong>&nbsp;Ctrl + K Ctrl + C</p>
<h3>10. Toggle Sidebar</h3>
<p>Of all the VS Code shortcuts, this is another major one for me. I don’t like that sidebar there when I’m writing code. At the same time, when I need it back, I want it back with ease.</p>
<figure class="textcenter"><img decoding="async" class="gm-loaded gm-observing gm-observing-cb" src="https://travismedia.gumlet.io/content/images/2019/12/vs-code-shortcuts-toggle-sidebar-comp.gif?w=800&amp;dpr=1.0" alt="vs code shortcuts toggle sidebar comp"></figure>
<p class="has-background"><strong>MacOS:</strong> Command + B<br />
<strong>Windows:</strong>&nbsp;Ctrl + B</p>
<h3>More Info</h3>
<p>Visual studio code can be downloaded <a href="https://code.visualstudio.com/download" target="_blank" rel="noreferrer noopener" aria-label="Visual studio code can be downloaded at the website. (opens in a new tab)">at their website</a>. It’s my favorite code editor and I use it exclusively. VS Code is also a full IDE, is packed with loads of features, extensions, is free, and thankfully open source.</p>
<h3>Conclusion</h3>
<p>Take the time to memorize these VS Code extensions and incorporate them into your workflow. You will surely find a boost in your productivity and your efficiency as a programmer.</p>
<p>The post <a href="http://kostacipo.stream/10-visual-studio-code-shortcuts-that-will-boost-your-productivity/">10 Visual Studio Code Shortcuts that will boost your productivity</a> appeared first on <a href="http://kostacipo.stream">Tech Chronicles</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://kostacipo.stream/10-visual-studio-code-shortcuts-that-will-boost-your-productivity/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Reverse Engineering</title>
		<link>http://kostacipo.stream/reverse-engineering/</link>
					<comments>http://kostacipo.stream/reverse-engineering/#respond</comments>
		
		<dc:creator><![CDATA[Majordomo]]></dc:creator>
		<pubDate>Sat, 07 Nov 2020 13:33:49 +0000</pubDate>
				<category><![CDATA[Data]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[reverse engineering]]></category>
		<guid isPermaLink="false">http://www.kostacipo.stream/?p=1869</guid>

					<description><![CDATA[<p>Reverse engineering as a part of software engineering The term reverse engineering, refers to the disassembling of an object, following a thorough examination of its composition/construction so to understand how it works to duplicate or upgrade the object. Taken by older industries, the practice of reverse engineering is now widely used in the software engineering [&#8230;]</p>
<p>The post <a href="http://kostacipo.stream/reverse-engineering/">Reverse Engineering</a> appeared first on <a href="http://kostacipo.stream">Tech Chronicles</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2 style="text-align: left;"><strong>Reverse engineering as a part of software engineering</strong></h2>
<p style="text-align: justify;">The term reverse engineering, refers to the disassembling of an object, following a thorough examination of its composition/construction so to understand how it works to duplicate or upgrade the object.</p>
<p style="text-align: justify;">Taken by older industries, the practice of reverse engineering is now widely used in the software engineering sector.</p>
<p style="text-align: justify;">In this digital-information age, reverse engineering has become a tool that can be used as a way to create compatible products that are cheaper than the existing ones or even free in some cases, uniquely modify the software, and exchange knowledge as a result into making better, more reliable and secure products.</p>
<p style="text-align: justify;">Can be applied to various aspects of both software, and hardware development to understand how they behave under various conditions, to retrieve the source code that was lost, fix issues, to adapt existing software programs with new hardware, etc.</p>
<p style="text-align: justify;">The use of reverse engineering is also greatly exercised to identify malicious content in the source code of a software, such as viruses, or to expose security flaws(backdoors, virus, misconfigurations) and address possible privacy issues.</p>
<p style="text-align: justify;">Researchers can also use this technique to reverse engineer malware to understand how it works to nullify its properties, identify the potential owner, and use the knowledge gained to update their virus databases and prepare mitigation measures for future malware attacks.</p>
<h3 style="text-align: justify;"><strong>Legalities of Reverse Engineering</strong></h3>
<p style="text-align: justify;">The law is not discouraging from taking apart the products available from almost any of the technologies that exist, including electronic, chemical, mechanical, software engineering, etc.</p>
<p style="text-align: justify;">&nbsp;Although reverse engineering a prototype or a source code of a program prior to its release will result in legal consequences of its proven to be so.</p>
<p style="text-align: justify;"><strong>Patent law</strong>&nbsp;is one of the laws that protect inventions where it prevents other parties from copying an invention, to reverse engineer it.&nbsp;</p>
<p style="text-align: justify;">&nbsp;In return, if the product is disclosed as a patent, the developer must reveal all the technical details.</p>
<p style="text-align: justify;">The supreme court of the United States of America though, established standards that prevent many software inventions from being eligible in the first place for patent protection.</p>
<p style="text-align: justify;"><strong>Copyright law</strong>&nbsp;protects software from both direct copying and close paraphrasing. The law protects details like software graphics, interface design, file structure, and organization, etc.</p>
<p style="text-align: justify;">The copyright law also protects the software code from being reconstructed, a third party can break the law when copying the key elements of the original software, even if it doesn’t include the original code line by line.</p>
<p style="text-align: justify;">However, the developer has to disclose the source code as a part of the registration process.</p>
<p style="text-align: justify;">A downside of this law is when a case is opened about potential copyright violation, the developer must be able to prove that the copier had access to its source code while proving that the copied code is similar to his.</p>
<h3 style="text-align: justify;"><strong>Reverse Engineering Tools Overview</strong></h3>
<p style="text-align: justify;">Reverse engineering tools are a must for the “library” of a hacker, software developer, and a security researcher.</p>
<p style="text-align: justify;">&nbsp;Using reverse engineering, hackers can compromise any security system, the use of those reverse engineering programs can allow them to manipulate data into a useful form, thanks to the development of digitizing devices.</p>
<p style="text-align: justify;">Reverse engineering to be achieved at its highest needs the appropriate knowledge combined with the proper tools.</p>
<p style="text-align: justify;">There are a variety of reverse engineering tools and can be divided into categories for their various uses which can be tracking the application running in real times, dissect binary codes into assembly codes, view, and edit binaries or embedded resources in EXE files, etc.</p>
<p style="text-align: justify;"><strong>Disassemblers and Decompilers</strong></p>
<p style="text-align: justify;">When a user knows what he/she is dealing with, meaning what programming language and compiler the intended software uses can start analyzing it, their task is to analyze compiled, binary file and display its source code’s structure in such a way a human can understand it.</p>
<p style="text-align: justify;">By extracting strings, functions, libraries, etc., a user can know what fragments of code references to them and what functions of the operating system are used by the program along with what functions are exported.</p>
<p style="text-align: justify;">Disassemblers can show us what the object code of the program in the form of x64 or x86, by analyzing what high-level language the program is compiled to.</p>
<p style="text-align: justify;">Decompilers use is for recreating the original high-level code from the code that the program is compiled.</p>
<p style="text-align: justify;"><strong>Debuggers</strong></p>
<p style="text-align: justify;">Debuggers by supporting CPU registers, hex dumping of programs, and more, can help programmers to track application running in real-time, observe how certain instructions affect the contents of memory, edit assembly codes in real-time and detect possible errors/”bugs”.<strong><br />
</strong></p>
<p style="text-align: justify;">When the program is open source, debugging a high-level code can be easy compared to when you don’t have access to the source code.</p>
<p style="text-align: justify;">Dedicated debuggers performing advance analysis of binary application structures can solve this issue but, in the end, their use requires knowledge of low-level languages as well as the functioning of the processor for which the program was compiled to.</p>
<p style="text-align: justify;"><strong>Hex Editors </strong></p>
<p style="text-align: justify;">Can allow the developer to view or edit binaries in order to make corrections or fixes etc., according to software requirements.</p>
<p style="text-align: justify;">Hex editor makes it possible to manipulate the fundamental binary data that makes up a computer file.</p>
<p style="text-align: justify;">There is a variety of hex editors base on their different functions and applications, some allowing them to visually display the internal structure of a file.</p>
<p style="text-align: justify;"><strong>Resource editors</strong></p>
<p style="text-align: justify;">Windows applications resources like icons, images, localized texts, version information, etc., can be saved in PE files within the resources area.</p>
<p style="text-align: justify;">Resource editors allow the view and edit of the resources that are embedded in the EXE file.</p>
<p style="text-align: justify;">As all application files are saved in an EXE or DLL format, when a developer needs to change some data the application, as long as their size remains unchanged, you can edit them using the hex editor.</p>
<p style="text-align: justify;">When their size (bigger images, longer text) needs to be changed or there is a need to add new data, is then where a resource editor comes in use for the developer.</p>
<p style="text-align: justify;"><strong>Identifiers</strong></p>
<p style="text-align: justify;">Identifiers can help when we are not so sure about how the intended program is created, it can distinguish features lie, section names, imported libraries, etc.</p>
<p style="text-align: justify;">Using the identifiers analysis, which includes a signature base to identify compilers, cryptographic libraries, security systems, etc., developers can decide what their next step should be(e.g. unpacking the application).</p>
<p style="text-align: justify;"><strong>Virtual environments</strong></p>
<p style="text-align: justify;">Can be used to analyze unknown/suspicious software programs.</p>
<p style="text-align: justify;">By running the unknown program in an uncontrolled environment, can cause irreversible damage if the program runs a payload in the background, so the use of a virtual environment, is a must when we are dealing with an unknown software so we can be safe running and analyzing it first in that environment.</p>
<h3 style="text-align: justify;"><strong>Reverse Engineering Hacking Tools</strong></h3>
<p style="text-align: justify;"><strong>Ghidra</strong></p>
<p style="text-align: justify;">In 2017, Wikileaks released Vault 7, a substantial collection of material about CIA/NSA cyber-activities along with series of documents, Ghidra became known.</p>
<p style="text-align: justify;">In 2019, NSA officially released the source code of the reverse engineering framework which was developed in the US.</p>
<p style="text-align: justify;">Its suite includes tools for analyzing compiled code on various platforms like Windows, Mac OS, and Linux.</p>
<p style="text-align: justify;">It can be run in both user-interface or command line mode, while It’s GUI is designed for less expert users and features assembler, disassembler, decompiler, and other features including processor instruction sets and executable formats.</p>
<p style="text-align: justify;">Its headless mode enables reverse engineer at scale or if it is used as a server to enable group collaboration when dealing with larger binaries.</p>
<p style="text-align: justify;">A basic programming experience, along with some knowledge of assembly language is required.</p>
<p style="text-align: justify;">When decompiling a code, if you select a portion of the assembly, it automatically highlights in the decompiler window the decompiled code, providing a good way of understanding how high-level code matches the disassembled code.</p>
<p style="text-align: justify;"><strong>Getting Started with Ghidra</strong></p>
<p style="text-align: justify;">Ghidra, in order to run, requires Java along with&nbsp;<a href="https://www.oracle.com/java/technologies/javase-jdk11-downloads.html">Java SE Development Kit 11</a>&nbsp;to be installed on the intended device.</p>
<p style="text-align: justify;">Upon opening the program Ghidra provides TIP of the day that can be useful for new users or even experienced users, providing with something of new information about the usage of the program.</p>
<p style="text-align: justify;"><strong>Features of Ghidra</strong></p>
<p style="text-align: justify;"><strong>Context Help</strong></p>
<p style="text-align: justify;">Ghidra comes with a contextual menu, by hovering over the most interface elements and pressing F1, a pop-up window with the help menu appears providing the user with more information about the element.</p>
<p style="text-align: justify;"><strong>Organize project sections</strong></p>
<p style="text-align: justify;">Ghidra can organize your project sections of disassembly code in various ways, just by hitting right click on the folder of your project, select “Modularize By” and choose between “Subroutine”, “Complexity Depth” or “Dominance”.</p>
<p style="text-align: justify;">The next window under “Program Trees” is “Symbol Tree” which enables viewing import, export, functions, labels, classes, and namespaces of a binary file.</p>
<p style="text-align: justify;"><strong>Listing Window</strong></p>
<p style="text-align: justify;">“Listing” window. Here you can see the reverse-engineered code.&nbsp;</p>
<p style="text-align: justify;">Users can configure the listing fields by clicking on the icon “Edit the listing fields” in the top right corner and then the “Instruction/Data” tab.&nbsp;</p>
<p style="text-align: justify;">Any element of the listing interface may be changed, relocated, disabled, or removed.</p>
<p style="text-align: justify;"><strong>Loading an executable</strong></p>
<p style="text-align: justify;">Support drag and drop function, a file can be loaded by dropping it into the projected window of Ghidra, launching a dialog box where a format is selected, destination folder, and the name of the program.</p>
<p style="text-align: justify;">Import results summary information appears once the file is imported.</p>
<p style="text-align: justify;">If the file is not analyzed, a list of Analyzers will appear in order for the user to enable various analyzers depending on the format of the file.</p>
<p style="text-align: justify;"><strong>Modifying Display Elements </strong></p>
<p style="text-align: justify;">By using CodeBrowser for reviewing the target file, Ghidra offers customizable display elements(where it can help to enhance readability for the user) and various options where can be accessed by clicking edit on the top menu, and then selecting tool options.<strong><br />
</strong></p>
<p style="text-align: justify;"><strong>Suggested environment changes:</strong></p>
<p style="text-align: justify;"><strong>Listing Display:</strong>&nbsp;Can increase the font size and enable bold formatting for easier reading.</p>
<p style="text-align: justify;"><strong>Listing Fields – Bytes Field</strong>: Change “Maximum Lines to Display” to 1 to simplify spacing between lines of assembly code.</p>
<p style="text-align: justify;"><strong>Listing Fields – Cursor Text Highlight</strong>: “Mouse Button to Activate”, change to left.</p>
<p style="text-align: justify;">It will highlight all instances of the selected text when the left mouse button is clicked — similarly to other disassemblers.</p>
<p style="text-align: justify;"><strong>Listing Fields – EOL Comments Field</strong>: Check “Show Semicolon at Start of Each Line” to better separate the assembly text from inserted comments</p>
<p style="text-align: justify;"><strong>Listing Fields – Operands Field:</strong>&nbsp;Check “Add Space After Separator” for improved text readability</p>
<p style="text-align: justify;"><strong>View Decompiler Output</strong></p>
<p style="text-align: justify;">Ghidra comes with a built-in decompiler output.</p>
<p style="text-align: justify;">&nbsp;It can display the high-level language of the assembly code.</p>
<p style="text-align: justify;">By highlighting one of the operators in the high-level language decompiler window, it highlights the relevant assembly providing the user with a good idea on how and which groups of the assembler instructions match the high-level instructions.</p>
<p style="text-align: justify;"><strong>Scripting<br />
</strong></p>
<p style="text-align: justify;">Ghidra includes support for writing Java and Python (via Jython) scripts to automate analysis.&nbsp;</p>
<p style="text-align: justify;">To view built-in scripts, go to Window – Script Manager.</p>
<p style="text-align: justify;">A user can add its own script by choosing the “create a new script” option in the script manager window top header menu.</p>
<p style="text-align: justify;">It supports scripting with Java and Python.</p>
<p style="text-align: justify;"><strong>Investigate a String Reference</strong><br />
&nbsp;<br />
Ghidra gives a review of the strings embedded within a target file.<br />
To navigate, click on Window – Defined Strings.&nbsp;<br />
&nbsp;<br />
Clicking on the row associated with a string populates the Listing window with the data on the intended address.<br />
&nbsp;<br />
To identify references to a string, the user should right-click in the blue area in the listing window – References – Show References to Address:</p>
<p style="text-align: justify;">&nbsp;The window can show how many references are to a particular string.</p>
<p style="text-align: justify;">&nbsp;<strong>Function call Graph</strong></p>
<p style="text-align: justify;">The function call graph displays the relationships between functions and provides a high-level overview of function calls.<br />
&nbsp;</p>
<p style="text-align: justify;"><strong>Binary Ninja</strong></p>
<p style="text-align: justify;">&nbsp;Binary Ninja is a reverse engineering tool, it’s a program analysis platform and includes a disassembler, it’s not a debugger or a decompiler.<br />
&nbsp;<br />
There Is a personal, commercial, and enterprise license to use this tool.<br />
&nbsp;<br />
Commercial version provides the capability to use more cores on the machine that is running for making the process faster and also supports a headless mode where the user can create and automate scripts without loading the UI(in the personal license user can also access the same API’s but only through the UI).<br />
&nbsp;</p>
<p style="text-align: justify;"><strong>Features of Binary Ninja</strong></p>
<p style="text-align: justify;">&nbsp;<br />
<strong>Cross-Platform</strong><br />
&nbsp;<br />
Works on OS X, Windows, or Linux.<br />
&nbsp;<br />
<strong>Undo Function</strong><br />
&nbsp;<br />
Users don’t have to be worried about losing useful information accidentally, Edit — Undo.<br />
&nbsp;<br />
<strong>Smooth Scrolling, Zooming</strong><br />
&nbsp;<br />
Scanning through large functions</p>
<p style="text-align: justify;"><strong>Multi-threaded Disassembly</strong><br />
&nbsp;<br />
&nbsp;This is included as mentioned above only in the commercial edition for multi-threaded analysis of large binaries files.<br />
&nbsp;</p>
<p style="text-align: justify;"><strong>LowLevelIL</strong><br />
&nbsp;<br />
An easy to write to IL powers automatic analysis across all architectures.</p>
<p style="text-align: justify;"><strong>Inline assembly editing</strong><br />
&nbsp;<br />
For fast binary patches.</p>
<p style="text-align: justify;"><strong>Right-Click Patching</strong><br />
&nbsp;<br />
Faster than inline editing.</p>
<p style="text-align: justify;"><strong>Handy Transforms</strong><br />
&nbsp;<br />
Born from the fast-paced CTF environment.</p>
<p style="text-align: justify;"><strong>Simultaneous Live View</strong><br />
&nbsp;<br />
A feature that a user can write hex and immediately see the changes live in disassembly.</p>
<p style="text-align: justify;"><strong>Bug Hunting </strong></p>
<p style="text-align: justify;">It good to be used for:</p>
<ul style="text-align: justify;">
<li>• PE, Mach-O, ELF file formats.</li>
<li>• Raw binaries executable code for x86,x64, armv7,armv8, MIPS, PPC, and others.<br />
• Firmware — some knowledge for assembly language is required</p>
<p>And it’s not good for things that are not binary code like:<br />
&nbsp;<br />
• Web apps<br />
• Java<br />
• .NET<br />
• Virtual machines</p>
<p>Visit the official documentation <a href="https://docs.binary.ninja/index.html">here</a>.</li>
</ul>
<p style="text-align: justify;"><strong>Apktool</strong><br />
&nbsp;<br />
&nbsp; A tool for reverse engineering Android APK files.<br />
&nbsp;<br />
It can be used to reverse engineering 3rd party, closed binary Android Apps, and also can decode resources to the nearly original form and rebuild them.<br />
&nbsp;<br />
It could be used for localizing, adding some features or support for custom platforms, analyzing applications, and more.<br />
&nbsp;<br />
&nbsp;<br />
<strong>Apktool Features<br />
</strong><strong> &nbsp;</strong><br />
<strong> • Disassembling resources to the nearly original form</strong><br />
<strong> &nbsp;</strong><br />
<strong> • Rebuilding decoded resources back to binary APK/JAR</strong><br />
<strong> &nbsp;</strong><br />
<strong> • Organizing and handling APKs that depend on framework resources</strong><br />
<strong> &nbsp;</strong><br />
<strong> • Smali Debugging (Removed in 2.1.0 in favor of IdeaSmali)</strong><br />
&nbsp;<br />
<strong>• Helping with repetitive tasks</strong><br />
It can make working with an app easier because of this project like file structure and automation of some repetitive tasks like building APK, etc.<br />
&nbsp;</p>
<p style="text-align: justify;"><strong>Example decoding APK Facebook lite</strong><br />
&nbsp;<br />
Using debug mode (d) to decode the given APK file<br />
&nbsp;</p>
<p style="text-align: justify;">Upon decoding the files, after making changes or inspecting the APK, a user can build the decoded files using the build function (b) by selecting the file with the decoded files of the APK and an output name of APK (-o).</p>
<p style="text-align: justify;"><strong>Javasnoop</strong><br />
&nbsp;<br />
&nbsp;<br />
It’s a default tool in the Kali Linux reverse engineering family tool and can intercept Java applications locally.<br />
&nbsp;It can be accessed from the terminal with a simple command — root@kali:~# javasnoop<br />
Intercepts Java applications locally.</p>
<p style="text-align: justify;">It’s a tool developed by Aspect Security to help people intercept Java function calls (e.g. toString) from Java applications.<br />
The tool can allow the user to attach to a process (like a debugger) and intercept a Java function call, view and modify parameter values and print the stackrace or save function calls.<br />
&nbsp;</p>
<p style="text-align: justify;"><strong>Features</strong><br />
&nbsp;<br />
The following features of the tool make the testing easier for any kind of Java-based apps.<br />
<strong>&nbsp;</strong><br />
<strong> • Allows easy interception of any method in the JVM</strong><br />
<strong> • Allows the editing of return values and parameters</strong><br />
<strong> • Allows custom Java to be inserted into any method</strong><br />
<strong> • Able to work on any type of Java application (J2SE, Applet, or Java Web Start)</strong><br />
<strong> • Able to work on already-running Java processes</strong><br />
<strong> • Not require any target source code (original or decompiled)</strong><br />
&nbsp;</p>
<p style="text-align: justify;">&nbsp;<strong>Javasnoop’s interface functionality</strong><br />
&nbsp;</p>
<p style="text-align: justify;"><strong>The first box (top left)</strong><br />
&nbsp;<br />
Is where a user can select class or method to be hooked and intercepted.<br />
The interface provides a button to add a new Hook so the user can add a method from a specific class available from the list.&nbsp;<br />
&nbsp;</p>
<p style="text-align: justify;"><strong>Second box(top right)</strong><br />
&nbsp;<br />
Provides features for setting various options for intercepting the method calls.<br />
Set regular expression conditions for matching and intercepting traffic from the method calls.<br />
&nbsp;<br />
<strong>On execution – Third box(bottom left)</strong><br />
&nbsp;<br />
The interface here helps in deciding what to do with a particular hook that the user selected from the first box.<br />
&nbsp;<br />
Various options like:<br />
&nbsp;<br />
• Printing the parameters/stacktrace on to the console or a particular file<br />
• Running custom scripts<br />
• Tampering with parameters<br />
• Tampering with a return value<br />
• Pausing program</p>
<p style="text-align: justify;"><strong>Fourth box (bottom right)</strong><br />
&nbsp;<br />
Here in this area, it shows the output from the hooks and the decompiled classes from the target application.&nbsp;</p>
<h3 style="text-align: justify;"><strong>Benefits of reverse engineering:</strong></h3>
<p style="text-align: justify;">&nbsp;<br />
Using creativity and knowledge, researchers can now innovate through reverse engineering, by understanding, taking apart, modifying, or even creating a new better software than before.<br />
&nbsp;<br />
• Examining the structures and processes of an application can lead to product innovation.<br />
• Knowledge gain by other researcher’s work<br />
• Reconstructing a product that is outdated&nbsp;<br />
• The discovery of software vulnerabilities&nbsp;<br />
• The development of applications that are more efficient and cheap.<br />
&nbsp;</p>
<h3 style="text-align: justify;"><strong>Importance of reverse engineering and the dark side of it.</strong></h3>
<p style="text-align: justify;">In the security world, researchers use reverse engineering to find security risks in programs, to understand malicious applications, etc.<br />
Cyber-criminals can also use this technique to exploit security bugs in applications, the difference with the security researchers is what they do with that vulnerability information.<br />
&nbsp;<br />
In a report conducted on April 2019, found that 97% of the 30 mobile financial apps that were tested, were lacking binary protection, making decompiling and review of the source code possible.<br />
&nbsp;<br />
Upon decompiling an app all kinds of sensitive information can be exposed, API URLs API keys hardcoded into the apps.<br />
The URLs can lead attackers to nonstandard port numbers, development servers, private keys, application file directories that were used for testing by developers, quality assurance engineers and can lead an attacker to compromise entire applications.<br />
&nbsp;<br />
Attackers use many anti-reverse engineering techniques to prevent detection or make it more difficult to recover the contents of their malicious apps.<br />
Some of them are:<br />
&nbsp;Detection of virtual machines, sandboxes — used to study malware, crypters — to encrypt the executable files,&nbsp;<br />
exe-protectors — to compress executable and add code to detect the presence of debuggers and eventually hide or corrupt the true structure of the executable.<br />
&nbsp;<br />
To counter reverse-engineering attacks, security teams need to know what tools are available, how they work, and lastly what attackers use for evading those tools.</p>
<p>The post <a href="http://kostacipo.stream/reverse-engineering/">Reverse Engineering</a> appeared first on <a href="http://kostacipo.stream">Tech Chronicles</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://kostacipo.stream/reverse-engineering/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>7 Skills of Highly “Effective” Programmers</title>
		<link>http://kostacipo.stream/7-skills-of-highly-effective-programmers/</link>
					<comments>http://kostacipo.stream/7-skills-of-highly-effective-programmers/#respond</comments>
		
		<dc:creator><![CDATA[Majordomo]]></dc:creator>
		<pubDate>Wed, 22 Jul 2020 21:59:56 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[programming]]></category>
		<guid isPermaLink="false">http://www.kostacipo.stream/?p=1801</guid>

					<description><![CDATA[<p>&#160; Software engineers spend a lot of time gaining skills for interviews by practicing leet code problems and perfecting resumes. Once they finally get that job at a startup, Google, Amazon, or another corporation, they might find the skills they used to get the job don’t match the ones they need in their everyday work. [&#8230;]</p>
<p>The post <a href="http://kostacipo.stream/7-skills-of-highly-effective-programmers/">7 Skills of Highly “Effective” Programmers</a> appeared first on <a href="http://kostacipo.stream">Tech Chronicles</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>&nbsp;</p>
<section class="di dj dk dl dm">
<div class="n p">
<div class="z ab ac ae af dn ah ai">
<p id="b1d8" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">Software engineers spend a lot of time gaining skills for interviews by practicing leet code problems and perfecting resumes.</p>
<p id="ccb1" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">Once they finally get that job at a startup, Google, Amazon, or another corporation, they might find the skills they used to get the job don’t match the ones they need in their everyday work.</p>
<p id="b839" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">Here are our seven skills of effective programmers.</p>
</div>
</div>
</section>
<hr class="iv ck iw ix iy iz ia ja jb jc jd je">
<section class="di dj dk dl dm">
<div class="n p">
<div class="z ab ac ae af dn ah ai">
<h1 id="96f2" class="jf jg as ar jh ji jj jk jl jm jn jo jp jq jr js jt ju jv jw jx eh" data-selectable-paragraph="">1. Learn How to Read Other People’s Code</h1>
<p id="f1f6" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph=""><mark class="uq ur lw"><img fetchpriority="high" decoding="async" class="pg uk s t u ho ai hy" src="https://miro.medium.com/max/744/1*aF4L0WQV77WPd1MW3r530Q.png" sizes="700px" srcset="https://miro.medium.com/max/276/1*aF4L0WQV77WPd1MW3r530Q.png 276w, https://miro.medium.com/max/552/1*aF4L0WQV77WPd1MW3r530Q.png 552w, https://miro.medium.com/max/640/1*aF4L0WQV77WPd1MW3r530Q.png 640w, https://miro.medium.com/max/700/1*aF4L0WQV77WPd1MW3r530Q.png 700w" alt="Image for post" width="744" height="612"></mark></p>
<p class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph=""><mark class="uq ur lw">Everyone but you writes terrible code.</mark></p>
<p id="039e" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">That is why a great skill that has multiple benefits is being able to follow other people’s code.</p>
<p id="965d" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">No matter how messy or poorly thought out a previous engineer’s code is, you still need to be able to wade through it. After all, it’s your job. Even when that engineer was you one year prior.</p>
<p id="a754" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">This skill benefits you in two ways. One, being able to read other people’s code is a great chance to learn what bad design is. While you are looking through other people’s code you learn what works and what doesn’t. More importantly, you learn what type of code is easy for another engineer to follow and what code is hard to follow.</p>
<p id="b330" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">You need to make sure you gripe as much as possible as you are reading over other people’s code. That way, other engineers understand how much of a superior engineer you are.</p>
<p id="9d25" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">Make sure you bring up points about the importance of maintainable code and good commenting. This further shows your dominance in the area of programming.</p>
<p id="f72b" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph=""><mark class="uq ur lw">Your code should be so well-designed that it requires no documentation. In fact, you shouldn’t document any of your code if you are a good programmer. This is just a waste of time and you need to spend your time coding and in meetings.</mark></p>
<p id="83d8" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">Being able to read other people’s messy code also makes it easy to make updates when needed. This occasionally means updating code you lack experience in. For instance, we once followed a script from Powershell to Python to Perl. We had limited experience in Perl, but we still had enough context to figure out what was going on and make the changes needed.</p>
<p id="b441" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">This comes from having a decent understanding of all the code as well as being able to read the Perl scripts.</p>
<p id="339a" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">Reading other people’s code makes you valuable because you can follow even over-engineered systems that might stump others.</p>
</div>
</div>
</section>
<hr class="iv ck iw ix iy iz ia ja jb jc jd je">
<section class="di dj dk dl dm">
<div class="n p">
<div class="z ab ac ae af dn ah ai">
<h1 id="7537" class="jf jg as ar jh ji jj jk jl jm jn jo jp jq jr js jt ju jv jw jx eh" data-selectable-paragraph="">2. A Sense for Bad Projects</h1>
<p id="9c82" class="ih ii as ij b ej ka il em kb in io kc er iq kd eu is ke ex iu di eh" data-selectable-paragraph="">There are many skills that take time to learn. One of the skills we believe is worth knowing is understanding what projects are not worth doing and what projects are clearly death marches.</p>
<p id="45ef" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">Large companies always have many more projects going than will probably ever be completed or impactful. There are some projects that might not make any business sense (at least not to you), and there are others that are just poorly managed. This is not to say that you should cut off an idea right when you disagree with the project. However, if the stakeholders can’t properly explain what they will be doing with the end result, then perhaps the project is not worth doing.</p>
<p id="eb5f" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">Also, some projects might be so focused on the technology instead of the solution that it might be clear from the beginning that there won’t be a lot of impact. This skill requires doing a lot of bad projects before you have an idea of what a bad project really is. So don’t spend too much time early on trying to discern each project.</p>
<p id="7761" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">At some point in your career, you will just have a good gut sense.</p>
</div>
</div>
</section>
<hr class="iv ck iw ix iy iz ia ja jb jc jd je">
<section class="di dj dk dl dm">
<div class="n p">
<div class="z ab ac ae af dn ah ai">
<h1 id="d7b5" class="jf jg as ar jh ji jj jk jl jm jn jo jp jq jr js jt ju jv jw jx eh" data-selectable-paragraph="">3. Avoiding Meetings</h1>
<p id="ddfa" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph=""><img decoding="async" class="pg uk s t u ho ai hy" src="https://miro.medium.com/max/2624/1*FOwBIudz9pwVbbt7uR6rqg.png" sizes="700px" srcset="https://miro.medium.com/max/276/1*FOwBIudz9pwVbbt7uR6rqg.png 276w, https://miro.medium.com/max/552/1*FOwBIudz9pwVbbt7uR6rqg.png 552w, https://miro.medium.com/max/640/1*FOwBIudz9pwVbbt7uR6rqg.png 640w, https://miro.medium.com/max/700/1*FOwBIudz9pwVbbt7uR6rqg.png 700w" alt="Image for post" width="2624" height="428">Whether you are a software engineer or data scientist, meetings are a necessity because you need to be able to get on the same page with your project managers, end-users, and clients. However, there is also a tendency for meetings to suddenly take over your entire schedule. This is why it’s important to learn how to avoid meetings that are unneeded. Maybe a better word to use is <em class="kh">manage </em>rather than avoid. The goal here is to make sure you spend your time in meetings that drive decisions and help your team move forward.</p>
<p id="73db" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">The most common method is to simply block out a two-hour block every day that is a constant meeting. Usually, most people will set up a recurring meeting at a time they find beneficial. They’ll use that as a time to catch up on their development work.</p>
<p id="38c5" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">Another way to avoid meetings so you can get work done is to show up before anyone else does. Personally, we like showing up early because in general, the office is quieter. Most people that show up early are like you, just wanting to get work done so no one bugs you.</p>
<p id="35a6" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">This is important for individual contributors because our work requires times where we focus and we don’t talk to other people. Yes, there are times you might be problem-solving where you might want to work with other people. But once you get past the blocking issues, you just need to code. It’s about getting into that zone where you are constantly holding a lot of complex ideas in your head about the work you are doing. If you are constantly stopped, it can be hard to pick up where you left off.</p>
</div>
</div>
</section>
<hr class="iv ck iw ix iy iz ia ja jb jc jd je">
<section class="di dj dk dl dm">
<div class="n p">
<div class="z ab ac ae af dn ah ai">
<h1 id="60b7" class="jf jg as ar jh ji jj jk jl jm jn jo jp jq jr js jt ju jv jw jx eh" data-selectable-paragraph="">4. Github…Wait no Git?</h1>
<p id="eb9d" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph=""><img decoding="async" class="pg uk s t u ho ai hy" src="https://miro.medium.com/max/481/0*mtL55js6ZZWiax7y.png" sizes="481px" srcset="https://miro.medium.com/max/276/0*mtL55js6ZZWiax7y.png 276w, https://miro.medium.com/max/481/0*mtL55js6ZZWiax7y.png 481w" alt="Image for post" width="481" height="455"></p>
<p class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">Some CS majors started using Git the day they were born. They understand every command and parameter and can run circles around professionals.</p>
<p id="074f" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">Others get their first taste of Git at their first job. For them, Git is a hellish landscape of confusing commands and processes. They are never 100% sure what they are doing (there’s a reason cheat sheets are popular).</p>
<p id="a569" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">No matter what repository system your company uses, the system is both helpful if you use it correctly and a hindrance if used improperly. It doesn’t take much for a simple push or commit to turn into you spending hours trying to untangle some hodgepodge of multiple branches and forks. In addition, if you constantly forget to pull the most recent version of the repository, you will also be dealing with merge conflicts that are never fun.</p>
<p id="5da7" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">If you need to keep a Git command cheat sheet, then do it. Whatever makes your life simpler.</p>
</div>
</div>
</section>
<hr class="iv ck iw ix iy iz ia ja jb jc jd je">
<section class="di dj dk dl dm">
<div class="n p">
<div class="z ab ac ae af dn ah ai">
<h1 id="215d" class="jf jg as ar jh ji jj jk jl jm jn jo jp jq jr js jt ju jv jw jx eh" data-selectable-paragraph="">5. Writing Simple Maintainable Code</h1>
<p id="7197" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph=""><img loading="lazy" decoding="async" class="pg uk s t u ho ai hy" src="https://miro.medium.com/max/550/1*1ceZ3tCVJ-iRyS7B2THn7Q.png" sizes="auto, 550px" srcset="https://miro.medium.com/max/276/1*1ceZ3tCVJ-iRyS7B2THn7Q.png 276w, https://miro.medium.com/max/550/1*1ceZ3tCVJ-iRyS7B2THn7Q.png 550w" alt="Image for post" width="550" height="230"></p>
<p class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">One tendency younger engineers might have is to attempt to implement everything they know into one solution. There is this desire to take your understanding of object-oriented programming, data structures, design patterns, and new technologies and use all of that in every bit of code you write. You create an unnecessary complexity because it’s so easy to be overly attached to a solution or design pattern you have used in the past.</p>
<p id="6d93" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">There is a balance with complex design concepts and simple code. Design patterns and object-oriented design are supposed to simplify code in the grand scheme of things. However, the more and more a process is abstracted, encapsulated, and black-boxed, the harder it can be to debug.</p>
</div>
</div>
</section>
<hr class="iv ck iw ix iy iz ia ja jb jc jd je">
<section class="di dj dk dl dm">
<div class="n p">
<div class="z ab ac ae af dn ah ai">
<h1 id="d113" class="jf jg as ar jh ji jj jk jl jm jn jo jp jq jr js jt ju jv jw jx eh" data-selectable-paragraph="">6. Learn to Say No and Prioritize</h1>
<p id="f132" class="ih ii as ij b ej ka il em kb in io kc er iq kd eu is ke ex iu di eh" data-selectable-paragraph="">This goes for really any role, whether you are a financial analyst or a software engineer. But in particular, tech roles seem to have everyone needing something from them. If you are a data engineer, you will probably get asked to do more than just develop pipelines. Some teams will need data extracts, others will need dashboards, and others will need new pipelines for their data scientists.</p>
<p id="26fb" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">Now, prioritizing and saying no might really be two different skills, but they are closely intertwined. Prioritizing means that you only spend time that has high impact for the company. Whereas saying no sometimes just means avoiding work that should be handled by a different team. They do often happen in tandem for all roles.</p>
<p id="9733" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">This can be a difficult skill to acquire as it is tempting to take on every request thrown your way. Especially if you are straight out of college. You want to avoid disappointing anyone, and you have always been provided a doable amount of work.</p>
<p id="f9d7" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">In large companies, there is always an endless amount of work. The key is only taking on what can be done.</p>
<p id="c275" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">There are a lot of skills that aren’t tested for in interviews or even always taught in colleges. Oftentimes, this is more a limitation of the environment rather than a lack of desire to expose students to problems that exist in real development environments.</p>
</div>
</div>
</section>
<hr class="iv ck iw ix iy iz ia ja jb jc jd je">
<section class="di dj dk dl dm">
<div class="n p">
<div class="z ab ac ae af dn ah ai">
<h1 id="acaa" class="jf jg as ar jh ji jj jk jl jm jn jo jp jq jr js jt ju jv jw jx eh" data-selectable-paragraph="">7. Operational Design Thinking</h1>
<p id="5787" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph=""><img loading="lazy" decoding="async" class="pg uk s t u ho ai hy" src="https://miro.medium.com/max/534/1*BnFh_-UMca79wgy7CVkHpQ.jpeg" sizes="auto, 534px" srcset="https://miro.medium.com/max/276/1*BnFh_-UMca79wgy7CVkHpQ.jpeg 276w, https://miro.medium.com/max/534/1*BnFh_-UMca79wgy7CVkHpQ.jpeg 534w" alt="Image for post" width="534" height="800"></p>
<p class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">One skill that is hard to test for in an interview and hard to replicate when you are taking courses in college is thinking through how an end-user might use your software incorrectly. We usually reference this as thinking through operational scenarios.</p>
<p id="a10c" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">However, this is just a polite way of saying you’re attempting to dummy proof code.</p>
<p id="3922" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">For instance, since much of programming is maintenance, it often means changing code that is highly tangled with other code. Even a simple alteration requires tracing every possible reference of an object, method, and/or API. Otherwise, it can be easy to accidentally break modules you don’t realize are attached. Even if you are just changing a data type in a database.</p>
<p id="e76c" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">It also includes thinking through edge cases and thinking through an entire high-level design before going into development.</p>
<p id="a225" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">As for more complex cases where you are developing new modules or microservices, it’s important to take your time and think through the operational scenarios of what you are building. Think about how future users might need to use your new module, how they might use it incorrectly, what parameters might be needed, and if there are different ways a future programmer might need your code.</p>
<p id="70df" class="ih ii as ij b ej ik il em im in io ip er iq ir eu is it ex iu di eh" data-selectable-paragraph="">Simply coding and programming is only part of the problem. It’s easy to create software that works well on your computer. But there are a lot of ways deploying code can go wrong. Once in production, it’s hard to say how code will be used and what other code will be attached to your original code. Five years from now, a future programmer might get frustrated at the limitations of your code.</p>
</div>
</div>
</section>
<p>The post <a href="http://kostacipo.stream/7-skills-of-highly-effective-programmers/">7 Skills of Highly “Effective” Programmers</a> appeared first on <a href="http://kostacipo.stream">Tech Chronicles</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://kostacipo.stream/7-skills-of-highly-effective-programmers/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>A CheatSheet of 128 CheatSheets for Developers</title>
		<link>http://kostacipo.stream/a-cheatsheet-of-128-cheatsheets-for-developers/</link>
					<comments>http://kostacipo.stream/a-cheatsheet-of-128-cheatsheets-for-developers/#respond</comments>
		
		<dc:creator><![CDATA[Majordomo]]></dc:creator>
		<pubDate>Fri, 28 Feb 2020 09:50:46 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[cheatsheet]]></category>
		<guid isPermaLink="false">http://www.kostacipo.stream/?p=1772</guid>

					<description><![CDATA[<p>&#160; A list of the (in my opinion) best Cheatsheets and tutorials for some of the top languages, frameworks and tools out there.&#160; General Awesome 001&#160;https://github.com/topics/awesome002&#160;https://github.com/detailyang/awesome-cheatsheet Tech interview 003&#160;https://yangshun.github.io/tech-interview-handbook/cheatsheet/004&#160;https://github.com/TSiege/Tech-Interview-Cheat-Sheet005&#160;https://dev.to/elliot/my-google-technical-interview-cheat-sheet-1lbd Complexity 006&#160;https://www.bigocheatsheet.com/007&#160;http://cooervo.github.io/Algorithms-DataStructures-BigONotation/ SEO 008&#160;https://dev.to/pagely/seo-cheat-sheet-for-devs-5h1g Programming, Scripting and Query Languages C 009&#160;https://developerinsider.co/c-programming-language-cheat-sheet/ C++ 010&#160;https://www.educba.com/c-programming-language-basics/ Go 011&#160;https://github.com/a8m/golang-cheat-sheet012&#160;https://devhints.io/go013&#160;https://dev.to/codehakase/how-i-learned-go-programming GraphQL 014&#160;https://devhints.io/graphql015&#160;https://raw.githubusercontent.com/sogko/graphql-shorthand-notation-cheat-sheet/master/graphql-shorthand-notation-cheat-sheet.png016&#160;https://dev.to/methodcoder/graphql-crash-course-in-10-pics-3b04 Java 017&#160;https://overapi.com/java018&#160;https://cheatography.com/son9912/cheat-sheets/java-oop-concept/019&#160;https://www.educba.com/category/software-development/software-development-tutorials/java-tutorial/020&#160;https://dev.to/monknomo/java-8-stream-cheatsheet&#8211;oad JavaScript, ES2015+ 021&#160;http://www.developer-cheatsheets.com/es6022&#160;https://htmlcheatsheet.com/js/023&#160;https://devhints.io/es6024&#160;https://overapi.com/javascript025&#160;https://dev.to/samanthaming/javascript-module-cheatsheet-5b4o026&#160;https://dev.to/samanthaming/es6-arrow-functions-cheatsheet-1cn PHP 027&#160;https://overapi.com/php028&#160;https://phpcheatsheets.com/029&#160;https://dev.to/biros/awesome-php-resources-on-dev&#8212;-3a18 Python 030&#160;https://devhints.io/python031&#160;https://overapi.com/python032&#160;https://www.pythoncheatsheet.org033&#160;https://dev.to/codingsafari/python-cheat-sheet-for-javascripters-2c4m [&#8230;]</p>
<p>The post <a href="http://kostacipo.stream/a-cheatsheet-of-128-cheatsheets-for-developers/">A CheatSheet of 128 CheatSheets for Developers</a> appeared first on <a href="http://kostacipo.stream">Tech Chronicles</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>&nbsp;</p>
<p>A list of the (in my opinion) best Cheatsheets and tutorials for some of the top languages, frameworks and tools out there.&nbsp;</p>
<h3>General</h3>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#awesome" name="awesome"></a>Awesome</h4>
<p><code>001</code>&nbsp;<a href="https://github.com/topics/awesome">https://github.com/topics/awesome</a><br /><code>002</code>&nbsp;<a href="https://github.com/detailyang/awesome-cheatsheet">https://github.com/detailyang/awesome-cheatsheet</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#tech-interview" name="tech-interview"></a>Tech interview</h4>
<p><code>003</code>&nbsp;<a href="https://yangshun.github.io/tech-interview-handbook/cheatsheet/">https://yangshun.github.io/tech-interview-handbook/cheatsheet/</a><br /><code>004</code>&nbsp;<a href="https://github.com/TSiege/Tech-Interview-Cheat-Sheet">https://github.com/TSiege/Tech-Interview-Cheat-Sheet</a><br /><code>005</code>&nbsp;<a href="https://dev.to/elliot/my-google-technical-interview-cheat-sheet-1lbd">https://dev.to/elliot/my-google-technical-interview-cheat-sheet-1lbd</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#complexity" name="complexity"></a>Complexity</h4>
<p><code>006</code>&nbsp;<a href="https://www.bigocheatsheet.com/">https://www.bigocheatsheet.com/</a><br /><code>007</code>&nbsp;<a href="http://cooervo.github.io/Algorithms-DataStructures-BigONotation/">http://cooervo.github.io/Algorithms-DataStructures-BigONotation/</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#seo" name="seo"></a>SEO</h4>
<p><code>008</code>&nbsp;<a href="https://dev.to/pagely/seo-cheat-sheet-for-devs-5h1g">https://dev.to/pagely/seo-cheat-sheet-for-devs-5h1g</a></p>
<h3><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#programming-scripting-and-query-languages" name="programming-scripting-and-query-languages"></a>Programming, Scripting and Query Languages</h3>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#c" name="c"></a>C</h4>
<p><code>009</code>&nbsp;<a href="https://developerinsider.co/c-programming-language-cheat-sheet/">https://developerinsider.co/c-programming-language-cheat-sheet/</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#c" name="c"></a>C++</h4>
<p><code>010</code>&nbsp;<a href="https://www.educba.com/c-programming-language-basics/">https://www.educba.com/c-programming-language-basics/</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#go" name="go"></a>Go</h4>
<p><code>011</code>&nbsp;<a href="https://github.com/a8m/golang-cheat-sheet">https://github.com/a8m/golang-cheat-sheet</a><br /><code>012</code>&nbsp;<a href="https://devhints.io/go">https://devhints.io/go</a><br /><code>013</code>&nbsp;<a href="https://dev.to/codehakase/how-i-learned-go-programming">https://dev.to/codehakase/how-i-learned-go-programming</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#graphql" name="graphql"></a>GraphQL</h4>
<p><code>014</code>&nbsp;<a href="https://devhints.io/graphql">https://devhints.io/graphql</a><br /><code>015</code>&nbsp;<a href="https://raw.githubusercontent.com/sogko/graphql-shorthand-notation-cheat-sheet/master/graphql-shorthand-notation-cheat-sheet.png">https://raw.githubusercontent.com/sogko/graphql-shorthand-notation-cheat-sheet/master/graphql-shorthand-notation-cheat-sheet.png</a><br /><code>016</code>&nbsp;<a href="https://dev.to/methodcoder/graphql-crash-course-in-10-pics-3b04">https://dev.to/methodcoder/graphql-crash-course-in-10-pics-3b04</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#java" name="java"></a>Java</h4>
<p><code>017</code>&nbsp;<a href="https://overapi.com/java">https://overapi.com/java</a><br /><code>018</code>&nbsp;<a href="https://cheatography.com/son9912/cheat-sheets/java-oop-concept/">https://cheatography.com/son9912/cheat-sheets/java-oop-concept/</a><br /><code>019</code>&nbsp;<a href="https://www.educba.com/category/software-development/software-development-tutorials/java-tutorial/">https://www.educba.com/category/software-development/software-development-tutorials/java-tutorial/</a><br /><code>020</code>&nbsp;<a href="https://dev.to/monknomo/java-8-stream-cheatsheet--oad">https://dev.to/monknomo/java-8-stream-cheatsheet&#8211;oad</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#javascript-es2015" name="javascript-es2015"></a>JavaScript, ES2015+</h4>
<p><code>021</code>&nbsp;<a href="http://www.developer-cheatsheets.com/es6">http://www.developer-cheatsheets.com/es6</a><br /><code>022</code>&nbsp;<a href="https://htmlcheatsheet.com/js/">https://htmlcheatsheet.com/js/</a><br /><code>023</code>&nbsp;<a href="https://devhints.io/es6">https://devhints.io/es6</a><br /><code>024</code>&nbsp;<a href="https://overapi.com/javascript">https://overapi.com/javascript</a><br /><code>025</code>&nbsp;<a href="https://dev.to/samanthaming/javascript-module-cheatsheet-5b4o">https://dev.to/samanthaming/javascript-module-cheatsheet-5b4o</a><br /><code>026</code>&nbsp;<a href="https://dev.to/samanthaming/es6-arrow-functions-cheatsheet-1cn">https://dev.to/samanthaming/es6-arrow-functions-cheatsheet-1cn</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#php" name="php"></a>PHP</h4>
<p><code>027</code>&nbsp;<a href="https://overapi.com/php">https://overapi.com/php</a><br /><code>028</code>&nbsp;<a href="https://phpcheatsheets.com/">https://phpcheatsheets.com/</a><br /><code>029</code>&nbsp;<a href="https://dev.to/biros/awesome-php-resources-on-dev----3a18">https://dev.to/biros/awesome-php-resources-on-dev&#8212;-3a18</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#python" name="python"></a>Python</h4>
<p><code>030</code>&nbsp;<a href="https://devhints.io/python">https://devhints.io/python</a><br /><code>031</code>&nbsp;<a href="https://overapi.com/python">https://overapi.com/python</a><br /><code>032</code>&nbsp;<a href="https://www.pythoncheatsheet.org/">https://www.pythoncheatsheet.org</a><br /><code>033</code>&nbsp;<a href="https://dev.to/codingsafari/python-cheat-sheet-for-javascripters-2c4m">https://dev.to/codingsafari/python-cheat-sheet-for-javascripters-2c4m</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#regex" name="regex"></a>Regex</h4>
<p><code>034</code>&nbsp;<a href="https://www.debuggex.com/cheatsheet/regex/javascript">https://www.debuggex.com/cheatsheet/regex/javascript</a><br /><code>035</code>&nbsp;<a href="https://devhints.io/regexp">https://devhints.io/regexp</a><br /><code>036</code>&nbsp;<a href="https://overapi.com/regex">https://overapi.com/regex</a><br /><code>037</code>&nbsp;<a href="https://dev.to/emmabostian/regex-cheat-sheet-2j2a">https://dev.to/emmabostian/regex-cheat-sheet-2j2a</a><br /><code>038</code>&nbsp;<a href="https://dev.to/catherinecodes/a-regex-cheatsheet-for-all-those-regex-haters-and-lovers--2cj1">https://dev.to/catherinecodes/a-regex-cheatsheet-for-all-those-regex-haters-and-lovers&#8211;2cj1</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#ruby" name="ruby"></a>Ruby</h4>
<p><code>039</code>&nbsp;<a href="https://overapi.com/ruby">https://overapi.com/ruby</a><br /><code>040</code>&nbsp;<a href="https://dev.to/teekay/idiomatic-ruby-writing-beautiful-code-56ef">https://dev.to/teekay/idiomatic-ruby-writing-beautiful-code-56ef</a><br /><code>041</code>&nbsp;<a href="https://dev.to/philnash/top-10-errors-from-1000-ruby-on-rails-projects-and-how-to-avoid-them-24m">https://dev.to/philnash/top-10-errors-from-1000-ruby-on-rails-projects-and-how-to-avoid-them-24m</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#sql-mysql" name="sql-mysql"></a>SQL, MySQL</h4>
<p><code>042</code>&nbsp;<a href="https://devhints.io/mysql">https://devhints.io/mysql</a><br /><code>043</code>&nbsp;<a href="https://overapi.com/mysql">https://overapi.com/mysql</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#typescript" name="typescript"></a>TypeScript</h4>
<p><code>044</code>&nbsp;<a href="https://learnxinyminutes.com/docs/typescript/">https://learnxinyminutes.com/docs/typescript/</a><br /><code>045</code>&nbsp;<a href="https://devhints.io/typescript">https://devhints.io/typescript</a></p>
<h3><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#frameworks-libraries-and-their-extensions" name="frameworks-libraries-and-their-extensions"></a>Frameworks, libraries and their extensions</h3>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#angular" name="angular"></a>Angular</h4>
<p><code>046</code>&nbsp;<a href="https://angular.io/guide/cheatsheet">https://angular.io/guide/cheatsheet</a><br /><code>047</code>&nbsp;<a href="https://dev.to/lysofdev/an-angular-testing-cheatsheet-5hj2">https://dev.to/lysofdev/an-angular-testing-cheatsheet-5hj2</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#jquery" name="jquery"></a>jQuery</h4>
<p><code>048</code>&nbsp;<a href="https://oscarotero.com/jquery/">https://oscarotero.com/jquery/</a><br /><code>049</code>&nbsp;<a href="https://overapi.com/jquery">https://overapi.com/jquery</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#react" name="react"></a>React</h4>
<p><code>050</code>&nbsp;<a href="http://www.developer-cheatsheets.com/react">http://www.developer-cheatsheets.com/react</a><br /><code>051</code>&nbsp;<a href="https://devhints.io/react">https://devhints.io/react</a><br /><code>052</code>&nbsp;<a href="https://dev.to/codeartistryio/the-react-cheatsheet-for-2020-real-world-examples-4hgg">https://dev.to/codeartistryio/the-react-cheatsheet-for-2020-real-world-examples-4hgg</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#redux" name="redux"></a>Redux</h4>
<p><code>053</code>&nbsp;<a href="http://www.developer-cheatsheets.com/redux">http://www.developer-cheatsheets.com/redux</a><br /><code>054</code>&nbsp;<a href="https://devhints.io/redux">https://devhints.io/redux</a><br /><code>055</code>&nbsp;<a href="https://github.com/linkmesrl/react-journey-2016/blob/master/resources/egghead-redux-cheat-sheet-3-2-1.pdf">https://github.com/linkmesrl/react-journey-2016/blob/master/resources/egghead-redux-cheat-sheet-3-2-1.pdf</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#vuejs" name="vuejs"></a>Vue.js</h4>
<p><code>056</code>&nbsp;<a href="https://marozed.ma/vue-cheatsheet/">https://marozed.ma/vue-cheatsheet/</a><br /><code>057</code>&nbsp;<a href="https://devhints.io/vue">https://devhints.io/vue</a><br /><code>058</code>&nbsp;<a href="https://dev.to/adnanbabakan/vue-cheat-sheet-1-194a">https://dev.to/adnanbabakan/vue-cheat-sheet-1-194a</a><br /><code>059</code>&nbsp;<a href="https://dev.to/adnanbabakan/vue-cheat-sheet-2-5aj8">https://dev.to/adnanbabakan/vue-cheat-sheet-2-5aj8</a><br /><code>060</code>&nbsp;<a href="https://dev.to/adnanbabakan/vue-cheat-sheet-3-advanced-4khj">https://dev.to/adnanbabakan/vue-cheat-sheet-3-advanced-4khj</a><br /><code>061</code>&nbsp;<a href="https://dev.to/devmount/how-to-kickstart-a-vuejs-project-2mj5">https://dev.to/devmount/how-to-kickstart-a-vuejs-project-2mj5</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#vuex" name="vuex"></a>Vuex</h4>
<p><code>062</code>&nbsp;<a href="https://vuejs-tips.github.io/vuex-cheatsheet/">https://vuejs-tips.github.io/vuex-cheatsheet/</a><br /><code>063</code>&nbsp;<a href="https://dev.to/napoleon039/when-why-and-how-to-use-vuex-9fl">https://dev.to/napoleon039/when-why-and-how-to-use-vuex-9fl</a></p>
<h3><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#editors-ides-and-other-tools" name="editors-ides-and-other-tools"></a>Editors, IDEs and other tools</h3>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#atom" name="atom"></a>Atom</h4>
<p><code>064</code>&nbsp;<a href="https://devhints.io/atom">https://devhints.io/atom</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#bash" name="bash"></a>Bash</h4>
<p><code>065</code>&nbsp;<a href="https://devhints.io/bash">https://devhints.io/bash</a><br /><code>066</code>&nbsp;<a href="http://johnstowers.co.nz/pages/bash-cheat-sheet.html">http://johnstowers.co.nz/pages/bash-cheat-sheet.html</a><br /><code>067</code>&nbsp;<a href="https://dev.to/devmount/9-evil-bash-commands-explained-4k5e">https://dev.to/devmount/9-evil-bash-commands-explained-4k5e</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#docker" name="docker"></a>Docker</h4>
<p><code>068</code>&nbsp;<a href="https://devhints.io/docker">https://devhints.io/docker</a><br /><code>069</code>&nbsp;<a href="https://dev.to/emarsys/the-missing-docker-cheatsheet-4dbg">https://dev.to/emarsys/the-missing-docker-cheatsheet-4dbg</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#git" name="git"></a>Git</h4>
<p><code>070</code>&nbsp;<a href="http://www.ndpsoftware.com/git-cheatsheet.html">http://www.ndpsoftware.com/git-cheatsheet.html</a><br /><code>071</code>&nbsp;<a href="https://overapi.com/git">https://overapi.com/git</a><br /><code>072</code>&nbsp;<a href="https://dev.to/maxpou/git-cheat-sheet-advanced-3a17">https://dev.to/maxpou/git-cheat-sheet-advanced-3a17</a><br /><code>073</code>&nbsp;<a href="https://dev.to/duomly/git-cheatsheet-for-beginners-5apl">https://dev.to/duomly/git-cheatsheet-for-beginners-5apl</a><br /><code>074</code>&nbsp;<a href="https://dev.to/antjanus/my-personal-git-tricks-cheatsheet-23j1">https://dev.to/antjanus/my-personal-git-tricks-cheatsheet-23j1</a><br /><code>075</code>&nbsp;<a href="https://dev.to/hengnee/yet-another-git-cheatsheet-4gjk">https://dev.to/hengnee/yet-another-git-cheatsheet-4gjk</a><br /><code>076</code>&nbsp;<a href="https://dev.to/devmount/how-to-correct-git-commit-messages-402d">https://dev.to/devmount/how-to-correct-git-commit-messages-402d</a><br /><code>077</code>&nbsp;<a href="https://dev.to/devmount/signed-git-commits-in-vs-code-36do">https://dev.to/devmount/signed-git-commits-in-vs-code-36do</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#nodejs" name="nodejs"></a>Node.js</h4>
<p><code>078</code>&nbsp;<a href="https://devhints.io/nodejs">https://devhints.io/nodejs</a><br /><code>079</code>&nbsp;<a href="https://overapi.com/nodejs">https://overapi.com/nodejs</a><br /><code>080</code>&nbsp;<a href="https://dev.to/santypk4/bulletproof-node-js-project-architecture-4epf">https://dev.to/santypk4/bulletproof-node-js-project-architecture-4epf</a><br /><code>081</code>&nbsp;<a href="https://dev.to/jorge_rockr/everything-you-need-to-know-about-node-js-lnc">https://dev.to/jorge_rockr/everything-you-need-to-know-about-node-js-lnc</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#sublime-text" name="sublime-text"></a>Sublime Text</h4>
<p><code>082</code>&nbsp;<a href="https://devhints.io/sublime-text">https://devhints.io/sublime-text</a><br /><code>083</code>&nbsp;<a href="https://shortcuts.design/toolspage-sublimetext.html">https://shortcuts.design/toolspage-sublimetext.html</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#vim" name="vim"></a>Vim</h4>
<p><code>084</code>&nbsp;<a href="https://vim.rtorr.com/">https://vim.rtorr.com/</a><br /><code>085</code>&nbsp;<a href="https://devhints.io/vim">https://devhints.io/vim</a><br /><code>086</code>&nbsp;<a href="https://sheet.shiar.nl/vi">https://sheet.shiar.nl/vi</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#visual-studio-code" name="visual-studio-code"></a>Visual Studio Code</h4>
<p><code>087</code>&nbsp;<a href="https://devhints.io/vscode">https://devhints.io/vscode</a><br /><code>088</code>&nbsp;<a href="https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf">https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf</a><br /><code>089</code>&nbsp;<a href="https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf">https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf</a><br /><code>090</code>&nbsp;<a href="https://code.visualstudio.com/shortcuts/keyboard-shortcuts-linux.pdf">https://code.visualstudio.com/shortcuts/keyboard-shortcuts-linux.pdf</a><br /><code>091</code>&nbsp;<a href="https://dev.to/devmount/23-lesser-known-vs-code-shortcuts-as-gif-80">https://dev.to/devmount/23-lesser-known-vs-code-shortcuts-as-gif-80</a></p>
<h3><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#markup-and-styling" name="markup-and-styling"></a>Markup and Styling</h3>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#css-css3-flexbox" name="css-css3-flexbox"></a>CSS, CSS3, Flexbox</h4>
<p><code>092</code>&nbsp;<a href="https://htmlcheatsheet.com/css/">https://htmlcheatsheet.com/css/</a><br /><code>093</code>&nbsp;<a href="https://devhints.io/css">https://devhints.io/css</a><br /><code>094</code>&nbsp;<a href="http://overapi.com/css">http://overapi.com/css</a><br /><code>095</code>&nbsp;<a href="https://yoksel.github.io/flex-cheatsheet/">https://yoksel.github.io/flex-cheatsheet/</a><br /><code>096</code>&nbsp;<a href="https://dev.to/proticm/css-variables-cheat-sheet-32id">https://dev.to/proticm/css-variables-cheat-sheet-32id</a><br /><code>097</code>&nbsp;<a href="https://dev.to/iggredible/css-selectors-cheatsheet-24bh">https://dev.to/iggredible/css-selectors-cheatsheet-24bh</a><br /><code>098</code>&nbsp;<a href="https://dev.to/devmount/learn-css-animation-by-creating-pure-css-loaders-3lm6">https://dev.to/devmount/learn-css-animation-by-creating-pure-css-loaders-3lm6</a><br /><code>099</code>&nbsp;<a href="https://dev.to/devmount/8-games-to-learn-css-the-fun-way-4e0f">https://dev.to/devmount/8-games-to-learn-css-the-fun-way-4e0f</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#emmet" name="emmet"></a>Emmet</h4>
<p><code>100</code>&nbsp;<a href="https://docs.emmet.io/cheat-sheet/">https://docs.emmet.io/cheat-sheet/</a><br /><code>101</code>&nbsp;<a href="https://devhints.io/emmet">https://devhints.io/emmet</a><br /><code>102</code>&nbsp;<a href="https://dev.to/lalawuhan/emmet-love-4be5">https://dev.to/lalawuhan/emmet-love-4be5</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#html-html5" name="html-html5"></a>HTML, HTML5</h4>
<p><code>103</code>&nbsp;<a href="https://htmlcheatsheet.com/">https://htmlcheatsheet.com/</a><br /><code>104</code>&nbsp;<a href="https://devhints.io/html">https://devhints.io/html</a><br /><code>105</code>&nbsp;<a href="http://overapi.com/html">http://overapi.com/html</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#json" name="json"></a>JSON</h4>
<p><code>106</code>&nbsp;<a href="https://cheatography.com/mackan90096/cheat-sheets/json/">https://cheatography.com/mackan90096/cheat-sheets/json/</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#latex" name="latex"></a>LaTeX</h4>
<p><code>107</code>&nbsp;<a href="https://wch.github.io/latexsheet/">https://wch.github.io/latexsheet/</a><br /><code>108</code>&nbsp;<a href="https://dev.to/nickymarino/lets-use-latex">https://dev.to/nickymarino/lets-use-latex</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#markdown" name="markdown"></a>Markdown</h4>
<p><code>109</code>&nbsp;<a href="https://www.markdownguide.org/cheat-sheet">https://www.markdownguide.org/cheat-sheet</a><br /><code>110</code>&nbsp;<a href="https://devhints.io/markdown">https://devhints.io/markdown</a><br /><code>111</code>&nbsp;<a href="https://dev.to/rattanakchea/markdown-cheatsheet-for-developers-2bjj">https://dev.to/rattanakchea/markdown-cheatsheet-for-developers-2bjj</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#pug" name="pug"></a>Pug</h4>
<p><code>112</code>&nbsp;<a href="https://devhints.io/pug">https://devhints.io/pug</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#sass-scss" name="sass-scss"></a>SASS, SCSS</h4>
<p><code>113</code>&nbsp;<a href="https://sass-cheatsheet.brunoscopelliti.com/">https://sass-cheatsheet.brunoscopelliti.com/</a><br /><code>114</code>&nbsp;<a href="https://devhints.io/sass">https://devhints.io/sass</a><br /><code>115</code>&nbsp;<a href="https://dev.to/finallynero/scss-cheatsheet-7g6">https://dev.to/finallynero/scss-cheatsheet-7g6</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#stylus" name="stylus"></a>Stylus</h4>
<p><code>116</code>&nbsp;<a href="https://devhints.io/stylus">https://devhints.io/stylus</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#xpath" name="xpath"></a>Xpath</h4>
<p><code>117</code>&nbsp;<a href="https://devhints.io/xpath">https://devhints.io/xpath</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#yaml" name="yaml"></a>Yaml</h4>
<p><code>118</code>&nbsp;<a href="https://lzone.de//cheat-sheet/YAML">https://lzone.de//cheat-sheet/YAML</a><br /><code>119</code>&nbsp;<a href="https://devhints.io/yaml">https://devhints.io/yaml</a></p>
<h3><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#platforms-web-apps-and-code-management" name="platforms-web-apps-and-code-management"></a>Platforms, web apps and code management</h3>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#github" name="github"></a>Github</h4>
<p><code>120</code>&nbsp;<a href="https://github.com/tiimgreen/github-cheat-sheet">https://github.com/tiimgreen/github-cheat-sheet</a><br /><code>121</code>&nbsp;<a href="https://github.github.com/training-kit/downloads/github-git-cheat-sheet/">https://github.github.com/training-kit/downloads/github-git-cheat-sheet/</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#gitlab" name="gitlab"></a>Gitlab</h4>
<p><code>122</code>&nbsp;<a href="https://docs.gitlab.com/ee/user/markdown.html">https://docs.gitlab.com/ee/user/markdown.html</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#jupyter-notebook" name="jupyter-notebook"></a>Jupyter Notebook</h4>
<p><code>123</code>&nbsp;<a href="https://s3.amazonaws.com/assets.datacamp.com/blog_assets/Jupyter_Notebook_Cheat_Sheet.pdf">https://s3.amazonaws.com/assets.datacamp.com/blog_assets/Jupyter_Notebook_Cheat_Sheet.pdf</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#npm" name="npm"></a>NPM</h4>
<p><code>124</code>&nbsp;<a href="https://devhints.io/npm">https://devhints.io/npm</a><br /><code>125</code>&nbsp;<a href="https://guide.freecodecamp.org/developer-tools/npm-cheatsheet/">https://guide.freecodecamp.org/developer-tools/npm-cheatsheet/</a><br /><code>126</code>&nbsp;<a href="https://dev.to/therealdanvega/creating-your-first-npm-package-2ehf">https://dev.to/therealdanvega/creating-your-first-npm-package-2ehf</a></p>
<h4><a class="anchor" href="https://dev.to/devmount/a-cheatsheet-of-128-cheatsheets-for-developers-f4m#yarn" name="yarn"></a>Yarn</h4>
<p><code>127</code>&nbsp;<a href="https://devhints.io/yarn">https://devhints.io/yarn</a><br /><code>128</code>&nbsp;<a href="https://infinite.red/files/yarn.pdf">https://infinite.red/files/yarn.pdf</a></p>
<p>The post <a href="http://kostacipo.stream/a-cheatsheet-of-128-cheatsheets-for-developers/">A CheatSheet of 128 CheatSheets for Developers</a> appeared first on <a href="http://kostacipo.stream">Tech Chronicles</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://kostacipo.stream/a-cheatsheet-of-128-cheatsheets-for-developers/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>16 Python Libraries to &#8216;pip&#8217; in 2020</title>
		<link>http://kostacipo.stream/16-python-libraries-to-pip-in-2020/</link>
					<comments>http://kostacipo.stream/16-python-libraries-to-pip-in-2020/#respond</comments>
		
		<dc:creator><![CDATA[Majordomo]]></dc:creator>
		<pubDate>Mon, 20 Jan 2020 10:51:41 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[python]]></category>
		<guid isPermaLink="false">http://www.kostacipo.stream/?p=1673</guid>

					<description><![CDATA[<p>&#160; In this article we will get familiar with several amazing Python libraries being used by the best software teams. With the exception of HTTPX (which is in beta), the libraries listed below are being actively developed &#38; maintained and are backed by a strong community. HTTPX HTTPX was developed by Tom Christine, who is [&#8230;]</p>
<p>The post <a href="http://kostacipo.stream/16-python-libraries-to-pip-in-2020/">16 Python Libraries to &#8216;pip&#8217; in 2020</a> appeared first on <a href="http://kostacipo.stream">Tech Chronicles</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>&nbsp;</p>
<div class="paragraph">In this article we will get familiar with several amazing Python libraries being used by the best software teams. With the exception of HTTPX (which is in beta), the libraries listed below are being actively developed &amp; maintained and are backed by a strong community.</div>
<h2>HTTPX</h2>
<div class="paragraph"><a href="https://github.com/encode/httpx">HTTPX</a> was developed by Tom Christine, who is a software engineer specialized in API design and development.</div>
<div>&nbsp;</div>
<div class="paragraph">The async paradigm is increasingly becoming more common in high-performance modern applications, but when you are using the async paradigm, the <a href="https://pypi.org/project/requests/">Requests </a>library cannot do its job very well.</div>
<div>&nbsp;</div>
<div class="paragraph">Therefore, HTTPX comes to solve this problem. HTTPX is an asynchronous HTTP client based on the well-established usability of <a href="https://pypi.org/project/requests/">Requests </a>and gives you HTTP/2 and HTTP/1.1 support. It gives you an API compatible with the Requests library as much as possible, and it has a tight control on the timeouts. HTTPX can also call directly into a Python web application using the ASGI protocol and it is fully type annotated. The library&nbsp; is also equipped with all the standard features of Requests, such as International Domains and URLs, Keep-Alive &amp; Connection Pooling, and Sessions with Cookie Persistence, etc.</div>
<div>&nbsp;</div>
<div class="paragraph">Moreover, you can use either asyncio or trio for HTTPX and apply this in high-performance async web frameworks. As a result HTTPX is able to handle a large numbers of requests.</div>
<h2>Arrow</h2>
<div class="paragraph">As many Python developers know, one way to work with date &amp; time objects is by using the uncompleted date, time, and timezone functions in the Python&#8217;s standard library and some other low-level modules. However, they don&#8217;t have high performance and good usability; for example, they have too many modules and types, which is hard for users to remember and distinguish. The conversions between timezones and timestamps are also long-winded.</div>
<div class="paragraph">Luckily, a sensible and human-friendly Python Library called <a href="https://github.com/crsmithdev/arrow">Arrow</a> can help users create, manipulate, format, and convert dates. It mainly aims to reduce your imports and code for dealing with dates and times.&nbsp;</div>
<div>&nbsp;</div>
<div class="paragraph">Arrow supports Python 2.7, 3.5, 3.6, 3.7 and 3.8, and broadly supports ISO 8601. Of course, it can do timezone conversion, and the timestamp is also a property in it.</div>
<div class="paragraph">Some features of Arrow can give you a clue of&nbsp; its capability. Arrow has a drop-in replacement for DateTime, and is Timezone-aware by default. Users will get easy-to-use creation options for many general input scenarios. The shift method is beneficial for relative offsets, such as offsets for weeks. It&#8217;s possible to automatically format and parse strings, which saves a lot of time. One more attractive feature is that Arrow can create periods, ranges, floors, and ceilings for time frames, ranging from microseconds to years.</div>
<h2>Python Fire</h2>
<div class="paragraph"><a href="https://github.com/google/python-fire">Python Fire</a> can automatically generate CLIs for any projects. The library makes the process of creating CLIs super simple. You only need to write the functionality at the command line as a function, module, or class, and once you call Fire, the CLI that you desire is ready for you.</div>
<div>&nbsp;</div>
<div class="paragraph">You probably want to test early on during the process of writing a Python library. Without Python Fire, you have to write a primary test method to run the functionality you desire to achieve. Although you can do the test in this way, you need to change the primary method whenever you have new features you want to test, updating the primary method again and again, which is time-consuming and annoying. Using Fire you don&#8217;t need to change your primary test method continuously when you test your command line.&nbsp;</div>
<div>&nbsp;</div>
<div class="paragraph">It is usually not super quick to understand a function by looking at its code, particularly when the function was written by someone else. A better way is to call Fire on the module. This feature allows you to easily inspect all module functions/methods.</div>
<div>&nbsp;</div>
<div class="paragraph">Moreover, Fire can let you transit directly between Bash and Python so that you can use the unix tools at the same time.&nbsp;</div>
<h2>Starlette</h2>
<div class="paragraph"><a href="https://www.starlette.io/">Starlette</a> is a lightweight ASGI framework or toolkit for building high-performance asyncio services.</div>
<div>&nbsp;</div>
<div class="paragraph">This production-ready library has many features, including support for WebSocket and GraphQL. Starlette can do in-process background tasks, CORS, GZip, Static Files and Streaming responses. All of these features have extensive test coverage and a code base that is 100% type annotated with zero hard dependencies.</div>
<div>&nbsp;</div>
<div class="paragraph">Starlette is meant to be used as a complete framework, or as an ASGI toolkit, providing users with the flexibility to apply any of the components independently. Moreover, reusable components can be shared between any ASGI framework, creating an ecosystem of shared middleware and mountable applications.</div>
<h2>Mypy</h2>
<div class="paragraph"><a href="https://github.com/python/mypy">Mypy</a> is an optimal static type checker for Python 3 and Python 2.7, and it is similar to a static analyzer, or a lint-like tool. By adding some typing annotations when you write your program, Mypy can help you type check your code and look for general bugs. Those annotations you leave in your code guide Mypy to do its job without interfering with your application because the annotations are viewed as comments that have no effects in the execution of your code.</div>
<div>&nbsp;</div>
<div class="paragraph">Mypy gives developers the flexibility to decide the workflow. The purpose of Mypy is to combine the advantages of dynamic typing and static typing in the applications. Therefore, users can use dynamic typing as a backup when static typing doesn&#8217;t work, such as for legacy code. When you run Mypy in your program like a linter, the errors will be reported in a compiler-style format. Mypy provides programmers with a robust and consistent check for a project and its dependencies.</div>
<div>&nbsp;</div>
<div class="paragraph">Another advantage of Mypy is its learning curve, which is minimal. Most new users of Mypy should be able to annotate the code correctly for the first time. Moreover, the <a href="https://mypy.readthedocs.io/en/latest/cheat_sheet_py3.html">Mypy cheat sheet</a> is a perfect start. One more advantage of Mypy is that It has a much lower false-positive rate compared to most static analyzers.</div>
<h2>FastAPI</h2>
<div class="paragraph"><a href="https://fastapi.tiangolo.com/">FastAPI</a> is a high-performance web framework for API development. FastAPI is based on standard Python type hints for Python 3.6+.</div>
<div class="paragraph">FastAPI comes with many interesting features, perhaps the most important one is speed since it is one of the fastest Python frameworks available. The speed of coding is also 200% faster compared to other frameworks.</div>
<div>&nbsp;</div>
<div class="paragraph">And if that wasn&#8217;t enough, FastAPI can help to keep a low bug rate and can even reduce human related errors by almost 40%. The framework is easy to learn and has an interactive documentation.</div>
<div>&nbsp;</div>
<div class="paragraph">FastAPI is based on open standards, for instance OpenAPI. It also comes with declarations of path operations, parameters, body requests, and security. Features for automatic client code generation in different languages are also available.</div>
<h2>Immutables</h2>
<div class="paragraph"><a href="https://github.com/magicstack/immutables">Immutables</a> is an immutable mapping type for Python. A Hash Array Mapped Trie (HAMT)&nbsp; used in Clojure, Scala, Haskell, and other functional languages.</div>
<div class="paragraph">Immutable mappings based on HAMT have O(log N) performance for both set() and get() operations, which is essentially O(1) for relatively small mappings.</div>
<h2>Expiring Dict</h2>
<div class="paragraph"><a href="https://github.com/mailgun/expiringdict">Expiring Dict</a> is a very handy Python caching library. It provides a dictionary with ordering and auto-expiring values for caching purposes. Dictionary elements have a TTL (max age) and max length, which are checked on each access.&nbsp;</div>
<h2>VCR.py</h2>
<div class="paragraph">Have you ever used Ruby&#8217;s VCR library? It records your test suite&#8217;s HTTP interactions and replays them during future test runs for fast, deterministic and accurate tests.</div>
<div>&nbsp;</div>
<div class="paragraph"><a href="https://github.com/kevin1024/vcrpy">VCR.py</a> is similar to Ruby&#8217;s VCR library. It makes the tests with HTTP requests more straightforward and quicker. If your code is in a VCR.py context manager or decorated function, when you run it VCR.py will record all the HTTP interactions during your tests. Then VCR.py will serialize and write the HTTP interactions to a cassette, which is a flat file. When you execute the recorded code it will replay the serialized requests and responses from the cassette file.</div>
<div>&nbsp;</div>
<div class="paragraph">This process has many benefits because the requests will not generate any HTTP traffic. Therefore, VCR.py can do its job offline, help to generate deterministic tests as well as significantly increase their execution speed.</div>
<div>&nbsp;</div>
<div class="paragraph">When you make changes to your tests all you need to do is to delete the cassette file. Then when you re-run the code, VCR.py will record again the HTTP interactions and generate a new cassette.</div>
<h2>Transformers</h2>
<div class="paragraph"><a href="https://github.com/huggingface/transformers">Transformers </a>(former pytorch-transformers and pytorch-pretrained-bert) provides Natural Language Understanding (NLU) and Natural Language Generation (NLG) with more than 32 prepared models in over 100 languages and deep interoperability between TensorFlow 2.0 and PyTorch. Those architectures generally are BERT, GPT-2, RoBERTa, XLM, DistilBert, XLNet, and others.</div>
<div>&nbsp;</div>
<div class="paragraph">Transformers is an easy-to-use library with no barriers to get familiar with. It is even more powerful and concise than <a href="https://keras.io/">Keras</a>, with the added benefit that it has extraordinary high performance when dealing with NLU and NLG projects.</div>
<div>&nbsp;</div>
<div class="paragraph">The goal of Transformers is to become the state-of-the-art NLP for everyone. No matter if you are a deep learning researcher, hands-on practitioner, or AI/ML/NLP teacher and educator, you can get a lot of support from Transformers.&nbsp; The library is very efficient as it reduces the compute costs. For example, you can share your trained models with your colleagues so that they do not need to spend extra efforts retraining models. It comes with more than 30 preset models, and over 100 languages which can save a lot of time on computing and thus help to reduce production costs.</div>
<div>&nbsp;</div>
<div class="paragraph">Lastly, Transformers can use the most suitable framework for each part of your applications over time. Specifically, Transformers can use only three lines of code to train a state-of-the-art system for you. The deep interoperability between TensorFlow 2.0 and PyTorch models is an added benefit.&nbsp;</div>
<h2>Modin</h2>
<div class="paragraph">If you are a data scientist you are probably familiar with the Pandas library. <a href="https://github.com/modin-project/modin">Modin</a> can scale your Pandas workflows by changing only one line of code. Sounds great, right?&nbsp;</div>
<div class="paragraph">Before proving more details on Modin we first need to introduce <a href="https://github.com/ray-project/ray">Ray</a>, which is the key to how Modin works. Ray is a fast and accessible framework for building and running distributed applications. Ray is packaged with Tune, RLlib, and Distributed Training.</div>
<div>&nbsp;</div>
<div class="paragraph">The relationship between Modin and Ray is that Modin uses Ray to speed up the Pandas notebook, scripts, and libraries in an effortless way. A weakness of other distributed DataFrame libraries is the regular conflicts among Pandas code. Modin can solve this problem by integrating the Pandas code seamlessly.</div>
<div>&nbsp;</div>
<div class="paragraph">Using Modin, you do not need to know details about the cores of your system and the distribution of the data. You do not need to abandon the Pandas notebooks you previously used to take advantage of the enormous acceleration provided by Modin.&nbsp;</div>
<div>&nbsp;</div>
<div class="paragraph">Moreover, the modin.pandas is an extremely lightweight parallel DataFrame. After you install Modin, there is no need to stop using the previous Pandas API because Modin can do transparent distribution of the data and computation.&nbsp;</div>
<div>&nbsp;</div>
<div class="paragraph">Sometimes, when facing different data sizes it may be difficult to scale 1KB DataFrames to 1TB, there is often a significant overhead. With Modin, you can directly get DataFrames at both 1KB and 1TB.</div>
<h2>Dash</h2>
<div class="paragraph">If you are building web apps with complex or large datasets, <a href="https://github.com/plotly/dash">Dash</a> might be for you. Dash is very suitable for visualizing data and it also provides apps with customized user interfaces in pure Python.</div>
<div>&nbsp;</div>
<div class="paragraph">Dash can even help you to build user interfaces with Python code in a short amount of time. Dash replaces many of the tools and technologies used for building an interactive web application and it does its job in a simple way.</div>
<h2>Detectron 2</h2>
<div class="paragraph">Detectron is an object detection platform. It is one of the open-source projects adopted by the Facebook AI Research group.</div>
<div>&nbsp;</div>
<div class="paragraph"><a href="https://github.com/facebookresearch/detectron2">Detectron 2</a> is the second generation of this library with many performance enhancements. The library is flexible and extensible and makes training on GPU servers a very quick process. It also comes with state-of-the-art object detection algorithms, allowing developers to do advanced research without the whole complete dataset.</div>
<div>&nbsp;</div>
<div class="paragraph">Detectron 2 was rewritten from Scratch in PyTorch, which is a great tool for deep learning. The vast and active community behind PyTorch is an added benefit for Detectron2 users.</div>
<div>&nbsp;</div>
<div class="paragraph">With Detectron2, users can insert their customized code into the object detection system as they see fit. Under this situation, hundreds of lines of code can successfully develop a new research project, and the core Detectron2 and the brand-new research achievement can be divided clearly. Moreover, Detectron2 also supports semantic segmentation and panoptic segmentation.</div>
<div>&nbsp;</div>
<div class="paragraph">The reason why Detectron2 is faster than the original version is due to moving the entire training pipeline to GPU. Distributing the training to different GPU servers makes the scaling process of large data sets much easier.</div>
<h2>Streamlit</h2>
<div class="paragraph"><a href="https://github.com/streamlit/streamlit">Streamlit</a> is a library that can provide you with the fastest way to build custom Machine Learning tools.&nbsp;</div>
<div>&nbsp;</div>
<div class="paragraph">The library embraces Python scripting resulting in clean code and fast prototyping. Each change in the Python code directly reruns the code from top to bottom. The cache primitive in Streamlit is consistent, immutable-by-default so users can reuse the information effortlessly.</div>
<h2>Imbalanced-learn</h2>
<div class="paragraph"><a href="https://github.com/scikit-learn-contrib/imbalanced-learn">Imbalanced-learn</a> offers many re-sampling techniques for machine learning projects. This python library is widely used in datasets to show a robust between-class imbalance.</div>
<div>&nbsp;</div>
<div class="paragraph">Imbalanced-learn is compatible with scikit-learn. Scikit-learn is a simple and efficient tool for predictive data analysis. It is built on NumPy, SciPy,and matplotlib. It is open source and very reusable. The library is available for Python 3.6+.</div>
<h2>PyTorch</h2>
<div class="paragraph"><a href="https://github.com/pytorch/pytorch">PyTorch</a> offers rapid prototyping for dynamic neural networks and&nbsp;strong GPU support.</div>
<div>&nbsp;</div>
<div class="paragraph">The compositions of PyTorch are torch, torch.autograd, torch.jit, torch.nn, torch.multiprocessing, and torch.utils. Component torch is a NumPy like Tensor library, which has the strong GPU support.&nbsp; Torch.autograd is a tape-based automatic differentiation library that is accessible to all various Tensor operations in torch. Torch.jit can work as a compilation stack to create serializable and ideal models. Troch.nn is aggregated with autograd as a neural network aiming for maximum flexibility. Torch.multiprocessing is useful for data loading and Hogwild training.</div>
<div>&nbsp;</div>
<div class="paragraph">Lastly, torch.utils has a data loader and other utility functions for convenience.</div>
<p>The post <a href="http://kostacipo.stream/16-python-libraries-to-pip-in-2020/">16 Python Libraries to &#8216;pip&#8217; in 2020</a> appeared first on <a href="http://kostacipo.stream">Tech Chronicles</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://kostacipo.stream/16-python-libraries-to-pip-in-2020/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How To Build a Chatbot Project Using Python</title>
		<link>http://kostacipo.stream/how-to-build-a-chatbot-project-using-python/</link>
					<comments>http://kostacipo.stream/how-to-build-a-chatbot-project-using-python/#respond</comments>
		
		<dc:creator><![CDATA[Majordomo]]></dc:creator>
		<pubDate>Fri, 17 Jan 2020 10:57:01 +0000</pubDate>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[python]]></category>
		<guid isPermaLink="false">http://www.kostacipo.stream/?p=1663</guid>

					<description><![CDATA[<p>&#160; Chatbots are extremely helpful for business organizations and also the customers. The majority of people prefer to talk directly from a chatbox instead of calling service centers. &#160; Facebook released data that proved the value of bots. More than 2 billion messages are sent between people and companies monthly. The HubSpot research tells that [&#8230;]</p>
<p>The post <a href="http://kostacipo.stream/how-to-build-a-chatbot-project-using-python/">How To Build a Chatbot Project Using Python</a> appeared first on <a href="http://kostacipo.stream">Tech Chronicles</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>&nbsp;</p>
<div class="paragraph">Chatbots are extremely helpful for business organizations and also the customers. The majority of people prefer to talk directly from a chatbox instead of calling service centers.</div>
<div>&nbsp;</div>
<div class="paragraph">Facebook released data that proved the value of bots. More than 2 billion messages are sent between people and companies monthly. The HubSpot research tells that 71% of the people want to get customer support from messaging apps. It is a quick way to get their problems solved so chatbots have a bright future in organizations.</div>
<div>&nbsp;</div>
<div class="paragraph">Today we are going to build an exciting project on Chatbot. We will implement a chatbot from scratch that will be able to understand what the user is talking about and give an appropriate response.</div>
<div>&nbsp;</div>
<div class="paragraph"><strong>Prerequisites</strong></div>
<div>&nbsp;</div>
<div class="paragraph">To implement the chatbot we will be using Keras which is a Deep Learning library, NLTK which is a Natural Language Processing Toolkit and some helpful libraries. Run the below command to make sure all the libraries are installed</div>
<div class="code-container">
<pre><code>pip install tensorflow keras pickle nltk&nbsp;</code></pre>
</div>
<div class="paragraph">Python Cheat Sheet &#8211;&nbsp;<a href="https://sites.google.com/view/learn-python-data-science/home"><strong><em>Master guide to learn Python for free</em></strong></a>.&nbsp;</div>
<h2>How do Chatbots work?</h2>
<div class="paragraph">Chatbots are nothing but an intelligent piece of software that can interact and communicate with people just like humans. Interesting isn’t it! So now let us understand how they actually work.&nbsp;All the chatbot comes under the NLP (Natural Language Processing) concepts. NLP is composed of two things:&nbsp;</div>
<ol>
<li><strong>NLU (Natural Language Understanding):</strong> The ability of machines to understand human language like English.</li>
<li><strong>NLG (Natural Language Generation):</strong> The ability of a machine to generate text similar to human written sentences.</li>
</ol>
<div class="paragraph">Image a user asking a question to a chatbot “Hey, What’s on the news today? ”&nbsp;The chatbot will break down the user sentence into two things: Intent and an Entity. The intent for this sentence could be get_news as it refers to an action the user wants to perform. The entity tells specific details about the intent, so here ‘today’ will be the entity. So this way a machine learning model is used to recognize the intents and entities of the chat.</div>
<h2>Project file structure&nbsp;</h2>
<div class="paragraph">After the project is complete, you will be left with all these files. Lets quickly go through each of them, it will give you an idea of how the project will be implemented.&nbsp;</div>
<ol>
<li><strong>Train_chatbot.py &#8211;</strong>&nbsp;In this file, we will build and train the deep learning model that can classify and identify what the user is asking to the bot.</li>
<li><strong>Gui_Chatbot.py &#8211;</strong>&nbsp;This file is where we will build a graphical user interface to chat with our trained chatbot.</li>
<li><strong>Intents.json &#8211;</strong>&nbsp;The intents file has all the data that we will use to train the model. It contains a collection of tags with their corresponding patterns and responses.</li>
<li><strong>Chatbot_model.h5 &#8211;</strong>&nbsp;This is a hierarchical data format file in which we have stored the weights and the architecture of our trained model.</li>
<li><strong>Classes.pkl &#8211;</strong> The pickle file can be used to store all the tag names to classify when we are predicting the message.</li>
<li><strong>Words.pkl &#8211;</strong> The words.pkl pickle file contains all the unique words that are the vocabulary of our model.</li>
</ol>
<div class="paragraph"><a href="https://drive.google.com/drive/folders/1r6MrrdE8V0bWBxndGfJxJ4Om62dJ2OMP?usp=sharing"><em>Download the source code and the dataset</em></a></div>
<h2>How to build your own chatbot?</h2>
<div class="paragraph">The building of this chatbot is simplified in 5 steps:</div>
<div>&nbsp;</div>
<div class="paragraph"><strong>Step 1.&nbsp; Import libraries and load the data</strong>&nbsp;&#8211;&nbsp;Create a new python file and name it as train_chatbot and then we are going to import all the required modules. After that, we will read the JSON data file in our python program.&nbsp;</div>
<div class="code-container">
<pre><code>import numpy as np
from keras.models import Sequential
from keras.layers import Dense, Activation, Dropout
from keras.optimizers import SGD
import random
import nltk
from nltk.stem import WordNetLemmatizer
lemmatizer = WordNetLemmatizer()
import json
import pickle
intents_file = open('intents.json').read()
intents = json.loads(intents_file)</code></pre>
</div>
<div class="paragraph">Here’s how our intents file looks like.</div>
<div>&nbsp;</div>
<div class="image-container"><img decoding="async" src="https://hackernoon.com/photos/1nWBP7HnklXk2egeiTHTBjYAe6G2-nq6c30pk" alt=""></div>
<div>&nbsp;</div>
<div class="paragraph"><strong>Step 2. Preprocessing the data</strong></div>
<div>&nbsp;</div>
<div class="paragraph">The model cannot take the raw data. It has to go through a lot of pre-processing for machine to easily understand. For a textual data, there are many preprocessing techniques available. The first technique is Tokenizing in which we break the sentences into words.&nbsp;&nbsp;</div>
<div>&nbsp;</div>
<div class="paragraph">By observing the intents file we can see that each tag contains a list of patterns and responses. We tokenize each pattern and add the words in a list. Also, we create a list of classes and documents to add all the intents associated with patterns.&nbsp;</div>
<div class="code-container">
<pre><code>words=[]
classes = []
documents = []
ignore_letters = ['!', '?', ',', '.']
for intent in intents['intents']:
&nbsp;&nbsp;&nbsp;&nbsp;for pattern in intent['patterns']:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#tokenize each word
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;word = nltk.word_tokenize(pattern)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;words.extend(word)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#add documents in the corpus
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documents.append((word, intent['tag']))
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# add to our classes list
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if intent['tag'] not in classes:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;classes.append(intent['tag'])
print(documents)</code></pre>
</div>
<div class="paragraph">Another technique is the Lemmatization. We can convert words into the lemma form so that we can reduce all the canonical words. For example, the words play, playing, plays, played, etc will all be replaced with play. This way we can reduce the number of total words in our vocabulary. So now we lemmatize each word and remove the duplicate words.&nbsp;</div>
<div class="code-container">
<pre><code># lemmaztize and lower each word and remove duplicates
words = [lemmatizer.lemmatize(w.lower()) for w in words if w not in ignore_letters]
words = sorted(list(set(words)))
# sort classes
classes = sorted(list(set(classes)))
# documents = combination between patterns and intents
print (len(documents), "documents")
# classes = intents
print (len(classes), "classes", classes)
# words = all words, vocabulary
print (len(words), "unique lemmatized words", words)
pickle.dump(words,open('words.pkl','wb'))
pickle.dump(classes,open('classes.pkl','wb'))</code></pre>
</div>
<div class="paragraph">In the end, the words contain the vocabulary of our project and classes contain the total entities to classify. To save the python object in a file we used the <strong>pickle.dump()</strong> method. These files will be helpful after the training is done and we predict the chats.</div>
<div>&nbsp;</div>
<div class="paragraph"><strong>Step 3. Create training and testing data</strong></div>
<div>&nbsp;</div>
<div class="paragraph">To train the model we will convert each input pattern into numbers. First, we will lemmatize each word of the pattern and create a list of zeroes of the same length as the total number of words. We will set value 1 to only those index that contains the word in the patterns. Same way we will create the output by setting 1 to the class input pattern belongs to.&nbsp;</div>
<div class="code-container">
<pre><code># create the training data
training = []
# create empty array for the output
output_empty = [0] * len(classes)
# training set, bag of words for every sentence
for doc in documents:
&nbsp;&nbsp;&nbsp;&nbsp;# initializing bag of words
&nbsp;&nbsp;&nbsp;&nbsp;bag = []
&nbsp;&nbsp;&nbsp;&nbsp;# list of tokenized words for the pattern
&nbsp;&nbsp;&nbsp;&nbsp;word_patterns = doc[0]
&nbsp;&nbsp;&nbsp;&nbsp;# lemmatize each word - create base word, in attempt to represent related words
&nbsp;&nbsp;&nbsp;&nbsp;word_patterns = [lemmatizer.lemmatize(word.lower()) for word in word_patterns]
&nbsp;&nbsp;&nbsp;&nbsp;# create the bag of words array with 1, if word is found in current pattern
&nbsp;&nbsp;&nbsp;&nbsp;for word in words:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bag.append(1) if word in word_patterns else bag.append(0)
&nbsp;&nbsp;&nbsp;&nbsp;# output is a '0' for each tag and '1' for current tag (for each pattern)
&nbsp;&nbsp;&nbsp;&nbsp;output_row = list(output_empty)
&nbsp;&nbsp;&nbsp;&nbsp;output_row[classes.index(doc[1])] = 1
&nbsp;&nbsp;&nbsp;&nbsp;training.append([bag, output_row])
# shuffle the features and make numpy array
random.shuffle(training)
training = np.array(training)
# create training and testing lists. X - patterns, Y - intents
train_x = list(training[:,0])
train_y = list(training[:,1])
print("Training data is created")</code></pre>
</div>
<div class="paragraph"><strong>Step 4. Training the model&nbsp;</strong></div>
<div>&nbsp;</div>
<div class="paragraph">The architecture of our model will be a neural network consisting of 3 Dense layers. The first layer has 128 neurons, second one has 64 and the last layer will have the same neurons as the number of classes. The dropout layers are introduced to reduce overfitting of the model. We have used SGD optimizer and fit the data to start training of the model. After the training of 200 epochs is completed we then save the trained model using Keras model.save(“chatbot_model.h5”) function.&nbsp;</div>
<div class="code-container">
<pre><code># deep neural networds model
model = Sequential()
model.add(Dense(128, input_shape=(len(train_x[0]),), activation='relu'))
model.add(Dropout(0.5))
model.add(Dense(64, activation='relu'))
model.add(Dropout(0.5))
model.add(Dense(len(train_y[0]), activation='softmax'))
# Compiling model. SGD with Nesterov accelerated gradient gives good results for this model
sgd = SGD(lr=0.01, decay=1e-6, momentum=0.9, nesterov=True)
model.compile(loss='categorical_crossentropy', optimizer=sgd, metrics=['accuracy'])
#Training and saving the model&nbsp;
hist = model.fit(np.array(train_x), np.array(train_y), epochs=200, batch_size=5, verbose=1)
model.save('chatbot_model.h5', hist)
print("model is created")</code></pre>
</div>
<div class="paragraph"><strong>Step 5. Interacting with the chatbot</strong></div>
<div>&nbsp;</div>
<div class="paragraph">Our model is ready to chat so now let’s create a nice graphical user interface for our chatbot in a new file. You can name the file as gui_chatbot.py</div>
<div>&nbsp;</div>
<div class="paragraph">In our GUI file, we will be using the Tkinter module to build the structure of the desktop application and then we will capture the user message and again perform some preprocessing before we input the message into our trained model.</div>
<div>&nbsp;</div>
<div class="paragraph">The model will then predict the tag of the user’s message and we will randomly select the response from the list of responses in our intents file.&nbsp;</div>
<div>&nbsp;</div>
<div class="paragraph">Here’s the full source code for the GUI file.&nbsp;</div>
<div class="code-container">
<pre><code>import nltk
from nltk.stem import WordNetLemmatizer
lemmatizer = WordNetLemmatizer()
import pickle
import numpy as np
from keras.models import load_model
model = load_model('chatbot_model.h5')
import json
import random
intents = json.loads(open('intents.json').read())
words = pickle.load(open('words.pkl','rb'))
classes = pickle.load(open('classes.pkl','rb'))
<span class="hljs-function">def clean_up_sentence(sentence):</span>
&nbsp;&nbsp;&nbsp;&nbsp;# tokenize the pattern - splitting words into array
&nbsp;&nbsp;&nbsp;&nbsp;sentence_words = nltk.word_tokenize(sentence)
&nbsp;&nbsp;&nbsp;&nbsp;# stemming every word - reducing to base form
&nbsp;&nbsp;&nbsp;&nbsp;sentence_words = [lemmatizer.lemmatize(word.lower()) for word in sentence_words]
&nbsp;&nbsp;&nbsp;&nbsp;return sentence_words
# return bag of words array: 0 or 1 for words that exist in sentence
<span class="hljs-function">def bag_of_words(sentence, words, show_details=True):</span>
&nbsp;&nbsp;&nbsp;&nbsp;# tokenizing patterns
&nbsp;&nbsp;&nbsp;&nbsp;sentence_words = clean_up_sentence(sentence)
&nbsp;&nbsp;&nbsp;&nbsp;# bag of words - vocabulary matrix
&nbsp;&nbsp;&nbsp;&nbsp;bag = [0]*len(words)&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;for s in sentence_words:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for i,word in enumerate(words):
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if word == s:&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# assign 1 if current word is in the vocabulary position
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bag[i] = 1
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if show_details:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print ("found in bag: %s" % word)
&nbsp;&nbsp;&nbsp;&nbsp;return(np.array(bag))
<span class="hljs-function">def predict_class(sentence):</span>
&nbsp;&nbsp;&nbsp;&nbsp;# filter below&nbsp; threshold predictions
&nbsp;&nbsp;&nbsp;&nbsp;p = bag_of_words(sentence, words,show_details=False)
&nbsp;&nbsp;&nbsp;&nbsp;res = model.predict(np.array([p]))[0]
&nbsp;&nbsp;&nbsp;&nbsp;ERROR_THRESHOLD = 0.25
&nbsp;&nbsp;&nbsp;&nbsp;results = [[i,r] for i,r in enumerate(res) if r&gt;ERROR_THRESHOLD]
&nbsp;&nbsp;&nbsp;&nbsp;# sorting strength probability
&nbsp;&nbsp;&nbsp;&nbsp;results.sort(key=lambda x: x[1], reverse=True)
&nbsp;&nbsp;&nbsp;&nbsp;return_list = []
&nbsp;&nbsp;&nbsp;&nbsp;for r in results:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return_list.append({"intent": classes[r[0]], "probability": str(r[1])})
&nbsp;&nbsp;&nbsp;&nbsp;return return_list
<span class="hljs-function">def getResponse(ints, intents_json):</span>
&nbsp;&nbsp;&nbsp;&nbsp;tag = ints[0]['intent']
&nbsp;&nbsp;&nbsp;&nbsp;list_of_intents = intents_json['intents']
&nbsp;&nbsp;&nbsp;&nbsp;for i in list_of_intents:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(i['tag']== tag):
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result = random.choice(i['responses'])
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break
&nbsp;&nbsp;&nbsp;&nbsp;return result
#Creating tkinter GUI
import tkinter
from tkinter import *
<span class="hljs-function">def send():</span>
&nbsp;&nbsp;&nbsp;&nbsp;msg = EntryBox.get("1.0",'end-1c').strip()
&nbsp;&nbsp;&nbsp;&nbsp;EntryBox.delete("0.0",END)
&nbsp;&nbsp;&nbsp;&nbsp;if msg != '':
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ChatBox.config(state=NORMAL)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ChatBox.insert(END, "You: " + msg + '\n\n')
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ChatBox.config(foreground="#446665", font=("Verdana", 12 ))
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ints = predict_class(msg)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;res = getResponse(ints, intents)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ChatBox.insert(END, "Bot: " + res + '\n\n')
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ChatBox.config(state=DISABLED)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ChatBox.yview(END)
root = Tk()
root.title("Chatbot")
root.geometry("400x500")
root.resizable(width=FALSE, height=FALSE)
#Create Chat window
ChatBox = Text(root, bd=0, bg="white", height="8", width="50", font="Arial",)
ChatBox.config(state=DISABLED)
#Bind scrollbar to Chat window
scrollbar = Scrollbar(root, command=ChatBox.yview, cursor="heart")
ChatBox['yscrollcommand'] = scrollbar.set
#Create Button to send message
SendButton = Button(root, font=("Verdana",12,'bold'), text="Send", width="12", height=5,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bd=0, bg="#f9a602", activebackground="#3c9d9b",fg='#000000',
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;command= send )
#Create the box to enter message
EntryBox = Text(root, bd=0, bg="white",width="29", height="5", font="Arial")
#EntryBox.bind("&lt;Return&gt;", send)
#Place all components on the screen
scrollbar.place(x=376,y=6, height=386)
ChatBox.place(x=6,y=6, height=386, width=370)
EntryBox.place(x=128, y=401, height=90, width=265)
SendButton.place(x=6, y=401, height=90)
root.mainloop()</code></pre>
</div>
<h2><strong>Running the chatbot</strong></h2>
<div class="paragraph">Now we have two separate files, one is the train_chatbot.py which we will use first to train the model.&nbsp;</div>
<div class="code-container">
<pre><code>python train_chatbot.py</code></pre>
</div>
<p>The post <a href="http://kostacipo.stream/how-to-build-a-chatbot-project-using-python/">How To Build a Chatbot Project Using Python</a> appeared first on <a href="http://kostacipo.stream">Tech Chronicles</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://kostacipo.stream/how-to-build-a-chatbot-project-using-python/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How SQL Database Engines Work</title>
		<link>http://kostacipo.stream/how-sql-database-engine-work/</link>
					<comments>http://kostacipo.stream/how-sql-database-engine-work/#respond</comments>
		
		<dc:creator><![CDATA[Majordomo]]></dc:creator>
		<pubDate>Fri, 17 Jan 2020 10:11:33 +0000</pubDate>
				<category><![CDATA[Data]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[sql]]></category>
		<guid isPermaLink="false">http://www.kostacipo.stream/?p=1659</guid>

					<description><![CDATA[<p>&#160; As a start, I am assuming that you all know what is SQL or you have some experience with SQL or you are using SQL for many years. &#160; I know many people who know so much about SQL and even have created many projects based on SQL and they do not know what [&#8230;]</p>
<p>The post <a href="http://kostacipo.stream/how-sql-database-engine-work/">How SQL Database Engines Work</a> appeared first on <a href="http://kostacipo.stream">Tech Chronicles</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>&nbsp;</p>
<div class="paragraph">As a start, I am assuming that you all know what is SQL or you have some experience with SQL or you are using SQL for many years.</div>
<div>&nbsp;</div>
<div class="paragraph">I know many people who know so much about SQL and even have created many projects based on SQL and they do not know what is the SQL engine or how actually SQL database engine works. It’s obvious no one’s care about the internal working of SQL engine or something because without knowing How SQL works we can still create and access database using any SQL program.</div>
<div>&nbsp;</div>
<div class="paragraph"><strong>##Is SQL a Programming or a Query Language?</strong></div>
<div>&nbsp;</div>
<div class="paragraph">With SQL we can interchangeably use the Query and Programming language, many developers refer SQL as a peculiar programming language because SQL engine contain two components compiler and vertical machine the compiler compile the query commands into procedures and the Virtual machine runs that procedures. The concept of SQL engine compiling and executing the SQL query make it a programming language. So if someone says SQL is a programming language then up to some extent he would be considered right.</div>
<div>&nbsp;</div>
<div class="paragraph"><strong>Why to use SQL if we any programming Language can create a CRUD operations program?</strong></div>
<div>&nbsp;</div>
<div class="paragraph">It’s correct that using any programming language we can create a program which can perform simple CRUD (Create Read Update and Delete) operations, but when it’s come complex queries for that in programming language we have to write hundreds of lines for the equivalent few lines of SQL.</div>
<div>&nbsp;</div>
<div class="paragraph"><strong>SQL Overview</strong></div>
<div>&nbsp;</div>
<div class="paragraph">SQL stands for Structured Query Language which could be refer as either a programming or a Query language, the main purpose of SQL to interact with the relational database in which data store in tabular form. SQL can manage a large amount of data, especially if data is written simultaneously and we have many transitions over that data.</div>
<div class="paragraph">When the user uses SQL for data management, there the user gets the ability to perform Create, Retrieve, Update, and Delete data between database. There are various Relational Database Management systems(DBMS) such as MySQL, SQLite, Postgres SQL, etc. and they all provided the same kind of features.</div>
<div class="paragraph">There are some terminologies in Database such as database server, or Database engine, or database management system. In database we can interchangeably use these three terminologies so do not get confused when we say SQL engine or SQL server, they all are same.</div>
<div>&nbsp;</div>
<div class="paragraph"><strong>What is a SQL Engine?</strong></div>
<div>&nbsp;</div>
<div class="paragraph">A SQL engine is a kind of software that collect and interprets the SQL commands so the appropriate operations can be performed on the relational database. The objective of SQL engine to create, read, update and delete (CRUD) data from a database.</div>
<div class="paragraph">A SQL engine or a SQL server database engine includes two main components a storage engine and a query processor, these days some modern SQL DBMS contains more than one Storage engines. We have many types of SQL engines and they all have different architecture, but used to perform the same objective which includes CRUD operations on the database and many other features.</div>
<div>&nbsp;</div>
<div class="paragraph">SQL has cover a large part of online market and many enterprises use their SQL systems for Online Transaction Processing and online analytical processing.</div>
<div>&nbsp;</div>
<div class="paragraph"><strong>How the SQL Database Engine Works?</strong></div>
<div>&nbsp;</div>
<div class="paragraph">On the surface we all know, the compiler of SQL compiles the query and the virtual machine execute the compiled query. Now let’s talk about how the database engine works.</div>
<div class="paragraph">SQL has many stages on which the process of query compilation and execution take place. Every SQL database engine contain two main components Compiler and Virtual machine to execute the queries. The compiler read the query and convert that query to appropriate byte code, then that byte code evaluated by the virtual machine and a proper response given back to the client.</div>
<div class="paragraph">The Complete Execution of a query is Categories into 3 main stages</div>
<ul>
<li>Compiling (Parsing, Checks, and Semantics)</li>
<li>Binding</li>
<li>Optimising</li>
<li>Executing</li>
</ul>
<div class="paragraph"><strong>Compiling-parsing</strong></div>
<div>&nbsp;</div>
<div class="paragraph">This is a part of compiling process, and in compiling parsing the query statement is tokenized into individual words with appropriate verbiage and clauses.</div>
<div>&nbsp;</div>
<div class="paragraph"><strong>Compiling-Check-Semantics</strong></div>
<div>&nbsp;</div>
<div class="paragraph">The Compiling Semitics checks the validation of the statement and match it with the system’s catalogue. This Compiling stage validates whether the query is valid or not, it also validates the authority of user to execute the statement.</div>
<div>&nbsp;</div>
<div class="paragraph"><strong>Compiling-Binding</strong></div>
<div>&nbsp;</div>
<div class="paragraph">It creates the corresponding binary representation for the entered query statement. All the SQL server engines has this compiling state where the byte code get generated.</div>
<div class="paragraph">By this stage of compiling the statement has been compiled and now it will be sent to the database server for the optimization and execution.</div>
<div>&nbsp;</div>
<div class="paragraph"><strong>Optimising</strong></div>
<div>&nbsp;</div>
<div class="paragraph">It Optimizes the best algorithm for the byte code. This feature is also known as Query Optimizer or Relational Engine.</div>
<div>&nbsp;</div>
<div class="paragraph"><strong>Executing</strong></div>
<div>&nbsp;</div>
<div class="paragraph">The Virtual machine get the Optimised byte code and execute it.</div>
<div class="paragraph">
<pre><code><strong>SQL STATEMENT --&gt; Parsing --&gt;Binding --&gt; Query Optimization --&gt; Query Execution --&gt;&nbsp;Result</strong></code></pre>
</div>
<div class="paragraph"><strong>Note: </strong>The Parsing Compiling process does not require any permission from database which make it the fastest processing stage of Compiling.</div>
<div>&nbsp;</div>
<div class="paragraph"><strong>SQL conversion of Data to Table</strong></div>
<div>&nbsp;</div>
<div class="paragraph">SQL was written in C and it uses a principle of Binary-Tree which make the incoming data to store in Rows and Columns. In binary tree structure we have several branches that keep pointing to the new data element same structure is followed by the SQL database in which data get turned into tables where each column and rows data point to each other.</div>
<div>&nbsp;</div>
<div class="paragraph"><strong>SQL Database Engines Work in a Nutshell</strong></div>
<div>&nbsp;</div>
<div class="paragraph">The SQL engine Process the query into multistage. The processing of query can vary from one relational DBMS to another. In the very first stage the query get parse and converted into compatible format such as JASON file, then the another compiling process take place which check the sematic of the parsed file, and in last stage of compilation the parsed file gets converted into corresponding byte code.</div>
<div class="paragraph">The Second step is optimization in which appropriate algorithms such as sorting, searching, etc. applied on the byte code. At last, the virtual machine executes the code and provide the client with the proper result.</div>
<div>&nbsp;</div>
<div class="paragraph"><strong>What is a SQL Server Storage Engine?</strong></div>
<div>&nbsp;</div>
<div class="paragraph">It is a software which is used to perform CRUD (Create, Read, Update and Delete) operation between disk and memory.</div>
<div>&nbsp;</div>
<div class="paragraph"><strong>Conclusion</strong></div>
<div>&nbsp;</div>
<div class="paragraph">To create a database environment, we require SQL database engine, and to build the database engine we often use the low-level programming languages such as C++ or C because they give user control over the memory management, which is missing in high-level programming languages, in high-level programming languages memory-management is done automatically by the operating system. SQL engine is cross-platform developers can use different platforms to build some program but all the platform can link with SQL engine for the database facilities.</div>
<p>The post <a href="http://kostacipo.stream/how-sql-database-engine-work/">How SQL Database Engines Work</a> appeared first on <a href="http://kostacipo.stream">Tech Chronicles</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://kostacipo.stream/how-sql-database-engine-work/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Creating a Secure Pipeline: Jenkins with SonarQube and DependencyCheck</title>
		<link>http://kostacipo.stream/creating-a-secure-pipeline-jenkins-with-sonarqube-and-dependencycheck/</link>
					<comments>http://kostacipo.stream/creating-a-secure-pipeline-jenkins-with-sonarqube-and-dependencycheck/#respond</comments>
		
		<dc:creator><![CDATA[Majordomo]]></dc:creator>
		<pubDate>Wed, 08 Jan 2020 10:45:34 +0000</pubDate>
				<category><![CDATA[DevOps]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[ci/cd]]></category>
		<category><![CDATA[jenkins]]></category>
		<category><![CDATA[owasp]]></category>
		<category><![CDATA[sonarqube]]></category>
		<guid isPermaLink="false">http://www.kostacipo.stream/?p=1639</guid>

					<description><![CDATA[<p>&#160; Configuring Jenkins To Build WebGoat We&#8217;re going to scan a known vulnerable webapp, WebGoat, which is an OWASP project used for learning basic web penetration testing skills and vulnerabilities. A good scanner should find a lot of things! A quick note: We were initially going to use Mutillidae, another vulnerable app written in PHP. [&#8230;]</p>
<p>The post <a href="http://kostacipo.stream/creating-a-secure-pipeline-jenkins-with-sonarqube-and-dependencycheck/">Creating a Secure Pipeline: Jenkins with SonarQube and DependencyCheck</a> appeared first on <a href="http://kostacipo.stream">Tech Chronicles</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>&nbsp;</p>
<h2 id="configuring-jenkins-to-build-webgoat">Configuring Jenkins To Build WebGoat</h2>
<p>We&#8217;re going to scan a known vulnerable webapp, <a href="https://webgoat.github.io/WebGoat/">WebGoat</a>, which is an OWASP project used for learning basic web penetration testing skills and vulnerabilities. A good scanner should find a lot of things!</p>
<p>A quick note: We were initially going to use <a href="https://github.com/webpwnized/mutillidae">Mutillidae</a>, another vulnerable app written in PHP. However we couldn&#8217;t find any good open source PHP Static analyzers that would catch the vulnerabilities. </p>
<p>Anyway, let&#8217;s get on with Jenkins. Navigate in your browser to <a href="http://localhost:8080">http://localhost:8080</a> and enter the admin password shown in the terminal running docker. Go ahead and install the default plugins (for a deployed instance, I would recommend only installing plugins you will actually use) and create your first admin user.</p>
<p>WebGoat requires Java 11 to build, which Jenkins won&#8217;t install automatically. Head over to the main page -&gt; Manage Jenkins -&gt; Global Tool Configuration. There are two sections here we will update now: JDK installation and Maven installations. We need to add a link to a Java 11 installer &#8211; we used <a href="https://download.java.net/java/GA/jdk11/13/GPL/openjdk-11.0.1_linux-x64_bin.tar.gz">https://download.java.net/java/GA/jdk11/13/GPL/openjdk-11.0.1_linux-x64_bin.tar.gz</a> and we can use the default maven. Your config should look like this:</p>
<figure class="kg-card kg-image-card kg-card-hascaption"><img decoding="async" class="kg-image" src="https://nullsweep.com/content/images/2019/05/jenkins_jdk_install_config.png"><figcaption>Jenkins JDK11 Install configuration</figcaption></figure>
<figure class="kg-card kg-image-card kg-card-hascaption"><img decoding="async" class="kg-image" src="https://nullsweep.com/content/images/2019/05/jenkins_maven_install_config.png"><figcaption>Jenkins Maven install configuration</figcaption></figure>
<p>We sometimes see Jenkins have trouble installing a JDK this way if more than one JDK is installed in the system. If this is the first one, there should be no problems.</p>
<p>Finally, we have to set the JAVA_HOME variable. In the Jenkins -&gt; Manage Jenkins -&gt; Configure System menu, enable environment varaibles and set JAVA_HOME equal to /var/jenkins_home/tools/hudson.model.JDK/openjdk11/jdk-11.0.1/.</p>
<p>Now let&#8217;s create a pipeline for WebGoat and make sure it builds successfully. Back on the main page choose new item -&gt; freestyle project.</p>
<p>The initial setup is pretty simple:</p>
<ul>
<li>Add Webgoat to the various github setting locations (https://github.com/WebGoat/WebGoat/)</li>
<li>Set the target branch to */develop</li>
<li>Create a maven build step (&#8220;Invoke top level maven targets&#8221;) and give it the command &#8220;clean install&#8221;</li>
</ul>
<p>Here is the full pipeline configuration:</p>
<figure class="kg-card kg-image-card kg-card-hascaption"><img decoding="async" class="kg-image" src="https://nullsweep.com/content/images/2019/05/initial_webgoat_pipeline.png"><figcaption>Basic WebGoat Pipeline</figcaption></figure>
<p>Try running it and making sure that everything builds successfully.</p>
<h2 id="adding-sonarqube-and-dependencycheck">Adding SonarQube and DependencyCheck</h2>
<h3 id="sonarqube-setup-security">SonarQube setup &amp; security</h3>
<p>We already have a SonarQube instance running, we just need to link and configure Jenkins to use it. Log in to <a href="http://localhost:9000">http://localhost:9000</a> and use the default sonarQube login of admin/admin.</p>
<p>Although this is only for practice, I still want to secure our SonarQube instance, so do the following:</p>
<ul>
<li>Change the admin password</li>
<li>Go to administration-&gt; security and turn on &#8220;Force user authentication&#8221;</li>
<li>Create a new user for Jenkins.</li>
<li>Log into the new user, go to the profile -&gt; security section, and generate a token. Copy this for later use.</li>
</ul>
<p>Finally, create a project named &#8220;webgoat&#8221; with your jenkins user.</p>
<h3 id="configure-the-plugins-for-jenkins">Configure the plugins for Jenkins</h3>
<p>We will need two new plugins for jenkins. In the Jenkins home page, go to Mange Jenkins -&gt; Manage Plugins. On the Available tab find and select &#8220;OWASP Dependency-Check Plugin&#8221; and &#8220;SonarQube Scanner for Jenkins&#8221;. Install them without restarting.</p>
<p>Back on the Jenkins home, go to Manage Jenkins -&gt; Global Tool Configuration. You should see a new option for SonarQube Scanner. Add an installation here (I just chose the latest from Maven Central) and save.</p>
<p>Finally, head over to Jenkins -&gt; Manage Jenkins -&gt; Configure System and add a sonarqube instance. The URL with our docker container is http://sonarqube:9000 and the token should be the one you saved while setting up the Jenkins user in SonarQube. Here is my setup:</p>
<figure class="kg-card kg-image-card kg-card-hascaption"><img decoding="async" class="kg-image" src="https://nullsweep.com/content/images/2019/05/sonarqube_settings.png"><figcaption>SonarQube Settings</figcaption></figure>
<p>One other thing I had to do to get SonarQube working properly. For some reason I couldn&#8217;t completely determine, the SonarQube startup script was truncating the JAVA_HOME path incorrectly, causing errors during the pipeline. To solve this, log into the docker container manually and update the sonar script to the proper JAVA_HOME.</p>
<pre class=" language-bash"><code class=" language-bash">$ docker <span class="token function">exec</span> -it secure_pipeline_jenkins_1 <span class="token function">bash</span>
jenkins@2ea0acb5905d:/$ <span class="token function">cd</span> /var/jenkins_home/tools/hudson.plugins.sonar.SonarRunnerInstallation/sonarqube
jenkins@2ea0acb5905d:~/tools/hudson.plugins.sonar.SonarRunnerInstallation/sonarqube$ <span class="token function">head</span> bin/sonar-scanner
<span class="token comment">#!/bin/sh</span>
<span class="token comment">#</span>
<span class="token comment"># SonarQube Scanner Startup Script for Unix</span>
<span class="token comment">#</span>
<span class="token comment"># Optional ENV vars:</span>
<span class="token comment">#   SONAR_SCANNER_OPTS - Parameters passed to the Java VM when running the SonarQube Scanner</span>
<span class="token comment">#   SONAR_SCANNER_DEBUG_OPTS - Extra parameters passed to the Java VM for debugging</span>
<span class="token comment">#   JAVA_HOME - Location of Java's installation</span>

JAVA_HOME<span class="token operator">=</span><span class="token string">"/var/jenkins_home/tools/hudson.model.JDK/openjdk11-remote/jdk-11.0.1"</span>
</code></pre>
<h3 id="add-sonarqube-and-dependencycheck-to-the-pipeline">Add SonarQube and DependencyCheck to the pipeline</h3>
<p>Now we can add these to our pipeline and start scanning with every build.</p>
<p>In the pipeline created earlier, add two new build steps &#8211; Invoke Dependency-Check analysis and Execute SonarQube Scanner. In the SonarQube scanner, add the configuration settings required &#8211; the project key and name should match the project you created in SonarQube.</p>
<pre class=" language-bash"><code class=" language-bash">sonar.projectKey<span class="token operator">=</span>webgoat
sonar.projectName<span class="token operator">=</span>webgoat
sonar.projectVersion<span class="token operator">=</span>1.0
sonar.language<span class="token operator">=</span>java
sonar.java.binaries<span class="token operator">=</span>**/target/classes
sonar.exclusions<span class="token operator">=</span>**/*.ts
</code></pre>
<p>I am excluding the TypeScript files above since we did not setup Node or a JS build step for our project. In a real project, we would want to ensure that they were also scannable.</p>
<p>In the DependencyCheck advanced section, check to generate HTML reports as well for easier viewing.</p>
<p>Here is my full pipeline configuration now:</p>
<figure class="kg-card kg-image-card kg-card-hascaption"><img decoding="async" class="kg-image" src="https://nullsweep.com/content/images/2019/05/webgoat_pipeline_with_sast.png"><figcaption>Full Secure Pipeline</figcaption></figure>
<p>Kick off a build and make sure it runs correctly. Afterwards, you should be able to see results.</p>
<h3 id="viewing-reports">Viewing Reports</h3>
<p>If all runs successfully, logging into SonarQube will show you security scan details (with plenty of findings!) and the pipeline can show you the dependencyCheck results in the workspace -&gt; dependency-check-report.html file.</p>
<figure class="kg-card kg-image-card kg-card-hascaption"><img decoding="async" class="kg-image" src="https://nullsweep.com/content/images/2019/05/dependencyCheck_results.png"><figcaption>DependencyCheck Sample Data</figcaption></figure>
<figure class="kg-card kg-image-card kg-card-hascaption"><img decoding="async" class="kg-image" src="https://nullsweep.com/content/images/2019/05/webgoat_sonarqube_report.png"><figcaption>SonarQube Findings</figcaption></figure>
<p>You can and should at this point consider additional SonarQube plugins (or other SAST tools) that are specifically for your languages and frameworks.</p>
<h2 id="breaking-the-build">Breaking the Build</h2>
<p>We want to know when something isn&#8217;t working right at the build phase. SonarQube gives us this for free with the plugin (you should see a nice red ERROR tag under the SonarQube Quality gate) but DependencyCheck requires one more configuration.</p>
<p>Add a post-build check for &#8220;Publish Dependency Check Results&#8221; and expand the advanced tabs. Just add some threshold data and the build will fail or be marked unstable according to the rules set.</p>
<p>Here &nbsp;is our final pipeline configuration, fully expanded.</p>
<figure class="kg-card kg-image-card"><img decoding="async" class="kg-image" src="https://nullsweep.com/content/images/2019/05/jenkins_full_sast.png"></figure>
<h2 id="final-thoughts">Final Thoughts</h2>
<p>Getting a CI/CD pipeline running with some basic security checks can be done within a few minutes. This will help keep your published artifacts in better shape and ensure the team has an opportunity to learn about security issues as soon as they emerge.</p>
<p>The post <a href="http://kostacipo.stream/creating-a-secure-pipeline-jenkins-with-sonarqube-and-dependencycheck/">Creating a Secure Pipeline: Jenkins with SonarQube and DependencyCheck</a> appeared first on <a href="http://kostacipo.stream">Tech Chronicles</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://kostacipo.stream/creating-a-secure-pipeline-jenkins-with-sonarqube-and-dependencycheck/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
