- Export key to file:
gpg -o key.gpg --export <KEY ID>
- Export key in ASCII:
gpg -o key.asc --export --armor <KEY ID>
Note: Omitting the -o|--output option will print the key to stdout.
gpg --import key.gpg
CREATE OR REPLACE FUNCTION drop_all () | |
RETURNS VOID AS | |
$$ | |
DECLARE rec RECORD; | |
BEGIN | |
-- Get all the schemas | |
FOR rec IN | |
SELECT nspname FROM pg_catalog.pg_namespace WHERE (nspname != 'public') and (nspname NOT LIKE 'pg_%') and (nspname != 'information_schema') LIMIT 50 | |
LOOP | |
EXECUTE format('DROP SCHEMA "%s" CASCADE', rec.nspname); |
Light Theme | |
#F9F4EE,#EEE8D5,#486570,#F9F4EE,#E8E1D8,#486570,#2AA198,#DC322F,#486570,#F9F4EE | |
Dark Theme | |
#292C33,#EEE8D5,#CFC2AE,#292C33,#6F7073,#CFC2AE,#5D8687,#5D8687,#CFC2AE,#292C33 |
-- Copied from https://www.alexedwards.net/blog/using-postgresql-jsonb | |
-- Create a table with a JSONB column. | |
CREATE TABLE items ( | |
id SERIAL PRIMARY KEY, | |
attrs JSONB | |
); | |
-- You can insert any well-formed json input into the column. Note that only | |
-- lowercase `true` and `false` spellings are accepted. |
# fluxctl cheatsheet | |
## Use different namespace than default for flux daemon. | |
export FLUX_FORWARD_NAMESPACE={kube_ns} | |
fluxctl --k8s-fwd-ns={kube_ns} list-workloads | |
## List all workloads | |
fluxctl list-workloads | |
## List all workloads in all namespaces |
# Local port forwarding | |
# Forward all the requests on localhost:8000 to restricted-domain.com:80 via remote-server.com | |
ssh -L 8000:restricted-domain.com:80 [email protected] | |
# Remote port forwarding | |
# Forward all requests to remote-server.com:8000 to your localhost:3000 | |
ssh -R 8000:localhost:3000 [email protected] |
gpg -o key.gpg --export <KEY ID>
gpg -o key.asc --export --armor <KEY ID>
Note: Omitting the -o|--output option will print the key to stdout.
gpg --import key.gpg
$\{var:-word}
: If var is null or unset, word is substituted for var. The value of var does not change.
$\{var:=word}
: If var is null or unset, var is set to the value of word.
$\{var:?message}
: If var is null or unset, message is printed to standard error. This checks that variables are set correctly.
$\{var:+word}
: If var is set, word is substituted for var. The value of var does not change.
package main | |
import ( | |
"runtime" | |
"fmt" | |
"time" | |
) | |
func main() { | |
// Print our starting memory usage (should be around 0mb) |
/* | |
*********************************************** | |
psql -h host -U user db: Connect to database | |
psql -E: Describe the underlaying queries of the \ commands | |
psql -l: List all database and exit | |
\q: Quit | |
\c db_name: Switch database | |
\l: Show databases | |
\d table_name: Show table info |
curl -ks registry/v2/_catalog | jq '.["repositories"] | join(" ")' | tr -d '"' | |
curl -ks registry/v2/go/tags/list | jq . | |
curl -ks registry/v2/_catalog | jq . |