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
>
x
-
+
oxygen ( server )
<
o
>
Linux
  • use PuTTY to SSH to server
  • put server name in the window title
    • can be set in PuTTY
    • can be dynamic with server's command prompt
      • PS1="# \u@\h:\w \t #"a (review oxygen's prompt)
  • use different colors for different servers
Naming
  • general to specific
  • noun then verb
  • camelCase
  • keep database column names in code until ready to output on report
JSON (JavaScript Object Notation)
  • layer between database and user
  • can generate per report and/or for multiple reports
  • make for process/queue time
  • make a daily build to cover multiple files
PHP Headers
  • "base" for error, debugging, language... settings. Pulling in all other headers
  • "database" for connecting to databases
  • "datetime" for formatting dates and times
  • "page" for headers, footers, etc
BASH Scripts
  • set_env
  • backup.sh
  • email.sh
  • diskChk.sh
  • loadChk.sh
  • swapChk.sh
To Do
  • git source control (configs and app code)
  • masquerade as xyz.abc.com (instead of oxygen.xyz.abc.com)
  • add page loaded timestamp in report footer (already in headers)
x
-
+
WikipediA
<
o
>
x
-
+
Musicians
<
o
>
x
-
+
Music Clips
<
o
>
x
-
+
Apache2 Server
<
o
>
Comments
  • Inline comments
    • # comment(s)
  • Block comments
    • <IfDefine IgnoreBlockComment>
         comment(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
>
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'

  • List version
    • SELECT version( );

  • List databases
    • \list or \l;

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

  • 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
-
+
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
>
x
-
+
Wallpaper
<
o
>
x
-
+
DuckDuckGo
<
o
>
x
-
+
Android Alternatives
<
o
>
x
-
+
LEGO
<
o
>
x
-
+
Bachelor Food
<
o
>
x
-
+
Foods (smoked)
<
o
>
x
-
+
Crawfish (boil)
<
o
>
x
-
+
Kombucha (brewing)
<
o
>
x
-
+
Server Naming Schemas
<
o
>
x
-
+
Simple Pleasures
<
o
>
x
-
+
Thanksgiving Food Favorites
<
o
>
x
-
+
Survival Items
<
o
>
x
-
+
Favorite Foods
<
o
>
x
-
+
Conversions
<
o
>
x
-
+
UNIX
<
o
>
CoNtRoL PaNeL
 Colors
 Paper
 Layout
 Open

 Theme

 Sort

 Find

 Edit

 Delete


x
-
+
Help
<
o
>
x
-
+
To Do
<
o
>
x
-
+
Releases
<
o
>
x
-
+
X-Ray
<
o
>
x
-
+
Sites
<
o
>
x
-
+
Notes
<
o
>
x
-
+
Timer
<
o
>
x
-
+
Media
<
o
>
© 2017-2024 panes.us