Skip to content

Instantly share code, notes, and snippets.

View tutelacooldouce's full-sized avatar

Bosastream tutelacooldouce

View GitHub Profile
@tutelacooldouce
tutelacooldouce / postgres-cheatsheet.md
Created December 9, 2021 09:06 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
curl -s -X GET http://localhost:8080/pdb/query/v4/facts --data-urlencode query@test --data-urlencode 'pretty=true'
curl -X POST http://localhost:8080/pdb/query/v4/facts \
-H 'Content-Type:application/json' \
-d '{"query":["and",["=","certname","FQDN"],["=","name","ipaddress"]]}'
content of file test :
["and",["=","certname","FQDN"],["or",["=","name","ipaddress"]]]
@tutelacooldouce
tutelacooldouce / cli.docker.sh
Created September 26, 2021 22:35 — forked from LeCoupa/cli.docker.sh
Docker Cheatsheet + Tips & Tricks --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
docker build -t friendlyname . # Create image using this directory's Dockerfile
docker run -p 4000:80 friendlyname # Run "friendlyname" mapping port 4000 to 80
docker run -d -p 4000:80 friendlyname # Same thing, but in detached mode
docker exec -it [container-id] bash # Enter a running container
docker ps # See a list of all running containers
docker stop <hash> # Gracefully stop the specified container
docker ps -a # See a list of all containers, even the ones not running
docker kill <hash> # Force shutdown of the specified container
docker rm <hash> # Remove the specified container from this machine
docker rm $(docker ps -a -q) # Remove all containers from this machine
@tutelacooldouce
tutelacooldouce / create-package.md
Created September 26, 2021 22:30 — forked from deanrather/create-package.md
Creating a .deb Package

Creating a .deb Package

This creates a package which runs an install.sh which copies a file somewhere the below is entirely incorrect. Hopefully I'll get around to fixing it tip: this would install to the root dir & the relative path to ./install.sh would be wrong

go to project directory

cd /path/to/project
@tutelacooldouce
tutelacooldouce / nginx-tuning.md
Created March 7, 2021 14:05 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

Ansible - Cheatsheet

ansible-galaxy

Playbook template init with ansible-galaxy

ansible-galaxy init roles/myrole

ansible-playbook

@tutelacooldouce
tutelacooldouce / Git - Cheatsheet.md
Created October 15, 2018 21:27 — forked from mbodo/Git - Cheatsheet.md
My simply Git Cheatsheet
@tutelacooldouce
tutelacooldouce / docker.md
Created October 15, 2018 21:24 — forked from mbodo/docker.md
Docker notes/cheatsheet