<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jeff Shomali</title>
    <description>The latest articles on DEV Community by Jeff Shomali (@jeffshomali).</description>
    <link>https://dev.to/jeffshomali</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F167242%2F74bc2e1c-a887-4c08-8d3e-a005e3a65dad.png</url>
      <title>DEV Community: Jeff Shomali</title>
      <link>https://dev.to/jeffshomali</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jeffshomali"/>
    <language>en</language>
    <item>
      <title>Compare Laravel, Django and Ruby on Rails by numbers</title>
      <dc:creator>Jeff Shomali</dc:creator>
      <pubDate>Wed, 04 Jan 2023 12:13:09 +0000</pubDate>
      <link>https://dev.to/jeffshomali/laravel-vs-django-vs-ruby-on-rails-and-by-stats-237p</link>
      <guid>https://dev.to/jeffshomali/laravel-vs-django-vs-ruby-on-rails-and-by-stats-237p</guid>
      <description>&lt;p&gt;Ruby on Rails, Django, and Laravel are three of the most popular web development frameworks available today. Each of these frameworks has its own set of strengths and weaknesses, and choosing the right one for your project can be a challenging task. In this blog post, we will compare these three frameworks in order to help you make an informed decision.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PHP is Dead&lt;/li&gt;
&lt;li&gt;Programming languages used in most popular websites&lt;/li&gt;
&lt;li&gt;Most Popular Framework on Github&lt;/li&gt;
&lt;li&gt;Google Trends&lt;/li&gt;
&lt;li&gt;Stack Overflow Most Used Languages&lt;/li&gt;
&lt;li&gt;Most Popular Programming Languages On StackOverflow 2008 - 2020&lt;/li&gt;
&lt;li&gt;Stack Overflow Framework Trends&lt;/li&gt;
&lt;li&gt;Usage statistics of server-side programming languages for websites&lt;/li&gt;
&lt;li&gt;Programming Language Usage Distribution in the Top 1 Million Sites&lt;/li&gt;
&lt;li&gt;Usage statistics of server-side programming languages for websites&lt;/li&gt;
&lt;li&gt;Which is the fastest?&lt;/li&gt;
&lt;li&gt;Performance Rating (TPR-3)&lt;/li&gt;
&lt;li&gt;Market Share by Top Websites&lt;/li&gt;
&lt;li&gt;JavaScript is same as PHP&lt;/li&gt;
&lt;li&gt;Languages Push/Pull Request data from Github&lt;/li&gt;
&lt;li&gt;Number Comparison&lt;/li&gt;
&lt;li&gt;Read More&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  PHP is Dead
&lt;/h2&gt;

&lt;p&gt;If you just Google &lt;a href="https://letmegooglethat.com/?q=php+is+dead" rel="noopener noreferrer"&gt;"PHP is Dead"&lt;/a&gt;you will find a lot of rumers talking about PHP last few years. As I started programming it was same. PHP is not dead, and in fact, it is still one of the most popular programming languages in use today, particularly for server-side web development.&lt;/p&gt;

&lt;p&gt;According to the &lt;a href="https://www.tiobe.com/tiobe-index/" rel="noopener noreferrer"&gt;TIOBE Index&lt;/a&gt;, which measures the popularity of programming languages, PHP has consistently ranked within the top &lt;strong&gt;10 most popular languages&lt;/strong&gt; since &lt;strong&gt;2003&lt;/strong&gt;. It is also widely used by many large websites, including Facebook, Wikipedia, and WordPress.&lt;/p&gt;

&lt;p&gt;There have been some predictions that PHP will eventually be replaced by newer languages, but it remains a popular and widely-used language for web development. It is constantly being updated and improved, and it is likely that it will continue to be a viable language for web development for the foreseeable future.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjczwccdkadpln0ps9ihl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjczwccdkadpln0ps9ihl.png" alt="PHP is Dead" width="478" height="476"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Programming languages used in most popular websites
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Programming_languages_used_in_most_popular_websites" rel="noopener noreferrer"&gt;Resource&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F31q2qmwq2t4ro4gb987d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F31q2qmwq2t4ro4gb987d.png" alt="Alt Text" width="800" height="335"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Most Popular Framework on Github
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/topics/framework" rel="noopener noreferrer"&gt;resource&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdmblyp7zdlsj8xh7gl92.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdmblyp7zdlsj8xh7gl92.png" alt="Alt Text" width="800" height="845"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Video Version
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/9z_2wmJOom4"&gt;
&lt;/iframe&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Google Trends
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://trends.google.com/trends/explore?date=today%205-y&amp;amp;q=django,ruby%20on%20rails,laravel" rel="noopener noreferrer"&gt;resource&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fynshnji08iqln273lrdg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fynshnji08iqln273lrdg.png" alt="Laravel vs Django vs Rails on Google Trends" width="800" height="391"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Stack Overflow Most Used Languages
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://insights.stackoverflow.com/survey/2020#technology-programming-scripting-and-markup-languages-all-respondents" rel="noopener noreferrer"&gt;resource&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpxsjdqp9kjebvp35pb5u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpxsjdqp9kjebvp35pb5u.png" alt="Alt Text" width="800" height="710"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Most Popular Programming Languages On StackOverflow 2008 - 2020
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Video Version 
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/FZoLXYKv3dE"&gt;
&lt;/iframe&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Stack Overflow Framework Trends
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://insights.stackoverflow.com/trends?tags=laravel%2Cdjango%2Cruby-on-rails" rel="noopener noreferrer"&gt;resource&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F87o21trdjoyx6o20dbk8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F87o21trdjoyx6o20dbk8.png" alt="Alt Text" width="800" height="519"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Usage statistics of server-side programming languages for websites
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://w3techs.com/technologies/overview/programming_language" rel="noopener noreferrer"&gt;resource&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fou3we9as163hq8cn3x34.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fou3we9as163hq8cn3x34.png" alt="Alt Text" width="532" height="365"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Programming Language Usage Distribution in the Top 1 Million Sites
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://trends.builtwith.com/framework/programming-language" rel="noopener noreferrer"&gt;resource&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7ohsf16f7hoas10z180p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7ohsf16f7hoas10z180p.png" alt="Alt Text" width="800" height="622"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Usage statistics of server-side programming languages for websites
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://w3techs.com/technologies/details/pl-php" rel="noopener noreferrer"&gt;resource&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1u58eiyre624wy1tsrzg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1u58eiyre624wy1tsrzg.png" alt="Alt Text" width="800" height="782"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Which is the fastest?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/the-benchmarker/web-frameworks" rel="noopener noreferrer"&gt;resource&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8vngrxp3g2v9202hrw52.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8vngrxp3g2v9202hrw52.png" alt="Alt Text" width="800" height="425"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Performance Rating (TPR-3)
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.techempower.com/benchmarks/#section=data-r21&amp;amp;hw=ph&amp;amp;test=composite&amp;amp;b=4&amp;amp;l=zijvgf-2yn&amp;amp;d=9&amp;amp;o=e&amp;amp;f=191c0-jz6rk-4fwhl0-27zqmo-5jskxs-13zyf4-by0y-27wu80-1ekm-50sidc-0-1-jz6rk-0" rel="noopener noreferrer"&gt;resource&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzmkyhfni6jcqk3b7m0mq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzmkyhfni6jcqk3b7m0mq.png" alt="What is the fastest Web Framework" width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Market Share by Top Websites
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.similartech.com/compare/django-vs-laravel" rel="noopener noreferrer"&gt;resource&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftabw28zn0t9s0sfiigv5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftabw28zn0t9s0sfiigv5.png" alt="Alt Text" width="800" height="595"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  JavaScript is same as PHP
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Video Version 
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/jMZssfxL6Sg"&gt;
&lt;/iframe&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Languages Push/Pull Request data from Github
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://madnight.github.io/githut/#/pull_requests/2022/3" rel="noopener noreferrer"&gt;resource&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdx69ka2otoufhfyxpfjo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdx69ka2otoufhfyxpfjo.png" alt="Languages Push/Pull Request data from Github" width="800" height="577"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Number Comparison
&lt;/h2&gt;

&lt;p&gt;It's difficult to accurately compare the popularity of web development frameworks such as Django, Ruby on Rails, and Laravel, as there are a number of factors that can influence their usage. However, here are some statistics that may be of interest:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;According to the TIOBE Index, which measures the popularity of programming languages, Python (the language in which Django is written) has consistently ranked within the top 10 most popular languages over the past few years. As of January 2021, it is ranked as the 4th most popular language.&lt;/li&gt;
&lt;li&gt;According to the Stack Overflow Developer Survey for 2021, Django was the 9th most popular web framework among professional developers.&lt;/li&gt;
&lt;li&gt;According to the same survey, Ruby (the language in which Ruby on Rails is written) was the 7th most popular language among professional developers, and Ruby on Rails was the 11th most popular web framework.&lt;/li&gt;
&lt;li&gt;According to the TIOBE Index, PHP (the language in which Laravel is written) has consistently ranked within the top 10 most popular languages over the past few years. As of January 2021, it is ranked as the 8th most popular language.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's worth noting that these rankings can vary depending on the source and the criteria used to measure popularity. Additionally, the popularity of a language or framework does not necessarily reflect its suitability for a particular project or use case.&lt;/p&gt;

&lt;h2&gt;
  
  
  Read More
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://slack.engineering/hacklang-at-slack-a-better-php/" rel="noopener noreferrer"&gt;Hacklang at Slack: A Better PHP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dzone.com/articles/the-top-programming-languages-organizations-rely-o" rel="noopener noreferrer"&gt;The Top Programming Languages Organizations Rely on Are Javascript, Python, and Java&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/watch?v=jMZssfxL6Sg&amp;amp;feature=share" rel="noopener noreferrer"&gt;We are coding like 1990's&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>django</category>
      <category>laravel</category>
      <category>ruby</category>
      <category>webframework</category>
    </item>
    <item>
      <title>15 Essential Network Commands for Developers/Sysadmins/DevOps: Examples and Uses</title>
      <dc:creator>Jeff Shomali</dc:creator>
      <pubDate>Wed, 04 Jan 2023 11:33:17 +0000</pubDate>
      <link>https://dev.to/jeffshomali/15-essential-network-commands-for-developerssysadminsdevops-examples-and-uses-1702</link>
      <guid>https://dev.to/jeffshomali/15-essential-network-commands-for-developerssysadminsdevops-examples-and-uses-1702</guid>
      <description>&lt;ul&gt;
&lt;li&gt;ping&lt;/li&gt;
&lt;li&gt;traceroute&lt;/li&gt;
&lt;li&gt;telnet&lt;/li&gt;
&lt;li&gt;nslookup:&lt;/li&gt;
&lt;li&gt;netstat&lt;/li&gt;
&lt;li&gt;arp&lt;/li&gt;
&lt;li&gt;route&lt;/li&gt;
&lt;li&gt;dig&lt;/li&gt;
&lt;li&gt;tcpdump&lt;/li&gt;
&lt;li&gt;ifconfig&lt;/li&gt;
&lt;li&gt;nmap&lt;/li&gt;
&lt;li&gt;ss&lt;/li&gt;
&lt;li&gt;iwconfig&lt;/li&gt;
&lt;li&gt;wpa_cli&lt;/li&gt;
&lt;li&gt;iptables&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As a developer, it's important to be comfortable using various network commands to troubleshoot and debug issues that may arise in your projects. In this blog post, we'll go over some of the most commonly used network commands and provide examples of how they can be used.&lt;/p&gt;

&lt;h2&gt;
  
  
  ping
&lt;/h2&gt;

&lt;p&gt;This command is used to test the connectivity between two devices on a network. It works by sending an ICMP (Internet Control Message Protocol) echo request to the specified destination, and then waits for a response. Here's an example of how to use ping:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ping google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This command will send ping requests to google.com and display the results, including the time it took for each request to be sent and received.&lt;/p&gt;

&lt;h2&gt;
  
  
  traceroute
&lt;/h2&gt;

&lt;p&gt;This command is used to trace the route that network packets take from the source to the destination. It can be helpful for identifying issues with routing, as well as for understanding the path that packets take through the network. Here's an example of how to use traceroute:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;traceroute google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This command will trace the route to google.com and display the results, including the hostname and IP address of each hop along the way.&lt;/p&gt;

&lt;h2&gt;
  
  
  telnet
&lt;/h2&gt;

&lt;p&gt;This command is used to establish a connection to a remote device using the Telnet protocol. It can be used to test connectivity to a specific port on a remote device, or to connect to a device's command line interface (CLI) for further troubleshooting. Here's an example of how to use telnet:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;telnet google.com 80
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This command will attempt to establish a Telnet connection to google.com on port 80 (the default HTTP port). If the connection is successful, you'll be able to send HTTP requests to the server and see the responses.&lt;/p&gt;

&lt;h2&gt;
  
  
  nslookup:
&lt;/h2&gt;

&lt;p&gt;This command is used to query the Domain Name System (DNS) to resolve hostnames to IP addresses, or vice versa. It can be useful for verifying that DNS records are correct, or for finding the IP address of a specific hostname. Here's an example of how to use nslookup:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nslookup google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This command will look up the IP address for google.com and display the results. You can also use nslookup to perform a reverse lookup, by specifying an IP address instead of a hostname:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nslookup 8.8.8.8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This command will look up the hostname for the IP address 8.8.8.8 (which happens to be a Google DNS server).&lt;/p&gt;

&lt;h2&gt;
  
  
  netstat
&lt;/h2&gt;

&lt;p&gt;This command is used to display information about network connections on a device. It can be used to see what ports are open, what connections are established, and what protocols are being used. Here's an example of how to use netstat:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;netstat -an
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This command will display all active network connections on the device, including the protocol (TCP or UDP), the local and remote address and port, and the status of the connection. You can use various flags to filter the results or display additional information.&lt;/p&gt;

&lt;h2&gt;
  
  
  arp
&lt;/h2&gt;

&lt;p&gt;This command is used to view and modify the Address Resolution Protocol (ARP) cache on a device. ARP is used to map IP addresses to physical (MAC) addresses on a network. Here's an example of how to use arp:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;arp -a
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This command will display the ARP cache for the device, showing the IP and MAC addresses of all known devices on the network. You can use various flags to add, delete, or modify entries in the ARP cache.&lt;/p&gt;

&lt;h2&gt;
  
  
  route
&lt;/h2&gt;

&lt;p&gt;This command is used to view and modify the routing table on a device. The routing table specifies the next hop for packets based on their destination address. Here's an example of how to use route:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;route -n
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This command will display the routing table for the device, showing the destination, gateway, and other information for each route. You can use various flags to add, delete, or modify routes in the routing table.&lt;/p&gt;

&lt;h2&gt;
  
  
  dig
&lt;/h2&gt;

&lt;p&gt;This command is used to query DNS servers for information about domain names. It can be used to perform a variety of DNS lookups, such as A record lookups (to resolve hostnames to IP addresses), MX record lookups (to find mail servers for a domain), and more. Here's an example of how to use dig:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dig google.com A
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This command will perform an A record lookup for google.com and display the results, including the IP addresses associated with the hostname.&lt;/p&gt;

&lt;h2&gt;
  
  
  tcpdump
&lt;/h2&gt;

&lt;p&gt;This command is used to capture and analyze network traffic on a device. It can be helpful for troubleshooting issues with network communication, as well as for understanding how network protocols work. Here's an example of how to use tcpdump:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tcpdump -i eth0 -s 0 -w capture.pcap
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This command will capture all traffic on the eth0 interface and save it to a file called capture.pcap. The &lt;code&gt;-s&lt;/code&gt; 0 flag specifies that the entire packet should be captured (up to the maximum size), and the  &lt;code&gt;-w&lt;/code&gt; flag specifies the output file. You can use various flags to filter the traffic or display it in different ways.&lt;/p&gt;

&lt;h2&gt;
  
  
  ifconfig
&lt;/h2&gt;

&lt;p&gt;This command used to configure network interfaces on Unix-like systems. It can be used to view and set the IP address, network mask, and other network settings for a device. Here's an example of how to use ifconfig:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ifconfig eth0 192.168.1.10 netmask 255.255.255.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This command will set the IP address of the &lt;code&gt;eth0&lt;/code&gt; interface to &lt;code&gt;192.168.1.10&lt;/code&gt; and the network mask to &lt;code&gt;255.255.255.0&lt;/code&gt;. These values will be used by the device to determine which IP addresses are on the same network and which require routing through a gateway.&lt;/p&gt;

&lt;p&gt;You can also use ifconfig to view the current settings for a network interface. For example:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ifconfig eth0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This command will display the current IP address, network mask, and other settings for the eth0 interface.&lt;/p&gt;

&lt;p&gt;Note that ifconfig has been deprecated in some systems and replaced by the ip command. However, it is still widely used and supported.&lt;/p&gt;

&lt;h2&gt;
  
  
  nmap
&lt;/h2&gt;

&lt;p&gt;This command is used to scan networks for open ports and other information about networked devices. It can be used for a variety of purposes, such as network security analysis, vulnerability assessment, and more. Here's an example of how to use nmap:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nmap -sT google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This command will perform a TCP SYN scan of google.com, which attempts to connect to all specified ports to determine which ones are open. You can use various flags to customize the scan, such as specifying the ports to scan or the type of scan to perform.&lt;/p&gt;

&lt;h2&gt;
  
  
  ss
&lt;/h2&gt;

&lt;p&gt;This command is used to display information about network sockets on a device. It can be used to see what connections are established, what protocols are being used, and more. Here's an example of how to use ss:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ss -t -a
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This command will display all TCP sockets on the device, showing the local and remote address and port, as well as the state of the connection. You can use various flags to filter the results or display additional information.&lt;/p&gt;

&lt;h2&gt;
  
  
  iwconfig
&lt;/h2&gt;

&lt;p&gt;This command is used to configure wireless interfaces on Linux systems. It can be used to view and set the SSID, frequency, and other wireless settings for a device. Here's an example of how to use iwconfig:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;iwconfig wlan0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This command will display the current wireless settings for the wlan0 interface. You can use various flags to set different values, such as the SSID or the frequency.&lt;/p&gt;

&lt;h2&gt;
  
  
  wpa_cli
&lt;/h2&gt;

&lt;p&gt;This command is used to manage and control the wpa_supplicant daemon, which is used to connect to wireless networks on Linux systems. It can be used to scan for available networks, connect to a specific network, and more. Here's an example of how to use wpa_cli:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wpa_cli scan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This command will scan for available wireless networks and display the results. You can then use the wpa_cli command to connect to a specific network by specifying the SSID and passphrase.&lt;/p&gt;

&lt;h2&gt;
  
  
  iptables
&lt;/h2&gt;

&lt;p&gt;This command is used to configure the Linux kernel's built-in firewall. It can be used to specify rules for how packets should be filtered based on various criteria, such as the source or destination address, the protocol, and more. Here's an example of how to use iptables:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;iptables -A INPUT -p tcp --dport 80 -j ACCEPT
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This command will add a rule to the firewall that allows incoming TCP packets on port 80 (the default HTTP port). The &lt;code&gt;-A INPUT&lt;/code&gt; flag specifies that the rule should be added to the INPUT chain (for incoming packets), and the &lt;code&gt;-j ACCEPT&lt;/code&gt; flag specifies that the packets should be accepted and allowed through the firewall.&lt;/p&gt;




&lt;p&gt;These are just a few examples of the many network commands that are available for developers to use. Whether you're working on a server, a network device, or a client application, being familiar with these and other network commands can be an invaluable tool for debugging and troubleshooting issues.&lt;/p&gt;

</description>
      <category>emptystring</category>
    </item>
    <item>
      <title>Integrating MacOS with multiple Github or Bitbucket accounts</title>
      <dc:creator>Jeff Shomali</dc:creator>
      <pubDate>Thu, 25 Nov 2021 22:27:25 +0000</pubDate>
      <link>https://dev.to/jeffshomali/integrating-macos-with-multiple-github-or-bitbucket-accounts-1an4</link>
      <guid>https://dev.to/jeffshomali/integrating-macos-with-multiple-github-or-bitbucket-accounts-1an4</guid>
      <description>&lt;p&gt;Assume you want to use your personal Github account on your work laptop, and wanted to commit to your personal account without breaking your work repository configuration. In this tutorial I will show you how to easily manage multiple Github/Bitbucket accounts on MacOS without conflict each other. &lt;/p&gt;

&lt;p&gt;To achieve our goal we need to tell Github/Bitbucket Git's engine that we have multiple account in one computer. &lt;/p&gt;

&lt;p&gt;So bare with me to achieve our goal. &lt;/p&gt;

&lt;h2&gt;
  
  
  Create a new SSH key
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Go to SSH directory &lt;code&gt;$ cd ~/.ssh&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create a new SSH key &lt;code&gt;ssh-keygen -t rsa -b 4096 -C &amp;lt;your_email@example.com?&lt;/code&gt; More on &lt;a href="https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#generating-a-new-ssh-key" rel="noopener noreferrer"&gt;Github&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Register created SSH key to Github
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;This is very strait forward, just follow the &lt;a href="https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account" rel="noopener noreferrer"&gt;Adding a new SSH key to your GitHub account&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Create SSH Config
&lt;/h2&gt;

&lt;p&gt;To connection to multiple remote server through the SSH we can use the SSH &lt;code&gt;config&lt;/code&gt; file. I'm not going to explain what is &lt;code&gt;config&lt;/code&gt; file in this post, but if you like to learn more about that here "&lt;a href="https://linuxize.com/post/using-the-ssh-config-file/" rel="noopener noreferrer"&gt;Using the SSH Config File&lt;/a&gt;" is a cool article that I found for you. Ok less talk do more!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a config file &lt;code&gt;$ cd ~/.ssh &amp;amp;&amp;amp; touch config&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Add your SSH configuration to &lt;code&gt;config&lt;/code&gt;. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is the syntax that you need to understand.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;
&lt;span class="c"&gt;# Host is the remote server&lt;/span&gt;

Host hostname1
    SSH_OPTION value
    SSH_OPTION value

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In our case we want to use multiple Github/Bitbucket accounts, so it will be&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;
&lt;span class="c"&gt;# Your Github account&lt;/span&gt;
Host github.com-&amp;lt;jeffshomali&amp;gt;
   User git
   HostName github.com
   IdentityFile ~/.ssh/&amp;lt;jeff_personal&amp;gt;  
   IdentitiesOnly &lt;span class="nb"&gt;yes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Just replace the &lt;code&gt;&amp;lt;&amp;gt;&lt;/code&gt; with your information.&lt;/p&gt;

&lt;h2&gt;
  
  
  Clone your repository.
&lt;/h2&gt;

&lt;p&gt;Go to your Github account and clone of the repository.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the repo in your code editor and make sure the Origin &lt;code&gt;fetch&lt;/code&gt; and &lt;code&gt;push&lt;/code&gt; urls are set with &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;$ git remote -v&lt;/code&gt; if not set that up with  &lt;code&gt;$ git remote add origin https://github.com/user/repo.git&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Add your Github username and email to every repo locally.
&lt;/h2&gt;

&lt;p&gt;To prevent the conflict between your personal repo and your work repos you need to add your information to each repo by add the username and email to local repo. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open your Git config file with &lt;code&gt;$ code .git/config&lt;/code&gt; or &lt;code&gt;$ git config --local -e&lt;/code&gt;. &lt;/li&gt;
&lt;li&gt;Add your username and email
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;[&lt;/span&gt;user]
    name &lt;span class="o"&gt;=&lt;/span&gt; your_github_username
    email &lt;span class="o"&gt;=&lt;/span&gt; your_github_email@email.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Confirm your information has been saved and present in config file by &lt;code&gt;$ git config --local -l&lt;/code&gt; and you should see your Github/Bitbucket &lt;code&gt;user.name&lt;/code&gt; and &lt;code&gt;user.email&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Done!&lt;/p&gt;

</description>
      <category>github</category>
      <category>git</category>
      <category>linux</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Using Slack Webhook</title>
      <dc:creator>Jeff Shomali</dc:creator>
      <pubDate>Wed, 13 Nov 2019 05:11:02 +0000</pubDate>
      <link>https://dev.to/jeffshomali/using-slack-webhook-3oif</link>
      <guid>https://dev.to/jeffshomali/using-slack-webhook-3oif</guid>
      <description>&lt;h3&gt;
  
  
  What do you learn in this post?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;You will learn how to create a Shell script.&lt;/li&gt;
&lt;li&gt;You will learn how to backup up your database by a script.&lt;/li&gt;
&lt;li&gt;You will learn how to automate your script by specif time of day.&lt;/li&gt;
&lt;li&gt;Also, you will learn how to send a message to your Slack channel programmatically. &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Overview
&lt;/h3&gt;

&lt;p&gt;Just imagine that you have a Slack channel, and you wanted to get notified when something happened in your Linux/Unix machine.  For instance, getting back up of something, or checking disk usage, monitor the network/process, or whatever you want to do in that machine manually. In this case, I assume you want to get a database backup and send a process success or failure message to your one of your Slack channels. Before to start this, you need to have a Slack account. The goal of this post is to take a backup every day and send a message to your Slack channel. Before to start this you need to have &lt;a href="https://slack.com/get-started" rel="noopener noreferrer"&gt;Slack&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Create Script
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Create your &lt;code&gt;script.sh&lt;/code&gt; file in your machine.&lt;/li&gt;
&lt;li&gt;Make your script executable by &lt;code&gt;chmod u+x script.sh&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Add your logic to it. For this case to get backup of MySQL database with &lt;code&gt;mysqldump&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;
&lt;span class="c"&gt;#!/bin/sh&lt;/span&gt;

&lt;span class="nb"&gt;date&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; +%Y%m%d&lt;span class="sb"&gt;`&lt;/span&gt;

mysqldump &lt;span class="nt"&gt;-h&lt;/span&gt; localhost &lt;span class="nt"&gt;-u&lt;/span&gt; root &lt;span class="nt"&gt;-p&lt;/span&gt; pass &lt;span class="nt"&gt;--single-transaction&lt;/span&gt; &lt;span class="nt"&gt;--quick&lt;/span&gt; databasename &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; jeff/backup/databse&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;date&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;.sql

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$?&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;-eq&lt;/span&gt; 0 &lt;span class="o"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;then
    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;" Script is running - &lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;date&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; jeff/dbbackup.log
     curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s1"&gt;'Content-type: application/json'&lt;/span&gt; &lt;span class="nt"&gt;--data&lt;/span&gt; &lt;span class="s1"&gt;'{"channel":"#&amp;lt;your channel name&amp;gt;","text":"&amp;lt;your message here&amp;gt;"}'&lt;/span&gt; https://&amp;lt;your-slack-chanel&amp;gt;.slack.com/services/hooks/&amp;lt;your hooks key&amp;gt;
&lt;span class="k"&gt;else
    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Script failed to run on &lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;date&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; jeff/dbbackup.log
    curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s1"&gt;'Content-type: application/json'&lt;/span&gt; &lt;span class="nt"&gt;--data&lt;/span&gt; &lt;span class="s1"&gt;'{"channel":"#&amp;lt;your channel name&amp;gt;","text":"&amp;lt;your message here&amp;gt; "}'&lt;/span&gt; https://&amp;lt;your-slack-chanel&amp;gt;.slack.com/services/hooks/&amp;lt;your hookks key&amp;gt;
&lt;span class="k"&gt;fi&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You need to modify the &lt;code&gt;&amp;lt;your message here&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;your channel name&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;your hooks key&lt;/code&gt; with your custom message and Slack webhooks' key. Where to get the key? follow next step&lt;/p&gt;

&lt;h3&gt;
  
  
  Create Slack Webhook
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Create a &lt;a href="https://slack.com/get-started" rel="noopener noreferrer"&gt;Slack account&lt;/a&gt; and channel if you don't have it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a &lt;a href="https://api.slack.com/apps/new" rel="noopener noreferrer"&gt;Slack App&lt;/a&gt;. Follow &lt;a href="https://api.slack.com/messaging/webhooks" rel="noopener noreferrer"&gt;this&lt;/a&gt; steps.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Add script to Cron jobs.
&lt;/h3&gt;

&lt;p&gt;If you want to schedules a command or script on your server to run automatically at a specified time and date, please read the end of my &lt;a href="https://dev.to/jeffshomali/how-to-backup-sync-all-of-your-dotfiles-with-github-e1c"&gt;last post&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Good luck 😉&lt;/p&gt;

</description>
      <category>linux</category>
      <category>database</category>
      <category>aws</category>
      <category>bash</category>
    </item>
    <item>
      <title>How to backup/sync all of your dotfiles with Github</title>
      <dc:creator>Jeff Shomali</dc:creator>
      <pubDate>Sun, 20 Oct 2019 21:39:04 +0000</pubDate>
      <link>https://dev.to/jeffshomali/how-to-backup-sync-all-of-your-dotfiles-with-github-e1c</link>
      <guid>https://dev.to/jeffshomali/how-to-backup-sync-all-of-your-dotfiles-with-github-e1c</guid>
      <description>&lt;p&gt;As a developer, one of the challenges that we are facing every day is to backup or sync up all of our &lt;code&gt;dot(.)&lt;/code&gt; files with a new or another environment. There are many dotfiles in my machine such as &lt;code&gt;.alias&lt;/code&gt;, &lt;code&gt;.vimrc&lt;/code&gt;, &lt;code&gt;.zshrc&lt;/code&gt;, &lt;code&gt;.gitconfig&lt;/code&gt; etc...&lt;/p&gt;

&lt;p&gt;I'm not going to explain how to get a back up of all your files because each one of us has a different environment, so I'll explain how to backup your VS-Code setting. I know there is a VS-Code extension that syncs up your setting with Github. Our goal is to understand how to back up #vscode settings, snippets, extensions, and sync it with Github manually.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create a Script
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Create a new Github repository in your Github.com&lt;/li&gt;
&lt;li&gt;In your local machine go to the desktop and open an empty folder in your terminal&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Initiate an empty Git repository with &lt;code&gt;$ git init&lt;/code&gt; and connect the local repo to newly created repo with &lt;code&gt;$ git remote add git@github.com:yourusername/yourrepo.git&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a shell script and name it whatever you want, like &lt;code&gt;backup.sh&lt;/code&gt; and past the following code on that file.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;


&lt;span class="c"&gt;# check to see is git command line installed in this machine&lt;/span&gt;
&lt;span class="nv"&gt;IS_GIT_AVAILABLE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;git &lt;span class="nt"&gt;--version&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="nv"&gt;$IS_GIT_AVAILABLE&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt;&lt;span class="s2"&gt;"version"&lt;/span&gt;&lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
  &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Git is Available"&lt;/span&gt;
&lt;span class="k"&gt;else
  &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Git is not installed"&lt;/span&gt;
  &lt;span class="nb"&gt;exit &lt;/span&gt;1
&lt;span class="k"&gt;fi&lt;/span&gt;


&lt;span class="c"&gt;# copy Vs-Code files&lt;/span&gt;
&lt;span class="nb"&gt;cp&lt;/span&gt;  &lt;span class="nv"&gt;$HOME&lt;/span&gt;/Library/Application&lt;span class="se"&gt;\ &lt;/span&gt;
Support/Code/User/&lt;span class="o"&gt;{&lt;/span&gt;keybindings.json,settings.json,spellright.dict&lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt;

&lt;span class="c"&gt;# copy snippets folder&lt;/span&gt;
&lt;span class="nb"&gt;cp&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="nv"&gt;$HOME&lt;/span&gt;/Library/Application&lt;span class="se"&gt;\ &lt;/span&gt;Support/Code/User/snippets &lt;span class="nb"&gt;.&lt;/span&gt;

&lt;span class="c"&gt;# copy list of extensions that currently installed&lt;/span&gt;
code &lt;span class="nt"&gt;--list-extensions&lt;/span&gt; &lt;span class="nt"&gt;--show-versions&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; ../../vscode/extensions.txt

&lt;span class="c"&gt;# copy other dot files &lt;/span&gt;
&lt;span class="nb"&gt;cp&lt;/span&gt;  &lt;span class="nv"&gt;$HOME&lt;/span&gt;/&lt;span class="o"&gt;{&lt;/span&gt;.zshrc,.vimrc&lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt;



&lt;span class="c"&gt;# Check git status&lt;/span&gt;
&lt;span class="nv"&gt;gs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;git status | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="s2"&gt;"modified"&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="c"&gt;# echo "${gs}"&lt;/span&gt;

&lt;span class="c"&gt;# If there is a new change&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="nv"&gt;$gs&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt;&lt;span class="s2"&gt;"modified"&lt;/span&gt;&lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
  &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"push"&lt;/span&gt;
&lt;span class="k"&gt;fi&lt;/span&gt;


&lt;span class="c"&gt;# push to Github&lt;/span&gt;
git add &lt;span class="nt"&gt;-u&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"New backup &lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; +&lt;span class="s1"&gt;'%Y-%m-%d %H:%M:%S'&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
git push origin master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Change the script permission with &lt;code&gt;$ chmod +x backup.sh&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Run the script with &lt;code&gt;$ ./backup.sh&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to run in background services:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;crontab -e&lt;/code&gt; and add your script path and time you want to run the script for example
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;crontab &lt;span class="nt"&gt;-e&lt;/span&gt;  &lt;span class="c"&gt;# this is open the cronjobs table in vim mode use i for insert mode&lt;/span&gt;

&lt;span class="c"&gt;# this is run the script every minutes&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;1 &lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="nb"&gt;cd&lt;/span&gt; /Users/macp15/Projects/dotfiles/scripts/backup &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; ./backup.sh

&lt;span class="c"&gt;# display list of cron jobs&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;crontab &lt;span class="nt"&gt;-l&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Done (Khalas).&lt;/p&gt;

</description>
      <category>vscode</category>
      <category>github</category>
      <category>bash</category>
      <category>linux</category>
    </item>
  </channel>
</rss>
