<?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: Sujit Kumar</title>
    <description>The latest articles on DEV Community by Sujit Kumar (@sujit-shrc).</description>
    <link>https://dev.to/sujit-shrc</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%2F693752%2F8def93b3-9930-42ae-b9d2-2152ede2afe1.jpeg</url>
      <title>DEV Community: Sujit Kumar</title>
      <link>https://dev.to/sujit-shrc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sujit-shrc"/>
    <language>en</language>
    <item>
      <title>Install AppImages on Arch Based Linux</title>
      <dc:creator>Sujit Kumar</dc:creator>
      <pubDate>Tue, 11 Feb 2025 13:49:59 +0000</pubDate>
      <link>https://dev.to/sujit-shrc/install-appimages-on-arch-based-linux-lm2</link>
      <guid>https://dev.to/sujit-shrc/install-appimages-on-arch-based-linux-lm2</guid>
      <description>&lt;h2&gt;
  
  
  How to Install and Use AppImages on Arch Linux
&lt;/h2&gt;

&lt;p&gt;AppImages are a great way to run applications on Arch Linux without installing them via the package manager. Unlike traditional packages, AppImages are self-contained, making them portable and easy to manage. However, to make them accessible via launchers like &lt;strong&gt;Rofi (drun mode)&lt;/strong&gt; or &lt;strong&gt;dmenu&lt;/strong&gt;, we need to set them up properly.&lt;/p&gt;

&lt;p&gt;This guide will walk you through the manual installation of an AppImage and integrating it into your system so it appears in Rofi and dmenu.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Step 1: Create a Directory for AppImages&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To keep things organized, store all AppImages in &lt;code&gt;~/.local/share/AppImage&lt;/code&gt;.&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="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/.local/share/AppImage
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;strong&gt;Step 2: Download the AppImage&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;For example, to install &lt;strong&gt;Obsidian&lt;/strong&gt;, download its AppImage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wget &lt;span class="nt"&gt;-O&lt;/span&gt; ~/.local/share/AppImage/Obsidian.AppImage &lt;span class="s2"&gt;"https://github.com/obsidianmd/obsidian-releases/releases/latest/download/Obsidian.AppImage"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you're installing another AppImage, replace the URL and filename accordingly.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Step 3: Make the AppImage Executable&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Before running the AppImage, it needs to be marked as executable:&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="nb"&gt;chmod&lt;/span&gt; +x ~/.local/share/AppImage/Obsidian.AppImage
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you're installing a different AppImage, replace &lt;code&gt;Obsidian.AppImage&lt;/code&gt; with the appropriate filename.&lt;/p&gt;

&lt;p&gt;To run the application:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;~/.local/share/AppImage/Obsidian.AppImage
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;strong&gt;Step 4: Create a .desktop File&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To make the application appear in launchers, we need to create a &lt;code&gt;.desktop&lt;/code&gt; entry.&lt;/p&gt;

&lt;p&gt;Open a new &lt;code&gt;.desktop&lt;/code&gt; file in your local applications directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nano ~/.local/share/applications/Obsidian.desktop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Paste the following content:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="nn"&gt;[Desktop Entry]&lt;/span&gt;
&lt;span class="py"&gt;Name&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;Obsidian&lt;/span&gt;
&lt;span class="py"&gt;Exec&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;/home/$USER/.local/share/AppImage/Obsidian.AppImage %u&lt;/span&gt;
&lt;span class="py"&gt;Icon&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;/home/$USER/.local/share/icons/Obsidian.png&lt;/span&gt;
&lt;span class="py"&gt;Type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;Application&lt;/span&gt;
&lt;span class="py"&gt;Categories&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;Office;Utility;&lt;/span&gt;
&lt;span class="py"&gt;StartupNotify&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;true&lt;/span&gt;
&lt;span class="py"&gt;Terminal&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;false&lt;/span&gt;
&lt;span class="py"&gt;Keywords&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;Notes;Markdown;Editor;Knowledge;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For another AppImage, change the &lt;code&gt;Name&lt;/code&gt;, &lt;code&gt;Exec&lt;/code&gt;, and &lt;code&gt;Icon&lt;/code&gt; fields accordingly.&lt;/p&gt;

&lt;p&gt;If the application provides an official icon, download and save it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wget &lt;span class="nt"&gt;-O&lt;/span&gt; ~/.local/share/icons/Obsidian.png &lt;span class="s2"&gt;"https://upload.wikimedia.org/wikipedia/commons/6/6c/Obsidian-logo.png"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For another application, replace the URL and filename.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Step 5: Update the Desktop Database&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To register the new application, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;update-desktop-database ~/.local/share/applications/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, you should be able to find the application in Rofi or dmenu.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Step 6: Launch the AppImage from Rofi (drun mode)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Press your &lt;strong&gt;Rofi shortcut key&lt;/strong&gt; (usually &lt;code&gt;Mod1 + D&lt;/code&gt; or &lt;code&gt;Alt + D&lt;/code&gt;) and search for the application name. It should now appear in the list!&lt;/p&gt;

&lt;p&gt;Alternatively, you can use dmenu:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dmenu_run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Type the application name and press enter to launch it.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Installing Other AppImages&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;If you want to install a different AppImage, follow the same steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Download the AppImage&lt;/strong&gt; and place it in &lt;code&gt;~/.local/share/AppImage&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Make it executable&lt;/strong&gt; using &lt;code&gt;chmod +x&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Create a .desktop file&lt;/strong&gt; in &lt;code&gt;~/.local/share/applications/&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Download an icon&lt;/strong&gt; if available and set the correct path.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Update the desktop database&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Launch it using Rofi or dmenu&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Just replace filenames and URLs accordingly.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Manually installing and setting up AppImages on Arch Linux ensures they integrate seamlessly into your application launchers like Rofi and dmenu. With these steps, you can keep your system clean and portable while still accessing the latest software. 🚀&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>appimage</category>
      <category>linux</category>
      <category>installation</category>
    </item>
    <item>
      <title>rnr: The Tool That Speaks Every Project run scripts</title>
      <dc:creator>Sujit Kumar</dc:creator>
      <pubDate>Sat, 28 Sep 2024 16:29:01 +0000</pubDate>
      <link>https://dev.to/sujit-shrc/rnr-the-tool-that-speaks-every-project-run-scripts-35kb</link>
      <guid>https://dev.to/sujit-shrc/rnr-the-tool-that-speaks-every-project-run-scripts-35kb</guid>
      <description>&lt;p&gt;Hey there, JavaScript and TypeScript developers! 👋 Are you tired of juggling different commands to start your various JS projects? Well, I've got some exciting news for you! I've created a tool called &lt;code&gt;rnr&lt;/code&gt; (pronounced "runner") that makes running any JavaScript or TypeScript project super easy.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's rnr and Why Did I Make It?
&lt;/h2&gt;

&lt;p&gt;Imagine you're working on several JavaScript projects - maybe a React app, a Node.js server, and a Vue.js website. Each one needs a different command to start. It's like having a bunch of different remote controls, one for each device. Confusing, right?&lt;/p&gt;

&lt;p&gt;That's why I made rnr. It's like a universal remote for your JS and TS projects. You just type &lt;code&gt;rnr&lt;/code&gt;, and it figures out how to start your project, no matter what framework or library you're using!&lt;/p&gt;

&lt;h2&gt;
  
  
  Cool Things rnr Can Do
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;It's Smart&lt;/strong&gt;: rnr looks at your project and knows if it's React, Vue, Express, or any other popular JS framework.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Works with Lots of JS Projects&lt;/strong&gt;: Whether you're using Next.js, Express, React, Vue, or plain JavaScript, rnr knows how to handle them all.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Picks the Best Package Manager&lt;/strong&gt;: rnr automatically chooses between npm, Yarn, pnpm, or Bun - whichever is best for your project.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;One Command Does It All&lt;/strong&gt;: Want to run in dev mode? Build your project? Start it in production mode? rnr can do all of that with just a tiny change to the command.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Easy to Set Up&lt;/strong&gt;: rnr sets itself up, but you can tweak things if you want to customize how it works with your project.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  rnr Modes: Different Ways to Run Your JS Project
&lt;/h2&gt;

&lt;p&gt;rnr is super flexible. It has different modes to help you work on your JavaScript project in different ways:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Dev Mode&lt;/strong&gt;: This is for when you're coding and want to see your changes right away. It's like having a live preview of your work.&lt;br&gt;
Use it like this: &lt;code&gt;rnr dev&lt;/code&gt; or just &lt;code&gt;rnr&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Build Mode&lt;/strong&gt;: When you're ready to get your project ready for deployment, use this mode. It's like packaging up your app for shipping.&lt;br&gt;
Use it like this: &lt;code&gt;rnr build&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Production Mode&lt;/strong&gt;: This is for running your app in a production environment. It's optimized for performance, not for development.&lt;br&gt;
Use it like this: &lt;code&gt;rnr prod&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And we're not stopping there! We're working on adding even more modes to make your JavaScript development life easier.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Get Started with rnr
&lt;/h2&gt;

&lt;p&gt;Getting rnr is super easy. Just type this in your command line:&lt;br&gt;
&lt;a href="https://www.npmjs.com/package/@sujit-shrc/rnr" rel="noopener noreferrer"&gt;Explore here&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i -g @sujit-shrc/rnr
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, go to any of your JavaScript or TypeScript project folders and type:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;That's it! rnr will start your project for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I Made rnr
&lt;/h2&gt;

&lt;p&gt;As a JavaScript developer, I was tired of switching between &lt;code&gt;npm run dev&lt;/code&gt;, &lt;code&gt;yarn start&lt;/code&gt;, &lt;code&gt;pnpm run serve&lt;/code&gt;, and so on for different projects. I thought, "There has to be a better way!" That's how rnr was born - to make running JS projects simple and consistent.&lt;br&gt;
&lt;a href="https://www.npmjs.com/package/@sujit-shrc/rnr" rel="noopener noreferrer"&gt;Go to npmjs&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Why You'll Love rnr
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Saves Time&lt;/strong&gt;: No more looking up how to start each JS project.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Works with All JS Frameworks&lt;/strong&gt;: Use the same command for your React, Vue, Angular, or Node.js projects.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Easy Mode Switching&lt;/strong&gt;: Switch between development, production, and build modes effortlessly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keeps Getting Better&lt;/strong&gt;: We're always adding support for more JS tools and frameworks.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  What's Next for rnr?
&lt;/h2&gt;

&lt;p&gt;We're working on making rnr even better for JavaScript and TypeScript developers! We're looking at adding support for more frameworks, improving how it detects project types, and maybe even adding some cool features for testing and debugging. Stay tuned!&lt;/p&gt;
&lt;h2&gt;
  
  
  Try rnr Today!
&lt;/h2&gt;

&lt;p&gt;Want to make running your JavaScript and TypeScript projects super easy? Give rnr a try:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i -g @sujit-shrc/rnr
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check out our &lt;a href="https://github.com/sujit-shrc/rnr" rel="noopener noreferrer"&gt;GitHub repo&lt;/a&gt; to learn more, report any issues, or contribute to making rnr even better for the JS community.&lt;/p&gt;

&lt;p&gt;Let's make JavaScript development easier and more fun together!&lt;/p&gt;

&lt;p&gt;Happy coding, JS enthusiasts! 😊&lt;/p&gt;




&lt;p&gt;&lt;em&gt;P.S. We'd love to hear what you think about rnr! Did you try it with your JavaScript projects? Do you have ideas to make it better for TypeScript users? Let us know in the comments or on GitHub. Your feedback helps us make rnr awesome for all JS developers!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>productivity</category>
      <category>opensource</category>
      <category>typescript</category>
    </item>
    <item>
      <title>My Go-To File Transfer Tools in Linux: A Terminal Lover's Guide</title>
      <dc:creator>Sujit Kumar</dc:creator>
      <pubDate>Wed, 28 Aug 2024 15:54:25 +0000</pubDate>
      <link>https://dev.to/sujit-shrc/my-go-to-file-transfer-tools-in-linux-a-terminal-lovers-guide-57ig</link>
      <guid>https://dev.to/sujit-shrc/my-go-to-file-transfer-tools-in-linux-a-terminal-lovers-guide-57ig</guid>
      <description>&lt;p&gt;Hey fellow Linux enthusiasts! Today, I want to share my favorite command-line tools for downloading and sharing files. As someone who practically lives in the terminal, I've found these tools to be indispensable in my daily workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Downloading Files: wget and curl
&lt;/h2&gt;

&lt;p&gt;When it comes to grabbing files from the web, two tools always come to mind: wget and curl.&lt;/p&gt;

&lt;h3&gt;
  
  
  wget: My Reliable Downloader
&lt;/h3&gt;

&lt;p&gt;I love wget for its simplicity and power. Here's how I typically use it:&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;# Basic download&lt;/span&gt;
wget https://example.com/file.zip

&lt;span class="c"&gt;# Resuming an interrupted download&lt;/span&gt;
wget &lt;span class="nt"&gt;-c&lt;/span&gt; https://example.com/large-file.iso

&lt;span class="c"&gt;# Downloading with a custom filename&lt;/span&gt;
wget &lt;span class="nt"&gt;-O&lt;/span&gt; my-file.zip https://example.com/file-with-long-name.zip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pro tip: If you're downloading a file on a flaky connection, try &lt;code&gt;wget --tries=0 --retry-connrefused&lt;/code&gt;. It'll keep trying until the download succeeds.&lt;/p&gt;

&lt;h3&gt;
  
  
  curl: More Than Just Downloads
&lt;/h3&gt;

&lt;p&gt;While wget is great, curl is my Swiss Army knife for web interactions:&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;# Basic file download&lt;/span&gt;
curl &lt;span class="nt"&gt;-O&lt;/span&gt; https://example.com/file.txt

&lt;span class="c"&gt;# Following redirects (super handy!)&lt;/span&gt;
curl &lt;span class="nt"&gt;-L&lt;/span&gt; &lt;span class="nt"&gt;-O&lt;/span&gt; https://example.com/redirected-file.txt

&lt;span class="c"&gt;# Downloading with authentication&lt;/span&gt;
curl &lt;span class="nt"&gt;-u&lt;/span&gt; username:password &lt;span class="nt"&gt;-O&lt;/span&gt; https://example.com/secure-file.zip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I often use curl when I need to inspect headers or make specific HTTP requests alongside downloads.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sharing Files: scp and sftp
&lt;/h2&gt;

&lt;p&gt;When it comes to moving files between machines, security is key. That's why I stick with scp and sftp.&lt;/p&gt;

&lt;h3&gt;
  
  
  scp: Quick and Secure File Transfers
&lt;/h3&gt;

&lt;p&gt;scp is my go-to for quick file transfers:&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;# Copying a local file to a remote system&lt;/span&gt;
scp /path/to/local/file user@remote:/path/to/destination

&lt;span class="c"&gt;# Copying from remote to local&lt;/span&gt;
scp user@remote:/path/to/remote/file /path/to/local/destination

&lt;span class="c"&gt;# Transferring entire directories&lt;/span&gt;
scp &lt;span class="nt"&gt;-r&lt;/span&gt; /local/directory user@remote:/remote/path
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I find scp particularly useful for its simplicity – it works just like cp, but over SSH.&lt;/p&gt;

&lt;h3&gt;
  
  
  sftp: When You Need More Interaction
&lt;/h3&gt;

&lt;p&gt;For more complex file management tasks, I turn to sftp:&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;# Connect to remote system&lt;/span&gt;
sftp user@remote

&lt;span class="c"&gt;# Once connected:&lt;/span&gt;
get remotefile.txt   &lt;span class="c"&gt;# Download file&lt;/span&gt;
put localfile.txt    &lt;span class="c"&gt;# Upload file&lt;/span&gt;
&lt;span class="nb"&gt;ls&lt;/span&gt;                   &lt;span class="c"&gt;# List remote files&lt;/span&gt;
lls                  &lt;span class="c"&gt;# List local files&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I love sftp for its interactive nature. It's perfect when I need to browse remote directories or perform multiple file operations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus Tip: Downloading from a List of URLs
&lt;/h2&gt;

&lt;p&gt;Sometimes, I find myself needing to download multiple files from a list of URLs. Here's a neat trick I use with both wget and curl to handle this scenario:&lt;/p&gt;

&lt;h3&gt;
  
  
  Using wget with a file list
&lt;/h3&gt;

&lt;p&gt;If you have a file (let's call it &lt;code&gt;urls.txt&lt;/code&gt;) containing URLs, each on a separate line, you can use wget like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wget &lt;span class="nt"&gt;-i&lt;/span&gt; urls.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command tells wget to read the URLs from the file and download each one. It's super handy when you're dealing with a bunch of files!&lt;/p&gt;

&lt;h3&gt;
  
  
  Using curl with a file list
&lt;/h3&gt;

&lt;p&gt;Curl can also handle this task, though it requires a bit more setup:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;xargs &lt;span class="nt"&gt;-n&lt;/span&gt; 1 curl &lt;span class="nt"&gt;-O&lt;/span&gt; &amp;lt; urls.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command uses &lt;code&gt;xargs&lt;/code&gt; to feed each line from &lt;code&gt;urls.txt&lt;/code&gt; to curl, which then downloads the file.&lt;/p&gt;

&lt;h3&gt;
  
  
  My personal preference
&lt;/h3&gt;

&lt;p&gt;Honestly, I tend to lean towards wget for this task. It's simpler and doesn't require additional commands. Plus, wget has some cool features for this scenario:&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;# Download files in the background&lt;/span&gt;
wget &lt;span class="nt"&gt;-b&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; urls.txt

&lt;span class="c"&gt;# Limit the download speed (useful to avoid network saturation)&lt;/span&gt;
wget &lt;span class="nt"&gt;--limit-rate&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;500k &lt;span class="nt"&gt;-i&lt;/span&gt; urls.txt

&lt;span class="c"&gt;# Continue partially downloaded files&lt;/span&gt;
wget &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; urls.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These options make wget incredibly flexible when working with file lists.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;These four tools – wget, curl, scp, and sftp – cover almost all of my file transfer needs in Linux. They're powerful, secure, and incredibly versatile. Plus, using them from the terminal just feels so much more efficient than clicking around in a GUI.&lt;/p&gt;

&lt;p&gt;What are your favorite file transfer tools in Linux? Do you use these, or do you have some hidden gems I should know about? Drop a comment below – I'm always eager to learn new tricks!&lt;/p&gt;

&lt;p&gt;Until next time, happy file transferring!&lt;/p&gt;

</description>
      <category>cli</category>
      <category>terminal</category>
      <category>linux</category>
      <category>linuxtips</category>
    </item>
    <item>
      <title>Mastering Conventional Git Commit Messages for Better Collaboration</title>
      <dc:creator>Sujit Kumar</dc:creator>
      <pubDate>Mon, 22 Jul 2024 05:02:08 +0000</pubDate>
      <link>https://dev.to/sujit-shrc/git-conventional-commit-63k</link>
      <guid>https://dev.to/sujit-shrc/git-conventional-commit-63k</guid>
      <description>&lt;h2&gt;
  
  
  My Adventure with Conventional Commits: A Simple Guide
&lt;/h2&gt;

&lt;p&gt;Hey there! I'm excited to share my journey with Conventional Commits. When I first started coding, my commit messages were a mess. But then I discovered this cool way of writing commits that changed everything for me. Let me tell you all about it!&lt;/p&gt;

&lt;h2&gt;
  
  
  What Are Conventional Commits?
&lt;/h2&gt;

&lt;p&gt;Conventional Commits are just a fancy way of saying "a set of rules for writing better commit messages". It's like having a template for your commits that makes them easier to understand and use.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Basic Idea
&lt;/h2&gt;

&lt;p&gt;Here's the simple structure:&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="nb"&gt;type&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;optional scope&lt;span class="o"&gt;)&lt;/span&gt;: short description

longer explanation &lt;span class="k"&gt;if &lt;/span&gt;you need it &lt;span class="o"&gt;[&lt;/span&gt;option body part]

any extra notes &lt;span class="o"&gt;[&lt;/span&gt;optional footer part]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Don't worry, I'll break this down for you!&lt;/p&gt;

&lt;p&gt;When I started, I kept forgetting which types to use. So I made a little cheat sheet. Here are the main ones I use:&lt;br&gt;
Certainly! I'll explain all the commit message types, provide examples of good and bad commit messages, and then offer some improved versions. Here's a comprehensive guide:&lt;/p&gt;
&lt;h2&gt;
  
  
  Understanding Commit Message Types
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;feat&lt;/strong&gt;: A new feature for the user or a significant addition to the application.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;fix&lt;/strong&gt;: A bug fix.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;docs&lt;/strong&gt;: Changes to documentation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;style&lt;/strong&gt;: Changes that don't affect the code's meaning (white-space, formatting, missing semi-colons, etc.).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;refactor&lt;/strong&gt;: Code changes that neither fix a bug nor add a feature.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;perf&lt;/strong&gt;: Code changes that improve performance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;test&lt;/strong&gt;: Adding or modifying tests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;build&lt;/strong&gt;: Changes that affect the build system or external dependencies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ci&lt;/strong&gt;: Changes to CI configuration files and scripts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;chore&lt;/strong&gt;: Other changes that don't modify src or test files.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Examples of Good vs Bad Commit Messages
&lt;/h2&gt;
&lt;h3&gt;
  
  
  1. feat (Feature)
&lt;/h3&gt;

&lt;p&gt;Good:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;feat(auth): implement two-factor authentication
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Bad:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;added new stuff
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Better:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;feat(auth): add Google Authenticator integration for 2FA

- Implement QR code generation for easy setup
- Add verification step to login process
- Include user settings to enable/disable 2FA
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. fix (Bug Fix)
&lt;/h3&gt;

&lt;p&gt;Good:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fix(checkout): resolve total calculation error in cart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Bad:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fixed bug
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Better:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fix(checkout): correct tax calculation for international orders

- Update tax rate retrieval to consider user's country
- Add unit tests for various tax scenarios
- Refactor tax calculation into separate utility function
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. docs (Documentation)
&lt;/h3&gt;

&lt;p&gt;Good:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docs: update API endpoints in README
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Bad:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;changed readme
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Better:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docs(api): revise and expand API documentation

- Add examples for all endpoints
- Include rate limiting information
- Update authentication section with new token format
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. style (Formatting)
&lt;/h3&gt;

&lt;p&gt;Good:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;style(global): apply consistent indentation to all files
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Bad:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Better:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;style: enforce consistent code style across project

- Apply Prettier with custom ruleset
- Adjust ESLint config to align with new style guide
- Update CI to fail on style violations
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  5. refactor
&lt;/h3&gt;

&lt;p&gt;Good:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;refactor(database): optimize user query for better performance
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Bad:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cleaned up code
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Better:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;refactor(user-service): improve efficiency of user data retrieval

- Replace multiple database calls with single aggregated query
- Implement caching layer for frequently accessed user data
- Update related services to use new optimized methods
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  6. perf (Performance)
&lt;/h3&gt;

&lt;p&gt;Good:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;perf(images): implement lazy loading for product images
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Bad:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;made site faster
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Better:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;perf(front-end): optimize initial page load time

- Implement code splitting for React components
- Set up lazy loading for below-the-fold content
- Minimize and compress all static assets
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  7. test
&lt;/h3&gt;

&lt;p&gt;Good:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;test(api): add unit tests for user registration process
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Bad:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;added tests
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Better:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;test(auth): expand test coverage for authentication module

- Add unit tests for password reset functionality
- Implement integration tests for OAuth flow
- Set up mock server for third-party auth provider testing
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  8. build
&lt;/h3&gt;

&lt;p&gt;Good:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;build(deps): upgrade to React 18
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Bad:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;updated packages
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Better:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;build: migrate from Webpack to Vite for faster builds

- Configure Vite for development and production environments
- Update npm scripts for new build process
- Adjust CI pipeline to accommodate Vite builds
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  9. ci (Continuous Integration)
&lt;/h3&gt;

&lt;p&gt;Good:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ci(travis): add automatic deployment to staging environment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Bad:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;updated ci
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Better:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ci: implement comprehensive CI/CD pipeline with GitHub Actions

- Set up automated testing for PRs
- Configure staging deployment on merge to develop branch
- Implement production deployment process for tagged releases
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  10. chore
&lt;/h3&gt;

&lt;p&gt;Good:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chore: update .gitignore to exclude .env files
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Bad:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;misc changes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Better:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chore(project): streamline development setup process

- Create detailed CONTRIBUTING.md with setup instructions
- Add .env.example file with required environment variables
- Update package.json with helpful npm scripts for common tasks
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Commit message with footer
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;feat&lt;span class="o"&gt;(&lt;/span&gt;user-profile&lt;span class="o"&gt;)&lt;/span&gt;: add ability to upload profile picture

- Implement image upload functionality
- Add image cropping and resizing options
- Create new API endpoint &lt;span class="k"&gt;for &lt;/span&gt;image upload

BREAKING CHANGE: This update requires a new &lt;span class="s1"&gt;'images'&lt;/span&gt; table &lt;span class="k"&gt;in &lt;/span&gt;the database.
Reviewed-by: Sujit
See-also: &lt;span class="c"&gt;#123, #456&lt;/span&gt;
Closes: &lt;span class="c"&gt;#789&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Tips I Learned the Hard Way
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Be clear about what you did. Future you will thank present you!&lt;/li&gt;
&lt;li&gt;Keep the first line short - aim for 50 characters or less.&lt;/li&gt;
&lt;li&gt;Use simple language. Pretend you're telling a friend what you did.&lt;/li&gt;
&lt;li&gt;If you're fixing a bug or implementing a feature, mention the issue number if you have one.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Why I Love Conventional Commits
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;It's easier to find things in the project history.&lt;/li&gt;
&lt;li&gt;It helps me think clearly about what I'm committing.&lt;/li&gt;
&lt;li&gt;My team can understand my changes without asking me a million questions.&lt;/li&gt;
&lt;li&gt;We can automatically generate changelogs and version numbers.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Oops! I Made a Mistake
&lt;/h2&gt;

&lt;p&gt;Don't panic! We all make mistakes. If you used the wrong type and haven't pushed your commit yet, you can fix it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Use &lt;code&gt;git commit --amend&lt;/code&gt; to change your last commit message.&lt;/li&gt;
&lt;li&gt;If it's an older commit, use &lt;code&gt;git rebase -i&lt;/code&gt; or &lt;code&gt;git rebase -i HEAD~n&lt;/code&gt; (replace n with the number of commits to go back), then change &lt;code&gt;pick&lt;/code&gt; to &lt;code&gt;reword&lt;/code&gt; for the commit you want to fix.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you've already pushed, it's usually best to just make a new commit with the correct message. Learn and move on!&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;Adopting Conventional Commits was a game-changer for me. It made my commits clearer, helped my team work better together, and even made me think more carefully about my code changes.&lt;/p&gt;

&lt;p&gt;Start small, be consistent, and don't worry if you make mistakes at first. Before you know it, you'll be a Conventional Commit pro!&lt;/p&gt;

&lt;p&gt;Have you tried Conventional Commits? I'd love to hear about your experiences. Drop a comment below and let's chat!&lt;/p&gt;

&lt;p&gt;Happy coding, everyone! 😊&lt;/p&gt;

</description>
      <category>git</category>
      <category>gitconventions</category>
    </item>
    <item>
      <title>The FastAPI Deployment Cookbook: Recipe for deploying FastAPI app with Docker and DigitalOcean"</title>
      <dc:creator>Sujit Kumar</dc:creator>
      <pubDate>Mon, 01 Jul 2024 15:17:43 +0000</pubDate>
      <link>https://dev.to/sujit-shrc/the-fastapi-deployment-cookbook-recipe-for-deploying-fastapi-app-with-docker-and-digitalocean-4apk</link>
      <guid>https://dev.to/sujit-shrc/the-fastapi-deployment-cookbook-recipe-for-deploying-fastapi-app-with-docker-and-digitalocean-4apk</guid>
      <description>&lt;h2&gt;
  
  
  From Local to Live: My Journey Deploying FastAPI with Docker on DigitalOcean
&lt;/h2&gt;

&lt;p&gt;Hey there, fellow developers! Today, I want to share my recent experience deploying a FastAPI application using Docker on a DigitalOcean droplet. It was quite a learning curve, but I've broken it down into manageable steps that I hope will help you avoid some of the pitfalls I encountered. Let's dive in!&lt;/p&gt;

&lt;h2&gt;
  
  
  What You'll Need Before We Start
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A DigitalOcean account (I'm using a basic droplet with Docker pre-installed)&lt;/li&gt;
&lt;li&gt;Some familiarity with Docker and FastAPI (but don't worry if you're new, we'll go through this together!)&lt;/li&gt;
&lt;li&gt;SSH access to your droplet&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 1: Crafting Your FastAPI App
&lt;/h2&gt;

&lt;p&gt;First things first, let's create a simple FastAPI app. Here's the bare-bones version I started with:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;main.py&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;fastapi&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;FastAPI&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FastAPI&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="nd"&gt;@app.get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;read_root&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;message&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello from FastAPI&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pretty straightforward, right? This just returns a JSON response when you hit the root endpoint.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Don't Forget Your Dependencies!
&lt;/h2&gt;

&lt;p&gt;I learned this the hard way: always keep your &lt;code&gt;requirements.txt&lt;/code&gt; updated. Here's what mine looks like:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;requirements.txt&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fastapi
uvicorn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pro tip: Use &lt;code&gt;pip freeze &amp;gt; requirements.txt&lt;/code&gt; to automatically generate this file from your current environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Dockerizing Your App
&lt;/h2&gt;

&lt;p&gt;Now, let's containerize our app. Here's the Dockerfile I ended up with after some tweaking:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;Dockerfile&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="s"&gt; python:3.11-slim&lt;/span&gt;
&lt;span class="k"&gt;WORKDIR&lt;/span&gt;&lt;span class="s"&gt; /app&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; . /app&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--no-cache-dir&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
&lt;span class="k"&gt;CMD&lt;/span&gt;&lt;span class="s"&gt; ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]  #or second command will work only when your main.py file contains your initial fastapi setup&lt;/span&gt;
&lt;span class="c"&gt;# CMD ["fastpi", "run", "--host", "0.0.0.0", "--port", "8000"]  &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 4: Building and Running Your Docker Container
&lt;/h2&gt;

&lt;p&gt;Here's where the magic happens. SSH into your DigitalOcean droplet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh user@your_droplet_ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: You can build your docker image locally then push it on dockerhub and after that you can pull your app-image on your production server directly. But for now we are building our docker image on production sever&lt;br&gt;
Once logged in, run these commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker build &lt;span class="nt"&gt;-t&lt;/span&gt; fastapi-app &lt;span class="nb"&gt;.&lt;/span&gt;
docker run &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nt"&gt;--name&lt;/span&gt; fastapi-app &lt;span class="nt"&gt;-p&lt;/span&gt; 8000:8000 fastapi-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Quick tip: Add &lt;code&gt;--restart unless-stopped&lt;/code&gt; to the &lt;code&gt;docker run&lt;/code&gt; command to make your container restart automatically if it crashes or if your droplet reboots.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Verifying Your Deployment
&lt;/h2&gt;

&lt;p&gt;After deployment, you can check the status of your running FastAPI app:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker ps
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To view the logs of your FastAPI app:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker logs fastapi-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To view stats of docker container usage(memory, cpu usage) of each running container&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker stats
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 6: Accessing Your Live Website
&lt;/h2&gt;

&lt;p&gt;Your FastAPI app should now be accessible at &lt;code&gt;http://your_droplet_ip:8000&lt;/code&gt;. Open this URL in your browser to see your live website!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important Note&lt;/strong&gt;: If your main file is named &lt;code&gt;main.py&lt;/code&gt; and contains the FastAPI app instance named &lt;code&gt;app&lt;/code&gt;, you can use the &lt;code&gt;fastapi run&lt;/code&gt; command instead of the custom uvicorn setup. However, when using Docker, we typically stick with the uvicorn command for more control over the host and port settings.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 7: Setting Up Nginx as a Reverse Proxy (Optional)
&lt;/h2&gt;

&lt;p&gt;Setting up Nginx as a reverse proxy can improve performance and security. Here's how to do it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install Nginx:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
   &lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Create a new config file:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;nano /etc/nginx/sites-available/fastapi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Add this configuration:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;   &lt;span class="k"&gt;server&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="kn"&gt;listen&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
       &lt;span class="kn"&gt;server_name&lt;/span&gt; &lt;span class="s"&gt;your_domain_or_ip&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

       &lt;span class="kn"&gt;location&lt;/span&gt; &lt;span class="n"&gt;/&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="kn"&gt;proxy_pass&lt;/span&gt; &lt;span class="s"&gt;http://localhost:8000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
           &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;Host&lt;/span&gt; &lt;span class="nv"&gt;$host&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
           &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;X-Real-IP&lt;/span&gt; &lt;span class="nv"&gt;$remote_addr&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
           &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;X-Forwarded-For&lt;/span&gt; &lt;span class="nv"&gt;$proxy_add_x_forwarded_for&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
           &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;X-Forwarded-Proto&lt;/span&gt; &lt;span class="nv"&gt;$scheme&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
       &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Enable the config and restart Nginx:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; /etc/nginx/sites-available/fastapi /etc/nginx/sites-enabled/
   &lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you set up Nginx, your app will be accessible at &lt;code&gt;http://your_droplet_ip&lt;/code&gt; (without the port number).&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus Tips I Wish I'd Known Earlier
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;HTTPS is a must&lt;/strong&gt;: I highly recommend setting up HTTPS using Let's Encrypt. It's free and easier than you might think!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Monitoring is key&lt;/strong&gt;: I use Prometheus and Grafana to keep an eye on my app's performance. It's saved me more than once!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Automate your deployments&lt;/strong&gt;: Look into CI/CD pipelines. I use GitHub Actions, and it's been a game-changer for my workflow.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Keep your images lean&lt;/strong&gt;: Use multi-stage builds to keep your Docker images as small as possible. It'll save you time and resources in the long run.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Environment variables are your friends&lt;/strong&gt;: Don't hardcode sensitive information. Use environment variables or Docker secrets instead.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;Deploying FastAPI with Docker on DigitalOcean has been an exciting journey for me. It's opened up a whole new world of possibilities for my web development projects. I hope this guide helps you on your own deployment adventures!&lt;/p&gt;

&lt;p&gt;Have you tried deploying FastAPI or any other Python web framework? I'd love to hear about your experiences in the comments. And if you found this guide helpful, don't forget to share it with your fellow devs!&lt;/p&gt;

&lt;p&gt;Happy coding, and may your deployments always be smooth! 🚀&lt;/p&gt;

</description>
      <category>fastapi</category>
      <category>deployment</category>
      <category>digitalocean</category>
      <category>fastapideployment</category>
    </item>
    <item>
      <title>Goodbye IP Addresses, Say Hello to the Magic of Network Aliases</title>
      <dc:creator>Sujit Kumar</dc:creator>
      <pubDate>Mon, 01 Jul 2024 14:26:57 +0000</pubDate>
      <link>https://dev.to/sujit-shrc/goodbye-ip-addresses-hello-sanity-the-magic-of-network-aliases-1i4j</link>
      <guid>https://dev.to/sujit-shrc/goodbye-ip-addresses-hello-sanity-the-magic-of-network-aliases-1i4j</guid>
      <description>&lt;h3&gt;
  
  
  Network Management Made Easy: My Go-To Alias Trick
&lt;/h3&gt;

&lt;p&gt;Hey there, fellow tech enthusiasts! Today, I'm sharing my favorite hack for simplifying network management: using aliases instead of IP addresses. Trust me, this little trick has saved me countless headaches. Let's dive in!&lt;/p&gt;

&lt;h4&gt;
  
  
  Why Bother with Aliases?
&lt;/h4&gt;

&lt;p&gt;Before we get to the how-to, let me tell you why this is so awesome:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Easy to remember&lt;/strong&gt;: "printer" is way easier to recall than 192.168.1.101&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fewer typos&lt;/strong&gt;: Less chance of mistyping a long IP address&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Quicker commands&lt;/strong&gt;: Type &lt;code&gt;ssh user@webserver&lt;/code&gt; instead of &lt;code&gt;ssh user@192.168.1.100&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Consistency&lt;/strong&gt;: Even if IP addresses change, your aliases stay the same&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Setting Up Aliases on Linux/Mac
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Open Terminal and type:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   sudo nano /etc/hosts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Add your aliases like this:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   192.168.1.1    router
   192.168.1.100  webserver
   192.168.1.101  staging-server
   192.168.1.102  printer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Save with Ctrl+X, then Y, then Enter.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Test it out:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

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

&lt;/div&gt;



&lt;p&gt;Pro tip: I like to add comments to my hosts file for future reference:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Home Network Devices
192.168.1.1    router
192.168.1.100  webserver
192.168.1.101  staging-server
192.168.1.102  printer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Setting Up Aliases on Windows
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Run Notepad as administrator (right-click, "Run as administrator")&lt;/li&gt;
&lt;li&gt;Open &lt;code&gt;C:\Windows\System32\drivers\etc\hosts&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Add your aliases just like in the Linux example&lt;/li&gt;
&lt;li&gt;Save and exit&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Quick Tip: If you can't save the file, try moving it to your desktop, edit it there, then move it back.&lt;/p&gt;

&lt;h4&gt;
  
  
  Practical Uses
&lt;/h4&gt;

&lt;p&gt;Now that you've set this up, here are some cool ways I use it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Quick SSH&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   ssh username@webserver
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Fast file transfers&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   scp myfile.txt username@staging-server:/path/to/destination/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Easy networking troubleshooting&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Hassle-free web development&lt;/strong&gt;:
In your browser, just type &lt;code&gt;http://webserver&lt;/code&gt; instead of the IP&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Bonus Tips
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use meaningful names&lt;/strong&gt;: Choose aliases that make sense to you.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Keep it updated&lt;/strong&gt;: Whenever you add a new device to your network, make it a habit to add an alias for it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Backup your hosts file&lt;/strong&gt;: I keep a copy of my hosts file in my cloud storage. It's a lifesaver when setting up a new machine.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use it for remote servers too&lt;/strong&gt;: I add aliases for my cloud servers as well. It's super handy when managing multiple environments.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Wrapping Up
&lt;/h3&gt;

&lt;p&gt;This simple trick has genuinely made my day-to-day tech life so much smoother. Give it a shot, and I bet you'll wonder how you ever managed without it. Got any cool networking tricks of your own? Drop them in the comments – I'm always eager to learn more!&lt;/p&gt;

&lt;p&gt;Remember, networking doesn't have to be a pain. With a little setup, you can make your digital life a whole lot easier. Happy networking, folks!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Decoding the Linux Command Line: 75 Indispensable Utilities Explained</title>
      <dc:creator>Sujit Kumar</dc:creator>
      <pubDate>Fri, 14 Jun 2024 14:32:58 +0000</pubDate>
      <link>https://dev.to/sujit-shrc/decoding-the-linux-command-line-52-indispensable-utilities-explained-34kk</link>
      <guid>https://dev.to/sujit-shrc/decoding-the-linux-command-line-52-indispensable-utilities-explained-34kk</guid>
      <description>&lt;h1&gt;
  
  
  Top 75 Linux Commands Every Regular User Must Know
&lt;/h1&gt;

&lt;p&gt;As a regular Linux user, mastering these essential commands can greatly enhance your productivity and efficiency. Let's dive into the top 75 Linux commands with practical examples.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;ls (List)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ls&lt;/code&gt; - List files and directories in the current directory.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ls -a&lt;/code&gt; - List all files, including hidden ones.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ls -l&lt;/code&gt; - List files with detailed information (permissions, owner, size, etc.).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ls -h&lt;/code&gt; - List files with detailed information in human readable format.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;pwd (Print Working Directory)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;pwd&lt;/code&gt; - Display the current working directory.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;cd (Change Directory)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;cd /path/to/directory&lt;/code&gt; - Navigate to the specified directory.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cd ..&lt;/code&gt; - Move up one directory level.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cd ~&lt;/code&gt; - Navigate to your home directory.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cd -&lt;/code&gt; - Go back to the last directory.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;mkdir (Make Directory)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;mkdir new_directory&lt;/code&gt; - Create a new directory.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mkdir -p /path/to/nested/directories&lt;/code&gt; - Create nested directories.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;touch (Create File)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;touch new_file.txt&lt;/code&gt; - Create a new, empty file.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;mv (Move)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;mv file.txt /path/to/directory&lt;/code&gt; - Move a file to a different directory.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mv old_name.txt new_name.txt&lt;/code&gt; - Rename a file.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;cp (Copy)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;cp file.txt /path/to/directory&lt;/code&gt; - Copy a file to a different directory.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cp -r directory1 /path/to/directory2&lt;/code&gt; - Copy a directory and its contents.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;rm (Remove)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;rm file.txt&lt;/code&gt; - Delete a file.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;rm -r directory&lt;/code&gt; - Delete a directory and its contents (use with caution!).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;cat (Concatenate)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;cat file.txt&lt;/code&gt; - Display the contents of a file.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cat file1.txt file2.txt &amp;gt; combined.txt&lt;/code&gt; - Combine two files into one.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;echo (Print)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;echo "Hello, World!"&lt;/code&gt; - Print a string.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;echo $PATH&lt;/code&gt; - Print the value of an environment variable.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;clear&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;clear&lt;/code&gt; - Clear the terminal screen.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;man (Manual)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;man ls&lt;/code&gt; - Display the manual page for the &lt;code&gt;ls&lt;/code&gt; command.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;uname (System Information)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;uname -a&lt;/code&gt; - Display detailed information about the system.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;whoami (User Information)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;whoami&lt;/code&gt; - Print the current user's username.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;head (Show Top Lines)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;head -n 10 file.txt&lt;/code&gt; - Display the first 10 lines of a file.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;tail (Show Bottom Lines)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;tail -n 20 log.txt&lt;/code&gt; - Display the last 20 lines of a file.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;diff (Compare Files)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;diff file1.txt file2.txt&lt;/code&gt; - Compare the contents of two files.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;cmp (Compare Files)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;cmp file1.txt file2.txt&lt;/code&gt; - Check if two files are identical byte-by-byte.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;comm (Compare Files)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;comm -13 file1.txt file2.txt&lt;/code&gt; - Show lines unique to each file and common lines.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;sort (Sort)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;sort file.txt&lt;/code&gt; - Sort the lines of a file in alphabetical order.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sort -n file.txt&lt;/code&gt; - Sort the lines of a file numerically.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;tar (Archive)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;tar -czf archive.tar.gz directory&lt;/code&gt; - Create a compressed tar archive of a directory.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;tar -xzf archive.tar.gz&lt;/code&gt; - Extract files from a compressed tar archive.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;grep (Search)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;grep "pattern" file.txt&lt;/code&gt; - Search for a pattern in a file.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ps aux | grep process_name&lt;/code&gt; - Find processes containing a specific name.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;ln (Create Link)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ln -s /path/to/file link_name&lt;/code&gt; - Create a symbolic link to a file.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;export (Set Environment Variables)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;export PATH=$PATH:/new/path&lt;/code&gt; - Add a new path to the &lt;code&gt;PATH&lt;/code&gt; environment variable.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;zip (Compress Files)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;zip archive.zip file1.txt file2.txt&lt;/code&gt; - Create a ZIP archive with multiple files.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;unzip (Extract Files)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;unzip archive.zip&lt;/code&gt; - Extract files from a ZIP archive.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;ssh (Secure Shell)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ssh user@remote_host&lt;/code&gt; - Connect to a remote system via SSH.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;service (Manage Services)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;service apache2 start&lt;/code&gt; - Start the Apache web server service.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;service mysql status&lt;/code&gt; - Check the status of the MySQL service.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;ps (Process Status)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ps aux&lt;/code&gt; - Display detailed information about running processes.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;kill and killall (Terminate Processes)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;kill 1234&lt;/code&gt; - Terminate a process with the specified PID (1234).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;killall process_name&lt;/code&gt; - Terminate all processes with a specific name.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;df (Disk Usage)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;df -h&lt;/code&gt; - Display disk usage in a human-readable format.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;mount (Mount File Systems)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;mount /dev/sdb1 /mnt/usb&lt;/code&gt; - Mount a USB drive to the &lt;code&gt;/mnt/usb&lt;/code&gt; directory.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;chmod (Change Permissions)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;chmod 755 file.sh&lt;/code&gt; - Grant read, write, and execute permissions to the owner, and read and execute permissions to group and others.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;chown (Change Ownership)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;chown user:group file.txt&lt;/code&gt; - Change the owner and group of a file.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;ifconfig (Network Configuration)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ifconfig&lt;/code&gt; - Display information about network interfaces and IP addresses.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;traceroute (Trace Network Route)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;traceroute example.com&lt;/code&gt; - Trace the network path to a remote host.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;wget (Web Get)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;wget https://example.com/file.zip&lt;/code&gt; - Download a file from a web server.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;ufw (Uncomplicated Firewall)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ufw enable&lt;/code&gt; - Enable the firewall.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ufw allow 22&lt;/code&gt; - Allow incoming connections on port 22 (SSH).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;iptables (Firewall)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;iptables -L&lt;/code&gt; - List current firewall rules.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;iptables -A INPUT -p tcp --dport 80 -j ACCEPT&lt;/code&gt; - Allow incoming TCP connections on port 80 (HTTP).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;apt, pacman, yum, rpm (Package Managers)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;apt update &amp;amp;&amp;amp; apt upgrade&lt;/code&gt; (Ubuntu/Debian) - Update package lists and upgrade installed packages.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;pacman -Syu&lt;/code&gt; (Arch Linux) - Synchronize package databases and upgrade installed packages.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;yum update&lt;/code&gt; (CentOS/RHEL) - Update installed packages.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;rpm -ivh package.rpm&lt;/code&gt; - Install an RPM package.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;sudo (Escalate Privileges)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;sudo command&lt;/code&gt; - Run a command with superuser (root) privileges.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;cal (Calendar)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;cal&lt;/code&gt; - Display the current month's calendar.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cal 2024&lt;/code&gt; - Display the entire year's calendar for 2024.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;alias (Create Command Shortcuts)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;alias ll='ls -l'&lt;/code&gt; - Create an alias for the &lt;code&gt;ls -l&lt;/code&gt; command.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;dd (Data Duplicator)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;dd if=/dev/zero of=/path/to/file bs=1M count=1024&lt;/code&gt; - Create a 1GB file filled with zeros.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;dd if=/path/to/iso of=/dev/sdx&lt;/code&gt; - Write an ISO image to a USB drive.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;whereis (Locate Command)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;whereis ls&lt;/code&gt; - Find the binary, source, and manual page files for the &lt;code&gt;ls&lt;/code&gt; command.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;whatis (Command Description)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;whatis ls&lt;/code&gt; - Display a brief description of the &lt;code&gt;ls&lt;/code&gt; command.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;top (Process Monitor)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;top&lt;/code&gt; - Display real-time information about running processes and system resource usage.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;useradd and usermod (User Management)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;useradd new_user&lt;/code&gt; - Create a new user account.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;usermod -aG sudo new_user&lt;/code&gt; - Add an existing user to the sudo group.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;passwd (Change Password)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;passwd&lt;/code&gt; - Change the password for the current user.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;passwd user_name&lt;/code&gt; (as root) - Change the password for a specific user.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;curl (Transfer Data)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;curl https://example.com&lt;/code&gt; - Fetch the contents of a URL.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;curl ifconfig.me&lt;/code&gt; - Display your public IP address.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;ping (Test Network Connectivity)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ping google.com&lt;/code&gt; - Test connectivity to a remote host.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ping -c 2 google.com&lt;/code&gt; - Send 2 ping packets and stop.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;h2&gt;
  
  
  &lt;strong&gt;netstat (Network Statistics)&lt;/strong&gt;
&lt;/h2&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;netstat -tunlp&lt;/code&gt; - Display listening network ports and associated processes.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;rsync (Remote Sync)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;rsync -avz /path/to/source /path/to/destination&lt;/code&gt; - Sync files between directories locally or remotely.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;scp (Secure Copy)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;scp file.txt user@remote_host:/path/to/destination&lt;/code&gt; - Copy files between hosts on a network.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;find (Find Files)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;find /path -name filename&lt;/code&gt; - Search for files in a directory hierarchy.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;locate (Locate Files)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;locate filename&lt;/code&gt; - Find the location of a file quickly.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;chmod (Change File Permissions)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;chmod 755 file.sh&lt;/code&gt; - Change the permission of a file or directory.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;chown (Change File Owner)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;chown user:group file.txt&lt;/code&gt; - Change the owner and group of a file.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;su (Switch User)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;su -&lt;/code&gt; - Switch to the root user.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;su - username&lt;/code&gt; - Switch to another user.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;usermod (Modify User)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;usermod -aG groupname username&lt;/code&gt; - Add a user to a group.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;groupadd (Add Group)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;groupadd groupname&lt;/code&gt; - Create a new group.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;groups (List Groups)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;groups username&lt;/code&gt; - Display groups for a user.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;last (Last Logins)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;last&lt;/code&gt; - Show a listing of last logged in users.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;hostname (Show or Set Hostname)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;hostname&lt;/code&gt; - Show the system's hostname.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;hostname new_hostname&lt;/code&gt; - Set the system's hostname.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;history (Command History)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;history&lt;/code&gt; - Display the command history.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;!n&lt;/code&gt; - Execute command number n from history.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;crontab (Cron Jobs)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;crontab -e&lt;/code&gt; - Edit the cron jobs.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;crontab -l&lt;/code&gt; - List the cron jobs.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;bg (Background Jobs)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;bg&lt;/code&gt; - Resume a suspended job in the background.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;fg (Foreground Jobs)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;fg&lt;/code&gt; - Bring a background job to the foreground.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;jobs (List Jobs)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;jobs&lt;/code&gt; - List all jobs.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;at (Schedule Tasks)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;at 10:00&lt;/code&gt; - Schedule a command to run at 10:00 AM.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;atq&lt;/code&gt; - List the pending jobs of users.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;basename (File Name)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;basename /path/to/file&lt;/code&gt; - Display file name without the directory path.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;dirname (Directory Name)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;dirname /path/to/file&lt;/code&gt; - Display the directory path of a file.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;file (File Type)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;file filename&lt;/code&gt; - Determine the file type.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;watch (Execute/Watch Command)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;watch -n 5 df -h&lt;/code&gt; - Execute a program periodically, showing output fullscreen.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;shutdown (Shutdown System)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;shutdown -h now&lt;/code&gt; - Shutdown the system immediately.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;shutdown -r now&lt;/code&gt; - Reboot the system immediately.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;With these 75 essential Linux commands under your belt, you'll be well-equipped to navigate the command line, manage files and processes, customize your system, and supercharge your productivity on the Linux operating system.&lt;br&gt;
Happy Coding!!&lt;/p&gt;

</description>
      <category>cmd</category>
      <category>terminal</category>
      <category>linux</category>
    </item>
    <item>
      <title>Mastering Git: Tips and Tricks for Efficient Version Control</title>
      <dc:creator>Sujit Kumar</dc:creator>
      <pubDate>Wed, 29 Nov 2023 15:33:04 +0000</pubDate>
      <link>https://dev.to/sujit-shrc/mastering-git-tips-and-tricks-for-efficient-version-control-44cm</link>
      <guid>https://dev.to/sujit-shrc/mastering-git-tips-and-tricks-for-efficient-version-control-44cm</guid>
      <description>&lt;p&gt;Git, the powerhouse of version control systems, empowers developers to manage their codebase effectively. As you delve deeper into the Git universe, discovering hidden gems and mastering its features can significantly enhance your workflow. One such gem is the often overlooked, yet incredibly handy, autocorrect feature.&lt;/p&gt;

&lt;h3&gt;
  
  
  Autocorrecting Typos for Swift Command Execution
&lt;/h3&gt;

&lt;p&gt;Have you ever found yourself typing &lt;code&gt;git comit&lt;/code&gt; instead of &lt;code&gt;git commit&lt;/code&gt; in the heat of coding? Fear not, for Git has a solution—autocorrect. By default, Git graciously suggests the most likely correct command when faced with a typo.&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="nv"&gt;$ &lt;/span&gt;git comit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Some awesome work"&lt;/span&gt;
git: &lt;span class="s1"&gt;'comit'&lt;/span&gt; is not a git command. See &lt;span class="s1"&gt;'git --help'&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;

The most similar &lt;span class="nb"&gt;command &lt;/span&gt;is
  commit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Instant Autocorrect for the Impatient Developer
&lt;/h3&gt;

&lt;p&gt;For those who can't wait to correct their mistakes, Git offers the immediate autocorrect mode. By setting the &lt;code&gt;help.autocorrect&lt;/code&gt; configuration to &lt;code&gt;immediate&lt;/code&gt;, Git will automatically run the first closely matched command without prompting.&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="nv"&gt;$ &lt;/span&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; help.autocorrect immediate
&lt;span class="nv"&gt;$ &lt;/span&gt;git comit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Some awesome work"&lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;main 25112f085] Some awesome work
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The Cautious Approach: Autocorrect with Prompt
&lt;/h3&gt;

&lt;p&gt;If the idea of immediate execution makes you a bit uneasy, Git provides a middle ground—prompt mode. This mode prompts you with a yes/no confirmation before executing the autocorrected command.&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="nv"&gt;$ &lt;/span&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; help.autocorrect prompt
&lt;span class="nv"&gt;$ &lt;/span&gt;git comit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"More awesome work"&lt;/span&gt;
Run &lt;span class="s1"&gt;'commit'&lt;/span&gt; instead &lt;span class="o"&gt;[&lt;/span&gt;y/N]? y
&lt;span class="o"&gt;[&lt;/span&gt;main 2183b892e] More awesome work
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Introducing a Timeout: Autocorrect with a Safety Net
&lt;/h3&gt;

&lt;p&gt;For those who want to add an extra layer of caution, Git allows you to set a timeout before automatically proceeding. This provides a short window for you to cancel the autocorrected command if needed.&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="nv"&gt;$ &lt;/span&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; help.autocorrect 20
&lt;span class="nv"&gt;$ &lt;/span&gt;git comit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Even more work"&lt;/span&gt; &lt;span class="nt"&gt;--allow-empty&lt;/span&gt;
Continuing &lt;span class="k"&gt;in &lt;/span&gt;2.0 seconds, assuming that you meant &lt;span class="s1"&gt;'commit'&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;main b0be18f0d] Even more work
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Additional Git Tips and Tricks
&lt;/h3&gt;

&lt;p&gt;Now that we've explored the power of autocorrect, let's delve into more Git tips and tricks to supercharge your version control skills.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;Interactive Staging&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Git allows you to stage changes interactively, giving you fine-grained control over what goes into your commit. Use the following command to enter interactive staging:&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="nv"&gt;$ &lt;/span&gt;git add &lt;span class="nt"&gt;-i&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This opens an interactive menu, allowing you to choose which changes to stage, unstage, or even split into smaller changes.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. &lt;strong&gt;Stash Uncommitted Changes&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Got changes you're not ready to commit, but you need to switch branches? Stash them!&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="nv"&gt;$ &lt;/span&gt;git stash save &lt;span class="s2"&gt;"Your stash message"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Later, you can reapply your changes:&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="nv"&gt;$ &lt;/span&gt;git stash apply
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. &lt;strong&gt;Reflog: Your Safety Net&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Ever made a change and then realized it was a mistake? The reflog is your safety net. It keeps a log of all reference updates, including branch switching and resets.&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="nv"&gt;$ &lt;/span&gt;git reflog
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can then use the commit hash to reset your branch back to a previous state.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. &lt;strong&gt;Aliases for Efficiency&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Create aliases for your frequently used Git commands to save keystrokes. For example:&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="nv"&gt;$ &lt;/span&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; alias.co checkout
&lt;span class="nv"&gt;$ &lt;/span&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; alias.br branch
&lt;span class="nv"&gt;$ &lt;/span&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; alias.ci commit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can use &lt;code&gt;git co&lt;/code&gt;, &lt;code&gt;git br&lt;/code&gt;, and &lt;code&gt;git ci&lt;/code&gt; instead of the longer commands.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. &lt;strong&gt;Git Hooks&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Git hooks enable you to automate actions at different points in the Git workflow. For instance, you can use a pre-commit hook to run tests before committing.&lt;/p&gt;

&lt;p&gt;Explore the &lt;code&gt;.git/hooks&lt;/code&gt; directory in your repository to see the available hooks.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. &lt;strong&gt;Git Bisect for Bug Hunting&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;When you encounter a bug and need to find the commit that introduced it, Git Bisect is your ally.&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="nv"&gt;$ &lt;/span&gt;git bisect start
&lt;span class="nv"&gt;$ &lt;/span&gt;git bisect bad  &lt;span class="c"&gt;# Current commit has the bug&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;git bisect good &amp;lt;commit&amp;gt;  &lt;span class="c"&gt;# A known good commit&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;git bisect run &amp;lt;test_command&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git will perform a binary search, helping you identify the commit responsible for the bug.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. &lt;strong&gt;Search Through Commits&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Looking for a specific change but can't remember which commit it's in? Use &lt;code&gt;git log&lt;/code&gt; with the &lt;code&gt;-S&lt;/code&gt; option to search for a specific string.&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="nv"&gt;$ &lt;/span&gt;git log &lt;span class="nt"&gt;-S&lt;/span&gt; &lt;span class="s2"&gt;"your search term"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  8. &lt;strong&gt;Git Worktree: Multiple Working Directories&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Git worktree allows you to maintain multiple working directories from a single repository. This is handy when you need to work on different branches simultaneously.&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="nv"&gt;$ &lt;/span&gt;git worktree add &lt;span class="nt"&gt;-b&lt;/span&gt; &amp;lt;new_branch&amp;gt; &amp;lt;path&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  9. &lt;strong&gt;Rebase for a Clean History&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Instead of merging branches, consider rebasing for a cleaner commit history.&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="nv"&gt;$ &lt;/span&gt;git checkout feature_branch
&lt;span class="nv"&gt;$ &lt;/span&gt;git rebase main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This integrates changes from the main branch into your feature branch without creating a merge commit.&lt;/p&gt;

&lt;h3&gt;
  
  
  10. &lt;strong&gt;Git Archive: Export Without .git Directory&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;When you need to create a clean export of your project without the &lt;code&gt;.git&lt;/code&gt; directory, use &lt;code&gt;git archive&lt;/code&gt;.&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="nv"&gt;$ &lt;/span&gt;git archive &lt;span class="nt"&gt;--format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;zip &lt;span class="nt"&gt;--output&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;project.zip master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates a zip file of your project, excluding version control files.&lt;/p&gt;

&lt;p&gt;Incorporate these tips and tricks into your Git workflow, and watch as your version control mastery reaches new heights. Happy coding!&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>versioncontrol</category>
    </item>
    <item>
      <title>Diving into Data: A Comprehensive Guide to Database Fundamentals</title>
      <dc:creator>Sujit Kumar</dc:creator>
      <pubDate>Sat, 11 Nov 2023 13:57:34 +0000</pubDate>
      <link>https://dev.to/sujit-shrc/diving-into-data-a-comprehensive-guide-to-database-fundamentals-4lhf</link>
      <guid>https://dev.to/sujit-shrc/diving-into-data-a-comprehensive-guide-to-database-fundamentals-4lhf</guid>
      <description>&lt;h2&gt;
  
  
  01_Intro:
&lt;/h2&gt;

&lt;p&gt;In this blog post, we will introduce you to the basics of databases, including what they are, different types of databases, and how they are used in the real world. We will also provide some technical examples &lt;/p&gt;

&lt;h1&gt;
  
  
  Understanding Data:
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Data&lt;/strong&gt; is the raw facts and figures, such as numbers, text, images, or any other pieces of information that can be stored and processed.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is a Database?
&lt;/h1&gt;

&lt;p&gt;A &lt;strong&gt;database&lt;/strong&gt; is a structured collection of data that is organized and stored in a way that allows for efficient retrieval and manipulation. It acts as a centralized repository for managing and storing information.&lt;/p&gt;

&lt;h2&gt;
  
  
  Properties of a Database:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data Integrity:&lt;/strong&gt; This ensures that the data in the database is accurate and consistent. For example, if you have a table storing employee information, data integrity would prevent a situation where an employee is assigned to a non-existent department.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Security:&lt;/strong&gt; Database systems implement security measures to control access to data. For instance, a user might have read-only access to a table containing recipes but can't modify the original recipes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Concurrency Control:&lt;/strong&gt; This property manages the simultaneous access to the database by multiple users to prevent conflicts. If two chefs try to modify the same recipe at the same time, concurrency control ensures that changes are made in a controlled manner.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  Types of Databases:
&lt;/h1&gt;

&lt;h2&gt;
  
  
  1. Relational Database:
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;relational database&lt;/strong&gt; organizes data into tables with rows and columns. Tables are related based on common attributes, creating a structured and easily understandable format. Let's consider an example:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Table: Recipes&lt;/strong&gt;&lt;br&gt;
| RecipeID | RecipeName     | Ingredients                  | Category    |&lt;br&gt;
|----------|----------------|------------------------------|-------------|&lt;br&gt;
| 1        | Spaghetti Bolognese | Pasta, Tomatoes, Beef, Onion | Main Course |&lt;br&gt;
| 2        | Chocolate Cake      | Flour, Sugar, Cocoa          | Dessert     |&lt;/p&gt;
&lt;h2&gt;
  
  
  2. NoSQL Database:
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;NoSQL database&lt;/strong&gt; is more flexible, allowing for the storage of various data types. Consider a document-oriented NoSQL database:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example Document: Customer&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"CustomerID"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"Name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"John Doe"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"Orders"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"OrderID"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;101&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Product"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Laptop"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Quantity"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"OrderID"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;102&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Product"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Smartphone"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Quantity"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Column Database:
&lt;/h2&gt;

&lt;p&gt;In a &lt;strong&gt;column database&lt;/strong&gt;, data is stored vertically rather than horizontally. This optimizes the retrieval of specific information. Consider a column-oriented table:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Table: Sales&lt;/strong&gt;&lt;br&gt;
| Product   | Jan_Sales | Feb_Sales | Mar_Sales |&lt;br&gt;
|-----------|-----------|-----------|-----------|&lt;br&gt;
| Laptop    | 100       | 120       | 90        |&lt;br&gt;
| Smartphone| 50        | 60        | 45        |&lt;/p&gt;
&lt;h2&gt;
  
  
  4. Graph Database:
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;graph database&lt;/strong&gt; represents data as nodes and edges. It's ideal for scenarios where relationships are crucial. Consider a social network scenario:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Graph: Social Network&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(John)-[:FRIENDS]-&amp;gt;(Jane)
(Jane)-[:FOLLOWS]-&amp;gt;(Bob)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. Key-Value Database:
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;key-value database&lt;/strong&gt; stores data as pairs of keys and values. It's simple but powerful for quick data retrieval. Consider a configuration settings scenario:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example: Configuration Settings&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "Theme": "Dark",
  "FontSize": 16,
  "Language": "English"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  6. Relational Database:
&lt;/h2&gt;

&lt;p&gt;In a &lt;strong&gt;relational database&lt;/strong&gt;, tables are interconnected based on common keys. For instance:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Table: Employees&lt;/strong&gt;&lt;br&gt;
| EmployeeID | Name       | DepartmentID |&lt;br&gt;
|------------|------------|--------------|&lt;br&gt;
| 1          | Alice      | 101          |&lt;br&gt;
| 2          | Bob        | 102          |&lt;/p&gt;

&lt;h1&gt;
  
  
  DBMS (Database Management System):
&lt;/h1&gt;

&lt;p&gt;A &lt;strong&gt;DBMS (Database Management System)&lt;/strong&gt; is software that interacts with the database. It manages tasks like data entry, retrieval, and updates. Examples include MySQL, MariaDB, PostgreSQL, or MongoDB.&lt;/p&gt;

&lt;h1&gt;
  
  
  Keys:
&lt;/h1&gt;

&lt;p&gt;In a relational database, keys are crucial for uniquely identifying records within a table. Let's consider an example with two tables: &lt;code&gt;Students&lt;/code&gt; and &lt;code&gt;Courses&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Table: Students&lt;/strong&gt;&lt;br&gt;
| StudentID | Name      | Age | &lt;br&gt;
|-----------|-----------|-----|&lt;br&gt;
| 1         | Alice     | 20  |&lt;br&gt;
| 2         | Bob       | 22  |&lt;br&gt;
| 3         | Charlie   | 21  |&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Table: Courses&lt;/strong&gt;&lt;br&gt;
| CourseID | CourseName       | Instructor     |&lt;br&gt;
|----------|------------------|-----------------|&lt;br&gt;
| 101      | Mathematics 101  | Prof. Smith     |&lt;br&gt;
| 102      | Physics 201      | Prof. Johnson   |&lt;/p&gt;

&lt;p&gt;In the &lt;code&gt;Students&lt;/code&gt; table, the &lt;code&gt;StudentID&lt;/code&gt; serves as the primary key, ensuring each student has a unique identifier. In the &lt;code&gt;Courses&lt;/code&gt; table, the &lt;code&gt;CourseID&lt;/code&gt; serves as the primary key, offering a unique identifier for each course.&lt;/p&gt;

&lt;p&gt;Now, let's introduce a third table, &lt;code&gt;Enrollments&lt;/code&gt;, to represent the relationship between students and courses.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Table: Enrollments&lt;/strong&gt;&lt;br&gt;
| StudentID | CourseID |&lt;br&gt;
|-----------|----------|&lt;br&gt;
| 1         | 101      |&lt;br&gt;
| 2         | 101      |&lt;br&gt;
| 2         | 102      |&lt;br&gt;
| 3         | 102      |&lt;/p&gt;

&lt;p&gt;In this &lt;code&gt;Enrollments&lt;/code&gt; table, &lt;code&gt;StudentID&lt;/code&gt; and &lt;code&gt;CourseID&lt;/code&gt; together form a composite primary key, establishing a link between students and the courses they are enrolled in.&lt;/p&gt;

&lt;h1&gt;
  
  
  Cardinality of Relationship:
&lt;/h1&gt;

&lt;p&gt;The cardinality of a relationship defines how many instances of one entity are related to another. Let's consider the relationship between students and courses.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;One-to-One (1:1) Relationship:&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In a one-to-one relationship, each record in the first table is related to one and only one record in the second table, and vice versa. This is less common but can be illustrated with a hypothetical &lt;code&gt;Advisor&lt;/code&gt; table.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Table: Advisor&lt;/strong&gt;&lt;br&gt;
| StudentID | AdvisorName |&lt;br&gt;
|-----------|-------------|&lt;br&gt;
| 1         | Prof. Brown |&lt;br&gt;
| 2         | Prof. Green |&lt;br&gt;
| 3         | Prof. White |&lt;/p&gt;

&lt;p&gt;Here, each student has a unique advisor, and each advisor advises only one student.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;One-to-Many (1:N) Relationship:&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In a one-to-many relationship, each record in the first table can be related to multiple records in the second table, but each record in the second table is related to only one record in the first table. Let's apply this to our &lt;code&gt;Students&lt;/code&gt; and &lt;code&gt;Enrollments&lt;/code&gt; tables.&lt;/p&gt;

&lt;p&gt;Each student in the &lt;code&gt;Students&lt;/code&gt; table can be enrolled in multiple courses, but each course in the &lt;code&gt;Courses&lt;/code&gt; table is typically associated with multiple students.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Many-to-Many (M:N) Relationship:&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In a many-to-many relationship, each record in the first table can be related to multiple records in the second table, and vice versa. The &lt;code&gt;Enrollments&lt;/code&gt; table we introduced earlier represents a many-to-many relationship. Multiple students can be enrolled in multiple courses.&lt;/p&gt;

&lt;p&gt;Understanding keys and the cardinality of relationships is fundamental for designing a well-structured and efficient relational database. These concepts ensure data integrity and provide a foundation for building complex and interconnected systems.&lt;/p&gt;

&lt;h1&gt;
  
  
  Drawbacks of Databases:
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Complexity:&lt;/strong&gt; Managing a large recipe collection (database) requires careful organization and planning, especially as the number of recipes (data) grows.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cost:&lt;/strong&gt; Establishing and maintaining a robust database can incur costs for hardware, software, and personnel.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Scalability Issues:&lt;/strong&gt; Just as a kitchen might struggle to handle a sudden increase in the number of guests, databases may face challenges in scaling up to handle a growing volume of data.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Understanding these concepts is like becoming a master chef in the world of information management. Each type of database has its unique flavor, and choosing the right one depends on the specific needs of your "culinary" project.&lt;/p&gt;

&lt;p&gt;"Thanks for tuning in! Until next time, happy learning and stay curious!"&lt;/p&gt;

</description>
      <category>database</category>
      <category>mysql</category>
      <category>mariadb</category>
      <category>mongodb</category>
    </item>
    <item>
      <title>Mastering Git: A Beginner's Guide to Version Control</title>
      <dc:creator>Sujit Kumar</dc:creator>
      <pubDate>Sun, 05 Nov 2023 14:04:19 +0000</pubDate>
      <link>https://dev.to/sujit-shrc/mastering-git-a-beginners-guide-to-version-control-3j7p</link>
      <guid>https://dev.to/sujit-shrc/mastering-git-a-beginners-guide-to-version-control-3j7p</guid>
      <description>&lt;p&gt;Welcome to the world of Git, a powerful version control system that helps you manage and track changes in your projects. Whether you're a coding novice or a seasoned developer, understanding Git is crucial for efficient collaboration and project management.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Chapter 1: Getting Started (Basics)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Repository&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Git is all about repositories - digital project folders. To create a new one, use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To grab an existing one from the web:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone &amp;lt;repository-url&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Clone&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Clone is like making a copy of a project. Use it to snag a remote repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/example/repo.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Commit&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Think of commits as snapshots of your project. To save your changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &amp;lt;filename&amp;gt;
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Your commit message here"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. Push&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Push is for sharing your local changes with others:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push origin master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;5. Pull&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Pull is for grabbing changes others made:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git pull origin master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;6. Branch&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Branches let you work on different parts at the same time:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch &amp;lt;branch-name&amp;gt;
git checkout &amp;lt;branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;7. Merge&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Merge combines changes from one branch into another:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout master
git merge &amp;lt;branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;8. Remote&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Remote is the centralized repository where everyone collaborates:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote add origin &amp;lt;repository-url&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;9. Fetch&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Fetch gets changes from the remote without merging:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git fetch origin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;10. HEAD&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;HEAD points to the latest commit in your working branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Chapter 2: Advanced Techniques&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Rebasing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Rebasing helps tidy up your commit history:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout feature-branch
git rebase master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Stash&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Stash is for saving changes not ready to be committed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git stash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Cherry-picking&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Cherry-picking lets you apply specific commits:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git cherry-pick &amp;lt;commit-hash&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. Submodules&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Submodules include external projects in your repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git submodule add &amp;lt;repository-url&amp;gt; &amp;lt;path&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;5. Hooks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Hooks are scripts that run at key Git points:&lt;/p&gt;

&lt;p&gt;Create &lt;code&gt;pre-commit&lt;/code&gt; in &lt;code&gt;.git/hooks/&lt;/code&gt; with your script.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Gitignore&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;.gitignore excludes files from version control:&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="nb"&gt;touch&lt;/span&gt; .gitignore
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Edit to specify files to ignore.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Reflog&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Reflog logs all changes to your repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git reflog
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;8. Bisect&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Bisect helps find when a bug was introduced:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git bisect start
git bisect bad
git bisect good &amp;lt;commit-hash&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;9. Tagging&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Tags mark specific points in history:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git tag &lt;span class="nt"&gt;-a&lt;/span&gt; v1.0 &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Version 1.0"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;10. Interactive Rebase&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Interactive rebase lets you modify commits:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git rebase &lt;span class="nt"&gt;-i&lt;/span&gt; HEAD~3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Mastering these basics and advanced Git concepts will empower you to efficiently manage your projects and collaborate seamlessly. Feel free to reach out if you want more details or explanations on any concept. Happy coding!&lt;/p&gt;

</description>
      <category>git</category>
      <category>githunt</category>
      <category>githack</category>
      <category>versioncontrol</category>
    </item>
    <item>
      <title>Docker: A Practical Guide with Arch Linux Setup: Part-1</title>
      <dc:creator>Sujit Kumar</dc:creator>
      <pubDate>Thu, 26 Oct 2023 13:41:07 +0000</pubDate>
      <link>https://dev.to/sujit-shrc/docker-a-practical-guide-with-arch-linux-setup-bdc</link>
      <guid>https://dev.to/sujit-shrc/docker-a-practical-guide-with-arch-linux-setup-bdc</guid>
      <description>&lt;h2&gt;
  
  
  Docker Intro:
&lt;/h2&gt;

&lt;p&gt;Docker has revolutionized the way we develop, deploy, and run applications. It provides a lightweight and efficient solution for packaging, distributing, and running software in isolated environments called containers. This blog post aims to guide you through the basics of Docker, including its setup on an Arch-based Linux system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Docker Basics
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;

&lt;p&gt;To install Docker on Arch Linux, you can use the following commands:&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="nb"&gt;sudo &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; docker
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start docker
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;docker
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will install Docker and start the Docker daemon.&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding User to Docker group
&lt;/h3&gt;

&lt;p&gt;To add the user to the docker group, use the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo usermod -aG docker $USER
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will add the user to the docker group without requiring sudo privileges.&lt;br&gt;
&lt;code&gt;Note:&lt;/code&gt; It requires to restart your device.&lt;/p&gt;
&lt;h3&gt;
  
  
  Running a Container
&lt;/h3&gt;

&lt;p&gt;Let's start with a simple example. To run an Ubuntu container interactively, use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;-it&lt;/span&gt; ubuntu
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Find Images in Docker Hub
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker search jenkins
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Download Docker Image from Docker Hub to Local
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker pull jenkins
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Delete Local image
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker rmi image_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command pulls the Ubuntu image from the Docker Hub and starts an interactive shell within the container.&lt;/p&gt;

&lt;h3&gt;
  
  
  Managing Containers
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Start/Stop a Container:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker start container_name
docker stop container_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;List Containers:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker ps &lt;span class="nt"&gt;-a&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Go Inside Docker Container:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker attach container_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Execute a Command in a Running Container:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker &lt;span class="nb"&gt;exec &lt;/span&gt;container_name &lt;span class="nb"&gt;command&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Attach to a Running Container:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker &lt;span class="nb"&gt;exec&lt;/span&gt; &lt;span class="nt"&gt;-it&lt;/span&gt; container_name bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Remove a Container:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker &lt;span class="nb"&gt;rm &lt;/span&gt;container_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Inspect Container Details:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker inspect container_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Diff Containers&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker diff container_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Commit changes into container and create updated image&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker commit container_name new_image_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Listing Images
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker images
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Dockerization with Dockerfile
&lt;/h3&gt;

&lt;p&gt;A Dockerfile is a script that contains a set of instructions for building a Docker image. Here's a basic example for a Node.js application:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="s"&gt; ubuntu&lt;/span&gt;

&lt;span class="k"&gt;RUN &lt;/span&gt;apt-get update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;    apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; curl &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;    curl &lt;span class="nt"&gt;-sL&lt;/span&gt; https://deb.nodesource.com/setup_14.x | bash &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;    apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; nodejs

&lt;span class="k"&gt;WORKDIR&lt;/span&gt;&lt;span class="s"&gt; /app&lt;/span&gt;

&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; package.json package-lock.json ./&lt;/span&gt;

&lt;span class="k"&gt;RUN &lt;/span&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt;

&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; . .&lt;/span&gt;

&lt;span class="k"&gt;CMD&lt;/span&gt;&lt;span class="s"&gt; ["node", "main.js"]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To build the image, navigate to the directory containing the Dockerfile and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker build &lt;span class="nt"&gt;-t&lt;/span&gt; your_image_name &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Container Networking
&lt;/h3&gt;

&lt;p&gt;To expose a port from the container to the host system, use the &lt;code&gt;-p&lt;/code&gt; flag. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;-it&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; 1025:1025 your_image_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This maps port 1025 on the host to port 1025 on the container.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Docker simplifies the process of packaging, distributing, and running applications. In this guide, we covered basic Docker commands, the creation of Dockerfiles, and container networking. This should serve as a solid foundation for further exploration into the world of containerization.&lt;br&gt;
Happy Dockering!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Mermaid: A powerful and flexible tool for creating diagrams</title>
      <dc:creator>Sujit Kumar</dc:creator>
      <pubDate>Wed, 25 Oct 2023 05:44:53 +0000</pubDate>
      <link>https://dev.to/sujit-shrc/mermaid-a-powerful-and-flexible-tool-for-creating-diagrams-627</link>
      <guid>https://dev.to/sujit-shrc/mermaid-a-powerful-and-flexible-tool-for-creating-diagrams-627</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is Mermaid?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Mermaid is a lightweight, text-based, open-source diagram and flowchart description language. It is used to create diagrams of all kinds, including flowcharts, sequence diagrams, gantt charts, and state diagrams. Mermaid diagrams are created using a simple text format, which makes them easy to read and write.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why use Mermaid?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are many reasons to use Mermaid, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Simplicity:&lt;/strong&gt; Mermaid is very easy to learn and use. Diagrams can be created using a simple text format, which makes them easy to read and write.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flexibility:&lt;/strong&gt; Mermaid can be used to create a wide variety of diagrams, including flowcharts, sequence diagrams, gantt charts, and state diagrams.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Power:&lt;/strong&gt; Mermaid is a powerful tool for creating complex diagrams. It supports a wide range of features, such as subgraphs, loops, and conditional statements.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Community support:&lt;/strong&gt; Mermaid has a large and active community of users who are always willing to help.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How to use Mermaid&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To use Mermaid, you need to install the Mermaid renderer. There are renderers available for a variety of platforms, including web, desktop, and mobile devices.&lt;/p&gt;

&lt;p&gt;Once you have installed the Mermaid renderer, you can start creating diagrams. To create a diagram, simply write the Mermaid code in a text file and save it with a &lt;code&gt;.mmd&lt;/code&gt; extension. Then, open the file in the Mermaid renderer to view the diagram.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mermaid examples&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here are some examples of Mermaid diagrams:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gitGraph
    commit
    commit
    branch develop
    checkout develop
    commit
    commit
    checkout main
    merge develop
    commit
    commit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ir6akb1x6yg874q1w3r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ir6akb1x6yg874q1w3r.png" alt="Image description" width="592" height="230"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pie title Pets adopted by volunteers
    "Dogs" : 386
    "Cats" : 85
    "Rats" : 15
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnivwq9d1fd5ourerpqcw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnivwq9d1fd5ourerpqcw.png" alt="Image description" width="492" height="326"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gantt
    title A Gantt Diagram
    dateFormat  YYYY-MM-DD
    section Section
    A task           :a1, 2014-01-01, 30d
    Another task     :after a1  , 20d
    section Another
    Task in sec      :2014-01-12  , 12d
    another task      : 24d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code creates a gantt chart that shows the development, testing, and deployment phases of a project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz3okp80mdoi7xli0v4mo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz3okp80mdoi7xli0v4mo.png" alt="Image description" width="765" height="154"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step-by-step guide to creating a Mermaid diagram&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install the Mermaid renderer.&lt;/li&gt;
&lt;li&gt;Create a new text file and save it with a &lt;code&gt;.mmd&lt;/code&gt; extension.&lt;/li&gt;
&lt;li&gt;Write the Mermaid code in the text file.&lt;/li&gt;
&lt;li&gt;Open the file in the Mermaid renderer to view the diagram.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Tips for creating Mermaid diagrams&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use meaningful names for your nodes and connectors.&lt;/li&gt;
&lt;li&gt;Use clear and concise labels for your arrows.&lt;/li&gt;
&lt;li&gt;Use consistent formatting throughout your diagram.&lt;/li&gt;
&lt;li&gt;Use subgraphs to organize your diagram and make it easier to read.&lt;/li&gt;
&lt;li&gt;Use loops and conditional statements to create complex diagrams.&lt;/li&gt;
&lt;li&gt;Test your Mermaid code thoroughly before using it in production.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Mermaid is a powerful and flexible tool for creating diagrams of all kinds. It is easy to learn and use, and it has a large and active community of users. If you need to create diagrams, I encourage you to try Mermaid.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
