x
-
+
Binary Powers
<
o
>
2 0
=
1
2 1
=
2
2 2
=
4
2 3
=
8
2 4
=
16
2 5
=
32
2 6
=
64
2 7
=
128
2 8
=
256
2 9
=
512
2 10
=
1024
2 11
=
2048
2 12
=
4096
2 13
=
8192
2 14
=
16384
2 15
=
32768
2 16
=
65536
2 17
=
131072
2 18
=
262144
2 19
=
524288
2 20
=
1048576
x
-
+
Linux "find" Command
<
o
>
find
<dir>
[-not] -name
<regex>
 . . .
 . . .
-type
<d,f,...>
 . . .
 . . .
-mtime
<+/-><integer>
 . . .
 . . .
-maxdepth
<integer>
 . . .
 . . .
-mindepth
<integer>
 . . .
 . . .
 . . .
 . . .
-exec <command> {} \;
x
-
+
Computer Links
<
o
>
x
-
+
VI Quick Navigation
<
o
>
"/"<string> ENTER
search
"/\c"<string> ENTER
search (case insensitive)
"?"<string> ENTER
search (backward)
"n"
next match in search
"N"
previous match in search
<integer>"G"
move cursor to <integer> line
"G"
move cursor to last line
"z" ENTER
move cursor line to top of screen
"|"
move cursor to first column
<integer>"|"
move cursor to <integer> column
"$"
move cursor to last column
<integer>"$"
move cursor to last column <integer> lines down
CONTROL "f"
move forward one full screen
CONTROL "b"
move backward one full screen
"w"
move to next word
"b"
move to beginning of word
<integer> ENTER
move <integer> lines down
")"
move a sentence forward
"("
move a sentence back
"}"
move a paragraph forward
"{"
move a paragraph back
x
-
+
JavaScript
<
o
>
<script src="myScript.js"></script>
debugger;
document.activeElement
console.log(   );
clear(   );
localStorage.clear(   );
document.getElementsById( 'name' );
document.getElementsByClassName( 'name' );
document.getElementsByTagName( 'name' );
document.getElementsByName( 'name' );
preventDefault(   );
document.styleSheets[9].rules[9] || document.styleSheets[9].cssRules[9]
document.styleSheets[9].cssRules[9].style.backgroundImage
"text-align: center;" ... "display: inline-block;"
querySelector( body #id );
querySelectorAll( body .class );
JSON.stringify(   ) turns a Javascript object into JSON text and stores that JSON text in a string
JSON.parse(   ) turns a string of JSON text into a Javascript object.
null != element.match(   )
string = element.replace(   )
element.style.zIndex = 9
window (global), var (local fn) and let (local block)
getElementByID(   ) can only be used on "document"
basically there are two event models in JavaScript...event capturing and event bubbling
element.classList.contains( 'class name to search' );
if( document.querySelector( '.mydivclass' ) !== null ){ // .. it exists }

chrome://about
chrome://settings/content/cookies
chrome://chrome/settings/clearBrowserData
file:///
x
-
+
WikipediA
<
o
>
x
-
+
Musicians
<
o
>
x
-
+
Music Clips
<
o
>
x
-
+
Apache2 Server
<
o
>
Comments
  • Inline comments
    • # coment(s)
  • Block comments
    • <IfDefine IgnoreBlockComment>
         coments(s)
      </IfDefine>
Apache HTTP server control interface
  • List help
    • apachectl -h
  • List server root directory (configs)
    • apachectl -t -D DUMP_RUN_CFG 2>/dev/null | grep 'ServerRoot' | awk -F'"' '{print $2}'
  • List server error file
    • apachectl -t -D DUMP_RUN_CFG 2>/dev/null | grep 'Main Error' | awk -F'"' '{print $2}'
  • show all loaded modules
    • apachectl -t -D DUMP_MODULES
  • Show parsed vhost settings
    • apachectl -t -D DUMP_VHOSTS
  • Restart server
    • apachectl -k restart
a2ensite, a2dissite - enable or disable an apache2 site / virtual host
  • Config file(s) are in <ServerRoot>/sites-available
  • a2ensite configFile
  • a2dissite configFile
Reload configs
  • systemctl reload apache2
  • OR
  • service apache2 reload
Retrieve runtime configuration from a local Apache 2 HTTP server
  • List help
    • a2query -h
  • List available sites
    • a2query -s
Manage user files for basic authentication
  • List help
    • htpasswd
  • Create a new file
    • htpasswd -c .htpasswd user
  • Add user to file
    • htpasswd .htpasswd user
  • Display line to added to file
    • htpasswd -n user
htaccess file basic setup
  • AuthType Basic
    AuthName "Restricted Area"
    AuthUserFile .htpasswd
    Require valid-user
Log rotate config
  • /etc/logrotate.d/apache2
My custom script called from "/etc/logrotate.d/apache2"
  • /usr/sbin/apacheAccessLog.sh
x
-
+
Hangman (elements)
<
o
>


Wrong Letters:


x
-
+
Linux Command Line
<
o
>
x
-
+
Colors
<
o
>
x
-
+
SQL Joins
<
o
>
x
-
+
Informix
<
o
>
Informix History

x
-
+
Web Utilities
<
o
>
x
-
+
About AOS
<
o
>
x
-
+
Interest Calculator
<
o
>
Principle
Interest
Year(s)
Δ Principle

x
-
+
"Quotes"
<
o
>
x
-
+
Hall of Fame
<
o
>
x
-
+
Sandbox
<
o
>
|PANES | | |PANES /^\ |PANES | |~~~| | | |^^^^^^^| / \ /^\ |[]+ | |~~~| |^^^^^^^| | +[]| | | | +[]|/\/\/\/\^/\/\/\/\|^^^^^^^| |+[]+ |~~~~~~~~~~~~~~~~~| +[]| | | [] /^\ [] |+[]+ | | +[]+| [] || || [] | +[]+| |[]+ | || || |[]+ | |_______|-----------------|_______|

Build a sand castle...
or two!

x
-
+
Playground
<
o
>
__________ __ ___ \______ \ | _____ ___ __ ___________ ___ __ __ ____ __| _/ | ___/ | \__ \\ | |/ __ \ __ \ / __\| | \/ \ / __ | | | | |__/ __ \\___ / /_/ \ | \_\ /_/ | | / | \/ /_/ | |____| |____(____ / ____\___ /|__| \___/|____/|___| /\____ | \/\/ /_____/ \/ \/

  Run around!

x
-
+
Garage
<
o
>
x
-
+
SSH connection attempts
<
o
>
1. Filter for interactive SSH logins
   bash> grep sshd.\*Failed /var/log/auth.log | less

2. Filter for failed connections (i.e. no login attempted, could be a port scanner, etc)
   bash> grep sshd.\*Did /var/log/auth.log | less
x
-
+
Class Outline - 2018/02/20
<
o
>
  1. Terminal
    • Basics...
      • simple commands...hostname, whoami, pwd, ls...
      • less overhead
      • super flexible...can do everything!
      • great tools
      • automation
      • VI
    • SSH to webserver
      • file structure dev, run and production
      • Files...panes*, hangman*, etc
      • reversi
  2. Browser
    • mulitiple tabs
      • great for testing...don't refresh
    • incognito window
      • fooled me with localStorage
    • refresh
      • get programming change into memory
      • page is really messed up
    • Inspect/JavaScript console
      • find elements in pages
      • localStorage
      • view CSS
      • type in console
  3. Page "find" layout and functionality
    • issue with highlight inside panes
  4. To Do List
    • explain what I ran into making this pane
x
-
+
Agent Jinxes
<
o
>
Password:
x
-
+
Places to Visit
<
o
>
x
-
+
Three Sysadmin Rules...
<
o
>
x
-
+
Island Albums (K^2)
<
o
>
x
-
+
Travel - NYC...Planning!
<
o
>
x
-
+
Agent Questions
<
o
>
Password:
x
-
+
Companies (Dream)
<
o
>
x
-
+
Interview Questions
<
o
>
x
-
+
Island Albums (Pumpkin)
<
o
>
x
-
+
Idioms
<
o
>
x
-
+
Agent Emojis (ASCII)
<
o
>
x
-
+
IKBB
<
o
>
Password:
x
-
+
Travel - NYC...Visit!
<
o
>
x
-
+
Travel Games
<
o
>
x
-
+
PostgreSQL
<
o
>
psql
  • Client config file
    • ${HOME}/.psqlrc
    • \set PROMPT1 '%[%033[1;37m%]%M:%> %n@%/%R%#%x%[%033[0m%] '
    • \set PROMPT2 ''
    • \pset
    • \pset null '(NULL)'
    • \set user 'SELECT current_user;'
    • \echo 'Message here!\n'

  • Connect
    • psql -U postgres [-d databaseName]
    • \c databaseName

  • List version
    • SELECT version( );

  • Help
    • \?
    • \? [commands]
    • \? [options]
    • \? [variables]
    • \h [NAME]

  • Pager...uses environment's "PAGER" variable
    • \pset pager off
    • \pset pager on

  • Edit query buffer...uses environment's "EDITOR" variable
    • ctrl-alt-j
    • \e

  • Command history
    • \s

  • Execute commands from a file
    • \i filename

  • Clear screen
    • \! clear

  • Set variables
    • \set
    • \set version 'SELECT version( );'
    • \set user 'SELECT current_user;'
    • \set extensions 'select * from pg_available_extensions;'
    • \set nopager '\\pset pager off'
    • \set pager '\\pset pager on'
    • \set ls '\\echo `ls`'
    • \set ECHO_HIDDEN
    • \unset ECHO_HIDDEN
    • \pset linestyle unicode \pset border 2
    • reset variable;
    • reset all;

  • show (show the value of a run-time parameter)
    • SHOW all;
    • SELECT * FROM pg_catalog.pg_settings;
    • SHOW parameterName;
    • select * from pg_catalog.pg_settings where name = 'parameterName';
    • SHOW search_path;

  • Set (change a run-time parameter)
    • SET name TO value;
    • SET search_path TO schemaName;

  • List databases
    • \l
    • \l+
    • SELECT datname FROM pg_database;

  • List tables
    • \dt
    • \dt+
    • \d table
    • \d+ table
    • SELECT
        *
      FROM
        pg_catalog.pg_tables
      WHERE
        schemaname != 'pg_catalog'
        AND
        schemaname != 'information_schema';
    • \dt schemaName .*
    • \dt *

  • List schemas (namespace)
    • \dn
    • SELECT * from pg_catalog.pg_namespace;
    • SELECT current_schema;
    • \dn+
    • SELECT
        n.nspname AS "Name",
        pg_catalog.pg_get_userbyid(n.nspowner) AS "Owner",
        pg_catalog.array_to_string(n.nspacl, E'\n') AS "Access privileges",
        pg_catalog.obj_description(n.oid, 'pg_namespace') AS "Description"
      FROM
        pg_catalog.pg_namespace n
      WHERE
        n.nspname !~ '^pg_'
        AND
        n.nspname <> 'information_schema'
      ORDER BY 1;

  • List objects (table, view, sequence, or index) definition
    • \d schemaName.<tab><tab>
    • \dtvs *   --tables/views/sequences
    • \dtvs schemaName.*   --tables/views/sequences
    • \d schemaName.*
    • SELECT
        table_name,
        column_name,
        data_type
      FROM
        information_schema.columns
      WHERE
        table_name = '
      tableName';

  • Extensions
    • \dx
    • SELECT * FROM pg_available_extensions;

  • List users (roles)
    • \du
    • \du+
    • select * from pg_user;
    • select CURRENT_USER;
    • SELECT
        *
      FROM
        information_schema.role_table_grants
      WHERE
        table_name = '
      tableName';

  • Create database
    • CREATE DATABASE databaseName;

  • Create table
    • CREATE TABLE tableName
      (
        
      id  serial not null primary key,
        
      dtCreated  timestamp not null,
        
      dtUpdated  timestamp,
        
      data  jsonb
      );

  • List object (table, view, sequence, or index) access privileges
    • \dp object
    • \z object

  • Grants
    • GRANT USAGE ON SCHEMA schema TO userName;
    • GRANT SELECT, INSERT, UPDATE ON tableName TO userName;
    • GRANT SELECT, UPDATE ON SEQUENCE tableName_fieldName_seq TO userName;

  • Select
    • SELECT columns FROM tableName;
    • SELECT columns FROM tableName WHERE expression;
    • SELECT columns FROM tableName WHERE expression LIMIT integer OFFSET integer;
    • SELECT columns FROM tableName WHERE expression ORDER BY column NULLS FIRST;
    • SELECT c.relname FROM pg_class c WHERE c.relkind = 'S';
    • SELECT * FROM tableName_fieldName_seq;

  • Repeat query
    • \g
    • \watch seconds

  • Set/unset timer
    • \timer

  • Insert
    • INSERT INTO tableName( dtcreated, data ) VALUES( now(), '{}' );

  • Delete record(s)
    • DELETE FROM tableName WHERE id >= 1000000;

  • Export table to CSV file
    • \COPY tableName TO 'path/fileName.csv' CSVheader;

  • Import table from CSV file
    • \COPY tableName FROM 'path/fileName.csv' WITH( FORMAT CSV );

  • Alter sequence
    • ALTER SEQUENCE tableName_fieldName_seq RESTART WITH 1;

  • Truncate table
    • TRUNCATE tableName;
    • TRUNCATE tableName RESTART IDENTITY;

  • Drop table
    • DROP TABLE tableName;

  • Active connections (w/query)
    • SELECT
        pid,
        datname,
        usename,
        application_name,
        client_hostname,
        client_port,
        backend_start,
        query_start,
        query,
        state
      FROM
        pg_stat_activity
      WHERE
        state = 'active';

pg_dump
  • Dump database
    • pg_dump databaseName
    • pg_dump --create databaseName
    • pg_dump --create --schema-only databaseName

  • Dump table
    • pg_dump --schema-only --table=tableName databaseName
    • pg_dump -st tableName databaseName
x
-
+
ID Generator
<
o
>
Length
Characters


 
x
-
+
Travel Map
<
o
>
x
-
+
Interesting Words
<
o
>
x
-
+
Open Reversi
<
o
>
x
-
+
Notes (ASCII)
<
o
>
x
-
+
Agent Vocab
<
o
>
x
-
+
What School Didn't Teach
<
o
>
x
-
+
Samsung Gear S3 Frontier (info)
<
o
>
x
-
+
OcciSpace
<
o
>
x
-
+
Recipes (food)
<
o
>
x
-
+
Samsung Gear S3 Frontier (faces)
<
o
>
x
-
+
Chicken or the Egg
<
o
>
x
-
+
My foxtrot
<
o
>
x
-
+
Fun Words to Swipe!
<
o
>

Here is my list!
In order of my discovery:
x
-
+
Astrological Signs
<
o
>
x
-
+
Time Share Game
<
o
>

Share fun times by texting with a friend(s)...
letting them know you are thinking of them.
Don't force...let it happen naturally.
Military time ups the game!
It is really cool to share a time that matches
two categories.

In order of favorites:

Matches two categories:
etc
x
-
+
The Friday Five
<
o
>
x
-
+
Song Duets
<
o
>
x
-
+
~Pages~
<
o
>
x
-
+
Lamborghini
<
o
>
x
-
+
2020 Summer Olympics (Sports)
<
o
>
x
-
+
VMware EXSi Shell
<
o
>
x
-
+
Phone Clips
<
o
>
CoNtRoL PaNeL
 Colors
 Paper
 Layout
 Open

 Theme

 Sort

 Find

 Edit

 Delete


x
-
+
Help
<
o
>
x
-
+
To Do
<
o
>