Skip to content

Instantly share code, notes, and snippets.

View vyspiansky's full-sized avatar

Ihor Vyspiansky vyspiansky

View GitHub Profile
@vyspiansky
vyspiansky / jest-test-commands.md
Last active February 8, 2023 08:26
Jest commands

Jest commands

Run specific test

jest --config=../../jest.config.js --colors src/path/to/file.test.ts
@vyspiansky
vyspiansky / minikube-hyperkit-snippets.md
Created February 1, 2023 09:50
Minikube + Hyperkit snippets

minikube start --kubernetes-version=v1.22.3 --driver=hyperkit --container-runtime=docker --nfs-share="/path/tp/project/folder" --nfs-shares-root="/"


minikube logs minikube profile list


minikube kubectl get nodes

@vyspiansky
vyspiansky / nmap-port-scanning.md
Created February 1, 2023 09:44
Port scanning nmap utility

nmap - Port scanning utility for large networks

Install on macOS:

brew install nmap

To see ports being listened to:

@vyspiansky
vyspiansky / docker-compose.md
Created February 1, 2023 09:41
Docker compose

Docker compose

Up a certain container only

docker-compose up -d <NAME>
docker-compose logs

Note: Just drop the -d flag if you want to see the logs echoed to stdout.

@vyspiansky
vyspiansky / cherry-pick.md
Created February 1, 2023 09:37
Cherry-pick

Cherry-pick

  1. Get commit hash 103fe73
  2. Create branch from a specific version (tag) and name it like forward-merge-<YOUR_BRANCH>
  3. Run git cherry-pick 103fe73
  4. Resolve conflicts if needed
@vyspiansky
vyspiansky / vs-code-snippets.md
Created January 31, 2023 21:59
Visual Studio Code snippets

How to compare 2 files

code -d left.txt right.txt

Note: where in your ~/.bash_profile file

code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;}
@vyspiansky
vyspiansky / redis-command-line-interface.md
Created January 31, 2023 21:49
Redis command line interface

Go to Redis command line interface

redis-cli -h 127.0.0.1 -p 6379

Info and stats about the server

127.0.0.1:6379&gt; INFO
@vyspiansky
vyspiansky / sequelize-log-generated-sql-query-statements.md
Created January 31, 2023 21:45
Sequelize: show generated SQL query statements

If you disabled query logging, you can still log individual queries when needed.

await User.findOne({
  logging: console.log, // log SQL statement to console
  // ...
});
@vyspiansky
vyspiansky / self-signed-certificate-in-debian-ubuntu.md
Created January 31, 2023 21:24
Self-signed certificate in Debian/Ubuntu

Debian/Ubuntu image already included a self-signed certificate.

docker run \
  --rm \
  -e POSTGRES_PASSWORD=password \
  postgres:12 \
  -c ssl=on \
  -c ssl_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem \
 -c ssl_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
@vyspiansky
vyspiansky / postgres-commands.md
Created January 31, 2023 21:21
Postgres: useful commands

DB restart

postgres=# SELECT pg_reload_conf();
  pg_reload_conf
----------------
  t
(1 row)