Mercurial Hosting > arkian
view src/computer_literacy/computer_literacy.html @ 27:9134d56639ae default tip
finish computer_literacy
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 09 Oct 2025 19:15:03 -0600 |
parents | fb87f762847e |
children |
line wrap: on
line source
<!doctype html> <html lang="en"> <head> <script src="/site.js"></script> <script> head() </script> <title>Arkian - Computer Literacy</title> <script> 'use strict'; let content = { intro: { title: 'Introduction', content: `\ <p>Computer literacy is a generally useful skill, and it helps with maintaining this website. Learning the basic skills taught here will give you a better understanding of your computer and will help you use it more effectively.</p> <p>I will often say "Do X" without saying how to do X. A big part of computer literacy is figuring out how to do things. Your two main resources are Google and AI's like ChatGPT and Claude.</p> ` , }, editor: { title: 'Text Editor and JSON', content: `\ <p>Many files on your computer are text files. These files contain simple text. You edit these files with a <a href="https://en.wikipedia.org/wiki/Text_editor">text editor</a>. <p>I reviewed the available text editors and I think <a href="https://www.sublimetext.com/">Sublime Text</a> is the best one available. So please download it and learn how it works.</p> <p><a href="https://en.wikipedia.org/wiki/JSON">JSON</a> is the most popular text data format. Do your own research on JSON to understand it. It is fairly simple.</p> <p>I paired Sublime Text with JSON because Sublime Text uses JSON files for its <a href="https://www.sublimetext.com/docs/settings.html">settings</a>. (Actually not quite pure JSON because it includes comments which are lines starting with <code>//</code>.) Experiment with Sublime Text settings to learn more about both Sublime Text and JSON.</p> ` , }, bash: { title: 'Bash - Command Line Shell', content: `\ <p><a href="https://www.gnu.org/software/bash/">Bash</a> is a <a href="https://en.wikipedia.org/wiki/Unix_shell">Unix shell</a> or <a href="https://en.wikipedia.org/wiki/Command-line_interface">command line</a>. Using the command line is like having a conversation with one's computer. Bash deals with basic concepts like files and directories. Using Bash will give you a much deeper understanding of your computer.</p> <p>There are many shells available but Bash is old and standard. None of the alternatives are better, so stick with Bash. For this lesson, please read <a href="bash.html">my tutorial</a>.</p> ` , }, regex: { title: 'Regular Expressions', content: `\ <p><a href="https://en.wikipedia.org/wiki/Regular_expression">Regular expressions</a>, or regex for short, are used for searching or matching text. This is a common need in programming, but is also useful for Bash which uses it in the <a href="https://en.wikipedia.org/wiki/Grep">grep</a> command.</p> <p>There are a few decent grep tutorials, so I don't have to write my own. Here they are:</p> <ul> <li><a href="https://vegastack.com/tutorials/regular-expressions-in-grep/">Regular Expressions in Grep</a></li> <li><a href="https://cs.nyu.edu/~mohri/unix08/lect4">Regular Expressions</a></li> <li><a href="https://www.gnu.org/software/grep/manual/grep.html">GNU Grep</a></li> </ul> <p>I suggest that you just read through these tutorials so that you get a sense for how regex and grep work. You don't need to practice anything here. You can come back to these tutorials later when you have a real need for regex or grep.</p> ` , }, hg: { title: 'Mercurial - Source Control', content: `\ <p><a href="https://en.wikipedia.org/wiki/Version_control">Source control</a> tracks changes to files. It is mostly used by programmers but is useful for anyone who wants to track changes in files. This website is in source control.</p> <p>The most popular source control software is <a href="https://git-scm.com/">Git</a>. Of course it is horrible since modern programmers only like horrible things. We use the less popular software <a href="https://www.mercurial-scm.org/">Mercurial</a>.</p> <p>Thankfully Mercurial is well documented. Read <a href="https://hgbook.red-bean.com/">Mercurial: The Definitive Guide</a> up to (and including) chapter 9.</p> <p>To get started with Mercurial, download Mercurial from <a href="https://www.mercurial-scm.org/">their website</a> and install it. Then do:</p> <code block> ~/learn $ hg version Mercurial Distributed SCM (version 5.2.2) (see https://mercurial-scm.org for more information) Copyright (C) 2005-2019 Matt Mackall and others This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ~/learn $ </code> <p>If this works, it is installed properly. Next <a href="https://hgbook.red-bean.com/read/a-tour-of-mercurial-the-basics.html#sec:tour-basic:username">set up your Mercurial configuration file</a> which is <code>~/.hgrc</code> on a Mac or <code>/c/Users/$(whoami)/mercurial.ini</code> on Windows <a href="https://www.msys2.org/">MSYS2</a>. My <a href="https://www.mercurial-scm.org/doc/hgrc.5.html">hgrc</a> file looks like this: <code block> [ui] username = Franklin Schmidt <fschmidt@gmail.com> [auth] hghosting.prefix = https://hg.reactionary.software/repo/ hghosting.username = fschmidt@gmail.com hghosting.password = xxxxxxxxxx [extensions] hgext.extdiff = [extdiff] cmd.dm = diffmerge </code> <p>You should register on <a href="https://hg.reactionary.software/">our Mercurial hosting service</a> and use your email as the username and the assigned password in <code>.hgrc</code>. The last two blocks set up <code>hg dm</code> to call <a href="https://sourcegear.com/diffmerge/">DiffMerge</a> by using the <a href="https://wiki.mercurial-scm.org/ExtdiffExtension">Extdiff extension</a>.</p> <p>Now you can play with <a href="https://hg.reactionary.software/repo/test/">https://hg.reactionary.software/repo/test/</a> like this:</p> <code block> ~/learn $ hg clone https://hg.reactionary.software/repo/test/ hgtest1 no changes found updating to branch default 0 files updated, 0 files merged, 0 files removed, 0 files unresolved ~/learn $ hg clone https://hg.reactionary.software/repo/test/ hgtest2 no changes found updating to branch default 0 files updated, 0 files merged, 0 files removed, 0 files unresolved ~/learn $ ls -Fd h* hgtest1/ hgtest2/ ~/learn $ cd hgtest1 ~/learn/hgtest1 $ touch file.txt ~/learn/hgtest1 $ e file.txt ~/learn/hgtest1 $ cat file.txt some text ~/learn/hgtest1 $ hg status ? file.txt ~/learn/hgtest1 $ hg add file.txt ~/learn/hgtest1 $ hg status A file.txt ~/learn/hgtest1 $ hg pull pulling from https://hg.reactionary.software/repo/test/ no changes found ~/learn/hgtest1 $ hg commit -m 'add file.txt' ~/learn/hgtest1 $ hg push pushing to https://hg.reactionary.software/repo/test/ searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files ~/learn/hgtest1 $ cd ../hgtest2 ~/learn/hgtest2 $ hg pull pulling from https://hg.reactionary.software/repo/test/ requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets aab34516d8dc (run 'hg update' to get a working copy) ~/learn/hgtest2 $ hg update 1 files updated, 0 files merged, 0 files removed, 0 files unresolved ~/learn/hgtest2 $ hg status ~/learn/hgtest2 $ cat file.txt some text ~/learn/hgtest2 $ e file.txt ~/learn/hgtest2 $ cat file.txt some text and more ~/learn/hgtest2 $ hg status M file.txt ~/learn/hgtest2 $ hg pull pulling from https://hg.reactionary.software/repo/test/ searching for changes no changes found ~/learn/hgtest2 $ hg dm ~/learn/hgtest2 $ hg commit -m 'and more' ~/learn/hgtest2 $ hg push pushing to https://hg.reactionary.software/repo/test/ searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files </code> ` , }, programming: { title: 'Programming', content: `\ <p>If you are interested in learning programming, you can continue with my <a href="https://www.reactionary.software/learn.html">reactionary programming course</a>.</p> ` , }, }; </script> </head> <body> <script> header() </script> <div content> <h1><a href="computer_literacy.html">Computer Literacy</a></h1> <hr> <h2>Contents</h2> <div toc> <script> showToc(content) </script> </div> <hr> <script> showContent(content,2) </script> </div> </body> </html>