Skip to content

Instantly share code, notes, and snippets.

View theothermattm's full-sized avatar

Matt M. theothermattm

View GitHub Profile
@theothermattm
theothermattm / node-debugging.md
Created June 14, 2019 13:31
Debugging w/ Node.js and Chrome

Node debugging with chrome

See this article first.

Use node --inspect

Most of the time it should give you a chrome URL. If not, go to about:inspect in chrome and you should see a target to inspect

Using mocha

@theothermattm
theothermattm / node-ca-certs.md
Created May 29, 2019 13:39
CA Certs In node
@theothermattm
theothermattm / engineering-culture-notes.md
Last active April 10, 2019 13:05
Engineering Culture Notes

Some of the greatest info I've seen on creating a healthy engineering courtesy of Spotify:

TODO make notes on this one

  • 0:50 - "We aim to make mistakes faster than anyone else" - Fail Fast and Improve Fast.
  • 1:30 - "Fail Friendly Environment" - Encourage sharing of failures so everyone can learn from them. Some teams have "Fail walls" showing off their failures.
@theothermattm
theothermattm / oracle-health-check.sql
Created February 21, 2019 15:37
Bash script to check health of an oracle instance
# original source based on: https://github.com/fabiohbarbosa/docker-healthcheck-oracle/blob/master/assets/healthcheck.sh
CHECK=$(${ORACLE_HOME}/bin/sqlplus -s ${HEALTHCHECK_USER}/${HEALTHCHECK_PASSWORD}@localhost/${HEALTHCHECK_SERVICE_NAME} as sysdba <<END
--set pagesize 0 feedback off verify off heading off echo off;
-- the simplest type of health check
--select count(*) from dual;
-- this will check if a
SELECT count(*) FROM V\$INSTANCE where INSTANCE_NAME = 'xe' and DATABASE_STATUS = 'ACTIVE';
exit;
END
@theothermattm
theothermattm / oracle-delete-all-tables.sql
Created February 15, 2019 20:30
Delete All Tables in an Oracle Schema
-- https://stackoverflow.com/questions/1690404/how-to-drop-all-user-tables
BEGIN
FOR cur_rec IN (SELECT object_name, object_type
FROM user_objects
WHERE object_type IN
('TABLE',
'VIEW',
'PACKAGE',
'PROCEDURE',
@theothermattm
theothermattm / experimental-culture.md
Last active October 8, 2018 13:01
Experimental Culture

Tom Chi - Learning Through Prototyping

()[https://www.youtube.com/watch?v=kuqgrvUPc5g]

  • Better to reason with experience/data than guesses
    • Find the quickest path to experience
    • Doing is the best kind of thinking.
  • Smart people will always have good defenses of their guesses
  • "Am I hearing a guess, or am I hearing direct experience?"
  • We want experience
@theothermattm
theothermattm / gist:5277168
Created March 30, 2013 15:45
SLF4J Parameterized Logging Example
// this
if ( logger.isDebugEnabled() ) {
logger.debug("Some code with a parameter: " + param1 + " - " + param2 + " - " + param3);
}
// becomes this
logger.debug("Some code with a parameter: {} - {} - {}", param1, param2, param3");
@theothermattm
theothermattm / gitignoresync.sh
Created July 28, 2017 19:09
Sync files using .gitignore
rsync -azP --delete --filter=":- .gitignore" . targethost:/targetdirectory
@theothermattm
theothermattm / KeyAuthSetup.md
Last active December 19, 2016 12:24
Setting up keyauth fast
  • On each remote server:
mkdir -p ~/.ssh; touch ~/.ssh/authorized_keys; chmod -R 700 ~/.ssh;
cat .ssh/id_rsa.pub | ssh username@host "cat >> ~/.ssh/authorized_keys"
@theothermattm
theothermattm / convert-crt-to-pem.sh
Created July 20, 2016 15:32
Convert .crt to .pem for CA's
# from https://github.com/nodejs/node/issues/3742#issuecomment-225939382
openssl x509 -inform der -in /Path/to/the.crt -out /Path/to/the/file.pem