Skip to content

Instantly share code, notes, and snippets.

@kenshin17
kenshin17 / database_backup_restore.adoc
Created August 8, 2019 09:22 — forked from stompro/database_backup_restore.adoc
Database Backup and Restore

Evergreen Database - Backup and Restore

Tips and tricks on backing up and restoring your Evergreen Database.

Backup to directory format dump. This allows the dump to be done in parrallel for speed, and automatically compresses the output. The downside is that it may not be possible to restore to a different version of postgresql. If you need to move from one version of postgres to another, don’t use the directory format. pg_dump -U evergreen -j 4 -F d -f $BACKUPDIR/$DBNAME-$CURTIME $DBNAME

Restore into a new database

@kenshin17
kenshin17 / Compile PostgreSQL 10.5 on Ubuntu-16.04
Created September 4, 2019 09:26
Compile-postgreSQL-10.5-Ubuntu-16.04.LTS.sh
#!/bin/bash
# File : Compile-postgreSQL-10.5-Ubuntu-16.04.LTS.sh
# OS : Ubuntu 16.04.5 LTS
# LastUpdate : 11:55 2019.05.13
# Description : Compile PostgreSQL 10.5 on Ubuntu-16.04
###########################################
export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
#!/bin/bash
# File : compile-mariadb-10.3.sh
# OS : Ubuntu 16.04.6 LTS
# LastUpdate : 16:55 2019.10.08
# Description : Compile MariaDB Server StandAlone / MariaDB Galera Cluster 10.3
###########################################
MARIADB_VERSION=10.3.18
MARIADB_HOME=/mariadb
@kenshin17
kenshin17 / compile-postgreSQL-11.5-Ubuntu-16.04.LTS.sh
Created November 4, 2019 07:40
Compile PostgreSQL 11.5 on Ubuntu
#!/bin/bash
# File : compile-postgreSQL-11.5-Ubuntu-16.04.LTS.sh
# OS : Ubuntu 16.04.6 LTS
# LastUpdate : 10:06 2019.10.07
# Description : Compile PostgreSQL 11.5 on Ubuntu
###########################################
##POSTGRESQL : /postgres/pgscript/postgres-stop.sh | /postgres/pgscript/postgres-restart.sh <<<<<RESTART>>>>>
# | CONFIG FILE : /postgres/pgdata/{postgresql.conf,pg_hba.conf}
# | CONNECT DBA : /postgres/pgscript/postgres-connect-dba.sh
@kenshin17
kenshin17 / compile-python-3.6.5.sh
Created November 4, 2019 07:51
Compile python-3.6.5
#!/bin/bash
# File : compile-python-3.6.5.sh
# OS : Redhat/Debian
# LastUpdate : 14:38 2019.11.04
# Description : Compile python-3.6.5
###########################################
# Determine OS platform
echo -e "\n########## Determine OS platform ##########"
if [ -f /etc/redhat-release ]; then
# For yum-based systems (like CentOS)
@kenshin17
kenshin17 / docker-cleanup-resources.md
Created November 28, 2019 02:11 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@kenshin17
kenshin17 / README.md
Created March 11, 2020 17:32 — forked from gnutix/README.md
Install a Raspberry Pi as a torrent download station (09.2019)
@kenshin17
kenshin17 / iterm2-solarized.md
Created March 18, 2020 16:50 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@kenshin17
kenshin17 / haproxy.config
Created January 21, 2021 06:39 — forked from meineerde/haproxy.config
Set all cookies set in the HTTP response to HttpOnly
acl httponly_cookie res.hdr(Set-Cookie),lower -m sub httponly
rspirep ^(set-cookie:.*) \1;\ HttpOnly if !httponly_cookie
@kenshin17
kenshin17 / nginx-tls.conf
Created January 28, 2021 03:04 — forked from gavinhungry/nginx-tls.conf
Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Name: nginx-tls.conf
# Auth: Gavin Lloyd <[email protected]>
# Desc: Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Enables HTTP/2, PFS, HSTS and OCSP stapling. Configuration options not related
# to SSL/TLS are not included here.
#
# Additional tips:
#