Category Archives: All

All of the posts on this site.

Git Commands

Terminology

origin =

main =

master =

remote =

Head =

Headless mode =

Modified =

Staged =

Committed =

Connecting

Start the ssh agent:

eval $(ssh-agent)

To generate an SSH key:

ssh-keygen

To add the SSH key to the SSH client for use:

ssh-add id_ed25519_github

Informational Commands

Git can be a little intimidating at first because it has the power to change the files you are working on, so it’s good to start with commands that don’t do anything to get a feel for the situation before you actually do something.

git config --list

Shows useful information about the current repository. Shows the remote.origin.url variable for example.

git config --get remote.origin.url

Shows just the url associated with local git repository.

git config --list --show-origin

Shows ___.

git status

Probably the most common git command.

git diff

To see changes since the last commit. Or

git diff > gitdiff.txt

for a text file of the information.

ls -al ~/.ssh

To check for SSH keys (on Linux only I think).

git log --oneline

Is useful to see all the commits in a row with their commit messages. Or

git log --oneline --decorate --graph --all

for more detailed information.

git log -p filename.py > log.txt

Makes a file with the entire change history of filename. The -p is patch text. This is great for resurrecting “lost portions” of code and replaced the file I used to keep: “unused code.txt”

git branch -v -a

Lists all the branches including remotes, with the current branch highlighted in green plus an asterisk.

git branch --show-current

Shows just the current branch.

git tag -n1

Says to list all the tags and show 1 line of annotation per tag. Default is 0 lines of annotation.

git ls-tree -r trunk --name-only

Initial Set-Up Commands and Connecting to GitHub

Notice above command to check for existing keys.

The first step is establishing an SSH key on the machine to be connected to GitHub then copy the public key to GitHub. This is a pretty good description of how to do that. Notice Git bash in Linux is just the command line of a Linux machine with Git installed while on Windows you have to open the Git bash executable for a Git-specific terminal.

& 'C:\Program Files\Git\bin\sh.exe' --login

to open the Git command line.

git clone git@github.com:rr34/Astro.git

Notice the format of the remote url determines SSH versus https transfer. The above format is for SSH, which is required to commit changes because password identification was disabled for committing changes.

To initialize, navigate to the directory where your code is stored, and:

git init

to initialize git tracking of the directory.

git add

to add files. You can add one at a time to be selective or

? how to add all the files in the directory, then ignore?

Create repository on Github, then start committing to it:

git commit -am 'Initial commit.'

To set the location of the remote repository:

git remote add origin git@github.com:rr34/Astroclock.git

To change the branch name. -m would be --move, -M is --move --force

git branch -M trunk

To make your first push to the remote repository. -u is --set-upstream:

git push -u origin trunk

Daily “Save Your Work” is Commit

This is a pretty good list here, but it lacks informational commands.

git commit -a -m 'commit message here'

git push

Are the daily “save your work” commands.

Renaming a File

git mv old-filename.extension new-filename.extension

To rename a file, use git to rename it instead of renaming it manually. This allows git to track the rename instead of appearing to be “delete and add new.”

Deleting a File

git rm filename

To delete a file, use git to allow git to track the deletion. Don’t do it manually or it just shows up missing.

Revert a Single File to an Old Version

git checkout <commit ID> filename

There are various ways to do this (restore and revert maybe?) but I did it once like this and it worked. You have to be OK with losing any work in that file since the last commit. The point is it doesn’t affect the other files.

Branching

git branch <new-branch-name>

To create a new branch.

git switch <new-branch-name>

To switch to a different branch (same as the still-valid git checkout <new-branch-name>)

git checkout -b new-branch-name

To create a new local branch and switch to it in one command.

git push --set-upstream origin new-branch-name

? is that right, not just push?

How to create a branch on GitHub here.

Tagging

git tag -a v1.0.0 ec595fb -m 'message here'

then

git push origin v1.0.0

to tag a past commit. Version naming convention is [Major].[Minor].[Patch]

Merging

To merge, create a pull request on GitHub, then compare and merge. It’s pretty self-explanatory, THEN to update your local repository:

git fetch

because you made changes to the GitHub version, but not your local version, so the changes have to be fetched (opposite of push I think?)

git switch main

to switch to the main branch, and you should see a message saying the local main is behind origin/main, then

git pull

to pull the commits into the local branch. Merge complete.

Remote Repository (GitHub Usually)

git remote -v

lists the remote repositories.

git remote set-url origin git@github.com:rr34/Astro.git

allows you to change the remote url for the origin.

GitHub-Specific Features

The following are features in GitHub only, not classic command line Git:

  • Releases – but tags are command line and also a way of doing releases.
  • Pull requests

What Will Cause the Apocalypse?

Had I really not published this post before? Here is my speculation on what will cause the (next) apocalypse / collapse of civilization. In order of likelihood:

Why ask this question, you ask? Apocalypse is a surprisingly entertaining subject for us. I ask, why are we all interested in it?

  1. Apathy: the builders of society get bored when we can’t reach new highs and we just let it go. Like a little boy playing with Legos, the world is built by men. How long does a Lego structure last? The bigger it is the funner it is to destroy. How long does a dollhouse last within sight of a young boy? We should enjoy our tower while it stands!
  2. Zombies: zombies have already caused one apocalyptic civilization collapse. The only question remaining is, could they end us entirely?
  3. Disease*: disease is ancient and kills by numbers even bigger than millions or billions. Disease kills by the percentage of population. Disease is our most ancient enemy and far-underrated as it is invisible and not glamorous or sensational.
  4. Nuclear war: nukes are powerful and most people don’t even realize how powerful. Fusion bombs make Hiroshima and Nagasaki look tiny.
  5. Global Carbon Transfer (commonly mis-labeled as “global warming” or “climate change): this I believe is unlikely to cause our end. I think we are being overly-optimistic to imagine that we will thrive long enough for this to get us.
  6. EMP: again I think it’s optimistic to believe we will last long enough for an electromagnetic pulse to get us. Plus, one-time catastrophes like an EMP are sensational but not nearly as crushing as grinding sickness that can slowly erode resolve over years, decades, centuries.
  7. Flood, Earthquake, Asteroid, Volcano, Fire, Storm: wouldn’t be the first time for some of these, but could any of them really take us out? An asteroid certainly could, but it’s pretty sensational.

*COVID has brought disease to our attention but the COVID response has mostly highlighted our unprecedented inability to actually do something. Lose weight? Strengthen ourselves in the face of disease? None of that. This could be a wake-up call to get healthy.

Computer Architecture, Terminology, Classification

Computer Architecture = Instruction Set Architecture (ISA) = Processor Architecture

At its lowest level, software must execute code properly on the processor chip itself. Processor architecture is standardized to allow for code to be written and compiled that works across many individual models of chips. Some common architectures with examples are:

IA-32

IA-32 is the 32-bit version of Intel’s x86 architecture.*

*Notice x86** does not by itself specify an architecture, it is a family of Intel architecture that includes everything from 16-bit released in 1978 to modern 64-bit.

**Note, the x86 Wikipedia article has a good explanation of which chips generally use which ISA.

  • The Intel 80386 microprocessor released in 1985 was the first commercial 32-bit processor.
X86-64 = X64 = X86_64 = AMD64 = INTEL 64

Released by Intel in 2003, 64-bit began to replace 32-bit.

  • Intel Pentium 4 F series.
ARMV8-A

ARMv8-A is the first 64-bit version of the ARM architecture. ARMv8-A is AArch64, which is the same as ARM64.

ARM is a double-acronym. RISC stands for Reduced Instruction Set Computing. All together, ARM stands for “Advanced Reduced Instruction Set Computing Machine.” The ARM architecture in general is maintained by ARM Ltd. in Cambridge, UK.

  • The ARM Cortex-A53 in the Raspberry Pi Zero 2 W uses ARMv8-A and is considered 64-bit.

Operating Systems Classified by ISA

Raspberry Pi OS

Currently, Raspberry Pi does not offer a 64-bit OS, but a beta 64-bit OS is in work and already available for download from the official library.

In a Linux command terminal, you can see processor information including architecture with the command:

lscpu

From Windows PowerShell, you can see processor information including architecture with the command:

systeminfo

Get-WmiObject Win32_Processor

Time v3 and Daylight Savings Time

There is a certain a group of people who hates the daylight savings time change because it “arbitrarily disconnects us from nature.” One day we wake up and the sun is up. The next day we wake up at the “same time” and it is dark (or vice versa when we go off daylight savings time).

To my timekeeping-conscious friends out there, we have something in common: a dislike of brutish machine timekeeping. However, I believe what we really dislike is industrial timekeeping as a whole, not just daylight savings time. The daylight savings time change is like a tiny semiannual glitch in the matrix of industrial timekeeping that draws our attention just enough to feel something is wrong but passes before we really focus the energy to investigate the true enormity of the problem.

The problem is industrial time – since the 18th century – and the solution is Time v3.

Ebola, How Bad?

No sources, but I am unaware of any dispute in the following quick summary:

Really Bad

  • Ebola causes internal and even external bleeding.
    • (The book The Hot Zone describes the virus “liquefying organs,” but this description is widely regarded as overly-sensational to the point of being inaccurate).
  • Very high fatality rate and recovered patients experience ongoing symptoms.
  • Ebola is known to lay dormant within individual human organs for many years.
  • The latest outbreaks are believed to have originated from recovered patients from previous outbreaks in whom the virus lay dormant for years.
  • Scientists believe it is theoretically possible for an Ebola virus to become airborne.

“Not So Bad”

  • As yet, Ebola has been contagious only by bodily fluid contact so outbreaks are almost always contained to just a few hundred people.
  • Infected persons are contagious only when symptomatic and the symptoms are too extreme to ignore. Little or no asymptomatic spread.

Snitch Lines

Citizens in Delaware Ohio and Columbus Ohio are encouraged to snitch on each other, even anonymously, for not covering their face or for large gatherings. Fact.

Delaware Ohio

To snitch in Delaware, go to this address:

https://delawarehealth.org/covid-19/

or call the hotline at 833-427-5364

Delaware is seeking mask snitching specifically:

Columbus Ohio

To snitch in Columbus, call 614-645-3111, or go to this address:

https://311.columbus.gov/311_main.aspx

and submit a service request.

Columbus is more concerned with gatherings, both indoors and outdoors, which are “violations”:

Gathering and mask snitching is currently the #10 service request in Columbus:

Celestial Movement: Know Less Understand More

The following are true and do not change perceptibly over an entire human lifetime.

  • The non-sun stars do not move relative to each other. Not now, not over thousands of years, not anytime we will ever know about. The stars remain a fixed spherical image we gaze out at from the inside.
  • The north star and southern cross remain in the same positions in the sky and do not move relative to an observer on Earth, even as Earth rotates. They mark the axis of rotation of Earth. Correct, they do not move at all. You could build a structure pointed at the north star one night and if the structure doesn’t move, it points at the north star day and night season after season year after year forever, whether you can see the north star or not, it’s there. (The structure would be called a gnomon, if you care).
  • All of the non-sun stars/constellations remain in the exact same latitude and therefore trace the exact same line through the sky each time Earth rotates, every day of our lives, no exceptions. The line a star traces through the sky at your location peaks at 90° – [your latitude] + [latitude of the star] always.
  • Earth’s rotational axis is not tilted. Earth’s orbital plane around the sun is tilted! When orienting celestial objects, we are forced to choose what we consider “upright.” Earth’s gravity cannot dictate “upright” for celestial objects. If you imagine Earth’s rotational axis as upright, the north star remains fixed as “north” or “up” and the orbital plane is then tilted 23° meaning Earth “moves north and south” as it orbits, or moves “up and down.”
  • The sun. slightly more complicated, but helpful because the sun is bright. What is a line of latitude? What does a line of latitude look like? The blindingly bright sun traces a line of latitude through the sky every day. On equinox days, the sun traces the 0° line of latitude (celestial equator) and on the solstices the sun traces the +/- 23.4° line of latitude. In between, the sun gradually traces lines of latitude from 0° to 23.4° to 0° to -23.4° and back to 0° again throughout the year. Each day the sun traces a slightly different line of latitude as Earth orbits.
  • Nobody is good at three-dimensional spherical-angle geometry! Nobody! Astronomers are not good at it. Nobody is! Then why does the current zodiac constellation represent the constellation behind the sun that we cannot see?? Because nobody is good at three dimensional geometry! Astronomers for millennia past and still today use the sun as a “pointer.” Nothing in the sky points like the sun. The sun is such a bright “pointer” that you cannot see what is behind it – but remember that the stars do not move relative to each other so if you have some idea of what the starry sky looks like, and you know the current zodiac constellation, you can reference the rest of the starry sky off of the sun itself. “Pisces is shining bright this month!” True statement – even though Pisces is only up during the day because looking forward the sun means looking toward the current zodiac constellation. We are currently in Pisces. “The sun pointer is moving toward the constellation Aries.” Another true statement. The line the sun traces through the starry background as we orbit is called the “ecliptic.”

Once you have some firm ground to stand on, you can start to remember some more basics and build. If you get confused, re-read the above and remind yourself that many things in the sky do not change!

  • Orion, the most widely-recognized constellation, is on the celestial equator. Therefore Orion rises directly east and sets directly west. Orion is “up” ~12 hours and “down” ~12 hours. Orion’s path peaks at 90° – [your latitude] above your horizon (directly overhead the equator). Also, Orion is visible from everywhere on Earth.
  • Orion is directly south of the border of Taurus and Gemini. The Taurus Gemini border marks the northern hemisphere summer solstice, so on the summer solstice the sun points near Orion. On the winter solstice, Orion is high in the sky at midnight.
  • Polaris, the north star, is located directly north at [your latitude]° above the horizon, always. Most people use the Big Dipper to find Polaris.
  • The two stars in the Big Dipper aligned with Polaris point to the ecliptic at Leo near its border with Virgo, so near the sun’s location at the autumnal equinox.
  • The Milky Way’s bright galactic center is among Sagittarius, specifically Sagittarius A. It is 29° south of the celestial equator so therefore peaks at 61° – [your latitude] in your sky (more visible in southern hemisphere). Being near the northern hemisphere winter solstice, it is most visible in northern hemisphere during summer.