<?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>Forem: David Cao</title>
    <description>The latest articles on Forem by David Cao (@caodawei3).</description>
    <link>https://forem.com/caodawei3</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%2F974956%2Feee9a0ce-bc51-433e-9fe4-5830963e456d.png</url>
      <title>Forem: David Cao</title>
      <link>https://forem.com/caodawei3</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/caodawei3"/>
    <language>en</language>
    <item>
      <title>No More Slowdowns! Learn How Many Cores Your Linux system Has &amp; Make it Fly</title>
      <dc:creator>David Cao</dc:creator>
      <pubDate>Sun, 07 Jan 2024 08:50:46 +0000</pubDate>
      <link>https://forem.com/caodawei3/no-more-slowdowns-learn-how-many-cores-your-linux-system-has-make-it-fly-jha</link>
      <guid>https://forem.com/caodawei3/no-more-slowdowns-learn-how-many-cores-your-linux-system-has-make-it-fly-jha</guid>
      <description>&lt;p&gt;Ever opened your favorite game or program and stared in frustration as it took ages to load? Does switching between apps feel like navigating through molasses? Don't despair. The culprit might not be your CPU cores.&lt;/p&gt;

&lt;p&gt;Think of your CPU as a team of construction workers. The more workers you have, the faster things get done, right? Well, that's exactly what CPU cores are – they're like tiny teams inside your computer, working together to handle all your tasks. And guess what? Knowing how many cores you have is the key to unlocking your PC's hidden potential!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.howtouselinux.com/post/linux-command-check-cpu-cores"&gt;Grab your keyboard, open this article, and unlock the secrets of your Linux's true power!&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>how to make Linux user password never expire</title>
      <dc:creator>David Cao</dc:creator>
      <pubDate>Sun, 07 Jan 2024 08:09:12 +0000</pubDate>
      <link>https://forem.com/caodawei3/how-to-make-linux-user-password-never-expire-20ei</link>
      <guid>https://forem.com/caodawei3/how-to-make-linux-user-password-never-expire-20ei</guid>
      <description>&lt;p&gt;In Linux land, passwords have an expiration date, just like your carton of oat milk. Every few months, that annoying chime reminds you: "Change your password"&lt;/p&gt;

&lt;p&gt;But why? It's a security dance. We make passwords expire to lock out intruders who might snag your old password and waltz into your system. New locks, new tunes, keep those bad guys out.&lt;/p&gt;

&lt;p&gt;However, sometimes this password tango can get tiresome. What if you're a super-secure admin account? Do they really need to change their passwords?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.howtouselinux.com/post/how-to-make-linux-user-password-never-expire"&gt;This article is your guide to breaking free from the password-pocalypse&lt;/a&gt;. It shows you how to make those passwords last forever, like that mythical fountain of youth. But remember, with great power comes great responsibility. Security is still paramount, so choose your moves wisely!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>image width for google discover</title>
      <dc:creator>David Cao</dc:creator>
      <pubDate>Fri, 13 Oct 2023 14:21:20 +0000</pubDate>
      <link>https://forem.com/caodawei3/post-image-for-google-discover-1600</link>
      <guid>https://forem.com/caodawei3/post-image-for-google-discover-1600</guid>
      <description>&lt;p&gt;Dear all,&lt;/p&gt;

&lt;p&gt;I got one question about the image size on my website. In order to get the post featured on Google discover, we have to put the image size 1200px.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Include compelling, high-quality images in your content, especially large images that are more likely to generate visits from Discover. Large images need to be at least 1200 px wide and enabled by the max-image-preview:large setting, or by using AMP. Avoid using a site logo as your image.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here is the html code for my website. The image width is 1024. But because of the layout of my website, The width has to meet this rule sizes="(max-width: 760px) calc(100vw - 40px), 720px"&lt;/p&gt;

&lt;p&gt;so my question is that from Google discover perspective, is the image width 1024 or 760px?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;img decoding="async" fetchpriority="high" class="aligncenter wp-image-12324 size-full lazyload" src="https://www.howtouselinux.com/wp-content/uploads/2023/10/A-Guide-to-Package-Managers-in-Linux.webp" alt="Understanding Package Management: A Guide to Package Managers in Linux" width="1024" height="640" srcset="https://www.howtouselinux.com/wp-content/uploads/2023/10/A-Guide-to-Package-Managers-in-Linux.webp 1024w, https://www.howtouselinux.com/wp-content/uploads/2023/10/A-Guide-to-Package-Managers-in-Linux-300x188.webp 300w, https://www.howtouselinux.com/wp-content/uploads/2023/10/A-Guide-to-Package-Managers-in-Linux-768x480.webp 768w, https://www.howtouselinux.com/wp-content/uploads/2023/10/A-Guide-to-Package-Managers-in-Linux-960x600.webp 960w, https://www.howtouselinux.com/wp-content/uploads/2023/10/A-Guide-to-Package-Managers-in-Linux-150x94.webp 150w" sizes="(max-width: 760px) calc(100vw - 40px), 720px" data-pin-media="https://www.howtouselinux.com/wp-content/uploads/2023/10/A-Guide-to-Package-Managers-in-Linux.webp" id="mv-trellis-img-3" loading="lazy" data-trellis-processed="1"&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Her is the link for above code   &lt;a href="https://www.howtouselinux.com/post/understanding-package-management-a-guide-to-package-managers-in-linux"&gt;https://www.howtouselinux.com/post/understanding-package-management-a-guide-to-package-managers-in-linux&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks a lot.&lt;/p&gt;

</description>
      <category>help</category>
    </item>
    <item>
      <title>Conquered a Major Challenge: A Case Study in Troubleshooting</title>
      <dc:creator>David Cao</dc:creator>
      <pubDate>Sat, 15 Jul 2023 03:59:59 +0000</pubDate>
      <link>https://forem.com/caodawei3/conquered-a-major-challenge-a-case-study-in-troubleshooting-5alo</link>
      <guid>https://forem.com/caodawei3/conquered-a-major-challenge-a-case-study-in-troubleshooting-5alo</guid>
      <description>&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As a software engineer for a large e-commerce company, I was faced with a challenging issue today. The newly launched order management system of the company was not functioning properly. When users attempted to create or view orders, they received an error message indicating that they did not have sufficient permissions to perform this operation. At the same time, our internal team discovered that the server was unable to connect to the internet properly, which was affecting the normal operation of other systems and services.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Problem Analysis Steps&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Confirm if the server process is running&lt;/strong&gt;: My first step was to use the &lt;code&gt;ps&lt;/code&gt; command and &lt;code&gt;systemctl status&lt;/code&gt; command to check if the order system service was running, and the results showed that everything was normal.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Check Network Connection&lt;/strong&gt;: Then, I used the &lt;code&gt;ping 8.8.8.8&lt;/code&gt; command to &lt;a href="https://www.howtouselinux.com/post/linux-command-check-network-status-on-linux"&gt;test the network connection&lt;/a&gt; and found that our server could not access the internet properly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Check Server IP Address&lt;/strong&gt;: I &lt;a href="https://www.howtouselinux.com/post/check-ip-address-in-linux"&gt;found the IP address of the server after using the &lt;code&gt;ip addr&lt;/code&gt; command&lt;/a&gt; and confirmed that it was not being used by another device and could be accessed by other devices on the network.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Check File Permissions and Ownership&lt;/strong&gt;: Next, I used the &lt;code&gt;ls -l&lt;/code&gt; command to &lt;a href="https://www.howtouselinux.com/post/check-file-permissions-in-linux"&gt;check the permissions and ownership&lt;/a&gt; of the files that the order system was trying to access. I noticed that some critical files were owned by a user that was unrelated to the order system, meaning that the order system could not access these files.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Check Server Firewall and SELinux settings&lt;/strong&gt;: Lastly, I &lt;a href="https://www.howtouselinux.com/post/check-selinux-status-in-linux"&gt;checked the SELinux settings&lt;/a&gt; and did not find any rules that could potentially block our system from accessing the network.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Problem Solution&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Change File Ownership&lt;/strong&gt;: My first step was to use the &lt;code&gt;chown&lt;/code&gt; command to &lt;a href="https://www.howtouselinux.com/post/linux-command-change-file-permissions-in-linux"&gt;change the ownership of the files&lt;/a&gt; to the order system's running user, for example, &lt;code&gt;sudo chown order_system:order_system /path/to/the/problematic/file&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Restart Network Service&lt;/strong&gt;: I suspected that the network issue might be due to a faulty configuration or failure of the network service, so I attempted to restart the network service using &lt;code&gt;systemctl restart networking&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Verify if the issue was resolved&lt;/strong&gt;: After making the changes, I restarted the order system and had the internal team and some selected users test it. Fortunately, they were able to create and view orders normally, and our server could also access the internet properly.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Solving this problem required step-by-step troubleshooting, but in the end, we were successful in resolving the issue and got the company's order management system back up and running. This experience emphasized the importance of detailed problem analysis and step-by-step troubleshooting strategy as an engineer.&lt;/p&gt;

</description>
      <category>linux</category>
    </item>
    <item>
      <title>check size of directory in Linux</title>
      <dc:creator>David Cao</dc:creator>
      <pubDate>Mon, 12 Jun 2023 13:48:20 +0000</pubDate>
      <link>https://forem.com/caodawei3/check-size-of-directory-in-linux-25ga</link>
      <guid>https://forem.com/caodawei3/check-size-of-directory-in-linux-25ga</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Linux is one of the most popular operating systems in the world. It is Unix-like, and it is also open-source. Quite a big percentage of developers use Linux because it can be customized in so many ways.&lt;/p&gt;

&lt;p&gt;What's cool about Linux is its command line. Every 'hackers' paradise. There are a ton of commands. If you aren't familiar with any Linux commands, be sure to check out this post on the &lt;a href="https://www.howtouselinux.com/post/linux-commands-for-linux-beginners-cheat-sheet"&gt;Linux Commands Everyone Should Know&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;There is probably a command for almost anything that you want to do. For example what if you wanted to get the size of a directory? Well luckily for you there is a command for that. In this post, we are going to talk about that command and see what it can offer.&lt;/p&gt;

&lt;h2&gt;
  
  
  The du command
&lt;/h2&gt;

&lt;p&gt;This command lets the user get a quick view of the disk usage. The best way to use it is by giving it the directory you want to see the size of. It should look a little something like this:&lt;br&gt;
du directory_name&lt;/p&gt;

&lt;p&gt;// output&lt;br&gt;
2314    directory_name&lt;/p&gt;

&lt;p&gt;This will give you the size of all the files and at the very end, it will &lt;a href="https://www.howtouselinux.com/post/check-directory-size-in-linux"&gt;give you the size of the directory&lt;/a&gt; itself. You could point out the full path, or you could just give the name of the directory you want to see if you are already on the same path.&lt;/p&gt;

&lt;p&gt;But we could make this even easier just b adding 2 flags. Flags help the command change its behavior. For the du command we could add the flags -s and -h.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;-s stands for summarize and it will show you only the total size of the directory, without all those files popping up on your screen.&lt;/li&gt;
&lt;li&gt;-h stands for human-readable and it will convert the size so that you can read it easier. Just by running the command without the -h flag doesn't specify you a unit of measurement.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So now to get the best of this command, you should run it like this with the -s and -h flags:&lt;br&gt;
du -sh directory_name&lt;/p&gt;

&lt;p&gt;// output&lt;br&gt;
44.5M   directory_name&lt;br&gt;
And if you wanted to see all of the directories sizes, you could just run this:&lt;br&gt;
du -sh ./*&lt;/p&gt;

&lt;p&gt;// output&lt;br&gt;
12.2M   dir1&lt;br&gt;
 2.5M   dir2&lt;br&gt;
  55M   dir3&lt;/p&gt;

&lt;p&gt;Another thing you can do is use pipe(|) and sort them by size, which will make it even easier for you to see their sizes. What | does is get the output from the command behind it and add it into the input of the command after it. So to sort the directories by size just run the following command:&lt;br&gt;
du -sh ./* | sort -h&lt;/p&gt;

&lt;p&gt;// output&lt;br&gt;
  55M   dir3&lt;br&gt;
12.2M   dir1&lt;br&gt;
 2.5M   dir2&lt;/p&gt;

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

&lt;p&gt;This is a pretty useful command that I think everybody should know, just because of how short and easy it is. I hope that this post has helped you and I wish you happy coding.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Never get ip address in Linux with this command</title>
      <dc:creator>David Cao</dc:creator>
      <pubDate>Wed, 08 Feb 2023 04:11:51 +0000</pubDate>
      <link>https://forem.com/caodawei3/never-to-get-ip-address-in-this-way-here-is-why-2gi6</link>
      <guid>https://forem.com/caodawei3/never-to-get-ip-address-in-this-way-here-is-why-2gi6</guid>
      <description>&lt;p&gt;Many websites recommend using the hostname command to obtain the IP address. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In this post, I will explain why you should not use this command.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The hostname command in Linux is used to display or set the hostname of a computer.&lt;/p&gt;

&lt;p&gt;When used without any arguments, the hostname command will display the current hostname of the system:&lt;/p&gt;

&lt;p&gt;hostname&lt;/p&gt;

&lt;p&gt;This is safe.&lt;/p&gt;

&lt;p&gt;When used with an argument, the hostname command can be used to set the hostname of the system:&lt;/p&gt;

&lt;p&gt;sudo hostname new_hostname&lt;/p&gt;

&lt;p&gt;hostname command also has the -I or --ip-address option to display the IP address of the system:&lt;/p&gt;

&lt;p&gt;sudo hostname -I&lt;/p&gt;

&lt;p&gt;This will display the IP addresses assigned to the system's network interfaces. &lt;/p&gt;

&lt;p&gt;so here is the problem.&lt;/p&gt;

&lt;p&gt;If you forgot to type the -, your hostname will be changed to I.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What will happen when the hostname is changed?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In our env, we have many oracle rac clusters.&lt;/p&gt;

&lt;p&gt;In the Oracle RAC cluster, the hostname is used to identify the node and communicate with other nodes in the cluster. &lt;/p&gt;

&lt;p&gt;When the hostname is changed, other nodes are not be able to communicate with the node and the node becomes inaccessible to the rest of the cluster.&lt;/p&gt;

&lt;p&gt;we got two incidents that were related to this in the past year.&lt;/p&gt;

&lt;p&gt;So we should always choose the safe command in our daily operation tasks as it can help minimize potential risks.&lt;/p&gt;

&lt;p&gt;Check this post to know &lt;a href="https://www.howtouselinux.com/post/check-ip-address-in-linux"&gt;how to safely check ip address in Linux&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>beginners</category>
      <category>cloud</category>
      <category>programming</category>
    </item>
    <item>
      <title>how /etc/hosts file works</title>
      <dc:creator>David Cao</dc:creator>
      <pubDate>Mon, 19 Dec 2022 14:05:45 +0000</pubDate>
      <link>https://forem.com/caodawei3/how-etchosts-file-works-5g61</link>
      <guid>https://forem.com/caodawei3/how-etchosts-file-works-5g61</guid>
      <description>&lt;p&gt;In the Linux operating system, the &lt;code&gt;/etc/hosts&lt;/code&gt; file is a simple text file that maps hostnames to IP addresses. It is used to resolve hostnames to IP addresses without the need for a DNS (Domain Name System) server.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;/etc/hosts&lt;/code&gt; file has the following format:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;IP_address hostname aliases&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;127.0.0.1 localhost
192.168.0.100 server1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the &lt;code&gt;/etc/hosts&lt;/code&gt; file maps the hostname &lt;code&gt;localhost&lt;/code&gt; to the IP address &lt;code&gt;127.0.0.1&lt;/code&gt;, and the hostname &lt;code&gt;server1&lt;/code&gt; to the IP address &lt;code&gt;192.168.0.100&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You can also specify multiple aliases for a hostname by separating them with spaces. For example:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;192.168.0.100 server1 server1.example.com&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;In this case, both &lt;code&gt;server1&lt;/code&gt; and &lt;code&gt;server1.example.com&lt;/code&gt; will be resolved to the IP address &lt;code&gt;192.168.0.100&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Note: In some cases, one server can have multiple IP addresses. Be sure to &lt;a href="https://www.howtouselinux.com/post/check-ip-address-in-linux" rel="noopener noreferrer"&gt;get the correct IP address&lt;/a&gt; and add it to the file.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;/etc/hosts&lt;/code&gt; file is usually the first place the operating system looks for hostname-to-IP address mappings. If the hostname is not found in the &lt;code&gt;/etc/hosts&lt;/code&gt; file, the operating system will consult a DNS server to resolve the hostname to an IP address.&lt;/p&gt;

&lt;p&gt;You can edit the &lt;code&gt;/etc/hosts&lt;/code&gt; file to add your own hostname-to-IP address mappings. This can be useful for testing purposes, or for setting up a small network without the need for a DNS server.&lt;/p&gt;

&lt;p&gt;It is important to note that the &lt;code&gt;/etc/hosts&lt;/code&gt; file does not support wildcards or regular expressions, and each entry must be specified individually.&lt;/p&gt;

&lt;p&gt;reference: &lt;a href="https://manpages.ubuntu.com/manpages/xenial/man5/hosts.5.html" rel="noopener noreferrer"&gt;https://manpages.ubuntu.com/manpages/xenial/man5/hosts.5.html&lt;/a&gt;&lt;/p&gt;

</description>
      <category>emptystring</category>
    </item>
    <item>
      <title>4 ways to troubleshooting Linux server reboot issue</title>
      <dc:creator>David Cao</dc:creator>
      <pubDate>Sun, 18 Dec 2022 12:30:20 +0000</pubDate>
      <link>https://forem.com/caodawei3/4-ways-to-troubleshooting-linux-server-reboot-issue-49d5</link>
      <guid>https://forem.com/caodawei3/4-ways-to-troubleshooting-linux-server-reboot-issue-49d5</guid>
      <description>&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
      &lt;div class="c-embed__cover"&gt;
        &lt;a href="https://www.howtouselinux.com/post/check-last-reboot-time-in-linux" class="c-link s:max-w-50 align-middle" rel="noopener noreferrer"&gt;
          &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.howtouselinux.com%2Fwp-content%2Fuploads%2F2024%2F01%2Fhowtouselinux-logo.png" height="500" class="m-0" width="500"&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;div class="c-embed__body"&gt;
      &lt;h2 class="fs-xl lh-tight"&gt;
        &lt;a href="https://www.howtouselinux.com/post/check-last-reboot-time-in-linux" rel="noopener noreferrer" class="c-link"&gt;
          4 Ways to check last reboot time in Linux - howtouselinux
        &lt;/a&gt;
      &lt;/h2&gt;
      &lt;div class="color-secondary fs-s flex items-center"&gt;
          &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.howtouselinux.com%2Fwp-content%2Fuploads%2F2023%2F09%2Fcropped-howtouselinux-logo-32x32.jpeg" width="32" height="32"&gt;
        howtouselinux.com
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
Last week, I received a report that one server had unexpectedly rebooted. This is a serious issue, as the server needs to be up and running at all times to support the business.

&lt;p&gt;Upon investigation, I found that the server rebooted at around 9:10 AM, which was our business time.  This means that the server was pretty busy at that time. But there were no error messages displayed before or after the reboot. I checked the system logs and find no indication of problems or issues that may have caused the reboot. I also checked the hardware and found no signs of failure or damage.&lt;/p&gt;

&lt;p&gt;At this point, I was unsure of the cause of the reboot. I considered the possibility that it may have been caused by a software issue, such as a bug or an update that caused problems because we just released a new version of our app recently.&lt;/p&gt;

&lt;p&gt;I decided to run a diagnostic tool to check for any software issues and also consider seeking help from our engineering team.&lt;/p&gt;

&lt;p&gt;In the end, it turns out that the reboot was caused by a software issue, specifically a bug in the new release. we are able to apply a patch to fix the bug and prevent future reboots. &lt;/p&gt;

&lt;p&gt;The server is now running smoothly and the business is able to continue operations without interruption.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;First, gather as much information as possible about the unexpected reboot. This may include &lt;a href="https://www.howtouselinux.com/post/check-last-reboot-time-in-linux" rel="noopener noreferrer"&gt;the time when the server reboot&lt;/a&gt;, any error messages that were displayed before or after the reboot, and any other relevant details.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Check the system logs for clues about the cause of the reboot. The kernel logs, system logs, and application logs may all contain useful information. Look for error messages or other indications of problems that may have led to the reboot.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Check the hardware for any signs of failure. This may include checking the system's temperature, examining the system's power supply, and looking for any loose or damaged components.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Check for any software issues that may have caused the reboot. This may include checking for updates or patches that may have been installed around the time of the reboot, or looking for any known bugs that may have caused the problem.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://www.howtouselinux.com/subscribe" rel="noopener noreferrer"&gt;Follow us on howtouselinux to get the latest Linux skills.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's important to approach troubleshooting in a systematic way and to gather as much information as possible before attempting to fix the problem. This will help ensure that the root cause of the problem is identified and properly addressed.&lt;/p&gt;

</description>
      <category>emptystring</category>
    </item>
    <item>
      <title>5 commands you need know about Linux networking</title>
      <dc:creator>David Cao</dc:creator>
      <pubDate>Sat, 17 Dec 2022 08:37:47 +0000</pubDate>
      <link>https://forem.com/caodawei3/5-commands-you-need-know-about-linux-networking-n3o</link>
      <guid>https://forem.com/caodawei3/5-commands-you-need-know-about-linux-networking-n3o</guid>
      <description>&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
      &lt;div class="c-embed__cover"&gt;
        &lt;a href="https://www.howtouselinux.com/post/useful-linux-network-troubleshooting-commands" class="c-link s:max-w-50 align-middle" rel="noopener noreferrer"&gt;
          &lt;img alt="" src="https://res.cloudinary.com/practicaldev/image/fetch/s--KvrMK4uH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://secure.gravatar.com/avatar/40b2a66f7499d77c683c8b1fab652f3c%3Fs%3D300%26r%3Dg" height="300" class="m-0" width="300"&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;div class="c-embed__body"&gt;
      &lt;h2 class="fs-xl lh-tight"&gt;
        &lt;a href="https://www.howtouselinux.com/post/useful-linux-network-troubleshooting-commands" rel="noopener noreferrer" class="c-link"&gt;
          5 useful Linux network troubleshooting commands - howtouselinux
        &lt;/a&gt;
      &lt;/h2&gt;
      &lt;div class="color-secondary fs-s flex items-center"&gt;
          &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://res.cloudinary.com/practicaldev/image/fetch/s--mKR_t9kC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.howtouselinux.com/wp-content/uploads/2022/04/howtouseinux-logo-150x136.png" width="150" height="136"&gt;
        howtouselinux.com
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Here are five commands that you can use to check the network status in Linux:&lt;/p&gt;

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

&lt;p&gt;ifconfig: This command displays information about the network interfaces on your system, including their IP addresses, netmasks, and network statistics.&lt;/p&gt;

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

&lt;p&gt;netstat: This command displays a variety of network-related information in Linux, including active network connections, routing tables, and network statistics.&lt;/p&gt;

&lt;p&gt;If you are having trouble connecting to a network resource, such as a web server, you can use netstat to see if there are any active connections to that server. To do this, you can use the -a flag to display all active connections, and the -n flag to display the connections using numerical addresses rather than hostnames. For example:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ netstat -an | grep &amp;lt;server_ip_address&amp;gt;&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
This will display any active connections to the server, along with their status and protocol. If there are no active connections, or if the connections are in a state such as TIME_WAIT or CLOSED, it could indicate a problem with the connection.&lt;/p&gt;

&lt;p&gt;This article explains more about &lt;a href="https://www.howtouselinux.com/post/linux-command-check-network-status-on-linux"&gt;how to check network status in Linux&lt;/a&gt;.&lt;/p&gt;

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

&lt;p&gt;traceroute: This command displays the route that packets take to reach a specified network host. It can be useful for troubleshooting network connectivity issues.&lt;/p&gt;

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

&lt;p&gt;ping: This command sends a small packet of data to a specified network host and measures the time it takes for the host to send a reply. You can use this command to determine whether the host is reachable and to measure the round-trip time for packets sent to that host.&lt;/p&gt;

&lt;p&gt;If you are having trouble accessing a network resource, such as a web server or a file share, you can use ping to test the connectivity between your system and the host.&lt;/p&gt;

&lt;p&gt;To do this, you can use the ping command followed by the IP address or hostname of the target host. For example:&lt;/p&gt;

&lt;p&gt;Copy code&lt;br&gt;
$ ping &lt;br&gt;
This will send a series of ICMP echo request packets to the target host and display the results, including the round-trip time for each packet and the percentage of packets that were received.&lt;/p&gt;

&lt;p&gt;If the host is reachable, you should see a series of replies from the host indicating that the packets were received. If the host is not reachable, you will see a series of request timeouts indicating that the packets were not received.&lt;/p&gt;

&lt;p&gt;If the host is not reachable, there could be a problem with the network connectivity between your system and the host. You can use the traceroute command to see the route that packets are taking between your system and the host, which can help you identify the source of the connectivity issue.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.redhat.com/sysadmin/ping-usage-basics"&gt;This article&lt;/a&gt; explains more about how to use ping command to troubleshooting network issues.&lt;/p&gt;

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

&lt;p&gt;nslookup: This command allows you to query Domain Name System (DNS) servers to resolve domain names to IP addresses and vice versa. You can use it to troubleshoot DNS-related issues or to find the IP address associated with a specific domain name.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>beginners</category>
      <category>programming</category>
      <category>cloud</category>
    </item>
    <item>
      <title>4 ways to check file size in Linux</title>
      <dc:creator>David Cao</dc:creator>
      <pubDate>Fri, 16 Dec 2022 08:22:35 +0000</pubDate>
      <link>https://forem.com/caodawei3/how-to-check-file-size-in-linux-2in1</link>
      <guid>https://forem.com/caodawei3/how-to-check-file-size-in-linux-2in1</guid>
      <description>&lt;p&gt;The file size is an important factor for many reasons. Whether you are trying to save space on your hard drive or just need to know the size of a file, it's helpful to know how to get this information in Linux. &lt;br&gt;
In this blog post, we will discuss four different ways to get file size in Linux. We will also provide tips on how to use each method. Let's get started!&lt;/p&gt;

&lt;p&gt;If you want to know the details about each command, you can check the following link.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.howtouselinux.com/post/check-file-size-in-linux"&gt;4 ways to check file size in Linux&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Checking File Size with the “du” Command: The du command is a very useful tool for getting file size in Linux. To check file size, type "du -sh filename" and hit enter. &lt;br&gt;
This will display the size of the file, as well as any subdirectories within it. You can also use the du command to check directory size. To do this, type “du -sh directoryname” and hit enter. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Checking File Size with the “ls” Command: The ls command is another way to get file size in Linux. To check file size, simply type "ls -l filename" and hit enter. &lt;br&gt;
This command will display the size of the file in a format that is easier to read. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Checking File Size with the “stat” Command: The stat command is another way to get file size in Linux. To check file size, type "stat filename" and hit enter. This will display detailed information about the file, including its size. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Checking File Size with the “find” Command: The find command is an advanced way of getting file size in Linux.&lt;br&gt;
To check file size, type "find filename -size n" and hit enter. This will display all files in the directory that are exactly n bytes in size. &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Subscribe to HowToUseLinux!&lt;/p&gt;

&lt;p&gt;Unlock the power of Linux with a click! Stay ahead of the curve with the latest trends, tools, and tricks in the Linux world. &lt;a href="https://www.howtouselinux.com/subscribe"&gt;Subscribe now and transform your Linux journey! &lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We are also looking for writers.&lt;/p&gt;

&lt;p&gt;These are just a few methods of getting file size in Linux. With these tips, you can easily get the information you need to manage your files and directories on Linux systems. Do you have any tips for getting file size in Linux? Let us know in the comments section below! Thanks for reading. &lt;/p&gt;

</description>
      <category>linux</category>
      <category>beginners</category>
      <category>cloud</category>
      <category>webdev</category>
    </item>
    <item>
      <title>An easy way to check directory size in Linux</title>
      <dc:creator>David Cao</dc:creator>
      <pubDate>Sun, 11 Dec 2022 11:50:39 +0000</pubDate>
      <link>https://forem.com/caodawei3/an-easy-way-to-check-directory-size-in-linux-2j66</link>
      <guid>https://forem.com/caodawei3/an-easy-way-to-check-directory-size-in-linux-2j66</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Linux is one of the most popular operating systems in the world. It is Unix-like, and it is also open-source. Quite a big percentage of developers use Linux because it can be customized in so many ways.&lt;/p&gt;

&lt;p&gt;What's cool about Linux is its command line. Every 'hackers' paradise. There are a ton of commands. &lt;/p&gt;

&lt;p&gt;There is probably a command for almost anything that you want to do. For example what if you wanted to get the size of a directory? Well luckily for you there is a command for that. In this post, we are going to talk about that command and see what it can offer.&lt;/p&gt;

&lt;p&gt;Reference:  &lt;a href="https://www.howtouselinux.com/post/check-directory-size-in-linux" rel="noopener noreferrer"&gt;4 ways to get the size of a directory in Linux&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  The  &lt;code&gt;du&lt;/code&gt;  command
&lt;/h1&gt;

&lt;p&gt;This command lets the user get a quick view of the  &lt;strong&gt;disk usage&lt;/strong&gt;. The best way to use it is by giving it the directory you want to see the size of. It should look a little something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;du directory_name  

// output  
2314    directory_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will give you the size of all the files and at the very end, it will give you the size of the directory itself. You could point out the full path, or you could just give the name of the directory you want to see if you are already on the same path.&lt;/p&gt;

&lt;p&gt;But we could make this even easier just b adding 2  &lt;strong&gt;flags&lt;/strong&gt;. Flags help the command change its behavior. For the  &lt;code&gt;du&lt;/code&gt;  command we could add the flags  &lt;code&gt;-s&lt;/code&gt;  and  &lt;code&gt;-h&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-s&lt;/code&gt;  stands for  &lt;strong&gt;summarize&lt;/strong&gt;  and it will show you only the total  size of the directory, without all those files popping up on your screen.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-h&lt;/code&gt;  stands for  &lt;strong&gt;human-readable&lt;/strong&gt;  and it will convert the size so that you can read it easier. Just by running the command without the  &lt;code&gt;-h&lt;/code&gt;  flag doesn't specify you a unit of measurement.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So now to get the best of this command, you should run it like this with the  &lt;code&gt;-s&lt;/code&gt;  and  &lt;code&gt;-h&lt;/code&gt;  flags:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;du -sh directory_name  

// output  
44.5M   directory_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And if you wanted to see all of the directories sizes, you could just run this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;du -sh ./*  

// output  
12.2M   dir1  
 2.5M   dir2  
  55M   dir3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Another thing you can do is use pipe(&lt;code&gt;|&lt;/code&gt;) and sort them by size, which will make it even easier for you to see their sizes. What  &lt;code&gt;|&lt;/code&gt;  does is get the output from the command behind it and add it into the input of the command after it. So to sort the directories by size just run 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;du -sh ./* | sort -h  

// output 
  55M   dir3  
12.2M   dir1  
 2.5M   dir2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;This is a pretty useful command that I think everybody should know, just because of how short and easy it is. I hope that this post has helped you and I wish you happy coding.&lt;/p&gt;

&lt;p&gt;If you aren't familiar with any Linux commands, be sure to check out this post on the  &lt;a href="https://access.redhat.com/rhel-cheatsheets" rel="noopener noreferrer"&gt;Linux command cheat sheet&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Linux Directory Structure</title>
      <dc:creator>David Cao</dc:creator>
      <pubDate>Mon, 05 Dec 2022 09:36:18 +0000</pubDate>
      <link>https://forem.com/caodawei3/linux-directory-structure-17i2</link>
      <guid>https://forem.com/caodawei3/linux-directory-structure-17i2</guid>
      <description>&lt;p&gt;Linux File System is organized in directories, each directory serves a purpose, here you can find a short but precise description for the most usefull directories:&lt;/p&gt;

&lt;p&gt;Check this post to &lt;a href="https://www.howtouselinux.com/post/linux-command-get-file-path" rel="noopener noreferrer"&gt;get the path where you are located in Linux&lt;/a&gt;.&lt;/p&gt;

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

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
  &lt;tr&gt;
    &lt;th&gt;/&lt;/th&gt;
    &lt;th&gt;The root directory, all directories start from this directory.&lt;/th&gt;
  &lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
  &lt;tr&gt;
    &lt;td&gt;/bin&lt;/td&gt;
    &lt;td&gt;Has programs essential for the system.&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;/boot&lt;/td&gt;
    &lt;td&gt;Has the Linux kernel, files needed for the boot sequence and boot configuration files.&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;/dev&lt;/td&gt;
    &lt;td&gt;Everything in Linux is a file, a device recognized by the system is represented by a file.&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;/etc&lt;/td&gt;
    &lt;td&gt;Has system wide configuration files, some of the most important are: crontab: scheduled tasks&lt;br&gt; fstab: mount points&lt;br&gt;* passwd: users&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;/home&lt;/td&gt;
    &lt;td&gt;Has directories for each user, a good practice is to keep this directory on a seperate partition.&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;/lib&lt;/td&gt;
    &lt;td&gt;Shared libraries for the programs.&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;/lost+found&lt;/td&gt;
    &lt;td&gt;It keeps filesystem recovered files, normally is empty.&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;/media&lt;/td&gt;
    &lt;td&gt;Mount points for removable media like usb.&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;/mnt&lt;/td&gt;
    &lt;td&gt;For things you mount manually or with fstab.&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;/opt&lt;/td&gt;
    &lt;td&gt;Usually is used to install optionall software.&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;/proc&lt;/td&gt;
    &lt;td&gt;Its a virtual file system which keeps files for running processes.&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;/root&lt;/td&gt;
    &lt;td&gt;The home directory for the root user.&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;/sbin&lt;/td&gt;
    &lt;td&gt;Programs that used from the root user.&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;/tmp&lt;/td&gt;
    &lt;td&gt;Used to keep temporary files used by the processes, its emptied after a reboot.&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;/usr&lt;/td&gt;
    &lt;td&gt;Contains programs/files used by regular users.&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;/usr/bin&lt;/td&gt;
    &lt;td&gt;Contains programs installed by the Linux installer.&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;/usr/lib&lt;/td&gt;
    &lt;td&gt;Shared libraries for programs in /usr/bin.&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;/usr/local&lt;/td&gt;
    &lt;td&gt;Programs that are not installed by the Linux installer, but are used for system wide usage.&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;/usr/sbin&lt;/td&gt;
    &lt;td&gt;Programs executed with sudo or root user, usually system administration things.&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;/usr/share&lt;/td&gt;
    &lt;td&gt;Files shared by programs in /usr/bin.&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;/usr/share/doc&lt;/td&gt;
    &lt;td&gt;Documentation files of programs in /usr/bin.&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;/var&lt;/td&gt;
    &lt;td&gt;Holds files that usually changes over time, like databases files.&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;/var/log&lt;/td&gt;
    &lt;td&gt;Logs of various programs.&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

</description>
      <category>watercooler</category>
    </item>
  </channel>
</rss>
