<?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: ritik</title>
    <description>The latest articles on DEV Community by ritik (@ritik_20).</description>
    <link>https://dev.to/ritik_20</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%2F758720%2Fa68b4ede-36b9-4e4e-8986-8dc4bb8e5a6d.jpeg</url>
      <title>DEV Community: ritik</title>
      <link>https://dev.to/ritik_20</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ritik_20"/>
    <language>en</language>
    <item>
      <title>Push your code on Github like Pro</title>
      <dc:creator>ritik</dc:creator>
      <pubDate>Fri, 22 Jul 2022 08:21:23 +0000</pubDate>
      <link>https://dev.to/ritik_20/push-your-code-on-github-like-pro-1g6a</link>
      <guid>https://dev.to/ritik_20/push-your-code-on-github-like-pro-1g6a</guid>
      <description>&lt;p&gt;I never liked to typing 4 commands each time for pushing your code to github.&lt;/p&gt;

&lt;p&gt;So i have created a alias for that and with also random commits name.&lt;/p&gt;

&lt;p&gt;paste the below code to your default &lt;code&gt;shellrc&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Get random gibbrish word

get_random(){
    random_commit=`shuf /usr/share/dict/cracklib-small | awk 'FNR == 1 { print $1 }'`
}
alias gpm='get_random; git add .; git commit -m ${random_commit}; git push origin main'

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

&lt;/div&gt;



&lt;p&gt;make sure you have file located at &lt;code&gt;/usr/share/dict/cracklib-small&lt;/code&gt;. For my system Manjaro &lt;code&gt;cracklib-small&lt;/code&gt; file consists of lots of english dictionary words.&lt;br&gt;
For you system it maybe different.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Setting up your Github workflow with SSH</title>
      <dc:creator>ritik</dc:creator>
      <pubDate>Sun, 23 Jan 2022 13:53:02 +0000</pubDate>
      <link>https://dev.to/ritik_20/setting-up-your-github-workflow-with-ssh-hf8</link>
      <guid>https://dev.to/ritik_20/setting-up-your-github-workflow-with-ssh-hf8</guid>
      <description>&lt;p&gt;As you already know that Github has removed the password authentication support on &lt;b&gt;August 13 2021&lt;/b&gt;. They have forced their user to use Personal Access Token instead of password.&lt;br&gt;
But storing and managing access token is very difficult task.&lt;br&gt;
No matter how hard you try to store it. One day you end up creating another one and this cycle never stop.&lt;/p&gt;

&lt;p&gt;We don't want to copy paste the long access token just for simple task of pushing our&lt;br&gt;
code to Github. For ease of our task we are going to &lt;code&gt;ssh&lt;/code&gt; instead of &lt;code&gt;https&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;But first you have to add a &lt;code&gt;ssh&lt;/code&gt; key to your Github account but first we to generate one.&lt;/p&gt;
&lt;h3&gt;
  
  
  Generating SSH key
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Open up your favorite terminal and type in
&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;ssh-keygen &lt;span class="nt"&gt;-t&lt;/span&gt; ed25519 &lt;span class="nt"&gt;-C&lt;/span&gt; &lt;span class="s2"&gt;"your_email@example.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;here replace &lt;code&gt;your_email@example.com&lt;/code&gt; with email which is registered on your github account.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You will prompted for default file location of key. Just hit enter.
&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;&amp;gt;&lt;/span&gt; Enter a file &lt;span class="k"&gt;in &lt;/span&gt;which to save the key &lt;span class="o"&gt;(&lt;/span&gt;/home/you/.ssh/algorithm&lt;span class="o"&gt;)&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;Press enter]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;You will get prompted of &lt;a href="https://docs.github.com/en/authentication/connecting-to-github-with-ssh/working-with-ssh-key-passphrases"&gt;passphrase&lt;/a&gt; , you can set empty passphrase and just hit enter.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once thats done you will get your &lt;code&gt;key fingerprint&lt;/code&gt; but don't copy it yet because that will be stripped down version of key.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Generating public/private ed25519 key pair.
Enter file &lt;span class="k"&gt;in &lt;/span&gt;which to save the key &lt;span class="o"&gt;(&lt;/span&gt;/home/ritik/.ssh/id_ed25519&lt;span class="o"&gt;)&lt;/span&gt;:
Enter passphrase &lt;span class="o"&gt;(&lt;/span&gt;empty &lt;span class="k"&gt;for &lt;/span&gt;no passphrase&lt;span class="o"&gt;)&lt;/span&gt;:
Enter same passphrase again:
Your identification has been saved &lt;span class="k"&gt;in&lt;/span&gt; /home/ritik/.ssh/id_ed25519
Your public key has been saved &lt;span class="k"&gt;in&lt;/span&gt; /home/ritik/.ssh/id_ed25519.pub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;In above result select the key file path , in my case it is &lt;code&gt;/home/ritik/.ssh/id_ed25519.pub&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;run below command.&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; /home/ritik/.ssh/id_ed25519.pub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Then you find your original key
&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;&lt;span class="nb"&gt;cat&lt;/span&gt; /home/ritik/.ssh/id_ed25519.pub
ssh-ed25519 AAAAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxK8475 dwi.ritik20@gmail.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt; copy all the text except &lt;code&gt;email&lt;/code&gt; part. Your key will look something like this.
&lt;code&gt;ssh-ed25519 AAAAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxK8475&lt;/code&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Registering SSH key on Github
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Go to your Github &lt;code&gt;setting&lt;/code&gt; -&amp;gt; &lt;code&gt;SSH and PGP&lt;/code&gt; section.&lt;/li&gt;
&lt;li&gt;Click on &lt;code&gt;New SSH Key&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Give a name to your key.&lt;/li&gt;
&lt;li&gt;Paste key in shown box.&lt;/li&gt;
&lt;li&gt;After that save your key.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You have succesfully add &lt;code&gt;ssh&lt;/code&gt; key in your Github Acccunt.&lt;/p&gt;

&lt;h3&gt;
  
  
  Changing remote origin url to ssh
&lt;/h3&gt;

&lt;p&gt;If you have a existing repository which origin url is set on &lt;code&gt;https&lt;/code&gt;, you can easily change it to &lt;code&gt;ssh&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Find your repository on github and click &lt;code&gt;Code&lt;/code&gt; button.&lt;/li&gt;
&lt;li&gt;And select &lt;code&gt;ssh&lt;/code&gt; and copy the text.&lt;/li&gt;
&lt;li&gt;Text will look something like below text.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git@github.com:your_user_name/your_repo.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Now open your &lt;code&gt;local repository&lt;/code&gt; into terminal.&lt;/li&gt;
&lt;li&gt;Set &lt;b&gt;remote&lt;/b&gt; url to ssh
&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;git remote set-url origin git@github.com:your_user_name/your_repo.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;here &lt;code&gt;origin&lt;/code&gt; is your alias of remote url. It should be your alias of remote url in my case i have set it to "origin".&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now you can easily push your code on Github without worrying about access token.&lt;/p&gt;

</description>
      <category>github</category>
      <category>git</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
