This commit is contained in:
Paul Trowbridge 2020-01-12 21:28:28 -05:00
parent 3729131510
commit 2a6f1c5dcf
32 changed files with 2252 additions and 2238 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
*.swp *.swp

View File

@ -1,21 +1,21 @@
Only applies to items that exist in both sets of data Only applies to items that exist in both sets of data
**Change in Price** **Change in Price**
( P₂ - P₁ ) Q₂ ( P₂ - P₁ ) Q₂
**Change in Quantity** **Change in Quantity**
( Q₂ - Q₁ ) P₁ ( Q₂ - Q₁ ) P₁
_To further break out change in quantity_ _To further break out change in quantity_
Change in Quantity - _Volume Related_ Change in Quantity - _Volume Related_
Q₂ ( Q₁ / Σ ( Q₁ ) ) - Q₁ Q₂ ( Q₁ / Σ ( Q₁ ) ) - Q₁
Change in Quantity - _Mix Related_ Change in Quantity - _Mix Related_
Q₂ - Q₂ ( Q₁ / Σ ( Q₁ ) ) Q₂ - Q₂ ( Q₁ / Σ ( Q₁ ) )

8
cms.md
View File

@ -1,5 +1,5 @@
PDMN24-1 Maintain Product Structure PDMN24-1 Maintain Product Structure
IVMN02-4 Maint Part/Plant IVMN02-4 Maint Part/Plant
IVMN14-7 Costing Sheet IVMN14-7 Costing Sheet
PDMN31-1 WO Production Reporting PDMN31-1 WO Production Reporting
PDMN06 Maintain WO PDMN06 Maintain WO

View File

@ -1,11 +1,11 @@
dotnet new console -n "name of directory or project" dotnet new console -n "name of directory or project"
dotnet build dotnet build
create exe targeting a runtime: create an executable if not already exists and build dll in bin/Release/win10-x64 create exe targeting a runtime: create an executable if not already exists and build dll in bin/Release/win10-x64
-------------------------------------------- --------------------------------------------
dotnet publish -c Release -r win10-x64 dotnet publish -c Release -r win10-x64
dotnet publish -c Release -f netcoreapp2.1 dotnet publish -c Release -f netcoreapp2.1
`dotnet restore` -> update/sync packages `dotnet restore` -> update/sync packages

View File

@ -1,3 +1,3 @@
iredmail iredmail
mailinabox mailinabox
mailcow mailcow

View File

@ -1,2 +1,2 @@
find and replace a word in an entire directory find and replace a word in an entire directory
`grep -rl target_word ./ | xargs sed -i 's/target_word/replace_word/g'` `grep -rl target_word ./ | xargs sed -i 's/target_word/replace_word/g'`

View File

@ -1,18 +1,18 @@
dbeaver dbeaver
vs code vs code
bash bash
vundle vundle
npgsql npgsql
pspg pspg
postgresql apt repo postgresql apt repo
pgadmin pgadmin
windows postgres windows postgres
nodejs nodejs
power bi power bi
ms data gateway ms data gateway
excel add-in excel add-in

View File

@ -1,14 +1,14 @@
install R kernel for jupyter to use install R kernel for jupyter to use
* `sudo R` * `sudo R`
* `install.packages('IRkernel')` * `install.packages('IRkernel')`
* `IRkernel::installspec()` * `IRkernel::installspec()`
run on network: run on network:
`jupyter notebook --ip 10.0.10.15 --port 8888` `jupyter notebook --ip 10.0.10.15 --port 8888`
basic packages: basic packages:
* ggplot2, plyr, ggExtra, scales * ggplot2, plyr, ggExtra, scales

View File

@ -1,28 +1,28 @@
create self-signed cert create self-signed cert
https://docs.nodejitsu.com/articles/HTTP/servers/how-to-create-a-HTTPS-server/ https://docs.nodejitsu.com/articles/HTTP/servers/how-to-create-a-HTTPS-server/
``` ```
openssl genrsa -out key.pem openssl genrsa -out key.pem
openssl req -new -key key.pem -out csr.pem openssl req -new -key key.pem -out csr.pem
openssl x509 -req -days 9999 -in csr.pem -signkey key.pem -out cert.pem openssl x509 -req -days 9999 -in csr.pem -signkey key.pem -out cert.pem
rm csr.pem rm csr.pem
``` ```
##Chrome stops accepting self-signed certs needs mod ##Chrome stops accepting self-signed certs needs mod
https://stackoverflow.com/questions/43665243/invalid-self-signed-ssl-cert-subject-alternative-name-missing https://stackoverflow.com/questions/43665243/invalid-self-signed-ssl-cert-subject-alternative-name-missing
1. set a file v3.ext 1. set a file v3.ext
``` ```
authorityKeyIdentifier=keyid,issuer authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names subjectAltName = @alt_names
[alt_names] [alt_names]
DNS.1 = %%DOMAIN%% DNS.1 = %%DOMAIN%%
``` ```
2. openssl req -new -key key.pem -out csr.pem -sha256 -extfile v3.ext 2. openssl req -new -key key.pem -out csr.pem -sha256 -extfile v3.ext

View File

@ -1,77 +1,77 @@
Logic to setup production plan, inventory balances, purchases, and shipments Logic to setup production plan, inventory balances, purchases, and shipments
Starting point Starting point
- known balances STKB - known balances STKB
- known available BOLH - not posted - known available BOLH - not posted
- known prod schedule SOFT - known prod schedule SOFT
- known shipments Sales Forecast - known shipments Sales Forecast
- forecasted orders Sales Forecast - forecasted orders Sales Forecast
- machines that a part can run on ?? - machines that a part can run on ??
- actual run-time performance Alternates - actual run-time performance Alternates
- actual BOM performance Alternates - actual BOM performance Alternates
- actual scrap performance Alternates - actual scrap performance Alternates
- available machine time ?? - available machine time ??
Populate Populate
- forecasted prod schedule - forecasted prod schedule
- forecasted on-hand (via forecast perpetual transactions) - forecasted on-hand (via forecast perpetual transactions)
- forecasted available (via forecast transactions) - forecasted available (via forecast transactions)
- forecasted purchases - forecasted purchases
Iterate through each calendar day Iterate through each calendar day
1. materialize forecasted purchases 1. materialize forecasted purchases
1. update on-hand & available 1. update on-hand & available
2. materialize production 2. materialize production
1. update on-hand & available 1. update on-hand & available
3. materialize transfers 3. materialize transfers
1. update on-hand & available 1. update on-hand & available
3. materialize shipments 3. materialize shipments
1. update on-hand & available 1. update on-hand & available
4. process forecasted order submissions 4. process forecasted order submissions
1. check for inventory available 1. check for inventory available
1. Yes 1. Yes
1. mark unavailable 1. mark unavailable
2. schedule shipment for request date 2. schedule shipment for request date
2. No or partial 2. No or partial
1. mark unavailable any partial 1. mark unavailable any partial
2. schedule on next open slot regardless of request date (each part should be mapped to certain set of machines) 2. schedule on next open slot regardless of request date (each part should be mapped to certain set of machines)
1. raw materials available 1. raw materials available
1. Yes 1. Yes
1. mark unavailable (at begin prod date?) 1. mark unavailable (at begin prod date?)
2. No 2. No
1. mark unavailable any partial (at begin prod date?) 1. mark unavailable any partial (at begin prod date?)
2. schedule a purchase net of lead time 2. schedule a purchase net of lead time
2. sub-components available? 2. sub-components available?
1. Yes 1. Yes
1. mark unavialable (at begin prod date?) 1. mark unavialable (at begin prod date?)
2. No 2. No
1. (return to 4.1.2.2) 1. (return to 4.1.2.2)
3. schedule transfer of production after completion if necessary 3. schedule transfer of production after completion if necessary
3. schedule shipment for request date, or production date if past request date 3. schedule shipment for request date, or production date if past request date
snap-shot STKB snap-shot STKB
snap-shot BOLH snap-shot BOLH
snap-shot SOFT snap-shot SOFT
some notes some notes
----------------- -----------------
* shift schedules * shift schedules
* parallel resources * parallel resources
* setup time * setup time
* efficiencies * efficiencies
* scrap rates * scrap rates
* blends * blends
* known 'A' item volumes planned regardless of demand * known 'A' item volumes planned regardless of demand
* visibility window for incomming orders * visibility window for incomming orders
* grouping items to reduce change-overs * grouping items to reduce change-overs
* initial start-up: merge with current machine schedule * initial start-up: merge with current machine schedule
* limit start date to child item availability * limit start date to child item availability
* procurement mix * procurement mix
* purchase lag * purchase lag
* transfer lag * transfer lag
* order priority * order priority
* inventory minimums * inventory minimums
* tool availability * tool availability

View File

@ -1,51 +1,51 @@
A method to planning sales A method to planning sales
---------------------------- ----------------------------
## Summary ## Summary
1. copy history 1. copy history
1. start with open orders 1. start with open orders
2. add orders as placed in past 2. add orders as placed in past
1. true-up to current run rate 1. true-up to current run rate
1. normalize price for current pricing 1. normalize price for current pricing
1. will need to idenitfy blocks in the base period that best represent pricing efforts 1. will need to idenitfy blocks in the base period that best represent pricing efforts
2. scale prior periods to match final pricing 2. scale prior periods to match final pricing
2. exclude expired products/customers 2. exclude expired products/customers
3. scale new developments to reflect full-year (new products customers) 3. scale new developments to reflect full-year (new products customers)
4. update cost to current 4. update cost to current
5. request date attainment performance 5. request date attainment performance
3. walk prior period sales to new baseline sales as change in run-rate 3. walk prior period sales to new baseline sales as change in run-rate
2. build in changes to current run-rate 2. build in changes to current run-rate
1. volume changes 1. volume changes
2. pricing changes 2. pricing changes
3. new products (must be defined in future at a mininum) 3. new products (must be defined in future at a mininum)
4. future cost changes 4. future cost changes
5. request date attainment 5. request date attainment
| timeline | day | running days | responsible | | timeline | day | running days | responsible |
| -------------------------------------------- | --- | ------------ | ----------- | | -------------------------------------------- | --- | ------------ | ----------- |
| **_establish run-rate sales_** | | | | | **_establish run-rate sales_** | | | |
| copy history | 1 | 1 | executor | | copy history | 1 | 1 | executor |
| identify pricing windows | 1 | 2 | sales team | | identify pricing windows | 1 | 2 | sales team |
| scale windows to match final | 1 | 3 | executor | | scale windows to match final | 1 | 3 | executor |
| identify expired products/customers | 3 | 6 | sales team | | identify expired products/customers | 3 | 6 | sales team |
| eliminate expired volume | 1 | 7 | executor | | eliminate expired volume | 1 | 7 | executor |
| identify new products/customers | 3 | 10 | sales team | | identify new products/customers | 3 | 10 | sales team |
| scale new to full year volume | 1 | 11 | executor | | scale new to full year volume | 1 | 11 | executor |
| **_load new plans_** | | | | | **_load new plans_** | | | |
| layer in planned changes not yet implemented | | | | | layer in planned changes not yet implemented | | | |
| identify changes to existing volume | 3 | 14 | sales team | | identify changes to existing volume | 3 | 14 | sales team |
| load changes | 1 | 15 | executor | | load changes | 1 | 15 | executor |
| identify changes in price | 3 | 18 | sales team | | identify changes in price | 3 | 18 | sales team |
| load changes | 1 | 19 | executor | | load changes | 1 | 19 | executor |
| identify new products | 3 | 22 | sales team | | identify new products | 3 | 22 | sales team |
| load new | 1 | 23 | executor | | load new | 1 | 23 | executor |
Table Layout Table Layout

View File

@ -1,37 +1,37 @@
[mailing_list](https://www.postgresql.org/message-id/flat/CAHq%2BKHJOvZT8M-o_sE%2BQzqqBGnUjNubWo_rRmpHZyw5ZUuaseg%40mail.gmail.com) [mailing_list](https://www.postgresql.org/message-id/flat/CAHq%2BKHJOvZT8M-o_sE%2BQzqqBGnUjNubWo_rRmpHZyw5ZUuaseg%40mail.gmail.com)
wouldn't that be Pg authing against the OS (pam) which in turn is forwarding to krb5? which seems like an extra added step wouldn't that be Pg authing against the OS (pam) which in turn is forwarding to krb5? which seems like an extra added step
sfrost [11:11 AM] sfrost [11:11 AM]
it's basically this: it's basically this:
ktpass -out postgres.keytab -princ ktpass -out postgres.keytab -princ
POSTGRES/centos(at)MY(dot)TESTDOMAIN(dot)LAN -mapUser enterprisedb -pass XXXXXX POSTGRES/centos(at)MY(dot)TESTDOMAIN(dot)LAN -mapUser enterprisedb -pass XXXXXX
-crypto DES-CBC-MD5 -crypto DES-CBC-MD5
(except adjusted a bit to make it not use a shitty crypto) (except adjusted a bit to make it not use a shitty crypto)
you use ktpass to create your keytab file you use ktpass to create your keytab file
copy the keytab file to the Linux box copy the keytab file to the Linux box
arossouw [11:12 AM] arossouw [11:12 AM]
Seems like effort, i'll just play dumb on that one Seems like effort, i'll just play dumb on that one
sfrost [11:12 AM] sfrost [11:12 AM]
oh, gotta fix the princ too or whatever oh, gotta fix the princ too or whatever
but it's not that hard but it's not that hard
and you might have to configure the realms, but not necessairly (that info is often in DNS already) and you might have to configure the realms, but not necessairly (that info is often in DNS already)
then you just tell PG where the keytab file is, set gssapi in PG's hba.conf, and create your users using their princ names, like 'sfrost@SNOWMAN.NET' then you just tell PG where the keytab file is, set gssapi in PG's hba.conf, and create your users using their princ names, like 'sfrost@SNOWMAN.NET'
dtseiler [11:13 AM] dtseiler [11:13 AM]
Im with @hunleyd, Id love to see a great howto post on that. Im with @hunleyd, Id love to see a great howto post on that.
arossouw [11:14 AM] arossouw [11:14 AM]
I suppose the question is what is the advantage of using kerberos, and then deciding if its worth spending time on I suppose the question is what is the advantage of using kerberos, and then deciding if its worth spending time on
sfrost [11:14 AM] sfrost [11:14 AM]
I just wrote it I just wrote it
^^^ see above ^^^ see above
also wrote the advantage... also wrote the advantage...
hunleyd [11:14 AM] hunleyd [11:14 AM]
maybe i'll try this as a 10% project some day maybe i'll try this as a 10% project some day

View File

@ -1,43 +1,43 @@
CREATE OR REPLACE FUNCTION public.jsonb_concat( CREATE OR REPLACE FUNCTION public.jsonb_concat(
state jsonb, state jsonb,
concat jsonb) concat jsonb)
RETURNS jsonb AS RETURNS jsonb AS
$BODY$ $BODY$
BEGIN BEGIN
--RAISE notice 'state is %', state; --RAISE notice 'state is %', state;
--RAISE notice 'concat is %', concat; --RAISE notice 'concat is %', concat;
RETURN state || concat; RETURN state || concat;
END; END;
$BODY$ $BODY$
LANGUAGE plpgsql VOLATILE LANGUAGE plpgsql VOLATILE
COST 100; COST 100;
CREATE OR REPLACE FUNCTION public.jsonb_concat_distinct_arr( CREATE OR REPLACE FUNCTION public.jsonb_concat_distinct_arr(
state jsonb, state jsonb,
concat jsonb) concat jsonb)
RETURNS jsonb AS RETURNS jsonb AS
$BODY$ $BODY$
BEGIN BEGIN
--RAISE notice 'state is %', state; --RAISE notice 'state is %', state;
--RAISE notice 'concat is %', concat; --RAISE notice 'concat is %', concat;
RETURN SELECT jsonb_agg(state || concat; RETURN SELECT jsonb_agg(state || concat;
END; END;
$BODY$ $BODY$
LANGUAGE plpgsql VOLATILE LANGUAGE plpgsql VOLATILE
COST 100; COST 100;
DROP AGGREGATE IF EXISTS public.jsonb_arr_aggc(jsonb); DROP AGGREGATE IF EXISTS public.jsonb_arr_aggc(jsonb);
CREATE AGGREGATE public.jsonb_arr_aggc(jsonb) ( CREATE AGGREGATE public.jsonb_arr_aggc(jsonb) (
SFUNC=public.jsonb_concat, SFUNC=public.jsonb_concat,
STYPE=jsonb, STYPE=jsonb,
INITCOND='[]' INITCOND='[]'
); );
DROP AGGREGATE IF EXISTS public.jsonb_obj_aggc(jsonb); DROP AGGREGATE IF EXISTS public.jsonb_obj_aggc(jsonb);
CREATE AGGREGATE public.jsonb_obj_aggc(jsonb) ( CREATE AGGREGATE public.jsonb_obj_aggc(jsonb) (
SFUNC=public.jsonb_concat, SFUNC=public.jsonb_concat,
STYPE=jsonb, STYPE=jsonb,
INITCOND='{}' INITCOND='{}'
); );

View File

@ -1,28 +1,28 @@
SELECT SELECT
c.relname table_name, c.relname table_name,
td.description table_description, td.description table_description,
n.nspname schema_name, n.nspname schema_name,
a.attname As column_name, a.attname As column_name,
cd.description column_description cd.description column_description
FROM FROM
pg_class As c pg_class As c
INNER JOIN pg_attribute As a ON INNER JOIN pg_attribute As a ON
c.oid = a.attrelid c.oid = a.attrelid
LEFT JOIN pg_namespace n ON LEFT JOIN pg_namespace n ON
n.oid = c.relnamespace n.oid = c.relnamespace
LEFT JOIN pg_tablespace t ON LEFT JOIN pg_tablespace t ON
t.oid = c.reltablespace t.oid = c.reltablespace
LEFT JOIN pg_description As cd ON LEFT JOIN pg_description As cd ON
cd.objoid = c.oid cd.objoid = c.oid
AND cd.objsubid = a.attnum AND cd.objsubid = a.attnum
LEFT JOIN pg_description As td ON LEFT JOIN pg_description As td ON
td.objoid = c.oid td.objoid = c.oid
AND td.objsubid = 0 AND td.objsubid = 0
WHERE WHERE
c.relkind IN('r', 'v') c.relkind IN('r', 'v')
--AND a.attname = 'd07txn' --AND a.attname = 'd07txn'
AND cd.description like '%Transaction Number%' AND cd.description like '%Transaction Number%'
ORDER BY ORDER BY
n.nspname, n.nspname,
c.relname, c.relname,
a.attname a.attname

View File

@ -1,99 +1,99 @@
# PostgreSQL Client Authentication Configuration File # PostgreSQL Client Authentication Configuration File
# =================================================== # ===================================================
# #
# Refer to the "Client Authentication" section in the PostgreSQL # Refer to the "Client Authentication" section in the PostgreSQL
# documentation for a complete description of this file. A short # documentation for a complete description of this file. A short
# synopsis follows. # synopsis follows.
# #
# This file controls: which hosts are allowed to connect, how clients # This file controls: which hosts are allowed to connect, how clients
# are authenticated, which PostgreSQL user names they can use, which # are authenticated, which PostgreSQL user names they can use, which
# databases they can access. Records take one of these forms: # databases they can access. Records take one of these forms:
# #
# local DATABASE USER METHOD [OPTIONS] # local DATABASE USER METHOD [OPTIONS]
# host DATABASE USER ADDRESS METHOD [OPTIONS] # host DATABASE USER ADDRESS METHOD [OPTIONS]
# hostssl DATABASE USER ADDRESS METHOD [OPTIONS] # hostssl DATABASE USER ADDRESS METHOD [OPTIONS]
# hostnossl DATABASE USER ADDRESS METHOD [OPTIONS] # hostnossl DATABASE USER ADDRESS METHOD [OPTIONS]
# #
# (The uppercase items must be replaced by actual values.) # (The uppercase items must be replaced by actual values.)
# #
# The first field is the connection type: "local" is a Unix-domain # The first field is the connection type: "local" is a Unix-domain
# socket, "host" is either a plain or SSL-encrypted TCP/IP socket, # socket, "host" is either a plain or SSL-encrypted TCP/IP socket,
# "hostssl" is an SSL-encrypted TCP/IP socket, and "hostnossl" is a # "hostssl" is an SSL-encrypted TCP/IP socket, and "hostnossl" is a
# plain TCP/IP socket. # plain TCP/IP socket.
# #
# DATABASE can be "all", "sameuser", "samerole", "replication", a # DATABASE can be "all", "sameuser", "samerole", "replication", a
# database name, or a comma-separated list thereof. The "all" # database name, or a comma-separated list thereof. The "all"
# keyword does not match "replication". Access to replication # keyword does not match "replication". Access to replication
# must be enabled in a separate record (see example below). # must be enabled in a separate record (see example below).
# #
# USER can be "all", a user name, a group name prefixed with "+", or a # USER can be "all", a user name, a group name prefixed with "+", or a
# comma-separated list thereof. In both the DATABASE and USER fields # comma-separated list thereof. In both the DATABASE and USER fields
# you can also write a file name prefixed with "@" to include names # you can also write a file name prefixed with "@" to include names
# from a separate file. # from a separate file.
# #
# ADDRESS specifies the set of hosts the record matches. It can be a # ADDRESS specifies the set of hosts the record matches. It can be a
# host name, or it is made up of an IP address and a CIDR mask that is # host name, or it is made up of an IP address and a CIDR mask that is
# an integer (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that # an integer (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that
# specifies the number of significant bits in the mask. A host name # specifies the number of significant bits in the mask. A host name
# that starts with a dot (.) matches a suffix of the actual host name. # that starts with a dot (.) matches a suffix of the actual host name.
# Alternatively, you can write an IP address and netmask in separate # Alternatively, you can write an IP address and netmask in separate
# columns to specify the set of hosts. Instead of a CIDR-address, you # columns to specify the set of hosts. Instead of a CIDR-address, you
# can write "samehost" to match any of the server's own IP addresses, # can write "samehost" to match any of the server's own IP addresses,
# or "samenet" to match any address in any subnet that the server is # or "samenet" to match any address in any subnet that the server is
# directly connected to. # directly connected to.
# #
# METHOD can be "trust", "reject", "md5", "password", "scram-sha-256", # METHOD can be "trust", "reject", "md5", "password", "scram-sha-256",
# "gss", "sspi", "ident", "peer", "pam", "ldap", "radius" or "cert". # "gss", "sspi", "ident", "peer", "pam", "ldap", "radius" or "cert".
# Note that "password" sends passwords in clear text; "md5" or # Note that "password" sends passwords in clear text; "md5" or
# "scram-sha-256" are preferred since they send encrypted passwords. # "scram-sha-256" are preferred since they send encrypted passwords.
# #
# OPTIONS are a set of options for the authentication in the format # OPTIONS are a set of options for the authentication in the format
# NAME=VALUE. The available options depend on the different # NAME=VALUE. The available options depend on the different
# authentication methods -- refer to the "Client Authentication" # authentication methods -- refer to the "Client Authentication"
# section in the documentation for a list of which options are # section in the documentation for a list of which options are
# available for which authentication methods. # available for which authentication methods.
# #
# Database and user names containing spaces, commas, quotes and other # Database and user names containing spaces, commas, quotes and other
# special characters must be quoted. Quoting one of the keywords # special characters must be quoted. Quoting one of the keywords
# "all", "sameuser", "samerole" or "replication" makes the name lose # "all", "sameuser", "samerole" or "replication" makes the name lose
# its special character, and just match a database or username with # its special character, and just match a database or username with
# that name. # that name.
# #
# This file is read on server startup and when the server receives a # This file is read on server startup and when the server receives a
# SIGHUP signal. If you edit the file on a running system, you have to # SIGHUP signal. If you edit the file on a running system, you have to
# SIGHUP the server for the changes to take effect, run "pg_ctl reload", # SIGHUP the server for the changes to take effect, run "pg_ctl reload",
# or execute "SELECT pg_reload_conf()". # or execute "SELECT pg_reload_conf()".
# #
# Put your actual configuration here # Put your actual configuration here
# ---------------------------------- # ----------------------------------
# #
# If you want to allow non-local connections, you need to add more # If you want to allow non-local connections, you need to add more
# "host" records. In that case you will also need to make PostgreSQL # "host" records. In that case you will also need to make PostgreSQL
# listen on a non-local interface via the listen_addresses # listen on a non-local interface via the listen_addresses
# configuration parameter, or via the -i or -h command line switches. # configuration parameter, or via the -i or -h command line switches.
# DO NOT DISABLE! # DO NOT DISABLE!
# If you change this first entry you will need to make sure that the # If you change this first entry you will need to make sure that the
# database superuser can access the database using some other method. # database superuser can access the database using some other method.
# Noninteractive access to all databases is required during automatic # Noninteractive access to all databases is required during automatic
# maintenance (custom daily cronjobs, replication, and similar tasks). # maintenance (custom daily cronjobs, replication, and similar tasks).
# #
# Database administrative login by Unix domain socket # Database administrative login by Unix domain socket
local all postgres peer local all postgres peer
# TYPE DATABASE USER ADDRESS METHOD # TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only # "local" is for Unix domain socket connections only
local all all peer local all all peer
# IPv4 local connections: # IPv4 local connections:
host all all 127.0.0.1/32 md5 host all all 127.0.0.1/32 md5
# IPv6 local connections: # IPv6 local connections:
host all all ::1/128 md5 host all all ::1/128 md5
# Allow replication connections from localhost, by a user with the # Allow replication connections from localhost, by a user with the
# replication privilege. # replication privilege.
local replication all peer local replication all peer
host replication all 127.0.0.1/32 md5 host replication all 127.0.0.1/32 md5
host replication all ::1/128 md5 host replication all ::1/128 md5

View File

@ -1,107 +1,107 @@
# PostgreSQL Client Authentication Configuration File # PostgreSQL Client Authentication Configuration File
# =================================================== # ===================================================
# #
# Refer to the "Client Authentication" section in the PostgreSQL # Refer to the "Client Authentication" section in the PostgreSQL
# documentation for a complete description of this file. A short # documentation for a complete description of this file. A short
# synopsis follows. # synopsis follows.
# #
# This file controls: which hosts are allowed to connect, how clients # This file controls: which hosts are allowed to connect, how clients
# are authenticated, which PostgreSQL user names they can use, which # are authenticated, which PostgreSQL user names they can use, which
# databases they can access. Records take one of these forms: # databases they can access. Records take one of these forms:
# #
# local DATABASE USER METHOD [OPTIONS] # local DATABASE USER METHOD [OPTIONS]
# host DATABASE USER ADDRESS METHOD [OPTIONS] # host DATABASE USER ADDRESS METHOD [OPTIONS]
# hostssl DATABASE USER ADDRESS METHOD [OPTIONS] # hostssl DATABASE USER ADDRESS METHOD [OPTIONS]
# hostnossl DATABASE USER ADDRESS METHOD [OPTIONS] # hostnossl DATABASE USER ADDRESS METHOD [OPTIONS]
# #
# (The uppercase items must be replaced by actual values.) # (The uppercase items must be replaced by actual values.)
# #
# The first field is the connection type: "local" is a Unix-domain # The first field is the connection type: "local" is a Unix-domain
# socket, "host" is either a plain or SSL-encrypted TCP/IP socket, # socket, "host" is either a plain or SSL-encrypted TCP/IP socket,
# "hostssl" is an SSL-encrypted TCP/IP socket, and "hostnossl" is a # "hostssl" is an SSL-encrypted TCP/IP socket, and "hostnossl" is a
# plain TCP/IP socket. # plain TCP/IP socket.
# #
# DATABASE can be "all", "sameuser", "samerole", "replication", a # DATABASE can be "all", "sameuser", "samerole", "replication", a
# database name, or a comma-separated list thereof. The "all" # database name, or a comma-separated list thereof. The "all"
# keyword does not match "replication". Access to replication # keyword does not match "replication". Access to replication
# must be enabled in a separate record (see example below). # must be enabled in a separate record (see example below).
# #
# USER can be "all", a user name, a group name prefixed with "+", or a # USER can be "all", a user name, a group name prefixed with "+", or a
# comma-separated list thereof. In both the DATABASE and USER fields # comma-separated list thereof. In both the DATABASE and USER fields
# you can also write a file name prefixed with "@" to include names # you can also write a file name prefixed with "@" to include names
# from a separate file. # from a separate file.
# #
# ADDRESS specifies the set of hosts the record matches. It can be a # ADDRESS specifies the set of hosts the record matches. It can be a
# host name, or it is made up of an IP address and a CIDR mask that is # host name, or it is made up of an IP address and a CIDR mask that is
# an integer (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that # an integer (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that
# specifies the number of significant bits in the mask. A host name # specifies the number of significant bits in the mask. A host name
# that starts with a dot (.) matches a suffix of the actual host name. # that starts with a dot (.) matches a suffix of the actual host name.
# Alternatively, you can write an IP address and netmask in separate # Alternatively, you can write an IP address and netmask in separate
# columns to specify the set of hosts. Instead of a CIDR-address, you # columns to specify the set of hosts. Instead of a CIDR-address, you
# can write "samehost" to match any of the server's own IP addresses, # can write "samehost" to match any of the server's own IP addresses,
# or "samenet" to match any address in any subnet that the server is # or "samenet" to match any address in any subnet that the server is
# directly connected to. # directly connected to.
# #
# METHOD can be "trust", "reject", "md5", "password", "scram-sha-256", # METHOD can be "trust", "reject", "md5", "password", "scram-sha-256",
# "gss", "sspi", "ident", "peer", "pam", "ldap", "radius" or "cert". # "gss", "sspi", "ident", "peer", "pam", "ldap", "radius" or "cert".
# Note that "password" sends passwords in clear text; "md5" or # Note that "password" sends passwords in clear text; "md5" or
# "scram-sha-256" are preferred since they send encrypted passwords. # "scram-sha-256" are preferred since they send encrypted passwords.
# #
# OPTIONS are a set of options for the authentication in the format # OPTIONS are a set of options for the authentication in the format
# NAME=VALUE. The available options depend on the different # NAME=VALUE. The available options depend on the different
# authentication methods -- refer to the "Client Authentication" # authentication methods -- refer to the "Client Authentication"
# section in the documentation for a list of which options are # section in the documentation for a list of which options are
# available for which authentication methods. # available for which authentication methods.
# #
# Database and user names containing spaces, commas, quotes and other # Database and user names containing spaces, commas, quotes and other
# special characters must be quoted. Quoting one of the keywords # special characters must be quoted. Quoting one of the keywords
# "all", "sameuser", "samerole" or "replication" makes the name lose # "all", "sameuser", "samerole" or "replication" makes the name lose
# its special character, and just match a database or username with # its special character, and just match a database or username with
# that name. # that name.
# #
# This file is read on server startup and when the server receives a # This file is read on server startup and when the server receives a
# SIGHUP signal. If you edit the file on a running system, you have to # SIGHUP signal. If you edit the file on a running system, you have to
# SIGHUP the server for the changes to take effect, run "pg_ctl reload", # SIGHUP the server for the changes to take effect, run "pg_ctl reload",
# or execute "SELECT pg_reload_conf()". # or execute "SELECT pg_reload_conf()".
# #
# Put your actual configuration here # Put your actual configuration here
# ---------------------------------- # ----------------------------------
# #
# If you want to allow non-local connections, you need to add more # If you want to allow non-local connections, you need to add more
# "host" records. In that case you will also need to make PostgreSQL # "host" records. In that case you will also need to make PostgreSQL
# listen on a non-local interface via the listen_addresses # listen on a non-local interface via the listen_addresses
# configuration parameter, or via the -i or -h command line switches. # configuration parameter, or via the -i or -h command line switches.
# DO NOT DISABLE! # DO NOT DISABLE!
# If you change this first entry you will need to make sure that the # If you change this first entry you will need to make sure that the
# database superuser can access the database using some other method. # database superuser can access the database using some other method.
# Noninteractive access to all databases is required during automatic # Noninteractive access to all databases is required during automatic
# maintenance (custom daily cronjobs, replication, and similar tasks). # maintenance (custom daily cronjobs, replication, and similar tasks).
# #
# Database administrative login by Unix domain socket # Database administrative login by Unix domain socket
#local all postgres peer #local all postgres peer
# TYPE DATABASE USER ADDRESS METHOD # TYPE DATABASE USER ADDRESS METHOD
# IPv4 local & remote connections: # IPv4 local & remote connections:
host ubm report 127.0.0.1/32 trust host ubm report 127.0.0.1/32 trust
host ubm powerbi 127.0.0.1/32 trust host ubm powerbi 127.0.0.1/32 trust
host ubm api 127.0.0.1/32 md5 host ubm api 127.0.0.1/32 md5
host dev api 127.0.0.1/32 md5 host dev api 127.0.0.1/32 md5
host all all 127.0.0.1/32 scram-sha-256 host all all 127.0.0.1/32 scram-sha-256
host ubm report 0.0.0.0/0 trust host ubm report 0.0.0.0/0 trust
host ubm api 0.0.0.0/0 md5 host ubm api 0.0.0.0/0 md5
host dev api 0.0.0.0/0 md5 host dev api 0.0.0.0/0 md5
host ubm ptrowbridge_md5 0.0.0.0/0 md5 host ubm ptrowbridge_md5 0.0.0.0/0 md5
host all all 0.0.0.0/0 scram-sha-256 host all all 0.0.0.0/0 scram-sha-256
# IPv6 local connections: # IPv6 local connections:
host ubm report fe80::/10 trust host ubm report fe80::/10 trust
host ubm powerbi fe80::/10 trust host ubm powerbi fe80::/10 trust
host ubm api fe80::/10 md5 host ubm api fe80::/10 md5
host dev api fe80::/10 md5 host dev api fe80::/10 md5
host ubm ptrowbridge_md5 fe80::/10 md5 host ubm ptrowbridge_md5 fe80::/10 md5
host all all fe80::/10 scram-sha-256 host all all fe80::/10 scram-sha-256
host all all ::/10 scram-sha-256 host all all ::/10 scram-sha-256
host all all ::/0 scram-sha-256 host all all ::/0 scram-sha-256

View File

@ -1,29 +1,29 @@
setup for single sign on with [SSPI](https://wiki.postgresql.org/wiki/Configuring_for_single_sign-on_using_SSPI_on_Windows) setup for single sign on with [SSPI](https://wiki.postgresql.org/wiki/Configuring_for_single_sign-on_using_SSPI_on_Windows)
md5 hash is salted with username in front md5 hash is salted with username in front
Memory Memory
========================================================= =========================================================
see whats in the buffer cache with pg_buffercache see whats in the buffer cache with pg_buffercache
`CREATE EXTENSION pg_buffercache` `CREATE EXTENSION pg_buffercache`
``` ```
SELECT SELECT
c.relname, c.relname,
COUNT(*) AS buffers COUNT(*) AS buffers
FROM FROM
pg_class c pg_class c
INNER JOIN pg_buffercache b ON INNER JOIN pg_buffercache b ON
b.relfilenode = c.relfilenode b.relfilenode = c.relfilenode
INNER JOIN pg_database d ON INNER JOIN pg_database d ON
( b.reldatabase = d.oid ( b.reldatabase = d.oid
AND d.datname = CURRENT_DATABASE()) AND d.datname = CURRENT_DATABASE())
GROUP BY GROUP BY
c.relname c.relname
ORDER BY ORDER BY
2 DESC 2 DESC
LIMIT 100; LIMIT 100;
``` ```

View File

@ -1,36 +1,36 @@
Version 10 Features Version 10 Features
=================== ===================
Auto Logging [blog](http://databasedoings.blogspot.com/2017/07/cool-stuff-in-postgresql-10-auto-logging.html) Auto Logging [blog](http://databasedoings.blogspot.com/2017/07/cool-stuff-in-postgresql-10-auto-logging.html)
Transition Tables [blog](http://databasedoings.blogspot.com/2017/07/cool-stuff-in-postgresql-10-transition.html) Transition Tables [blog](http://databasedoings.blogspot.com/2017/07/cool-stuff-in-postgresql-10-transition.html)
Correlated Columns Query Plan [blog](https://blog.2ndquadrant.com/pg-phriday-crazy-correlated-column-crusade/) Correlated Columns Query Plan [blog](https://blog.2ndquadrant.com/pg-phriday-crazy-correlated-column-crusade/)
Native Partitioning Native Partitioning
Logical Replication Logical Replication
Add a version of jsonb's delete operator that takes an array of keys to delete (Magnus Hagander) Add a version of jsonb's delete operator that takes an array of keys to delete (Magnus Hagander)
Make json_populate_record() and related functions process JSON arrays and objects recursively (Nikita Glukhov) Make json_populate_record() and related functions process JSON arrays and objects recursively (Nikita Glukhov)
Identity Columns [blog](https://blog.2ndquadrant.com/postgresql-10-identity-columns/) Identity Columns [blog](https://blog.2ndquadrant.com/postgresql-10-identity-columns/)
Add view pg_hba_file_rules to display the contents of pg_hba.conf (Haribabu Kommi) Add view pg_hba_file_rules to display the contents of pg_hba.conf (Haribabu Kommi)
Add XMLTABLE function that converts XML-formatted data into a row set (Pavel Stehule, Álvaro Herrera) Add XMLTABLE function that converts XML-formatted data into a row set (Pavel Stehule, Álvaro Herrera)
Security Security
=================== ===================
LDAP & Active Directory [blog](https://www.openscg.com/2017/07/setting-up-ldap-with-active-directory-in-postgresql/) LDAP & Active Directory [blog](https://www.openscg.com/2017/07/setting-up-ldap-with-active-directory-in-postgresql/)
Add SCRAM-SHA-256 support for password negotiation and storage (Michael Paquier, Heikki Linnakangas) Add SCRAM-SHA-256 support for password negotiation and storage (Michael Paquier, Heikki Linnakangas)
Monitoring Monitoring
==================== ====================
file system info - [pg_stat_kcache](https://rjuju.github.io/postgresql/2018/07/17/pg_stat_kcache-2-1-is-out.html) file system info - [pg_stat_kcache](https://rjuju.github.io/postgresql/2018/07/17/pg_stat_kcache-2-1-is-out.html)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,39 +1,39 @@
DROP USER IF EXISTS report; DROP USER IF EXISTS report;
SET password_encryption = 'scram-sha-256'; SET password_encryption = 'scram-sha-256';
CREATE ROLE report WITH CREATE ROLE report WITH
LOGIN LOGIN
NOSUPERUSER NOSUPERUSER
NOCREATEDB NOCREATEDB
NOCREATEROLE NOCREATEROLE
INHERIT INHERIT
NOREPLICATION NOREPLICATION
CONNECTION LIMIT -1 CONNECTION LIMIT -1
PASSWORD 'report'; PASSWORD 'report';
--------------------grant-------------------------------------------------- --------------------grant--------------------------------------------------
GRANT USAGE ON SCHEMA lgdat TO report; GRANT USAGE ON SCHEMA lgdat TO report;
GRANT SELECT /*, UPDATE, INSERT, DELETE*/ ON ALL TABLES IN SCHEMA lgdat TO report; GRANT SELECT /*, UPDATE, INSERT, DELETE*/ ON ALL TABLES IN SCHEMA lgdat TO report;
GRANT USAGE ON ALL SEQUENCES IN SCHEMA lgdat TO report; GRANT USAGE ON ALL SEQUENCES IN SCHEMA lgdat TO report;
ALTER DEFAULT PRIVILEGES IN SCHEMA lgdat GRANT SELECT/*, UPDATE, INSERT, DELETE*/ ON TABLES TO report; ALTER DEFAULT PRIVILEGES IN SCHEMA lgdat GRANT SELECT/*, UPDATE, INSERT, DELETE*/ ON TABLES TO report;
ALTER DEFAULT PRIVILEGES IN SCHEMA lgdat GRANT USAGE ON SEQUENCES TO report; ALTER DEFAULT PRIVILEGES IN SCHEMA lgdat GRANT USAGE ON SEQUENCES TO report;
---------------------------revoke--------------------------------------- ---------------------------revoke---------------------------------------
REVOKE USAGE ON SCHEMA lgdat FROM report; REVOKE USAGE ON SCHEMA lgdat FROM report;
REVOKE USAGE ON SCHEMA lgdat FROM report; REVOKE USAGE ON SCHEMA lgdat FROM report;
REVOKE SELECT , UPDATE, INSERT, DELETE ON ALL TABLES IN SCHEMA lgdat FROM report; REVOKE SELECT , UPDATE, INSERT, DELETE ON ALL TABLES IN SCHEMA lgdat FROM report;
REVOKE USAGE ON ALL SEQUENCES IN SCHEMA lgdat FROM report; REVOKE USAGE ON ALL SEQUENCES IN SCHEMA lgdat FROM report;
ALTER DEFAULT PRIVILEGES IN SCHEMA lgdat REVOKE SELECT, UPDATE, INSERT, DELETE ON TABLES FROM report; ALTER DEFAULT PRIVILEGES IN SCHEMA lgdat REVOKE SELECT, UPDATE, INSERT, DELETE ON TABLES FROM report;
ALTER DEFAULT PRIVILEGES IN SCHEMA lgdat REVOKE USAGE ON SEQUENCES FROM report; ALTER DEFAULT PRIVILEGES IN SCHEMA lgdat REVOKE USAGE ON SEQUENCES FROM report;

11
redis.md Normal file
View File

@ -0,0 +1,11 @@
should be set to bind to 127.0.0.1::1 so as to only accept localhost connections
should be able to run `redis-cli` after clean install which defauts to run on port 6379
run `openssl rand 60 | openssl base64 -A` to generate a random strong password
set as value at `requirepass {pw}`
some addition info on disabling dangerous commands
https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-redis-on-ubuntu-18-04

126
role.md
View File

@ -1,64 +1,64 @@
Deriving The Trial Balance Deriving The Trial Balance
============================================================================================================= =============================================================================================================
* Entries and reocniliations * Entries and reocniliations
* Payroll * Payroll
* Data: Retain all payroll data in a `database` to build entries * Data: Retain all payroll data in a `database` to build entries
* Mappings: Configure `Paycom GL Interface` * Mappings: Configure `Paycom GL Interface`
* `401k`: book disbursements and reconcile to Paycom withholdings * `401k`: book disbursements and reconcile to Paycom withholdings
* `FSA`: book FSA funding entries and reconcile to Paycom withholdings * `FSA`: book FSA funding entries and reconcile to Paycom withholdings
* Debt & Cash * Debt & Cash
* Data: retain all PNC information available in a `database` to build entries (cash, revolver, debt) * Data: retain all PNC information available in a `database` to build entries (cash, revolver, debt)
* Book all PNC `loan activity` * Book all PNC `loan activity`
* Book interest on `notes` * Book interest on `notes`
* Reconcile all balance sheet `debt` * Reconcile all balance sheet `debt`
* Book `interest rate swap` valuation * Book `interest rate swap` valuation
* Bank Rec: * Bank Rec:
* book entry to break out `freight checks` * book entry to break out `freight checks`
* book entries to clean up missed `fees` * book entries to clean up missed `fees`
* book entries to deal with `miscelaneous discrepencies` * book entries to deal with `miscelaneous discrepencies`
* book entry to classify `outstanding checks` as liabilities * book entry to classify `outstanding checks` as liabilities
* Intercompany Activity * Intercompany Activity
* Support `transfer pricing` entry * Support `transfer pricing` entry
* Book `consolidating` entries * Book `consolidating` entries
* Book `currency translation adjustment` for consolidated USD trial balance * Book `currency translation adjustment` for consolidated USD trial balance
* Reconcile `CTA` & `Equity` * Reconcile `CTA` & `Equity`
* Reclassify any `intercompany liabilites` out of the trade accounts * Reclassify any `intercompany liabilites` out of the trade accounts
* Validate that `intercompany balances` are eliminated from consolidated trial balance * Validate that `intercompany balances` are eliminated from consolidated trial balance
* Other Balance Sheet Items * Other Balance Sheet Items
* Book and reconcile amortization of `intangibles` * Book and reconcile amortization of `intangibles`
* Book and reconcile amortization of `defered financing costs` * Book and reconcile amortization of `defered financing costs`
* Book RSM determined `tax provision` and current year `tax accrual` * Book RSM determined `tax provision` and current year `tax accrual`
* CMS Module Corrections * CMS Module Corrections
* book entry to fix `virtual sales` * book entry to fix `virtual sales`
* book entry to fix `credits` * book entry to fix `credits`
* furnish a report to the plants breaking out the `book to perpetual` issues * furnish a report to the plants breaking out the `book to perpetual` issues
* sales timing and valuation issues * sales timing and valuation issues
* cost roll impact * cost roll impact
* production ledger issues * production ledger issues
* voucher issues * voucher issues
* issues with transfers * issues with transfers
* issues with returns * issues with returns
* Configuration * Configuration
* Module accounts (sales, inventory, production, manual adjustments, AP, AR, intecompany) * Module accounts (sales, inventory, production, manual adjustments, AP, AR, intecompany)
* Chart of Accounts * Chart of Accounts
* EBITDA flags * EBITDA flags
* consolidation flags * consolidation flags
* consolidation heirarchy * consolidation heirarchy
* financial statement lines * financial statement lines
* currency indicator * currency indicator
Interpreting The Trial Balance Interpreting The Trial Balance
========================================================================================================= =========================================================================================================
* Rebuild trial balance into alternate financial statement formats * Rebuild trial balance into alternate financial statement formats
* Rebuilt subledger that matches original ledger * Rebuilt subledger that matches original ledger
* Rebuild production subledger that does not match original * Rebuild production subledger that does not match original
* Sales Matrix * Sales Matrix
* A large number of reports that I can't even list but are maintained [here](https://bitbucket.org/hccompanies/hc_ubm/src/master/) * A large number of reports that I can't even list but are maintained [here](https://bitbucket.org/hccompanies/hc_ubm/src/master/)
Forecasting Forecasting
============================= =============================
* Product Strucutre Explosion Logic * Product Strucutre Explosion Logic
* global scale cost change estimates * global scale cost change estimates
* production plans * production plans
* inventory forecasts * inventory forecasts
* Sales forecast tool * Sales forecast tool

View File

@ -1,33 +1,33 @@
CREATE PROC RLARP.TEST AS CREATE PROC RLARP.TEST AS
BEGIN BEGIN
PRINT 'Hi'; --non-erroring statement PRINT 'Hi'; --non-erroring statement
create table #temp(x varchar(255)); --create a permanent object to call outside block after error create table #temp(x varchar(255)); --create a permanent object to call outside block after error
insert into #temp select 1/0; insert into #temp select 1/0;
insert into #temp select 'hi'; --fill it after error insert into #temp select 'hi'; --fill it after error
--select * from #temp; --select it after error --select * from #temp; --select it after error
PRINT ERROR_MESSAGE(); --error message is gone PRINT ERROR_MESSAGE(); --error message is gone
END; END;
begin transaction x begin transaction x
declare @e int; declare @e int;
DECLARE @em varchar(max); DECLARE @em varchar(max);
begin try begin try
EXEC RLARP.TEST; EXEC RLARP.TEST;
end TRY end TRY
begin CATCH begin CATCH
select @e = ERROR_NUMBER(), @em = ERROR_MESSAGE(); select @e = ERROR_NUMBER(), @em = ERROR_MESSAGE();
if @e <> 0 if @e <> 0
BEGIN BEGIN
rollback transaction x; rollback transaction x;
print @em; print @em;
END END
if @e = 0 if @e = 0
BEGIN BEGIN
commit transaction x; commit transaction x;
print 'ok'; print 'ok';
end end
end catch end catch
SELECT * FROM #temp SELECT * FROM #temp

View File

@ -1,5 +1,5 @@
invite link invite link
https://meta.sr.ht/register/K8XW9Hyl86fdL0f925ertqEv https://meta.sr.ht/register/K8XW9Hyl86fdL0f925ertqEv
must have public key (ssh-keygen) upoaded to your account for git pushing must have public key (ssh-keygen) upoaded to your account for git pushing

50
tmux.md
View File

@ -1,25 +1,25 @@
`Ctlr+B` activiates command entry (called the prefix) `Ctlr+B` activiates command entry (called the prefix)
panes panes
---------------------------------- ----------------------------------
% = split pane right % = split pane right
" = split pane below " = split pane below
<Up>/<Left> = switch panes <Up>/<Left> = switch panes
z = maximize/minimize pane z = maximize/minimize pane
x = kill pane x = kill pane
Ctrl+B+<Arrow> = resize Ctrl+B+<Arrow> = resize
windows windows
---------------------------------- ----------------------------------
c = create new window c = create new window
w = create window selection prompt w = create window selection prompt
sessions sessions
---------------------------------- ----------------------------------
d = detach session d = detach session
tmux ls = list sesions tmux ls = list sesions
tmux attach -t 0 = attach to session 0 tmux attach -t 0 = attach to session 0

View File

@ -1,6 +1,6 @@
for windows for windows
------------------ ------------------
* `apt install cifs-utils` * `apt install cifs-utils`
* create target folder `mkdir //mnt/onedrive` * create target folder `mkdir //mnt/onedrive`
* `sudo mount.cifs //192.168.1.89/Users/fleet/OneDrive onedrive/ -o user=fleet` * `sudo mount.cifs //192.168.1.89/Users/fleet/OneDrive onedrive/ -o user=fleet`

View File

@ -1,7 +1,10 @@
scanning services that are running: scanning services that are running:
sudo nmap -T Aggressive -A -v 127.0.0.1 -p 1-10000 sudo nmap -T Aggressive -A -v 127.0.0.1 -p 1-10000
sudo netstat --tcp --udp --listening --program sudo netstat --tcp --udp --listening --program
sudo lsof +M -i4 -i6 sudo lsof +M -i4 -i6
let's encrypt certbot instructions for apache:
https://certbot.eff.org/lets-encrypt/ubuntubionic-apache

View File

@ -1,43 +1,43 @@
apt update apt update
``` ```
sudo apt update sudo apt update
sudo apt upgrade sudo apt upgrade
//sometimes network-manager service is not running after update and cannot resolve addresses //sometimes network-manager service is not running after update and cannot resolve addresses
sudo service network-manager start sudo service network-manager start
sudo ln -sf /run/resolvconf/resolv.conf /etc/resolv.conf sudo ln -sf /run/resolvconf/resolv.conf /etc/resolv.conf
``` ```
also had to reference [this article](https://askubuntu.com/questions/368435/how-do-i-fix-dns-resolving-which-doesnt-work-after-upgrading-to-ubuntu-13-10-s) also had to reference [this article](https://askubuntu.com/questions/368435/how-do-i-fix-dns-resolving-which-doesnt-work-after-upgrading-to-ubuntu-13-10-s)
version control /etc version control /etc
``` ```
cd //etc cd //etc
sudo git init sudo git init
sudo git add . sudo git add .
sudo git commit -m "initial setup" sudo git commit -m "initial setup"
``` ```
pspg pager pspg pager
``` ```
sudp apt-get install pspg sudp apt-get install pspg
``` ```
postgres postgres
``` ```
sudo vim /etc/apt/sources.list.d/pgdg.list sudo vim /etc/apt/sources.list.d/pgdg.list
deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update sudo apt-get update
sudo apt-get install postgresql-11 sudo apt-get install postgresql-11
``` ```
vundle vundle
``` ```
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
``` ```
dotfiles (depends on vundle currently) dotfiles (depends on vundle currently)
``` ```
git clone "https://fleetside@bitbucket.com/fleetside/dotfiles.git" git clone "https://fleetside@bitbucket.com/fleetside/dotfiles.git"
cp -R ~/dotfiles/. ~/ cp -R ~/dotfiles/. ~/
sudo rm -r dotfiles/ sudo rm -r dotfiles/
``` ```

View File

@ -1,21 +1,21 @@
`//etc/systemd/system/filename.service` `//etc/systemd/system/filename.service`
``` ```
[Unit] [Unit]
Description=forecast_api Description=forecast_api
After=network.target After=network.target
[Service] [Service]
ExecStart=/usr/bin/node //opt/forecast_api/index.js ExecStart=/usr/bin/node //opt/forecast_api/index.js
Restart=always Restart=always
User=fc_api User=fc_api
Environemnt=NODE_ENV=production Environemnt=NODE_ENV=production
WorkingDirectory=//opt/forecast_api WorkingDirectory=//opt/forecast_api
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
``` ```
`systemctl enable forecast.api` `systemctl enable forecast.api`
`systemctl start forecast_api.service` `systemctl start forecast_api.service`

View File

@ -1,8 +1,8 @@
`adduser` -> high-level `adduser` -> high-level
`useradd` -> low-level `useradd` -> low-level
adduser fc_api adduser fc_api
usermod -a -G sudo fc_api usermod -a -G sudo fc_api
chown user_name directory/ chown user_name directory/
chgrp user_name directory/ chgrp user_name directory/

View File

@ -1,4 +1,4 @@
* fit width `-` * fit width `-`
* move columne `H L` * move columne `H L`
* move end/beg/left/right `g+hjkl` * move end/beg/left/right `g+hjkl`
* select rows `s`, `u` all `gu`, `gs` * select rows `s`, `u` all `gu`, `gs`