Arduino Student Kit February-April 2022 lead by Matt Johnson
Arduino Student Kit
| # Testing SSL connection to PostgreSQL database | |
| psql -h testpg.555555555555.us-east-1.rds.amazonaws.com -p 5432 \ | |
| "dbname=testpg user=testuser sslrootcert=rds-ca-2019-root.pem sslmode=verify-full" |
| # ZSH - ~/.zshrc | |
| # Luke's config for the Zoomer Shell (https://gist.github.com/LukeSmithxyz/e62f26e55ea8b0ed41a65912fbebbe52) | |
| autoload -U colors && colors | |
| PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b " | |
| PS1='$("$POWERLINE_COMMAND" $=POWERLINE_COMMAND_ARGS shell aboveleft -r .zsh --last-exit-code=$? --last-pipe-status="$pipestatus" --renderer-arg="client_id=$$" --renderer-arg="shortened_path=${(%):-%~}" --jobnum=$_POWERLINE_JOBNUM --renderer-arg="mode=$_POWERLINE_MODE" --renderer-arg="default_mode=$_POWERLINE_DEFAULT_MODE" --width=$(( ${COLUMNS:-$(_powerline_columns_fallback)} - ${ZLE_RPROMPT_INDENT:-1} )))' | |
| # BASH - ~/.bash_profile | |
| PS1="\[\033[0;5m\]\u@\h\[\033[0m\]:\@:\[\033[0;31m\]\w\[\033[0m\]#" | |
| PS1="\[\033[0;36m\]\u@\h\[\033[0m\]:\@:\[\033[0;37m\]\w\[\033[0m\]$" |
| AddKeysToAgent ask | |
| # Managing multiple github keys with host entries and defaults with exclusions | |
| # Test with: | |
| # ssh -T git@asdf | |
| # ssh -T [email protected] | |
| Host github.com | |
| UseKeychain yes | |
| AddKeysToAgent yes | |
| IdentityFile ~/.ssh/id_rsa |
| # When you SSH into a server for the first time it prompts you if you trust the remote server's host key | |
| # To validate that they key you received is the same as the server you just logged into you can check | |
| # the fingerprint of the host key on the remote server itself. | |
| # Output fingerprint of system's host key | |
| ssh-keygen -l -f /etc/ssh/ssh_host_ecdsa_key.pub | |
| # You can fingerprint both the private and public key from a file | |
| # They should both produce the same fingerprint value. | |
| ssh-keygen -l -f ~/.ssh/id_ed25519.pub |
| # Detect Source Guardian encoded files search for 'sg_load(' in php encoded files | |
| # Detect ionCube encoded files search for 'ioncube_loader_' in php encoded files |
| # Heroku Postgres spins up instances that could be using self-signed certificates | |
| # You can view the details of a Postgres certificate to validate it | |
| openssl version | |
| # version 1.1.1+ supports postgres client connections | |
| # RHEL 8 / CentOS 8 should have a new enough version of openssl | |
| # macOS 11 uses LibreSSL and does not have support for this | |
| POSTGRES_HOST="my_postgres_db.lan" | |
| POSTGRES_PORT="5432" |
| -- Magento 2 Order Summary by date/hour | |
| select date_format( created_at, '%Y-%m-%d %H:00' ) date_hour, | |
| count(*) order_count | |
| from sales_order o | |
| where o.created_at > '2021-01-01' and o.created_at < '2021-04-10' | |
| group by date_format( created_at, '%Y%m%d%H' ) | |
| having order_count > 100 | |
| order by order_count desc; |
| # Install Pygments (https://pygments.org/) | |
| pip install Pygments | |
| brew install pygments | |
| # XML | |
| cat myfile.xml | xmllint --format - | pygmentize -l xml | |
| # JSON | |
| cat myfile.json | jq . | pygmentize -l json |