<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>DevMemo – linux</title><link>https://devmemo.gitlab.io/categories/linux/</link><description>Recent content in linux on DevMemo</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Sat, 26 Aug 2023 21:16:11 +0000</lastBuildDate><atom:link href="https://devmemo.gitlab.io/categories/linux/index.xml" rel="self" type="application/rss+xml"/><item><title>Blog: How To Debug Emacs Cpp Indentation</title><link>https://devmemo.gitlab.io/blog/how_to_debug_emacs_cpp_indentation/</link><pubDate>Sat, 26 Aug 2023 21:16:11 +0000</pubDate><guid>https://devmemo.gitlab.io/blog/how_to_debug_emacs_cpp_indentation/</guid><description>
&lt;h2 id="do-syntactic-analysis">Do Syntactic Analysis&lt;/h2>
&lt;p>Do &lt;code>c-show-syntactic-information&lt;/code> or &lt;code>C-c C-s&lt;/code> to get an syntactic analysis first, you should get something like this&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-text" data-lang="text">&lt;span style="display:flex;">&lt;span>Syntactic analysis: ((statement-block-intro 930))
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>At the same time, emacs will also highlight the anchor point.&lt;/p>
&lt;h2 id="set-c-set-offset">Set &lt;code>c-set-offset&lt;/code>&lt;/h2>
&lt;p>Do the following to adjust the indentation.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-text" data-lang="text">&lt;span style="display:flex;">&lt;span>(defun c-indentation-hook ()
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (c-set-offset &amp;#39;statement-block-intro 2)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>(add-hook &amp;#39;c-mode-common-hook &amp;#39;c-indentation-hook)
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>You&amp;rsquo;ll need to reopen the file to allow the above change to take effect.&lt;/p></description></item><item><title>Blog: Automate Ubuntu Installation</title><link>https://devmemo.gitlab.io/blog/automate_ubuntu_installation/</link><pubDate>Wed, 01 Feb 2023 16:22:53 -0800</pubDate><guid>https://devmemo.gitlab.io/blog/automate_ubuntu_installation/</guid><description>
&lt;p>As a software engineer, I frequently needed to create new Linux VMs for testing and other purposes. The traditional way of installing Linux on a VM is very inefficient, which consumes a lot of my time. Automating the process is very appealing to me.&lt;/p>
&lt;p>In this post, I&amp;rsquo;m going to give you step-by-step instructions of how to do that.&lt;/p>
&lt;h2 id="build-ubuntu-auto-install-iso-image">Build Ubuntu Auto-Install Iso Image&lt;/h2>
&lt;h3 id="prerequisites">Prerequisites&lt;/h3>
&lt;p>To build an auto-install ubuntu image, we&amp;rsquo;ll need to install the following packages first&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>sudo apt update &lt;span style="color:#f92672">&amp;amp;&amp;amp;&lt;/span> sudo apt install p7zip wget xorriso whois
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="set-up-build-environment">Set Up Build Environment&lt;/h3>
&lt;p>Next, let&amp;rsquo;s download the latest ubuntu image from the official website. The version we are going to be using is &lt;a href="https://releases.ubuntu.com/22.04.1/ubuntu-22.04.1-live-server-amd64.iso">ubuntu 20.04&lt;/a>.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Go to your home directory.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>cd
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Create a directory for our image building process.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>mkdir ubuntu-auto-install-image-building
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>cd ubuntu-auto-install-image-building/
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Download the latest package.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>wget https://releases.ubuntu.com/22.04.1/ubuntu-22.04.1-live-server-amd64.iso
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Create a source directory.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>mkdir ubuntu-iso-sources
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Unpack the iso to the ubuntu-iso-sources dir.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>7z -y x ubuntu-22.04.1-live-server-amd64.iso -oubuntu-iso-sources
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Go into the source directory.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>cd ubuntu-iso-sources
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Move BOOT directory outside, since this is not needed in the final iso.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>mv &lt;span style="color:#ae81ff">\[&lt;/span>BOOT&lt;span style="color:#ae81ff">\]&lt;/span> ../BOOT
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="update-image-files">Update Image Files&lt;/h3>
&lt;p>After the source files are unpacked, let&amp;rsquo;s update some files.&lt;/p>
&lt;h4 id="create-an-grub-entry">Create An Grub Entry&lt;/h4>
&lt;p>The first file to update is the grub file, i.e., &lt;code>~/ubuntu-auto-install-image-building/ubuntu-iso-sources/boot/grub/grub.cfg&lt;/code>. We&amp;rsquo;ll need to do two things:&lt;/p>
&lt;ul>
&lt;li>Add an autoinstall entry.&lt;/li>
&lt;li>Make wait time shorter (this is optional).&lt;/li>
&lt;/ul>
&lt;p>The updated file looks like this. The highlighted lines are modified.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;display:grid;">&lt;code class="language-txt" data-lang="txt">&lt;span style="display:flex; background-color:#3c3d38">&lt;span>set timeout=5
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>loadfont unicode
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>set menu_color_normal=white/black
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>set menu_color_highlight=black/light-gray
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex; background-color:#3c3d38">&lt;span>menuentry &amp;#34;Autoinstall Ubuntu Server&amp;#34; {
&lt;/span>&lt;/span>&lt;span style="display:flex; background-color:#3c3d38">&lt;span> set gfxpayload=keep
&lt;/span>&lt;/span>&lt;span style="display:flex; background-color:#3c3d38">&lt;span> linux /casper/vmlinuz quiet autoinstall ds=nocloud\;s=/cdrom/server/ ---
&lt;/span>&lt;/span>&lt;span style="display:flex; background-color:#3c3d38">&lt;span> initrd /casper/initrd
&lt;/span>&lt;/span>&lt;span style="display:flex; background-color:#3c3d38">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>menuentry &amp;#34;Try or Install Ubuntu Server&amp;#34; {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> set gfxpayload=keep
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> linux /casper/vmlinuz ---
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> initrd /casper/initrd
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>grub_platform
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>if [ &amp;#34;$grub_platform&amp;#34; = &amp;#34;efi&amp;#34; ]; then
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>menuentry &amp;#39;Boot from next volume&amp;#39; {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> exit 1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>menuentry &amp;#39;UEFI Firmware Settings&amp;#39; {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> fwsetup
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>else
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>menuentry &amp;#39;Test memory&amp;#39; {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> linux16 /boot/memtest86+.bin
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>fi
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h4 id="create-file-user-data">Create File user-data&lt;/h4>
&lt;p>Next, we&amp;rsquo;ll need to create a user-data file, &lt;code>~/ubuntu-auto-install-image-building/ubuntu-iso-sources/server/user-data&lt;/code>, with the following content.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">#cloud-config&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">autoinstall&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">version&lt;/span>: &lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">keyboard&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">layout&lt;/span>: &lt;span style="color:#ae81ff">us&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">identity&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">hostname&lt;/span>: &lt;span style="color:#ae81ff">ubuntu-server&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">password&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;$y$j9T$qiKEYsg5oLCDV.XxExdEB/$41TEJJWV7he/aTyHQEDAWJyfKceDtCYVk.Agh9aAvk3&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">username&lt;/span>: &lt;span style="color:#ae81ff">swe&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">ssh&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">allow-pw&lt;/span>: &lt;span style="color:#66d9ef">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">install-server&lt;/span>: &lt;span style="color:#66d9ef">true&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>This is a minimum setup, which only creates a user with a password. The password is &lt;code>devmemo-passwd&lt;/code>. The password string above is generated using the following command&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>mkpasswd &lt;span style="color:#e6db74">&amp;#34;devmemo-passwd&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;blockquote>
&lt;p>Note that the above config is really a minimum one. Check out &lt;a href="https://ubuntu.com/server/docs/install/autoinstall-reference">this page&lt;/a> if you need more configurations.&lt;/p>
&lt;/blockquote>
&lt;h4 id="create-file-meta-data">Create File meta-data&lt;/h4>
&lt;p>For our use case, we don&amp;rsquo;t need any data in meta-data file. So we&amp;rsquo;ll just need to create an empty file.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>touch ~/ubuntu-auto-install-image-building/ubuntu-iso-sources/server/meta-data
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="create-an-auto-installation-iso-image">Create An Auto-Installation Iso Image&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Create the auto-installation iso image.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>xorriso -as mkisofs -r &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> -V &lt;span style="color:#e6db74">&amp;#39;Ubuntu 22.04 LTS (Auto Install)&amp;#39;&lt;/span> &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> -o ../ubuntu-22.04-autoinstall.iso &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> --grub2-mbr ../BOOT/1-Boot-NoEmul.img &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> -partition_offset &lt;span style="color:#ae81ff">16&lt;/span> &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> --mbr-force-bootable &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> -append_partition &lt;span style="color:#ae81ff">2&lt;/span> 28732ac11ff8d211ba4b00a0c93ec93b ../BOOT/2-Boot-NoEmul.img &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> -appended_part_as_gpt &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> -iso_mbr_part_type a2a0d0ebe5b9334487c068b6b72699c7 &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> -c &lt;span style="color:#e6db74">&amp;#39;/boot.catalog&amp;#39;&lt;/span> &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> -b &lt;span style="color:#e6db74">&amp;#39;/boot/grub/i386-pc/eltorito.img&amp;#39;&lt;/span> &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> -no-emul-boot -boot-load-size &lt;span style="color:#ae81ff">4&lt;/span> -boot-info-table --grub2-boot-info &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> -eltorito-alt-boot &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> -e &lt;span style="color:#e6db74">&amp;#39;--interval:appended_partition_2:::&amp;#39;&lt;/span> &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> -no-emul-boot .
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Check out the image.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>cd ..
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>ls -alh ubuntu-22.04-autoinstall.iso
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Now the ubuntu auto-install image is created. You can use it to auto install ubuntu on physical machines or VMs.&lt;/p>
&lt;h2 id="create-your-vms">Create Your VMs&lt;/h2>
&lt;p>After you finish the last section, you already have an ubuntu auto-installation image. This section is totally optional.&lt;/p>
&lt;p>In this section, I&amp;rsquo;ll demonstrate how to use this image on proxmox.&lt;/p>
&lt;h3 id="upload-the-image-to-proxmox-host">Upload The Image To Proxmox Host&lt;/h3>
&lt;p>First, let&amp;rsquo;s upload the image to the VM host. You can either use the web UI, or directly copy the iso into &lt;code>/var/lib/vz/template/iso&lt;/code>.&lt;/p>
&lt;h3 id="create-a-vm">Create A VM&lt;/h3>
&lt;p>Next, let&amp;rsquo;s create a VM, put the iso into its cdrom, and make the cdrom the boot device.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>qm create &lt;span style="color:#ae81ff">1000&lt;/span> --name vm1000 --cores &lt;span style="color:#ae81ff">4&lt;/span> --memory &lt;span style="color:#ae81ff">8192&lt;/span> &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> --scsi0 file&lt;span style="color:#f92672">=&lt;/span>ssd:32 --net0 virtio,bridge&lt;span style="color:#f92672">=&lt;/span>vmbr0 &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> --cdrom local:iso/ubuntu-22.04-autoinstall.iso
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>For example, the above command will create a 4 core, 8GB ram, and 32GB ssd VM. Start the VM, and then all you have to do is to wait until the OS is fully installed.&lt;/p></description></item><item><title>Cheatsheets: Linux Cheatsheet</title><link>https://devmemo.gitlab.io/cheatsheets/linux/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://devmemo.gitlab.io/cheatsheets/linux/</guid><description>
&lt;h2 id="commands">Commands&lt;/h2>
&lt;h3 id="file--directory-basics">File &amp;amp; Directory Basics&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># List files in the current directory.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>ls
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># List files in the current directory with details.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>ls -alh
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Change current directory.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>cd
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Show current directory.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>pwd
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Create an empty directory.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>mkdir
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Copy file.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>cp &amp;lt;src-filename&amp;gt; &amp;lt;dst-filename&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Copy directory.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>cp -Rf &amp;lt;src-dirname&amp;gt; &amp;lt;dst-dirname&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Move file or directory.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>mv &amp;lt;src-filename&amp;gt; &amp;lt;dst-filename&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Remove file.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>rm &amp;lt;filename&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Remove an empty directory.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>rmdir &amp;lt;dirname&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Remove a non-empty directory.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>rm -Rf &amp;lt;dirname&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Create a new empty file.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>touch &amp;lt;filename&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Find files.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>find . -iname &amp;lt;filename-regex&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Find all files.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>find . -type f
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="file-content">File Content&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Print file content.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>cat &amp;lt;filename&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Search texts in file.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>grep &amp;lt;text&amp;gt; &amp;lt;filename&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Search regex pattern in file.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>grep -e &amp;lt;regex-pattern&amp;gt; &amp;lt;filename&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Show first few lines in file.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>head -n &amp;lt;line-count&amp;gt; &amp;lt;filename&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Show last few lines in file.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>tail -n &amp;lt;line-count&amp;gt; &amp;lt;filename&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Follow file changes.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>tail -f &amp;lt;filename&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="file-access">File Access&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Change file access. An example of access-code is 600.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>chmod &amp;lt;access-code&amp;gt; &amp;lt;filename&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Change file owner.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>chown &amp;lt;owner&amp;gt;&lt;span style="color:#f92672">[&lt;/span>:&amp;lt;group&amp;gt;&lt;span style="color:#f92672">]&lt;/span> &amp;lt;filename&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="package--compress">Package &amp;amp; Compress&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Pack a directory into a tar file.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>tar -cvf &amp;lt;tar-filename&amp;gt;.tar &amp;lt;dirname&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Unpack a tar file.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>tar -xvf &amp;lt;tar-filename&amp;gt;.tar
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Zip a file.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>zip &amp;lt;zip-filename&amp;gt; file1 file2 file3 ...
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Unzip a file.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>unzip &amp;lt;zip-filename&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="disk">Disk&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Show free disk spaces for each block device.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>df -alh
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Display the disk usage of files under the current directory.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>du -h ./*
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Show block devices.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>lsblk
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="process">Process&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># List process.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>ps aux
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Kill a process with SIGTERM.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>kill &amp;lt;pid&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Kill a process with SIGKILL (the strongest killing signal).&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>kill -9 &amp;lt;pid&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># List all processes in a terminal UI.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>top
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># List all processes in an advanced terminal UI.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>htop
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="networking">Networking&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Download data from url.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>curl &amp;lt;url&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Download data from url to local file.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>curl &amp;lt;url&amp;gt; -o &amp;lt;filename&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># List all ports opened.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>netstat -an
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># List network configuration.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>ifconfig
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Ping network connectivity.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>ping
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="user">User&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Add a new user.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo adduser &amp;lt;username&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Delete a user.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo deluser &amp;lt;username&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="packages">Packages&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Install packages on ubuntu or debian.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo apt install &amp;lt;package-name&amp;gt;&lt;span style="color:#f92672">[=&lt;/span>&amp;lt;version&amp;gt;&lt;span style="color:#f92672">]&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Uninstall packages from ubuntu or debian.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo apt-get --purge remove &amp;lt;package-name&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="system">System&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Display information about your system.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>uname -a
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Display Linux release information&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>lsb_release -a
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Show hostname.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>hostname
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Reboot system now.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo reboot now
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Shutdown system now.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo shutdown -h now
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="services">Services&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># List all units.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>systemctl list-units
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># List all service units.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>systemctl list-units --type&lt;span style="color:#f92672">=&lt;/span>service
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Start a service.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo systemctl start &amp;lt;service-name&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Restart a service.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo systemctl restart &amp;lt;service-name&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Stop a service.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo systemctl stop &amp;lt;service-name&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Check a service status.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo systemctl status &amp;lt;service-name&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Enable a service to start as system starts.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo systemctl enable &amp;lt;service-name&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="configuration-files">Configuration Files&lt;/h2>
&lt;div class="sw-lg-table-container dark-scrollbar">
&lt;table class="sw-key-value-table" id="">
&lt;thead>
&lt;tr>
&lt;th>File Path&lt;/th>
&lt;th>Scope&lt;/th>
&lt;th>File Use&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>/boot/grub/grub.cfg&lt;/code>&lt;/td>
&lt;td>global&lt;/td>
&lt;td>the generated grub file&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>/etc/bash.bashrc&lt;/code>&lt;/td>
&lt;td>global&lt;/td>
&lt;td>global config file for bash&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>/etc/default/grub&lt;/code>&lt;/td>
&lt;td>global&lt;/td>
&lt;td>config used by update-grub to generate /boot/grub/grub.cfg&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>/etc/dhcp/dhclient.conf&lt;/code>&lt;/td>
&lt;td>global&lt;/td>
&lt;td>DCHP client configs&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>/etc/fstab&lt;/code>&lt;/td>
&lt;td>global&lt;/td>
&lt;td>startup mount configs&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>/etc/hostname&lt;/code>&lt;/td>
&lt;td>global&lt;/td>
&lt;td>hostname&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>/etc/hosts&lt;/code>&lt;/td>
&lt;td>global&lt;/td>
&lt;td>static dhcp entries&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>/etc/mime.types&lt;/code>&lt;/td>
&lt;td>global&lt;/td>
&lt;td>MIME types and filename extensions associated with them&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>/etc/motd&lt;/code>&lt;/td>
&lt;td>global&lt;/td>
&lt;td>log in prompt message&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>/etc/profile&lt;/code>&lt;/td>
&lt;td>global&lt;/td>
&lt;td>commands for the login shell to execute&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>/etc/resolv.conf&lt;/code>&lt;/td>
&lt;td>global&lt;/td>
&lt;td>DNS server config&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>/etc/sudoers&lt;/code>&lt;/td>
&lt;td>global&lt;/td>
&lt;td>configs for sudoers&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>/etc/timezone&lt;/code>&lt;/td>
&lt;td>global&lt;/td>
&lt;td>local timezone&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>~/.bashrc&lt;/code>&lt;/td>
&lt;td>user&lt;/td>
&lt;td>bash startup config for non-login shell&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>~/.editor&lt;/code>&lt;/td>
&lt;td>user&lt;/td>
&lt;td>sets the default editor for the user&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>~/.gitconfig&lt;/code>&lt;/td>
&lt;td>user&lt;/td>
&lt;td>sets the default configs for git&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>~/.profile&lt;/code>&lt;/td>
&lt;td>user&lt;/td>
&lt;td>shell startup commands&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>~/.ssh/config&lt;/code>&lt;/td>
&lt;td>user&lt;/td>
&lt;td>user ssh config&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>~/.vimrc&lt;/code>&lt;/td>
&lt;td>user&lt;/td>
&lt;td>vim config&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>~/.emacs&lt;/code>&lt;/td>
&lt;td>user&lt;/td>
&lt;td>emacs config&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>~/.xinitrc&lt;/code>&lt;/td>
&lt;td>user&lt;/td>
&lt;td>xmanager config&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div></description></item></channel></rss>