<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ryan Collins</title>
    <description>The latest articles on DEV Community by Ryan Collins (@mrrcollins).</description>
    <link>https://dev.to/mrrcollins</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%2F218294%2Fa7eed80f-0283-4ac6-96fc-68fa73319f1a.jpeg</url>
      <title>DEV Community: Ryan Collins</title>
      <link>https://dev.to/mrrcollins</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mrrcollins"/>
    <language>en</language>
    <item>
      <title>How I sync live coding from my Atari 1200XL to Github</title>
      <dc:creator>Ryan Collins</dc:creator>
      <pubDate>Tue, 11 Oct 2022 13:11:00 +0000</pubDate>
      <link>https://dev.to/mrrcollins/how-i-sync-live-coding-from-my-atari-1200xl-to-github-3eoo</link>
      <guid>https://dev.to/mrrcollins/how-i-sync-live-coding-from-my-atari-1200xl-to-github-3eoo</guid>
      <description>&lt;p&gt;For the past few weeks I’ve been &lt;a href="https://twitch.tv/gozgeek"&gt;streaming&lt;/a&gt; a live coding session from my Atari 1200XL, programming a Snake game in AtariBasic. Last week I had the idea, what if I could share the code live while streaming so others could follow along? I figured out how to do it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;For this to work, you’ll need the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An Atari 8-bit computer. The 800 and 1200XL have the best keyboards, but the 800XL is the most common and thus cheaper. For the 800 you’ll need the AtariBasic cartridge&lt;/li&gt;
&lt;li&gt;A Fujinet. This is a wifi enabled device that adds all sorts of cool networking capabilities to your Atari 8-bit. We’re only using it for disk emulation.&lt;/li&gt;
&lt;li&gt;Local Linux host. The Linux host will run &lt;code&gt;tnfsd&lt;/code&gt; to share the disk image to the Atari. It will also run a script that will extract the files from the disk image, convert line endings for files that end in &lt;code&gt;.LST&lt;/code&gt;, and commit these to Github.&lt;/li&gt;
&lt;li&gt;Public Github repo and SSH logins set up. The Linux host will commit the changes and push them to the repo, and to do this automatically you’ll need to have ssh keys set up.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On the Linux host you’ll need to install:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;tnfsd - &lt;a href="https://fujinet.online/download/"&gt;Download the binary under TNFS server&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;git&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://pypi.org/project/atrcopy/"&gt;atrcopy&lt;/a&gt; - The script that extracts files from a disk image.&lt;/li&gt;
&lt;li&gt;tmux - Not required, but makes it easier to run the TNSF server and the script at the same time.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/clibs/entr"&gt;entr&lt;/a&gt; - Monitors a file for changes and then runs a script&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  a8syncdev.sh
&lt;/h2&gt;

&lt;p&gt;Here’s the script that syncs the files from the disk image to the git repo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash

diskimage="${HOME}/atari8/GozSnake.atr"

cp "${diskimage}" .

cd src
~/.local/bin/atrcopy "${diskimage}" extract --all -f

for file in *.LST
do
.
.
tr '\233\177' '\12\11' &amp;lt;"${file}" &amp;gt; /tmp/temp.lst
.
.
cp /tmp/temp.lst "${file}"
done

cd ..
git add *
git commit -am "Automated commit `date`..."
git push

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

&lt;/div&gt;



&lt;p&gt;The TNFS server is sharing out the ~/atari8 directory, which in this case contains our disk image GozSnake.atr which is mounted on the Atari. The script is run in the local repo folder. When this script runs, it will:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;copies the current disk image into the repo&lt;/li&gt;
&lt;li&gt;extract the contents of the disk to the &lt;code&gt;src&lt;/code&gt; directory&lt;/li&gt;
&lt;li&gt;translate the line ends for any file that ends in .LST&lt;/li&gt;
&lt;li&gt;Adds everything to git&lt;/li&gt;
&lt;li&gt;Commits everything with an automated message&lt;/li&gt;
&lt;li&gt;Pushes it to Github&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, how do we run this automatically? We could set it up to run every 10 seconds, but that seems wasteful, especially when we have &lt;code&gt;entr&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Enter entr
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;entr&lt;/code&gt; is a command that can watch a file or folder and run other commands when the file or folder changes. In our case, we want it to watch our &lt;code&gt;GozSnake.atr&lt;/code&gt; disk image file and run &lt;code&gt;a8syncdev.sh&lt;/code&gt; when it changes. We can do that with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls ~/atari8/GozSnake.atr | entr ../a8syncdev.sh

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

&lt;/div&gt;



&lt;p&gt;I run in from my repo directory so the paths are correct. The &lt;code&gt;a8syncdev.sh&lt;/code&gt; script is one level up. Anytime the disk image file changes, the script is ran and the git repo is updated.&lt;/p&gt;

&lt;h2&gt;
  
  
  Watch it in action
&lt;/h2&gt;

&lt;p&gt;Follow me &lt;a href="https://twitter.com/gozgeek"&gt;over on Twitter&lt;/a&gt;, &lt;a href="https://oldbytes.space/web/@goz"&gt;Mastodon&lt;/a&gt;, and/or &lt;a href="https://twitch.tv/gozgeek"&gt;Twitch&lt;/a&gt; to know when I’m streaming. Let me know if you can see any improvements!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>📹 Saving social media videos to your phone</title>
      <dc:creator>Ryan Collins</dc:creator>
      <pubDate>Tue, 04 Oct 2022 18:06:00 +0000</pubDate>
      <link>https://dev.to/mrrcollins/saving-social-media-videos-to-your-phone-4dce</link>
      <guid>https://dev.to/mrrcollins/saving-social-media-videos-to-your-phone-4dce</guid>
      <description>&lt;p&gt;I happen to have a problem with scrolling through a lot of social media. In my travels, I’ll come across a lot of videos that I’d like to share or save. The problem with sharing the videos is that sometimes the site doesn’t make it very pleasant for a person without an account to view the video. Facebook, I’m looking at you. Another issue is that the video may get pulled for various reasons. Since I’m a big geek always looking for a way to overengineer a solution, I wrote a couple of scripts to make it easy to download videos from social media sites so I can share them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;If you’d like to try this yourself, here are the tools you’ll need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An Unix based host that you can access publicly on the internet. I use a virtual private server, but you can use the free tier from Amazon or any VPS provider.&lt;/li&gt;
&lt;li&gt;yt-dlp: This software is the magic that allows everything to happen. It’s a fork of &lt;code&gt;youtube-dl&lt;/code&gt; and is a command line app that downloads videos from various services.&lt;/li&gt;
&lt;li&gt;Telegram: Telegram is my instant messaging client of choice, and I use &lt;code&gt;telegram-send&lt;/code&gt; to send me the movie file once it’s downloaded&lt;/li&gt;
&lt;li&gt;sqlite3: I could probably queue up videos with a plain text file, but why do that when I can use a full blown database. Another bonus is that I’ve wanted a reason to use sqlite3 in a project.&lt;/li&gt;
&lt;li&gt;tmux: &lt;code&gt;tmux&lt;/code&gt; is a terminal multiplexer which allows you to have multiple windows open over a command line interface. You can also detach from the session and it stays running.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Installing the software
&lt;/h2&gt;

&lt;p&gt;On your VPS you’ll need to install the software needed. You can follow the directions at each site for installing and configuring the software.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;yt-dlp&lt;/li&gt;
&lt;li&gt;telegram-send&lt;/li&gt;
&lt;li&gt;sqlite3&lt;/li&gt;
&lt;li&gt;tmux (or your favorite terminal multiplexer)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You don’t have to use Telegram, you can use something else, but I would recommend at least checking it out. It gives you unlimited storage with file sizes up to 2GB (however, &lt;code&gt;telegram-send&lt;/code&gt; can only send videos up to 50MB, which isn’t a problem with short social media videos).&lt;/p&gt;

&lt;h2&gt;
  
  
  getvideo.sh
&lt;/h2&gt;

&lt;p&gt;First up is a script to download the video. Yes, we could call &lt;code&gt;yt-dlp&lt;/code&gt; directly, but I want control over where the videos are saved along with how they are named.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash

cd ${HOME}/Movies
filename=$(/usr/local/bin/yt-dlp --windows-filenames --get-filename "${1}")
file="${filename:0:33}-${filename: -24}"

/usr/local/bin/yt-dlp --windows-filenames -o "${file}" "${1}"

telegram-send --video "${file}" --caption "${filename}"

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

&lt;/div&gt;



&lt;p&gt;You will have to adjust the paths to fit your situation. I store the downloaded videos in &lt;code&gt;~/Movies&lt;/code&gt;. Let me know how to improve the naming of the file. This way works well enough for me with Tik Tok videos, but I’m always ready for improvement.&lt;/p&gt;

&lt;p&gt;Once we &lt;code&gt;chmod +x getvideo.sh&lt;/code&gt; we can call the script with one parameter, the url for the video. This could be the link to the tweet with the video, or the link from Tik Tok. The video will be downloaded and then sent to me in Telegram.&lt;/p&gt;

&lt;p&gt;This is what my first iteration of downloading videos looked like. On my iPhone I made a Shortcut that would call the &lt;code&gt;getvideo.sh&lt;/code&gt; script over ssh. The problem was that once I initiated the Shortcut, I was stuck waiting for it to finish. Since that could take a minute or so, I needed to come up with a better solution. Enter a download queue in an sqlite3 database.&lt;/p&gt;

&lt;h2&gt;
  
  
  The database
&lt;/h2&gt;

&lt;p&gt;The database will store a command and a variable to the command. I’m wanting to extend the queuing system into other areas, like scheduling tweets or Mastodon toots.&lt;/p&gt;

&lt;p&gt;I use &lt;code&gt;~/Development&lt;/code&gt; as a place to store all of my scripts, so inside that folder I created a folder called gozcron. That will be where I save the database and any other scripts I may need.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sqlite3&lt;/code&gt; is pretty cool, creating the database is as simple as &lt;code&gt;sqlite3 gozcron.db&lt;/code&gt;. You will enter the &lt;code&gt;sqlite3&lt;/code&gt; prompt. Here is the create statement I used to create a table in the database called &lt;code&gt;actions&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE TABLE actions (id INTEGER PRIMARY KEY,action varchar(30),variable varchar(1024),due varchar(32),completed BYTE DEFAULT '0');

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

&lt;/div&gt;



&lt;p&gt;There are 5 columns:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;id: An autoincrementing field to use for delete or update actions&lt;/li&gt;
&lt;li&gt;action: Denotes the steps to take with this record. Currently only supports &lt;code&gt;getvideo&lt;/code&gt; but will support other tasks in the future.&lt;/li&gt;
&lt;li&gt;variable: Stores the arguments for the action. For &lt;code&gt;getvideo&lt;/code&gt; that would be the URL of the video.&lt;/li&gt;
&lt;li&gt;due: In the future I want to be able to schedule when tasks happen. The date/time of the scheduled action will be stored in this field but for &lt;code&gt;getvideo&lt;/code&gt; it is ignored.&lt;/li&gt;
&lt;li&gt;completed: Once the task is done, this field will be set to 1.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After the create statement is ran, you can exit sqlite3 with &lt;code&gt;.quit&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  addtask.sh
&lt;/h2&gt;

&lt;p&gt;Now that we have a database, let’s add tasks to it. The &lt;code&gt;addtask.sh&lt;/code&gt; script will take 3 arguments and add them as a record to the &lt;code&gt;actions&lt;/code&gt; table.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash

cd ${HOME}/Development/gozcron

action="${1}"
var="${2}"
due="${3}"

echo "${action}-${var}-${due}" &amp;gt;&amp;gt; addtask.log

sqlite3 gozcron.db &amp;lt;&amp;lt;EOF
insert into actions (action,variable,due)
.
.
VALUES
("${action}","${var}","${3}");

EOF&amp;gt;&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;echo&lt;/code&gt; line is used for debugging, I don’t know if I’ll leave it in the script, but it’s there for now. For downloading videos I run the script with only two arguments, &lt;code&gt;addtask.sh getvideo https://MEDIAURL&lt;/code&gt;. This runs from an SSH step in an iOS Shortcut. Since it only adds one record to a database, it finishes a lot quicker on the phone.&lt;/p&gt;

&lt;h2&gt;
  
  
  gozcrond.sh
&lt;/h2&gt;

&lt;p&gt;We’ve got a script that will download the video, and a script to store which videos to download, now we need a script that will go through our queue in the database and download the videos. That’s where gozcrond.sh comes in.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash

getvideo="${HOME}/Development/gozcron/getvideo.sh"

now=$(date +"%Y-%m-%d %H:%M")
list=$(sqlite3 -batch -separator ',' gozcron.db "select id,action,variable from actions where completed=\"0\" AND (due &amp;lt; \"${now}\" OR due IS NULL)";)

while read -r line; do
    id=$(echo "${line}" | cut -d "," -f 1)
    action=$(echo "${line}" | cut -d "," -f 2)
    var=$(echo "${line}" | cut -d "," -f 3)

    #echo "id: ${id}, Action: ${action}, Variable: ${var}"

    case "${action}" in
        getvideo)
            echo "Downloading movie ${var}"
            ${getvideo} ${var}            
            sqlite3 -batch gozcron.db "update actions set completed=\"1\" where id=\"${id}\";"
            ;;
    esac

done &amp;lt;&amp;lt;&amp;lt;"${list}"

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

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;gozcrond.sh&lt;/code&gt; selects all of the tasks that aren’t completed and that are either past their due date or do not have a due date set. It then iterates through the list, and runs &lt;code&gt;getvideo.sh&lt;/code&gt; on any row that has &lt;code&gt;getvideo&lt;/code&gt; as the action. If I run the script, it checks once and then exits. We don’t want to do that, so I run it with &lt;code&gt;while TRUE; do ./gozcrond.sh; sleep 60; done&lt;/code&gt;. I probably should just incorporate the loop in the script, and maybe I will.&lt;/p&gt;

&lt;h2&gt;
  
  
  Running all the time
&lt;/h2&gt;

&lt;p&gt;Since I get tired of looking up how to create services, I run the script in a window under &lt;code&gt;tmux&lt;/code&gt;. I can then detach from my session and my script stays running.&lt;code&gt;tmux&lt;/code&gt; is a terminal multiplexer, allowing you to run multiple windows or screens from one connection. It also lets you disconnect and leave your stuff running. for when you reconnect.&lt;/p&gt;

</description>
      <category>bash</category>
      <category>videos</category>
    </item>
    <item>
      <title>📱 Fixing a Kindle Fire tablet stuck at the boot screen</title>
      <dc:creator>Ryan Collins</dc:creator>
      <pubDate>Tue, 24 May 2022 12:17:00 +0000</pubDate>
      <link>https://dev.to/mrrcollins/fixing-a-kindle-fire-tablet-stuck-at-the-boot-screen-2f0n</link>
      <guid>https://dev.to/mrrcollins/fixing-a-kindle-fire-tablet-stuck-at-the-boot-screen-2f0n</guid>
      <description>&lt;p&gt;Back in 2015 I bought a Kindle Fire 7" tablet to play around with. Since then, it’s been sitting around, not getting charged. Apparently, that’s a bad thing because after I charged it the device would get stuck on the Kindle logo. Booting into the recovery menu wouldn’t fix it, but, after digging around on the internet, I found out what to do.&lt;/p&gt;

&lt;p&gt;THESE DIRECTIONS WILL WIPE OUT EVERYTHING ON THE DEVICE!!&lt;/p&gt;

&lt;h2&gt;
  
  
  Download the firmware
&lt;/h2&gt;

&lt;p&gt;You’ll need the firmware for your tablet. Amazon &lt;a href="https://www.amazon.com/gp/help/customer/display.html?nodeId=200529680"&gt;maintains a page that has all of the software updates for their devices&lt;/a&gt;. If you are like me and have no idea what tablet you have, go look at your orders and find it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get minimal ADB and Fastboot
&lt;/h2&gt;

&lt;p&gt;I did this on a Windows machine, and the kind folks over at XDA Developers &lt;a href="https://forum.xda-developers.com/t/tool-minimal-adb-and-fastboot-2-9-18.2317790/"&gt;has a nice little download that will get you set up with the adb tools&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Install the tools and then let the program open. For other operating systems, you’ll need to see about how to get it set up with adb.&lt;/p&gt;

&lt;h2&gt;
  
  
  Plug our device into the computer and boot into recovery
&lt;/h2&gt;

&lt;p&gt;Start up the device holding down the volume down key and the power key. After 10-30 seconds you’ll see the recovery menu. Using the volume keys, navigate to &lt;strong&gt;Apply Update with adb&lt;/strong&gt; and hit the power button to select.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sideload that firmware baby!
&lt;/h2&gt;

&lt;p&gt;In the Minimal ADB and Fastboot window, type &lt;code&gt;adb devices&lt;/code&gt; to see if your device shows up. If it doesn’t, try a different USB cable.&lt;/p&gt;

&lt;p&gt;To load the firmware, use the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;adb sideload D:\Downloads\update-kindle-Fire_7_LC_5th_Gen-37.6.2.6_user_626549020.bin

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

&lt;/div&gt;



&lt;p&gt;Use the full path to the .bin file. Easiest way to do this is to type &lt;code&gt;adb sideload&lt;/code&gt; into the window, and then open File Explorer. Navigate to the .bin file and drag it to the &lt;code&gt;Minimal ADB and Fastboot&lt;/code&gt; window. Drop it there and the full path will appear.&lt;/p&gt;

&lt;p&gt;Press enter to start the process. It may take 10-15+ minutes. Once complete, reboot the device. Hopefully it will start up like new and you’ll be in business!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>🖥 Session aliases with tmux</title>
      <dc:creator>Ryan Collins</dc:creator>
      <pubDate>Fri, 16 Jul 2021 14:16:00 +0000</pubDate>
      <link>https://dev.to/mrrcollins/session-aliases-with-tmux-191p</link>
      <guid>https://dev.to/mrrcollins/session-aliases-with-tmux-191p</guid>
      <description>&lt;p&gt;I use tmux as my screen multiplexer, and in the past, I used &lt;code&gt;control-A d&lt;/code&gt; to disconnect and &lt;code&gt;tmux a -d&lt;/code&gt; to reattach to the session. This gets cumbersome if I haven’t created a tmux session yet, since &lt;code&gt;tmux a -d&lt;/code&gt; will give me an error that no session exists.&lt;/p&gt;

&lt;h2&gt;
  
  
  Aliases to the rescue
&lt;/h2&gt;

&lt;p&gt;To help start sessions, and now name them, I use the following alias:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;alias tma="tmux new -ADs"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To create a session named &lt;code&gt;main&lt;/code&gt; or re-attach to a disconnected session, I can now type &lt;code&gt;tma main&lt;/code&gt;. The alias will create a session named &lt;code&gt;main&lt;/code&gt; if one doesn’t exist, or reconnect to the session named &lt;code&gt;main&lt;/code&gt;. This also makes it easy to create named tmux sessions without having to remember the syntax.&lt;/p&gt;

</description>
      <category>tmux</category>
      <category>bash</category>
    </item>
    <item>
      <title>🖼 Resize and re-compress your photos with squoosh.app</title>
      <dc:creator>Ryan Collins</dc:creator>
      <pubDate>Fri, 09 Jul 2021 12:58:00 +0000</pubDate>
      <link>https://dev.to/mrrcollins/resize-and-re-compress-your-photos-with-squoosh-app-5eh0</link>
      <guid>https://dev.to/mrrcollins/resize-and-re-compress-your-photos-with-squoosh-app-5eh0</guid>
      <description>&lt;p&gt;Have you needed to quickly resize or recompress a picture and don’t want to wait for Affinity Photo or Photoshop to load? Then do I have a web app for you!&lt;/p&gt;

&lt;h2&gt;
  
  
  Squoosh is in the house
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://squoosh.app/"&gt;Squoosh&lt;/a&gt; is a Google project that was created to highlight offline apps in the browser. The site allows you to not only convert photos to other formats, but to also resize and reduce the number of colors in a photo.&lt;/p&gt;

&lt;p&gt;These two techniques can let you compress photos to at least 90% without any noticeable effects.&lt;/p&gt;

&lt;h2&gt;
  
  
  CLI now included
&lt;/h2&gt;

&lt;p&gt;But you’re a developer, and you want to be able to automate these conversions. Well, Google &lt;a href="https://github.com/GoogleChromeLabs/squoosh/tree/dev/cli"&gt;also has you covered&lt;/a&gt;. You can now run the conversions from the commandline.&lt;/p&gt;

&lt;h2&gt;
  
  
  Uses for you
&lt;/h2&gt;

&lt;p&gt;I find myself using &lt;a href="https://squoosh.app/"&gt;Squoosh&lt;/a&gt; quite a bit for quick compressing and resizing. It works well for these simple tasks when you want something down now!&lt;/p&gt;

</description>
      <category>graphics</category>
      <category>squoosh</category>
      <category>webapp</category>
    </item>
    <item>
      <title>💻 My favorite Windows apps</title>
      <dc:creator>Ryan Collins</dc:creator>
      <pubDate>Fri, 02 Jul 2021 16:16:00 +0000</pubDate>
      <link>https://dev.to/mrrcollins/my-favorite-windows-apps-3jim</link>
      <guid>https://dev.to/mrrcollins/my-favorite-windows-apps-3jim</guid>
      <description>&lt;p&gt;This past week I bought a new laptop, a Lenovo Thinkpad X1 Carbon Nano (say that five times fast). It’s been awhile since I have set up a new machine, so I started to document setting this one up. I’m surprised how quickly I had it set up, no wonder I haven’t automated it.&lt;/p&gt;

&lt;p&gt;In no particular order, here are the apps I use regularly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Browsers
&lt;/h2&gt;

&lt;p&gt;Windows comes with Edge installed, but I also install &lt;a href="https://google.com/chrome"&gt;Google Chrome&lt;/a&gt;, &lt;a href="https://brave.com"&gt;Brave&lt;/a&gt;, and &lt;a href="https://mozilla.org"&gt;Firefox&lt;/a&gt;. Each browser has synced turned on, so I don’t have to install my favorite extensions. I jump between browsers pretty regularly, and barely have a favorite for any length of time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Apps
&lt;/h2&gt;

&lt;p&gt;For graphics I use Affinity Designer and Affinity Photo. They’re pretty awesome and very affordable.&lt;/p&gt;

&lt;p&gt;I use &lt;a href="https://telegram.org/"&gt;Telegram Messenger&lt;/a&gt; for more than just messaging. It is how I transfer files between my devices and phone, along with backups.&lt;/p&gt;

&lt;p&gt;These are the only three applications I use outside of games and browsers.&lt;/p&gt;

&lt;p&gt;On my desktop I use Davinci Resolv for video editing. I haven’t installed it yet on my laptop because I don’t know if I will be doing much video editing on the go, but I probably will.&lt;/p&gt;

&lt;h2&gt;
  
  
  Windows Subsystem for Linux
&lt;/h2&gt;

&lt;p&gt;I need my command line, so up comes WSL along with Ubuntu and Alpine. Ubuntu is used as my shell on the computer, while I use Alpine to connect over ssh/mosh to my virtual private servers. That task could be done under Ubuntu, but Alpine is really lightweight and I want experience with other distributions.&lt;/p&gt;

&lt;p&gt;Along with WSL I install the &lt;a href="https://github.com/microsoft/terminal"&gt;Windows Terminal&lt;/a&gt;. It has come a long way in a short time. To set it up I copy the settings.json file from a machine where Windows Terminal is already set up how I like it.&lt;/p&gt;

&lt;p&gt;Since I like playing around with Linux at the command line, I already have a &lt;a href="https://github.com/mrrcollins/dotfiles"&gt;bootstrap script and keep my dotfiles in a Git repo&lt;/a&gt; making it really easy to set up any Linux machine just as I like it.&lt;/p&gt;

&lt;p&gt;I’m currently playing around with adding the &lt;a href="https://nixos.org/"&gt;Nix package manager&lt;/a&gt;. It offers more up to date packages and I really like how it works.&lt;/p&gt;

&lt;h2&gt;
  
  
  Utilities
&lt;/h2&gt;

&lt;p&gt;For screenshots I use &lt;a href="https://getgreenshot.org/"&gt;Greenshot&lt;/a&gt;. I also like a good clipboard manager, so the &lt;a href="https://ditto-cp.sourceforge.io/"&gt;Ditto clipboard manager&lt;/a&gt; is installed. I want to like &lt;a href="https://getsharex.com/"&gt;ShareX&lt;/a&gt; for screenshots, but I haven’t had a chance to get comfortable with it.&lt;/p&gt;

&lt;p&gt;I use &lt;a href="https://docs.microsoft.com/en-us/windows/powertoys/"&gt;Microsoft PowerToys&lt;/a&gt; for two things. &lt;strong&gt;Powertoys Run&lt;/strong&gt; is how I launch applications under Windows. &lt;strong&gt;Fancy Zones&lt;/strong&gt; offers the ability to customize the snapping of Windows. &lt;strong&gt;PowerRename&lt;/strong&gt; is very powerful, so if you need to rename a bunch of files, check it out.&lt;/p&gt;

&lt;p&gt;To store/backup my files, I use Google Drive Backup and Sync. Twenty bucks a year for 100GB is hard to beat. In my homelab I have FreeNAS set up as a file server, but I haven’t set up remote access to it yet. When I’m at home I connect to it though.&lt;/p&gt;

&lt;p&gt;Compressed files are handled by &lt;a href="https://www.7-zip.org/"&gt;7-Zip&lt;/a&gt;. I really like being able to right click on a compressed file and expand it to a folder named after the file.&lt;/p&gt;

&lt;p&gt;Finally, the utility I can’t live without, &lt;a href="https://espanso.org/"&gt;espanso&lt;/a&gt;, a cross platform text expander. I don’t know why it isn’t talked about more, but it is great!&lt;/p&gt;

&lt;h2&gt;
  
  
  Windows settings
&lt;/h2&gt;

&lt;p&gt;The defaults work pretty well. Since I use virtual desktops, I change the default behavior for alt-tab to show the windows on all of the desktops, not just the desktop I am on. I also uncheck “When I snap a window, show what I can snap next to it”.&lt;/p&gt;

&lt;h2&gt;
  
  
  Miscellaneous
&lt;/h2&gt;

&lt;p&gt;My programming font of choice to install is &lt;a href="https://www.jetbrains.com/lp/mono/"&gt;JetBrains Mono&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.retroarch.com/"&gt;RetroArch&lt;/a&gt;, &lt;a href="https://store.steampowered.com/"&gt;Steam&lt;/a&gt;, &lt;a href="https://www.epicgames.com/store/en-US/"&gt;Epic&lt;/a&gt;, and &lt;a href="https://www.gog.com/"&gt;GOG&lt;/a&gt; are installed for games. I also use &lt;a href="https://parsec.app/"&gt;Parsec&lt;/a&gt; to connect to my desktop when I need more horsepower.&lt;/p&gt;

&lt;p&gt;All in all, my needs are pretty simple. A browser and command line gets me 80% of the way there. What Windows apps did I miss that you can’t live without?&lt;/p&gt;

</description>
      <category>windows</category>
    </item>
    <item>
      <title>✔ Tasks and To Dos My Plain Text Journey Part VI</title>
      <dc:creator>Ryan Collins</dc:creator>
      <pubDate>Fri, 25 Jun 2021 12:54:00 +0000</pubDate>
      <link>https://dev.to/mrrcollins/tasks-and-to-dos-my-plain-text-journey-part-vi-50bg</link>
      <guid>https://dev.to/mrrcollins/tasks-and-to-dos-my-plain-text-journey-part-vi-50bg</guid>
      <description>&lt;p&gt;I believe that there are as many ways to manages tasks as there are stars in the sky. Through the years I have tested several different methods, and my current methods rely on two plain text formats for tasks: Taskpaper and todo.txt.&lt;/p&gt;

&lt;h2&gt;
  
  
  .taskpaper format
&lt;/h2&gt;

&lt;p&gt;I started with the Taskpaper format, keeping my todo list in a file named &lt;code&gt;today.taskpaper&lt;/code&gt;. The Taskpaper format is pretty simple. Projects are on a line by themselves and end with a &lt;code&gt;:&lt;/code&gt;. Tasks are on their own lines, and start with a &lt;code&gt;-&lt;/code&gt;. Here’s a sample file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Errands:
- Check out that car
- Drop off packages

Grocery:
- Milk
- Eggs
- Diet Mountain Dew
- Ho Hos

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

&lt;/div&gt;



&lt;p&gt;To set priorities, contexts, start dates, due dates, etc. you use the &lt;code&gt;@&lt;/code&gt; in front of whatever word you want to use. For example, &lt;code&gt;@due(2021-12-24)&lt;/code&gt; would be a due date for a task, and &lt;code&gt;@start(2021-11-30)&lt;/code&gt; could be a start date. The @ words used are up to you, and you can use whatever you want. To complete a task, you add @done(YYYY-MM-DD) to the task line.&lt;/p&gt;

&lt;p&gt;Taskpaper is great for outlining, but it is a pain to parse in scripts. Because of this, I currently use todo.txt for my daily to do list, while .taskpaper files are used for specific projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  todo.txt
&lt;/h2&gt;

&lt;p&gt;&lt;a href="http://todotxt.org/"&gt;todo.txt&lt;/a&gt; lists each task as itself on a line. No prefix necessary. Projects are added to a task with &lt;code&gt;+PROJECTNAME&lt;/code&gt; and contexts use &lt;code&gt;@CONTEXT&lt;/code&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;Get milk +grocery @errands
Check out that car @errands
Ho Hos +grocery @errands
Diet Mountain Dew +grocery @errands

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

&lt;/div&gt;



&lt;p&gt;Priorities are prepended to the line, and they go from A-Z. I have no idea why you would use all of them, but hey, you be you. The priority goes in parenthesis at the beginning of the line: &lt;code&gt;(A) Ho Hos +grocery @errands.&lt;/code&gt; Extra information that you may want to put with a task can be added as a &lt;code&gt;key:value&lt;/code&gt; pair, such as due dates (&lt;code&gt;due:2021-12-24&lt;/code&gt;) or threshold (start) date (&lt;code&gt;t:2021-11-30&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;To mark a task done, you prepend an &lt;code&gt;x&lt;/code&gt; to the beginning of the line. You can also add &lt;code&gt;done:YYYY-MM-DD&lt;/code&gt; to the line to record the date completed.&lt;/p&gt;

&lt;p&gt;The todo.txt format is pretty easy to parse, and has a wide ecosystem of scripts and programs behind it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Working with the lists
&lt;/h2&gt;

&lt;p&gt;The lists are all stored in the same Git repo as my plain-text notes, using a folder named &lt;code&gt;Lists&lt;/code&gt;. To work with the lists at the command line, I use the &lt;a href="http://todotxt.org/"&gt;todo.txt bash script&lt;/a&gt; for the &lt;code&gt;todo.txt&lt;/code&gt; file. For the .taskpaper files I use Vim and the &lt;a href="https://github.com/davidoc/taskpaper.vim"&gt;Taskpaper plugin&lt;/a&gt;. If you were working from the GUI, there are plugins for VS Code or several different apps to use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Notifications
&lt;/h2&gt;

&lt;p&gt;When I have due dates I do like to get a notification at the start of the day. I wrote a bash script that goes through my &lt;code&gt;todo.txt&lt;/code&gt; file and looks for tasks with a due dates of today. The script runs at midnight. The script adds a priority of &lt;code&gt;(A)&lt;/code&gt; for tasks due today, and then it sends me a list of tasks that have a priority set.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash

nl=$'\n'

#TelegramBot
# .telegraminfo has the bot API key and my Telegram chat ID
source ~/.telegraminfo.cfg

#Where are the tasks
TASKS="${HOME}/notes/Lists/todo.txt"
temp="/tmp/temp.todo.txt"

# Delete the temp file if it exists
[-f ${temp}] &amp;amp;&amp;amp; rm "${temp}"

# Loop through the file and look for tasks due today
# Set the priority to (A)
while read i || [[-n $i]]; do
    if [[${i} =~ "due:${TODAY}"]]; then
        echo "(A) ${i}" &amp;gt;&amp;gt; "${temp}" 
    else 
        echo "${i}" &amp;gt;&amp;gt; ${temp}
    fi
done &amp;lt; "${TASKS}"
mv "${temp}" "${TASKS}"

#Message what is due today
DUE=""

# Anything with a priority set will be sent
while read i || [[-n $i]]; do
    if [[${i} =~ ^\(.\)\]]; then
        DUE+="${i}${nl}"
    fi
done &amp;lt; ${TASKS}

# Send to Telegram

read -r -d '' MSG &amp;lt;&amp;lt;EOT
Tasks due ${TODAY}:
${DUE}
EOT

/usr/bin/curl -s -X POST \
https://api.telegram.org/bot${APIKEY}/sendMessage \
-d text="${MSG}" \
-d parse_mode="Markdown" \
-d chat_id=${TO} &amp;gt; /dev/null

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  It works for me, but…
&lt;/h2&gt;

&lt;p&gt;I like how I have it set up now, but I feel like there is still room for improvement. Maybe when I find some time…&lt;/p&gt;

</description>
      <category>plaintext</category>
      <category>bash</category>
      <category>todo</category>
    </item>
    <item>
      <title>💾 Saving bash history across terminals</title>
      <dc:creator>Ryan Collins</dc:creator>
      <pubDate>Fri, 18 Jun 2021 12:23:00 +0000</pubDate>
      <link>https://dev.to/mrrcollins/saving-bash-history-across-terminals-b80</link>
      <guid>https://dev.to/mrrcollins/saving-bash-history-across-terminals-b80</guid>
      <description>&lt;p&gt;I’m very comfortable with bash, and I use it a lot with tmux. However, I didn’t like how I would lose command line history across these multiple terminals. After doing a little research, I figured out how to save my history for each terminal. Not only that, but I can also search all of the history. Now I don’t lose commands!&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting up your .bashrc
&lt;/h2&gt;

&lt;p&gt;Here are the relevant lines from my .bashrc. After adding them to yours, either log out and back in or include them into the current shell with &lt;code&gt;source ~/.bashrc&lt;/code&gt;. No terminals will start saving their history unless you restart the shell or source the new lines.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# save history for multiple terminals
# create a folder to store the history
if [! -d "${HOME}/.bash_history_log"]; then
    mkdir "${HOME}/.bash_history_log"
fi

# Add the tty to the history file
# Each terminal's history will be stored in 
# its own file
HISTSUFFIX=`tty | sed 's/\///g;s/^dev//g'`
HISTFILE="$HOME/.bash_history_log/bash_history_$HISTSUFFIX"

# Time stamp for the history
HISTTIMEFORMAT="%y-%m-%d %H:%M:%S "

# don't put duplicate lines or lines starting with space in the history.
HISTCONTROL=ignoredups:ignorespace

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=5000

# append to the history file, don't overwrite it
shopt -s histappend

# Add to the history everytime the prompt is shown
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007";history -a'

# Search history
function searchhistory() {
    grep -ri "${1}" ~/.bash_history_log/*
}
alias shistory=searchhistory

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  In practice
&lt;/h2&gt;

&lt;p&gt;History is now automatically saved. To search for a command, I use the &lt;code&gt;searchhistory&lt;/code&gt; function, which I alias to &lt;code&gt;shistory&lt;/code&gt;. As an example, to see all of the Linux containers commands I have used, I can search the history with &lt;code&gt;shistory lxc&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Since I modify the command prompt, you will probably want to change it to suit your personal needs. The secret sauce is the &lt;code&gt;history -a&lt;/code&gt; which appends the commands to the history file that aren’t already added.&lt;/p&gt;

&lt;h2&gt;
  
  
  Improvements?
&lt;/h2&gt;

&lt;p&gt;This is something I hacked together after a bunch of searches. Please let me know if it can be improved! Also, I post daily over at &lt;a href="https://gozgeek.com"&gt;GozGeek&lt;/a&gt; if your interested in geeky stuff.&lt;/p&gt;

</description>
      <category>bash</category>
      <category>tmux</category>
    </item>
    <item>
      <title>✍ Keeping Notes My Plain Text Journey Part V</title>
      <dc:creator>Ryan Collins</dc:creator>
      <pubDate>Fri, 11 Jun 2021 12:21:00 +0000</pubDate>
      <link>https://dev.to/mrrcollins/keeping-notes-my-plain-text-journey-part-v-1pec</link>
      <guid>https://dev.to/mrrcollins/keeping-notes-my-plain-text-journey-part-v-1pec</guid>
      <description>&lt;p&gt;&lt;strong&gt;This is an ongoing series:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/mrrcollins/tools-for-working-with-plain-text-files-my-plain-text-journey-part-ii-4803"&gt;📃 My journey into the plain text life - Intro&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/mrrcollins/my-journey-into-the-plain-text-life-intro-3082"&gt;🛠️ Tools for working with plain text files - My Plain Text Journey Part II&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/mrrcollins/syncing-my-notes-my-plain-text-journey-part-iii-2kf"&gt;🗃️ Syncing my notes - My Plain Text Journey Part III&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/mrrcollins/journaling-my-plain-text-journey-part-iv-5b9"&gt;📝 Journaling - My Plain Text Journey Part IV&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/mrrcollins/keeping-notes-my-plain-text-journey-part-v-1pec"&gt;✍ Keeping Notes My Plain Text Journey Part V&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/mrrcollins/tasks-and-to-dos-my-plain-text-journey-part-vi-50bg"&gt;✔ Tasks and To Dos My Plain Text Journey Part VI&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  My notes are not fancy
&lt;/h2&gt;

&lt;p&gt;This article can be condensed to “all of my notes are in my Notes folder”. Well, that isn’t quite correct, I do keep a Projects folder for notes that have a project in common.&lt;/p&gt;

&lt;p&gt;All of my notes are in Markdown format. Plain Jane, vanilla markdown. It does everything that I need, and nothing more. I also don’t have pictures or drawings in my notes. You could add them, but since git doesn’t really like binary files and I store my notes in git, I try to limit the amount of binary files I’ve added.&lt;/p&gt;

&lt;h2&gt;
  
  
  My notes/Notes folder
&lt;/h2&gt;

&lt;p&gt;If you’ve been following along with my plain text journey, you know that I keep everything in a folder unsurprisingly named &lt;code&gt;notes&lt;/code&gt;. So, to make things confusing, I put my plain text notes into a Notes folder. Note the capital &lt;code&gt;N&lt;/code&gt;. This folder contains files for each note that I take. Every 6 months to a year, I go in and archive notes that aren’t relevant anymore.&lt;/p&gt;

&lt;p&gt;Each note is a separate file in &lt;code&gt;Notes&lt;/code&gt; for the most part. I do have some notes such as &lt;code&gt;ideas.md&lt;/code&gt; in which I list different ideas. There is also a &lt;code&gt;tips.md&lt;/code&gt; file where I keep track of all sorts of cli/app/program tips. This file is a life saver, before I would have to Google each time I needed to do something I couldn’t remember.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating a note
&lt;/h2&gt;

&lt;p&gt;I use the following script named &lt;code&gt;nn&lt;/code&gt; to create a note:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash

## New Drafts
## Modified from GozNote
## Quickly create notes from the commandline or something like Alfred

if [$# -eq 0]; then
    echo "NewNote v.02"
    echo "Enter the name of the note as the argument"
    exit
fi

TITLE="$@"
AUTHOR="`whoami`"
DATE=`date +"%Y-%m-%d %H:%M"`

# Parameters for Vim to jump to the bottom of the file 
# and start in Insert mode
EDITOR="vim + +startinsert"
DEFAULTFOLDER="."
EXT="md"

# I originally prepended the date, but now I don't.
#PREPEND="`date +%Y-%m-%d`-"
PREPEND=""
SLUG=$(echo -n "${TITLE}" | sed -e 's/[^[:alnum:]]/-/g' | tr -s '-' | tr A-Z a-z)

#If the title begins with a 2, assume that it's a date 
#and set the title to everything after the first 11 characters.
if [["${TITLE:0:1}" == "2"]]; then TITLE=${TITLE:11}; fi

if [[! -f ${DEFAULTFOLDER}/${PREPEND}${SLUG}.${EXT}]]; then
    echo -e "---\nTitle: ${TITLE}\nAuthor: ${AUTHOR}\nDate: ${DATE}\nSlug: ${SLUG}\nCategory: \nTags:\nStatus: draft\n---\n\n" &amp;gt; "${DEFAULTFOLDER}/${PREPEND}${SLUG}.${EXT}"
fi

${EDITOR} "${DEFAULTFOLDER}/${PREPEND}${SLUG}.${EXT}"

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

&lt;/div&gt;



&lt;p&gt;Originally, I was setting the default folder in the script so I could create a note at the command line from anywhere, but I’ve switched it to making the note in the current folder. I run the script with the name of the note as the parameters: &lt;code&gt;nn Indepth review of the Atari Computer&lt;/code&gt;. The script creates a slug for a file name based on the name of the note and adds some frontmatter to the note. After running that command I could get a note named &lt;code&gt;indepth-review-of-the-atari-computer.md&lt;/code&gt; that looks 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;--------
Title: Indepth review of the Atari Computer
Author: goz
date: 2021-06-11T08:21:00-04:00
Slug: indepth-review-of-the-atari-computer
Category:
Tags:
--------

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Mobile
&lt;/h3&gt;

&lt;p&gt;On my iPhone I created a Shortcut that mimics my new note script. Once the note is created, I can open and edit it in iA Writer. Under Android, I do everything under Termux, so it works the same as if I was on my Linux box.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding and linking notes
&lt;/h2&gt;

&lt;p&gt;I don’t bother with linking between notes or dealing with searches. The default OS searches work well, or a simple &lt;code&gt;grep&lt;/code&gt; can be used to find a particular note.&lt;/p&gt;

&lt;h2&gt;
  
  
  Managing and archiving Notes folder
&lt;/h2&gt;

&lt;p&gt;Every so often I go through my Notes folder and move things to an Archive. In &lt;code&gt;notes/Archive&lt;/code&gt; I have a folder for each year, and I’ll move notes I no longer need into the archive folder of the year the note was created. There may be hundreds of notes, but I don’t really care. I can &lt;code&gt;grep&lt;/code&gt; or search for old notes that I may need.&lt;/p&gt;

&lt;h2&gt;
  
  
  Works on my system
&lt;/h2&gt;

&lt;p&gt;This works well for me. I can create or access my notes from any platform. What do you think?&lt;/p&gt;

</description>
      <category>plaintext</category>
      <category>notes</category>
      <category>bash</category>
    </item>
    <item>
      <title>💬 Using Telegram for notes, bookmarks, and more</title>
      <dc:creator>Ryan Collins</dc:creator>
      <pubDate>Fri, 04 Jun 2021 17:10:00 +0000</pubDate>
      <link>https://dev.to/mrrcollins/using-telegram-for-notes-bookmarks-and-more-3o68</link>
      <guid>https://dev.to/mrrcollins/using-telegram-for-notes-bookmarks-and-more-3o68</guid>
      <description>&lt;p&gt;&lt;em&gt;Photo by &lt;a href="https://unsplash.com/@ademay?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Adem AY&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/telegram?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It’s no secret that Telegram is my favorite instant messaging platform. The advantages are many, with the biggest being its cross-platformness (it’s a word now, I just used it). I can run Telegram on any of my devices and computers, easily sharing information, pictures, and other multimedia.&lt;/p&gt;

&lt;p&gt;Telegram offers unlimited storage, although the individual file size is limited to 2GB. More than enough space for bookmarks, notes, pictures, and videos that I may come across in my internet travels.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create some private groups
&lt;/h2&gt;

&lt;p&gt;I have started private groups called &lt;strong&gt;Notes&lt;/strong&gt; and &lt;strong&gt;Bookmarks&lt;/strong&gt; to save little bits of information that I come across throughout the day. These groups have only one member, me! Telegram by default creates a &lt;strong&gt;Saved Messages&lt;/strong&gt; group for you, but I like to break up the information. You could create a private group for each category. Do you like gardening? Create a private group called &lt;strong&gt;Gardening&lt;/strong&gt; and save your notes, bookmarks, and other information in it.&lt;/p&gt;

&lt;p&gt;These private groups are my “brain dump”, or a GTD inbox. They give me an easy way to save information. By lowering the friction to save, I have a better chance of actually saving the information.&lt;/p&gt;

&lt;p&gt;To create a private group, you have to invite at least one other person. I use my wife’s account for this. After the group is created, you can remove the other person so that you are the only member. Now you can save your stuff into your group.&lt;/p&gt;

&lt;h2&gt;
  
  
  Saving information
&lt;/h2&gt;

&lt;p&gt;On my iPhone, I use the &lt;em&gt;Share Sheet&lt;/em&gt; and save information directly to the group. On the desktop and laptop, I copy the information and paste it into the group. Under Android, I can use the built in share mechanism to send information directly to the group I want.&lt;/p&gt;

&lt;h2&gt;
  
  
  Access and searching
&lt;/h2&gt;

&lt;p&gt;Now I can access that information from any of my devices. The built in search of Telegram works well in this regard.&lt;/p&gt;

</description>
      <category>telegram</category>
    </item>
    <item>
      <title>📝 Journaling - My Plain Text Journey Part IV</title>
      <dc:creator>Ryan Collins</dc:creator>
      <pubDate>Fri, 28 May 2021 16:28:00 +0000</pubDate>
      <link>https://dev.to/mrrcollins/journaling-my-plain-text-journey-part-iv-5b9</link>
      <guid>https://dev.to/mrrcollins/journaling-my-plain-text-journey-part-iv-5b9</guid>
      <description>&lt;p&gt;&lt;strong&gt;This is an ongoing series:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/mrrcollins/tools-for-working-with-plain-text-files-my-plain-text-journey-part-ii-4803"&gt;📃 My journey into the plain text life - Intro&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/mrrcollins/my-journey-into-the-plain-text-life-intro-3082"&gt;🛠️ Tools for working with plain text files - My Plain Text Journey Part II&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/mrrcollins/syncing-my-notes-my-plain-text-journey-part-iii-2kf"&gt;🗃️ Syncing my notes - My Plain Text Journey Part III&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/mrrcollins/journaling-my-plain-text-journey-part-iv-5b9"&gt;📝 Journaling - My Plain Text Journey Part IV&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/mrrcollins/keeping-notes-my-plain-text-journey-part-v-1pec"&gt;✍ Keeping Notes My Plain Text Journey Part V&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/mrrcollins/tasks-and-to-dos-my-plain-text-journey-part-vi-50bg"&gt;✔ Tasks and To Dos My Plain Text Journey Part VI&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;A journal is a great way to remember things that happen, or to take note of something that may be useful in the future. They also let you reflect, giving you a better understanding of your life and where you are going. There are a number of journaling apps out there, but here is how I do mine with nothing more than a text editor.&lt;/p&gt;

&lt;h2&gt;
  
  
  My journal
&lt;/h2&gt;

&lt;p&gt;I’ve tried several different types of journals. Before I settled on the plain text life, my favorite was a password protect blog at wordpress.com. It’s still up with a bunch of entries, but I’ve found that plain text journaling works better for me.&lt;/p&gt;

&lt;p&gt;To organize my journaling, I create a file for each year in a folder caller Journal. For example, unsurprisingly my current journal is a file named &lt;code&gt;2021.md&lt;/code&gt;. Some like to create a file for each day. I tried that for awhile, but it just didn’t work for me. My editor of choice is Vim, and it handles files with 10s of thousands of lines without issue.&lt;/p&gt;

&lt;h2&gt;
  
  
  Organizing entries
&lt;/h2&gt;

&lt;p&gt;At midnight, I have a job that runs called &lt;code&gt;nextday.sh&lt;/code&gt;. The main location for my notes is on a virtual private server (VPS), which makes it easy to schedule jobs 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;#!/bin/bash

#Where is the journal
JOURNAL="/home/goz/notes/Journal/$(date +"%Y").md"

JDATE=$(date +"%D - %a")

# Sync, just in case
cd ~/notes
./notesync.sh

# Create a new day in the journal
echo -e "\n# ${JDATE}" &amp;gt;&amp;gt; ${JOURNAL}

# Sync, just in case
./notesync.sh

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

&lt;/div&gt;



&lt;p&gt;It adds the current date to the journal, along with the day of the week. I originally only put the date, but when looking back it is nice to know what day of the week an event happened. By including the day of the week I don’t have to consult a calendar.&lt;/p&gt;

&lt;p&gt;Each entry is prefaced with &lt;code&gt;YYYY/mm/dd HH:MM&lt;/code&gt;, which I create with an &lt;a href="https://espanso.com"&gt;Espanso expansion&lt;/a&gt;, an abbreviation in Vim (&lt;code&gt;iab &amp;lt;expr&amp;gt; dts strftime("%Y/%m/%d %H:%M -")&lt;/code&gt; lets me type &lt;code&gt;dts&lt;/code&gt; to insert a date time stamp), or an Ultisnip snippet with the Ultisnip plugin for Vim. If you use a different text editor, there is probably a way for you to easily insert the date and time stamp.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding entries
&lt;/h2&gt;

&lt;p&gt;I have three ways to add entries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;je&lt;/code&gt; function&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In my .bashrc I have a function named &lt;code&gt;je&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;je() {
    ENTRY=$1
    echo -e "\n`date +\"%Y/%m/%d %R\"` - ${1}" &amp;gt;&amp;gt; ~/notes/Journal/`date +"%Y"`.md
}

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

&lt;/div&gt;



&lt;p&gt;If you don’t want to add a function you could create a script and place it in your path. To add an entry I type &lt;code&gt;je "This is my entry"&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;j&lt;/code&gt; alias&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For longer or multiple entries I have an alias that launches Vim with my Journal, takes me to the end of the file, and puts me in insert mode:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;alias j='vim + +startinsert ~/notes/Journal/`date +"%Y"`.md'

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

&lt;/div&gt;



&lt;p&gt;** TelegramBot **&lt;/p&gt;

&lt;p&gt;I wish I could share this, but it’s not quite ready yet. The bot, which I call Brantley, has several features. One is the ability to append entries to my Journal. This makes adding entries as simple as sending a text message in Telegram.&lt;/p&gt;

&lt;p&gt;The bot runs on the same VPS as the scheduled job to mark a new entry for each day. I’ll be sharing it soon, so stay tuned!&lt;/p&gt;

&lt;h2&gt;
  
  
  Additional ramblings
&lt;/h2&gt;

&lt;p&gt;To help with entries, I’m experimenting with adding questions to be answered throughout the day. I’m not very consistent on answering the questions, so they usually get deleted, but sometimes I do answer them. These are added to the journal with additional cron jobs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Morning questions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At 5am, the following questions are added:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;YYYY-mm-dd 05:00 - Morning Routine

    My Daily Highlight:

    I am grateful for:
    1.
    2.
    3.

    What would make today great?
    1.
    2.

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

&lt;/div&gt;



&lt;p&gt;Under &lt;code&gt;What would make today great&lt;/code&gt; I only list things that I can control or do. It’s never, “I wish Jane would stop coming to my desk for chit-chat”. I write something like “I’m going to complete 3 tasks on my big project”.&lt;/p&gt;

&lt;p&gt;Here is the script I use to add the questions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash

nl=$'\n'

#Where is the journal
JOURNAL="/home/goz/notes/Journal/$(date +"%Y").md"
je=$(date +"%Y/%m/%d %H:%M")
echo "${nl}${je} - Morning Routine" &amp;gt;&amp;gt; ${JOURNAL}
cat &amp;lt;&amp;lt;EOT &amp;gt;&amp;gt; ${JOURNAL}

    My Daily Highlight: 

    I am grateful for:
    1. 
    2. 
    3. 

    What would make today great?
    1. 
    2. 

EOT

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Daily Affirmation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At noon the following gets added: &lt;code&gt;I am...&lt;/code&gt;. I try to write something positive about myself. Here’s the script I use to add that to the journal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash

nl=$'\n'

#Where is the journal
JOURNAL="/home/goz/notes/Journal/$(date +"%Y").markdown"
je="$(date +"%Y/%m/%d %H:%M")"
echo "${nl}${je} - Daily Affirmations" &amp;gt;&amp;gt; ${JOURNAL}
cat &amp;lt;&amp;lt;EOT &amp;gt;&amp;gt; ${JOURNAL} 
    I am...

EOT

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Evening routine&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At 7pm the following gets added to the journal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;3 Amazing things that happened today
1. 
2. 
3. 

How could I have made today better?

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

&lt;/div&gt;



&lt;p&gt;As with the morning questions, I answer these as things that I did or influenced. Trying to control others never works. To add these lines I schedule the following script at 7pm:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash

nl=$'\n'

#Where is the journal
JOURNAL="/home/goz/notes/Journal/$(date +"%Y").md"
je="$(date +"%Y/%m/%d %H:%M")"
echo "${nl}${je} - Nightly Routine" &amp;gt;&amp;gt; ${JOURNAL}
cat &amp;lt;&amp;lt;EOT &amp;gt;&amp;gt; ${JOURNAL} 
    3 Amazing things that happened today
    1. 
    2. 
    3. 

    How could I have made today better?

EOT

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

&lt;/div&gt;



&lt;p&gt;Like I said before, it’s nice to have these questions added, but it seems like I only answer them about half the time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Go forth and journal
&lt;/h2&gt;

&lt;p&gt;This is how I journal, not how you should journal. It has taken me a few years to get to the point where I’m comfortable with sharing how I do it. Hopefully there are some nuggets of wisdom that will help you along your journey!&lt;/p&gt;

&lt;p&gt;Do you do something differently? Or is there something that’s unclear? Let me know in the comments!&lt;/p&gt;

</description>
      <category>plaintext</category>
      <category>bash</category>
      <category>devjournal</category>
    </item>
    <item>
      <title>🔒 Encryption and storage made easy with Keybase</title>
      <dc:creator>Ryan Collins</dc:creator>
      <pubDate>Fri, 21 May 2021 14:35:00 +0000</pubDate>
      <link>https://dev.to/mrrcollins/encryption-and-storage-made-easy-with-keybase-l9p</link>
      <guid>https://dev.to/mrrcollins/encryption-and-storage-made-easy-with-keybase-l9p</guid>
      <description>&lt;p&gt;Are you looking for a way to securely store and share information? Then check out &lt;a href="https://keybase.io/"&gt;Keybase&lt;/a&gt;!&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Keybase?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://keybase.io/"&gt;Keybase&lt;/a&gt; is a messaging client with encryption, along with encrypted storage and encrypted sharing. By using public key cryptography, all data is secured and can’t be read by anyone, include Keybase themselves. Data in this context means your 1:1 chats, group chats, files, etc. are securely stored.&lt;/p&gt;

&lt;p&gt;The Keybase website also lets you encrypt information for Keybase users, allowing someone to send me information that only I can read.&lt;/p&gt;

&lt;p&gt;The final feature is identification. By leveraging the services you already use, you verify with Keybase who you are. You can check that out by &lt;a href="https://keybase.io/mr_rcollins"&gt;visiting my Keybase page&lt;/a&gt; and clicking on the various sites and services that I have verified with my account.&lt;/p&gt;

&lt;h2&gt;
  
  
  Clients
&lt;/h2&gt;

&lt;p&gt;There are clients for every Linux, Windows, and macOS, plus you can use it at the command line under Linux.&lt;/p&gt;

&lt;h2&gt;
  
  
  Chat
&lt;/h2&gt;

&lt;p&gt;Your chats are encrypted and viewable only by the other person (or persons) in the chat.&lt;/p&gt;

&lt;h2&gt;
  
  
  Storage
&lt;/h2&gt;

&lt;p&gt;Keybase offers 250GB of storage, along with encrypted git access which you can use to host encrypted git repositories. Folders in the storage can be shared with individuals, and are encrypted.&lt;/p&gt;

&lt;p&gt;Another nice feature of the storage is that your public folder is also available on the web. This makes it really easy to share files with others, they don’t need any account to download the file. If they have a Keybase account, you can share it encrypted, so only they can use the file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Crypto tools
&lt;/h2&gt;

&lt;p&gt;With Keybase you have the ability to encrypt, decrypt, sign, and verify messages. This works from their website, so the person sending you information doesn’t need a Keybase account. They can visit &lt;a href="https://keybase.io/encrypt"&gt;the encrypt page on the web&lt;/a&gt; and search for your account. Once they find it, they can enter their message and click &lt;strong&gt;Encrypt&lt;/strong&gt;. Now the message will be encrypted with PGP and they can email you the plaintext message. Only you will be able to decrypt the message.&lt;/p&gt;

&lt;p&gt;I use this all the time when I need someone to send me information securely. The person only needs to know how to fill out a pretty generic web form.&lt;/p&gt;

&lt;h2&gt;
  
  
  Teams
&lt;/h2&gt;

&lt;p&gt;Sure, you can use Slack or Discord to converse with your team, but if you want to do it securely, you’ll want to check out Keybase. Your team allows you to securely share information.&lt;/p&gt;

&lt;h2&gt;
  
  
  Git
&lt;/h2&gt;

&lt;p&gt;Keybase also supports the storage of encrypted repos. This uses a built in feature of git, so you can continue to use your favorite tools. The url changes to a keybase: url instead of ssh: or https://. It is normal git, nothing fancy like issue tracking or wikis.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting started
&lt;/h2&gt;

&lt;p&gt;Head on over the the &lt;a href="https://keybase.io/"&gt;Keybase website&lt;/a&gt; to sign up. One concern you may have is that Keybase was purchased by Zoom back in May 2020. The math is solid, so I’m not too worried, but it is something to be aware of.&lt;/p&gt;

&lt;p&gt;There are a ton of other features, but this is enough to get you started.&lt;/p&gt;

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