Frontier Software

External Utilties

These are utilities that often don’t come included in various Linux distributions. Arch Linux tends to put them in the extra folder

jq

type

$(jq '.performer | type' <<<"$schema")

type can be null, boolean, number, string, array or object.

has(key)

https://github.com/shngli/Database-apps/tree/master/SQL

create table College(cName text, state text, enrollment int);
create table Student(sID int, sName text, GPA real, sizeHS int);
create table Apply(sID int, cName text, major text, decision text);

insert into Student values (123, 'Amy', 3.9, 1000);
insert into Student values (234, 'Bob', 3.6, 1500);
insert into Student values (345, 'Craig', 3.5, 500);
insert into Student values (456, 'Doris', 3.9, 1000);
insert into Student values (567, 'Edward', 2.9, 2000);
insert into Student values (678, 'Fay', 3.8, 200);
insert into Student values (789, 'Gary', 3.4, 800);
insert into Student values (987, 'Helen', 3.7, 800);
insert into Student values (876, 'Irene', 3.9, 400);
insert into Student values (765, 'Jay', 2.9, 1500);
insert into Student values (654, 'Amy', 3.9, 1000);
insert into Student values (543, 'Craig', 3.4, 2000);

insert into College values ('Stanford', 'CA', 15000);
insert into College values ('Berkeley', 'CA', 36000);
insert into College values ('MIT', 'MA', 10000);
insert into College values ('Cornell', 'NY', 21000);

insert into Apply values (123, 'Stanford', 'CS', 'Y');
insert into Apply values (123, 'Stanford', 'EE', 'N');
insert into Apply values (123, 'Berkeley', 'CS', 'Y');
insert into Apply values (123, 'Cornell', 'EE', 'Y');
insert into Apply values (234, 'Berkeley', 'biology', 'N');
insert into Apply values (345, 'MIT', 'bioengineering', 'Y');
insert into Apply values (345, 'Cornell', 'bioengineering', 'N');
insert into Apply values (345, 'Cornell', 'CS', 'Y');
insert into Apply values (345, 'Cornell', 'EE', 'N');
insert into Apply values (678, 'Stanford', 'history', 'Y');
insert into Apply values (987, 'Stanford', 'CS', 'Y');
insert into Apply values (987, 'Berkeley', 'CS', 'Y');
insert into Apply values (876, 'Stanford', 'CS', 'N');
insert into Apply values (876, 'MIT', 'biology', 'Y');
insert into Apply values (876, 'MIT', 'marine biology', 'N');
insert into Apply values (765, 'Stanford', 'history', 'Y');
insert into Apply values (765, 'Cornell', 'history', 'N');
insert into Apply values (765, 'Cornell', 'psychology', 'Y');
insert into Apply values (543, 'MIT', 'CS', 'N');

Converted into Json using https://beautifytools.com/sql-to-json-converter.php and stored in students.json

nc

Netcat (nc) allows us to write a simple http server in Bash.

Though nc was a traditional part of Unix, Linux distributions don’t tend to include it. I installed openbsd-netcat rather than gnu-netcat since it seems to be more actively maintained.

A nice tutorial which got me started is Building a Web server in Bash. Besides nc, this introduced me to named pipes created with mkfifo.

A simple manpage webapp written in Bash

For my first webapp, I want to create a manpage reader.

hq

Github

git

Setting up a repository on the server

# mkdir /srv/git/projectname.git
# git --bare init /srv/git/projectname.git
# chown -R git:git /srv/git/projectname.git

$ git config --global --add safe.directory /srv/git/poopsheet.git
git pull --rebase
git rebase --abort

Learning git

git help
git help tutorial
git help everyday
git help revisions
git help workflows

GitHub manual

full commands list

Atlasian Tutorial

configuration

Default .git/conf

[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[remote "origin"]
        url = /srv/git/myprojectname.git
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
        remote = origin
        merge = refs/heads/master

Assume the following history exists and the current branch is master:

tree

man page

Before I discovered the tree command, I wasted huge amounts of time manually making grapic directory listings.

$ tree ~/webapps/frontiersoftware
/home/roblaing/webapps/frontiersoftware
├── archetypes
│   └── default.md
├── assets
├── config
│   └── _default
│       └── hugo.json
├── content
│   ├── bash
│   │   ├── coreutils
│   │   │   ├── _index.md
│   │   │   └── sed
│   │   │       ├── index.md
│   │   │       └── spec
│   │   │           ├── basics_spec.sh
│   │   │           ├── deleting_lines_spec.sh
│   │   │           ├── inserting_lines_spec.sh
│   │   │           ├── printing_spec.sh
│   │   │           ├── spec_helper.sh
│   │   │           └── substitution_spec.sh
│   │   ├── extra
│   │   │   ├── _index.md
│   │   │   └── tree
│   │   │       └── index.md
│   │   ├── _index.md
│   │   └── util-linux
│   │       └── _index.md
│   ├── hugo
│   └── _index.md
├── data
├── i18n
├── layouts
│   ├── _default
│   │   ├── baseof.html
│   │   ├── list.html
│   │   └── single.html
│   └── shortcodes
│       └── insert-code.html
├── static
└── themes

21 directories, 19 files