Christian Remnant Now / ๐Ÿ’ป Unix

โ€œHacking3โ€

๐Ÿ”

My son, fear thou the LORD and the king: and meddle not with them that are given to change: Prov 24:21

Page Contents:

  1. Unix
  2. Tools & Applications
    • [Text] Universal Interface
      • Dict Very simple, very powerful
      • Markdown Easy to master, does not get in the way, opens many doors
      • Vim Takes a bit to master, worth every investment in time you give it
    • [Database] Flat, Relational, or Hierarchical, choose wisely
      • /rdb Turns the shell into a 4GL
      • Sqlite Worlds number one database, by far
      • Visidata Swiss Army Knife of data tools!
    • DosBox Hey! Who put that on this page? ๐Ÿค“
  3. Scripts
    • Web scripts Used to create and manage this site
    • Web Stats ๐Ÿ“Š Mostly for me to get a quick peek
  4. Config files Little bit of this and that, some UI tweaks
  5. cli kjv Always keep at hand for real problems
  6. Unix Fun ๐Ÿ‘พ
  7. Unix Links ๐Ÿ”—
  8. Unix Software ๐Ÿ”—
  9. Quick References ๐Ÿ“–
  10. Tech books I like ๐Ÿ“–

๐Ÿ’ก Tip: ๐Ÿ“ฐ Tech News


๐Ÿ“ Personal Note:

I am a born again, old school hacker. Not like what you see portrayed in the movies, breaking into government computers and stealing information. But real hackers are folks who like to learn about technology and modify it for their own use. Any technology, not just computers. I worked for 30+ years with Unix systems. Now I just handle mailing lists for a printing company, in North Dakota (not much tech here).

But I still love to use UNIX/Linux (I will mix the terms going forward, get use to it). I write code for my personal use, just for fun. I also maintain this website and use it to study the Bible. see About

Side note: Background is โ€œgreen-barโ€ like the old computer lab paper.

When I was in the IT work place, it was as:

Listed now in Wiby!

๐Ÿง  UNIX - A computer operating system

Those who do not understand Unix are condemned to reinvent it, poorly.

โ€œThis is the Unix philosophy: Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface.โ€ - Douglas McIlroy, former head of Bell Labs Computing Sciences Research Center

Dilbert Unix Comic.png โ€œDilbert Unix Comicโ€

Why I like Unix

I was thinking about this today (7/27/2021), as I was changing the lm script. I donโ€™t even remember the place I got it from anymore. But I used it and thought it was handy. Then I wanted some color, so I changed it. Then I wanted mp3 files supported. Next I added a total play time. This last mod happened when I tried to point to another directory and it did not support it.

It (Unix) allows me to do what I want, the way I want it, when I want it. Its free, powerful, not a resource pig, and once you master the shell, you can do just about anything you can think of. It puts the power in the users hands.

I started this website with some basic understanding of HTML, and decided to use Markdown to keep it simple. The more I worked with the site, it became a hassle. So I wrote some scripts, (site and web) to manage it. Then modified .vimrc to support Markdown macros I wanted. Now it takes me a couple of minutes to manage the site. Most of it is completely automated.

Oh, and the cost? FREE!

See: Introduction to Unix/Linux for more information as to why you should consider it.

I have been using UNIX or some variant of it for most of my life. I have used many flavors over the years. This is a sampling of my personal favorites:

History of UNIX

Magazineโ€™s

ATT archives: The Unix Operating System Duration: 00:27 Posted: 06/26/21

Unix pipeline Brian Kernighan Computerphile Duration: 00:05 Posted: Thursday 08/26/2021

SunOS Unix Nostalgia Duration: 00:02 Posted: 06/26/21

Coherent 4 Duration: 00:05 Posted: 06/26/21

BBS: The Documentary Episode 1 of 8 Baud The Beginning Duration: 00:39 Posted: 06/30/21

๐Ÿ”— UNIX videos and the rest of the BBS documentary.

Unix is basically simple operating system, but you have to be a genius to understand the simplicity.

๐Ÿ”

Text: The word โ€œswordโ€ is simply putting an โ€œsโ€ before โ€œword.โ€

โ€œHacking2โ€

โœ”๏ธ Dict

A Dictionary Server Protocol

The Dictionary Server Protocol (DICT) is a TCP transaction based query/response protocol that allows a client to access dictionary definitions from a set of natural language dictionary databases.

Or just use curl:

 curl dict.org/d:33612
220 dict.dict.org dictd 1.12.1/rf on Linux 4.19.0-10-amd64 <auth.mime> <277847552.2469.1708605145@dict.dict.org>
250 ok
150 1 definitions retrieved
151 "33612" gaz2k-zips "U.S. Gazetteer Zip Code Tabulation Areas (2000)"
33612 -- U.S. ZIP code
   Municipality (1990):  TAMPA, Florida
   All ZIPs for this municipality (1990):
                         33602 33603 33604 33605 33606 33607
                         33608 33609 33610 33611 33612 33613
                         33614 33615 33616 33617 33619 33620
                         33625 33626 33629 33634 33635 33637
                         33647
   Population (2000):    42961
   Housing Units (2000): 19145
   Land area (2000):     10.212845 sq. miles (26.451145 sq. km)
   Water area (2000):    0.177965 sq. miles (0.460928 sq. km)
   Total area (2000):    10.390810 sq. miles (26.912073 sq. km)
   Located within:       Florida (FL)
   Location:             28.048595 N, 82.451716 W

.
250 ok [d/m/c = 1/0/44; 0.000r 0.000u 0.000s]
221 bye [d/m/c = 0/0/0; 0.000r 0.000u 0.000s]
๐Ÿ”

๐Ÿ–Š Markdown

A simple markup language that can be used with Vi (or Vim)

This is what I use to maintain my website, keep all of my notes (technical, Bible, personal), and write in. It can be easily converted to HTML, PDF, docx, etcโ€ฆ

Please note: If you clink on the page title at the very top of each page, it will display the markdown source. Click here to see the CSS

Also note: My bash web scripts and .vimrc are setup for markdown development.

๐Ÿ’ก Tip: Some sites with tools and information on it

Some markdown examples and documents

title.txt contains:

---
title: CRN's Recipes
author: Mitchell Johnston
rights:  Creative Commons Non-Commercial Share Alike 3.0
language: en-US
...

Christian Remnant Nowโ€™s AV Bible in HTML

CRNโ€™s AV Bible in HTML PDF EPUB

Note: This implementation of the King James Bible works well with text mode browsers like Lynx.

How to integrate script output (plain text) simply using iframes:

Cron entry:

0,30 * * * * /home/mitch/bin/conky-weather >/var/www/clock/weather.html

Script:

#!/bin/bash

echo '<pre>'
ansiweather -a false|tr '-' '\n'|sed -e "s/Weather/$(date +%R)/" -e "s/Lisbon/Temp/g" -e "0,/in/s//\n/"
echo " "
ansiweather -a false -f4 |sed -e 's/Lisbon forecast: //g' -e 's/-/  \n/g'  -e 's/Lisbon forecast => //g'|tail -4
echo '</pre>'

Added to header for page:

<script>
  function resizeIframe(obj) {
    obj.style.height = obj.contentWindow.document.documentElement.scrollHeight + 'px';
    obj.style.width = obj.contentWindow.document.documentElement.scrollWidth + 'px';
  }
</script>

Added to markdown:

<p>
<iframe src="/clock/weather.html" scrolling="no" onload="resizeIframe(this)" frameBorder="0"></iframe>
</p>

Sample output:

Plus:

The Easiest Way To Make Presentations Pandoc Markdown Duration: 00:08 Posted: 2019-04-23

๐Ÿ”

tips

Vimassistant.gif โ€œVimassistantโ€

Vim Tips You Probably Never Heard Of Duration: 00:12 Posted: 2021-07-17

Copy And Paste To From Vim From To Other Programs Duration: 00:07 Posted: 2023-08-26

How To Use Vim G Duration: 00:12 Posted: 2023-08-26


Q: How do you generate a random string?

A: Put a Windows user in front of vi, and tell them to exit

Vi Exit.jpg โ€œVi Exitโ€

๐Ÿ”

Databases: Connecting The Dots

โ€œDbโ€

My long time favorite DB is /rdb, not the one on this site. The commercial one written ANSI C. It is no longer produced, and I do not have the source (I do own the original docs, and related book). So now I use SQLite for most needs.

Databases, and text processing is what Unix does best. Learn some shell, Markdown, and SQLite, and you will find very little you canโ€™t do.

On a side note: Look at Nutshell Plus database in DosBox See old review


The Computer Chronicles: Easy To Use Databases Duration: 00:26 Posted: 06/05/21

๐Ÿ”

๐Ÿ—ƒ๏ธ /rdb

โ€œRdbโ€

A relational database that turns the shell into a 4gl.

If you are interested in data science then you should look at this book: - ๐Ÿ”— Data Science at the Command Line

If you want some data to play with in a few formats look at Data.gov

This still works, on systems today! A couple names conflict so add before /usr/bin in PATH. I run it on Linux Mint, and Android under Termux

The following files contain tab separated text databases that can be used with /rdb.

CSV files to play with

๐Ÿ”

๐Ÿ—ƒ๏ธ Sqlite (Small, fast, reliable, choose any three!)

SQLite is the most used database engine in the world.

Donโ€™t forget to see the SQL section on the links page. It has some good resources.

sqlite files to play with

๐Ÿ’ก Tip:

webster(){ ## Lookup in Webster's 1828 via sqlite
sqlite3 -batch ~/db/websters-1828.sqlite <<SQL | sed "s/\b$1\b/${BG}$1${N}/I"|less -F
.headers off
.mode line
select * from Dictionary where Topic LIKE "$1";
.quit
SQL
}

Beginners Tutorial On Sqlite3 In The Linux Shell Part 1 Duration: 00:20 Posted: 2023-05-25

Beginners Tutorial On Sqlite3 In The Linux Shell Part 2 Duration: 00:11 Posted: 2023-05-25

Beginners Tutorial On Sqlite3 In The Linux Shell Part 3 Duration: 00:14 Posted: 2023-05-25

Beginners Tutorial On Sqlite3 In The Linux Shell Part 4 Duration: 00:08 Posted: 2023-05-28

๐Ÿ”

๐Ÿ‘“ Visidata (Free data viewer/searcher for CVS, TSV, JASON, and more)

โ€œVisidata.orgโ€

One of my favorite tools for data, I use it for quick searches and data extraction and conversion. It does so much more. It supports Markdown as well!

Visidata Lightning Demo Duration: 00:04 Posted: 2024-02-13

๐Ÿ”

๐Ÿ“œ Some of my scripts

Uf009527.gif โ€œUf009527โ€

See: ct() in .bashrc Itโ€™s a cooking/coffee timer. Also See: Old Mac Video on Coffee. ๐ŸŽฌ Java Noir 23M

Where there is a shell, there is a way.

You can find my basic template for bash here: bash template. I use my own tool to manage templates, not vim. I wrote it for vi, back in the day and still use it.

๐Ÿ’ป Code:

while :; do line; sleep .02; done # fun little display

lm sample output:

00:10:14.66 ๐ŸŽฅ the-benefits-and-uses-of-fuchsias.mp4
00:20:35.82 ๐ŸŽฅ a-2007-document-shows-the-pandemic-was-a-corporatist-coup.mp4
00:20:46.06 ๐ŸŽฅ immunology-is-not-science-a-eye-opening-look-at-the-science-.mp4

Total: 0:51:37

๐Ÿค“ (L:1 J:0) [mitch๐ŸŒ€mitch-crn] ๐ŸŽฌ /var/www/include/vids/clips/sat
End sample output

This calls a script named now (see below), that displays the weather, calender with highlighted current date, and time.

To the Unix purist, who are amazed that I would write and used menus: If I do it all the time, I automate it. Why have many small scripts, and aliases when I can come up with a clever solution? Besides, I enjoy writing code!

๐Ÿ“œ Scripts from others (more to come as I have time)

๐Ÿ”

Web scripts used to create and manage this site

๐Ÿ”‘ This website is made from markdown files. I wrote the following scripts to make it easy for me to manage it. I often change them when I think of a better way to do something, or to address an issue I run into. Like all of my scripts on this page, I did not write them for public consumption. With that said I have attempted to keep them readable, and commented. A lot of them will auto install requirements with apt. This is because I can copy them and have them work without much to think about on my side. Please note: I use Pandoc as the back end for markdown conversion.

๐Ÿ’ก Tip: I do not have ANY CGI, the entire site in static, manually updated with the scripts below. It cracks me up to watch my logs (lnav), and see all the hacking attempts. People really want to take this site down. They go after, PHP, SQL, WordPress, MySQL, and more.

See also: readme MD sitemap

Sitemap made via crontab entry: 0 0 * * * cd /var/wwww;tree . -d -L 4 -H http://crn.hopto.org -o sitemap.html

๐Ÿ’ป Code:

If you want to use my system and need some help, feel free to email me. If you find a bug or want a feature, you can contact me as well. Just keep in mind I wrote this for my own use.

๐Ÿ”

๐Ÿ“Š Stats (updated every 1/2 hour)

homepage

homepage


sar -s $(date -d โ€œ2 hours agoโ€ +%H):00:00

๐Ÿ”

๐Ÿ“Ž My settings

Neofetch sample display

โ€œNeofetchโ€

๐Ÿ”
๐Ÿ”

๐Ÿ’ป DosBox

โ€œMsdos2โ€

I used Dos back in the day and I decided to build a DosBox environment to run some of the classics

You can run DosBox on Windows 10, Linux, and even on Android.

I have installed and configured:

๐Ÿ”

๐Ÿ“œ New Linux CLI KJV Bible!

I added a version of the KJV for Linux, you need to compile it from ๐Ÿ—œ๏ธ source.

kjv can be built by cloning the repository and then running make:

git clone https://github.com/bontibon/kjv.git 
cd kjv
make

Place in your search path or ./kjv, kjv -h (displays help).

I like this one better than the one that installs from apt, it works better for integrating it into .vimrc.

๐Ÿ”

๐Ÿ‘พ UNIX/Geek fun

Johnny Castaway Screensaver Duration: 00:36 Posted: 2023-08-22

I told my wife she should embrace her mistakesโ€ฆ She hugged me.

The links page has some web based distractions/fun.

To see this site in textonly as it would be in lynx: crn.hopto.org

๐Ÿ‡ Follow the white rabit Double-click for color effect

RFCโ€™s Really Fun Comments

File Description
rfc968 ..... Twas the Night Before Start-up
rfc1097 ..... TELNET SUBLIMINAL-MESSAGE Option
rfc1149 ..... IP Datagrams on Avian Carriers
rfc1216 ..... Gigabit Network Economics and Paradigm Shifts
rfc1217 ..... Consortium for Slow Commotion Research
rfc1438 ..... Internet Engineering Task Force Statements Of Boredom
rfc1607 ..... A VIEW FROM THE 21ST CENTURY
rfc1925 ..... The Twelve Networking Truths

Pictures

Console Screen Savers and Wrapper

I hang out in the shell all the time and so have come up with a way to have a โ€˜screen saverโ€™. It is manually called by a script called โ€˜sโ€™ (why type more?). My โ€˜menuโ€™ script listed above has a timeout value, so if you do not select anything, it will auto run โ€˜sโ€™.

Games scripts

I have collected a little sample of some of the better games written in scripting languages. I have enjoyed using them over the years.

If someone with better perl skills wants to add an ending (win/loose) to this, send me the updated one to post.

Code

struct ComputerContractor
{
    double    salary;
    long      lunches;
    float     jobs;
    char      unstable;
    void      work;
    int       hiring_him_again;
    const     pain_in_the_arse;
    unsigned  agreement;
    short     fuse;
    volatile  personality;
    static    progress;
};

// and there are no unions in sight
๐Ÿ”

๐Ÿ’ก Tip: Windows and Mac users

People say that if you play Microsoft CDโ€™s backwards, you hear satanic things, but thatโ€™s nothing, because if you play them forwards, they install Windows.

MobaXterm Enhanced terminal for Windows with X11 server, tabbed SSH client, network tools and much more

โ€œMobaxtermโ€

๐Ÿ”


๐Ÿ“ฆ Good Sources

Dt211207.gif โ€œDt211207โ€

๐Ÿ”

Updated: Tue 18 Feb 2025 11:41:54 AM CST