<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>GNU/Linux Notes on Christopher Carter</title>
    <link>https://chrisevancarter.com/linux/</link>
    <description>Recent content in GNU/Linux Notes on Christopher Carter</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Wed, 16 Apr 2025 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://chrisevancarter.com/linux/feed.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>dd</title>
      <link>https://chrisevancarter.com/linux/dd/</link>
      <pubDate>Wed, 16 Apr 2025 00:00:00 +0000</pubDate>
      <guid>https://chrisevancarter.com/linux/dd/</guid>
      <description>&lt;p&gt;&lt;code&gt;dd&lt;/code&gt; is a program for converting and copying files, with sometimes disastrous consequences. It is nicknamed &amp;ldquo;disk destroyer&amp;rdquo; for a reason. Be careful.&lt;/p&gt;&#xA;&lt;p&gt;For tasks like copying an &lt;code&gt;.iso&lt;/code&gt; to a drive to make bootable media, consider using something like &lt;a href=&#34;https://www.ventoy.net/en/index.html&#34;&gt;Ventoy&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h1 id=&#34;formatting-a-drive-with-an-iso&#34;&gt;Formatting a Drive With An &lt;code&gt;.iso&lt;/code&gt;&lt;/h1&gt;&#xA;&lt;p&gt;You can use use &lt;code&gt;dd&lt;/code&gt; is to copy &lt;code&gt;.iso&lt;/code&gt; image files to block media (like a USB drive) to make the media bootable. This is done by running:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Deploy a Website With rsync</title>
      <link>https://chrisevancarter.com/linux/deploy-website-with-rsync/</link>
      <pubDate>Wed, 16 Apr 2025 00:00:00 +0000</pubDate>
      <guid>https://chrisevancarter.com/linux/deploy-website-with-rsync/</guid>
      <description>&lt;p&gt;You can deploy a static website easily using &lt;code&gt;rsync&lt;/code&gt;. No CI/CD, git integration, Netlify, or other modern devops bloat required!&lt;/p&gt;&#xA;&lt;p&gt;On the remote machine, create a directory under your user, e.g. &lt;code&gt;~/www/mysite&lt;/code&gt;. Then create a symlink so the website can be served by your webserver, e.g. from &lt;code&gt;/var/www/mysite&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo ln -sT ~/www/mysite /var/www/mysite&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;On the local machine, assuming your static site lives at &lt;code&gt;mysite/&lt;/code&gt; &lt;a href=&#34;https://chrisevancarter.com/linux/ssh/&#34;&gt;set up ssh with the remote server&lt;/a&gt; and use the following &lt;code&gt;rsync&lt;/code&gt; command:&lt;/p&gt;</description>
    </item>
    <item>
      <title>ffmpeg</title>
      <link>https://chrisevancarter.com/linux/ffmpeg/</link>
      <pubDate>Wed, 16 Apr 2025 00:00:00 +0000</pubDate>
      <guid>https://chrisevancarter.com/linux/ffmpeg/</guid>
      <description>&lt;p&gt;&lt;code&gt;ffmpeg&lt;/code&gt; is for video stuff. The basic principle is to take a video/audio input, and transform it to a video/audio output:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ffmpeg -i &amp;lt;input&amp;gt; &amp;lt;output&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h1 id=&#34;trimming-a-video&#34;&gt;Trimming a Video&lt;/h1&gt;&#xA;&lt;p&gt;A video can be trimmed using the following pattern:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ffmpeg -ss 00:00:40 -to 00:01:16 -i input.mp4 output.mp4&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;code&gt;-ss&lt;/code&gt; is the start time of the clip you wish to cut, &lt;code&gt;-to&lt;/code&gt; is the end time of the clip, and &lt;code&gt;-i&lt;/code&gt; is the input video file.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Formatting Block Storage</title>
      <link>https://chrisevancarter.com/linux/format-usb/</link>
      <pubDate>Wed, 16 Apr 2025 00:00:00 +0000</pubDate>
      <guid>https://chrisevancarter.com/linux/format-usb/</guid>
      <description>&lt;p&gt;Formatting a block storage device, like a hard drive or a flash drive, is the process of making the drive usable for storage. It consists of two steps:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Format the partitions of the drive. These are logical sections of memorythat can have distinct filesystems, mount points, etc.&lt;/li&gt;&#xA;&lt;li&gt;Make filesystems on the partitions. This allows your computer to write files to the partitions when the device is mounted.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h1 id=&#34;format-the-partitions&#34;&gt;Format the Partitions&lt;/h1&gt;&#xA;&lt;p&gt;Use &lt;code&gt;fdisk&lt;/code&gt; to manage the partitions on the block device. Start the process with&lt;/p&gt;</description>
    </item>
    <item>
      <title>Mounting Devices</title>
      <link>https://chrisevancarter.com/linux/mount/</link>
      <pubDate>Wed, 16 Apr 2025 00:00:00 +0000</pubDate>
      <guid>https://chrisevancarter.com/linux/mount/</guid>
      <description>&lt;p&gt;To access an external storage device, like a flash drive, a hard drive, a mobile phone, etc., the device must be &lt;em&gt;mounted&lt;/em&gt; to a location on your filesystem.&lt;/p&gt;&#xA;&lt;h1 id=&#34;block-devices&#34;&gt;Block Devices&lt;/h1&gt;&#xA;&lt;p&gt;To mount a block device (hard drive, flash drive, etc.), use the &lt;code&gt;mount&lt;/code&gt; syscall:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo mount &amp;lt;device&amp;gt; &amp;lt;mountpoint&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;where &lt;code&gt;&amp;lt;device&amp;gt;&lt;/code&gt; is a device e.g. &lt;code&gt;/dev/sdb1&lt;/code&gt; and &lt;code&gt;&amp;lt;mountpoint&amp;gt;&lt;/code&gt; is a directory on your device to mount to. To unmount, simply do:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo umount &amp;lt;device&amp;gt;&#xA;# or&#xA;sudo umount &amp;lt;mountpoint&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;where-should-my-mountpoint-be&#34;&gt;Where should my mountpoint be?&lt;/h2&gt;&#xA;&lt;p&gt;If it is removable media, &lt;a href=&#34;https://www.linuxbase.org/betaspecs/fhs/fhs.html#mediaMountPoint&#34;&gt;mount it under &lt;code&gt;/media&lt;/code&gt;&lt;/a&gt;. &lt;code&gt;/media&lt;/code&gt; often has seperate subdirectories unter it for each removable medium, e.g. &lt;code&gt;/media/floppy&lt;/code&gt;, &lt;code&gt;/media/cdrom&lt;/code&gt;, &lt;code&gt;/media/zip&lt;/code&gt;, etc. I have &lt;code&gt;/media/usb&lt;/code&gt; for my usb drives.&lt;/p&gt;</description>
    </item>
    <item>
      <title>SSH</title>
      <link>https://chrisevancarter.com/linux/ssh/</link>
      <pubDate>Wed, 16 Apr 2025 00:00:00 +0000</pubDate>
      <guid>https://chrisevancarter.com/linux/ssh/</guid>
      <description>&lt;p&gt;&lt;code&gt;ssh&lt;/code&gt;, short for &amp;ldquo;secure shell&amp;rdquo;, is a protocol to make an encrypted connection to a remote server. Per the name, the most common use case is to connect via shell, but it is also used by applications like &lt;code&gt;git&lt;/code&gt;, &lt;code&gt;scp&lt;/code&gt;, etc. to make secure connections and transfer data.&lt;/p&gt;&#xA;&lt;h1 id=&#34;using-ssh&#34;&gt;Using SSH&lt;/h1&gt;&#xA;&lt;p&gt;You initiate a connection to a server over &lt;code&gt;ssh&lt;/code&gt; by opening a terminal and running&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ssh &amp;lt;username&amp;gt;@&amp;lt;server&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;for example&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ssh mike@example.com&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Depending on the server configuration, you will be prompted for your password for the account you have on the server. Upon successfuly authentication, a shell session on the remote server will appear in your terminal, and you can interact as you would in a normal terminal session.&lt;/p&gt;</description>
    </item>
    <item>
      <title>GPG</title>
      <link>https://chrisevancarter.com/linux/gpg/</link>
      <pubDate>Tue, 16 Apr 2024 00:00:00 +0000</pubDate>
      <guid>https://chrisevancarter.com/linux/gpg/</guid>
      <description>&lt;p&gt;GPG, short for &amp;ldquo;GNU Privacy Guard&amp;rdquo; allows you to encrypt and sign data according to the OpenPGP (or just &amp;ldquo;PGP&amp;rdquo;) standard. It can be used to verify software downloads and encrypt email.&lt;/p&gt;&#xA;&lt;p&gt;It can be difficult to find a single place that enumerates all the essential GPG concepts and terminology in one place. I recommend reading &lt;a href=&#34;https://www.gnupg.org/&#34;&gt;the website for GPG&lt;/a&gt;, as well as &lt;a href=&#34;https://emailselfdefense.fsf.org/en/&#34;&gt;Email Self-Defense&lt;/a&gt;, and of course, &lt;code&gt;man gpg&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h1 id=&#34;generating-a-gpg-key&#34;&gt;Generating a GPG key&lt;/h1&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;run &lt;code&gt;gpg --full-generate-key&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Select &lt;code&gt;RSA and RSA&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Enter &lt;code&gt;4096&lt;/code&gt; for key size.&lt;/li&gt;&#xA;&lt;li&gt;Enter an expiration date, e.g. &lt;code&gt;2y&lt;/code&gt; for 2 years.&lt;/li&gt;&#xA;&lt;li&gt;Pick a passphrase for the key.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;You can edit a gpg key by running &lt;code&gt;gpg --edit-key&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
