Skip to content

Instantly share code, notes, and snippets.

View 5t33's full-sized avatar

Steven Staley 5t33

View GitHub Profile
ps -daf # show me all the processes and all the info
ps aux # show me processes as well, but more organized
lsof -i :<port> # get PID and other info of process running on port
# Below is an example of some things you can do with gawk/awk (gawk on mac). Read man for more detail.
some_command | gawk/awk '{variable = gensub(/<your regex>/,"\\1","g",$1); if(!d[ip]) { print variable; d[ip]=1; fflush(stdout)}'
#another awk example that I don't fully understand, but keeping it to look into later
some_command | awk '$1>1024 {print ":" $0; fflush()}'
@j3k0
j3k0 / override-set-timeout-a.js
Last active October 28, 2022 02:24
setTimeout based on the audioContext timer
function customTimeoutFunction(audioContext) {
let tasks = [];
let nextTaskId = 1;
function now() {
return audioContext.currentTime * 1000;
}
function scheduler() {
@Can-Sahin
Can-Sahin / cognito-idtoken-cli.sh
Last active February 14, 2023 21:22
Simple shell script to obtain a IdToken from Cognito User Pool. Just like logging in.
#!/bin/bash
username="COGNITO_USER_NAME"
password="PASSWORD"
clientid="APP_CLIENT_ID"
region="eu-west-1"
aws_profile="AWS_CLI_PROFILE"
response_json=""
json_field='IdToken'