Skip to content

Instantly share code, notes, and snippets.

View duyhenryer's full-sized avatar
🥦
Củ Cải Trắng

Duy Henry duyhenryer

🥦
Củ Cải Trắng
View GitHub Profile
### Keybase proof
I hereby claim:
* I am duyhenryer on github.
* I am duyhenryer (https://keybase.io/duyhenryer) on keybase.
* I have a public key whose fingerprint is AF28 575C AB2A E03E 0B91 58CA A806 0DC8 C69B 7D19
To claim this, I am signing this object:
@duyhenryer
duyhenryer / virtualbox_vagrant_home.bat
Created December 6, 2019 14:52 — forked from michaelklapper/virtualbox_vagrant_home.bat
Reconfigure VirtualBox and Vagrant home directory for Windows Set VirtualBox home directory to: C:\VMs Store vagrant boxes: C:\VMs\vagrant.d
# VirtualBox home directory.
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" setproperty machinefolder "C:\VMs"
# Vagrant home directory for downloadad boxes.
REG ADD HKCU\Environment /v VAGRANT_HOME /t REG_SZ /d "C:\VMs\vagrant.d"
@duyhenryer
duyhenryer / Documentation.md
Created April 18, 2020 16:37 — forked from KartikTalwar/Documentation.md
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@duyhenryer
duyhenryer / README.md
Created September 28, 2020 08:33 — forked from Eyjafjallajokull/README.md
AWS EBS - Find unused snapshots

This script can help you find and remove unused AWS snapshots and volumes.

There is hardcoded list of regions that it searches, adjust the value to suit your needs.

Use snapshot.py snapshot-report to generate report.csv containing information about all snapshots.

snapshot.py snapshot-cleanup lets you interactively delete snapshot if it finds it is referencing unexisting resources.

./snapshots.py --help
@duyhenryer
duyhenryer / gist:6ad1a4252607a857572d8aaafe847dd0
Created October 23, 2020 09:09 — forked from kapkaev/gist:4619127
MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error. Resque
$ redis-cli
> config set stop-writes-on-bgsave-error no
@duyhenryer
duyhenryer / snapshots.py
Created October 23, 2020 16:27 — forked from nicbor/snapshots.py
AWS EBS - Find unused snapshots - this script generates csv raport about snapshot usage
import re
import boto3
import csv
from botocore.exceptions import ClientError
ec2 = boto3.client('ec2')
def get_snapshots():
return ec2.describe_snapshots(OwnerIds=['self'])['Snapshots']
@duyhenryer
duyhenryer / MongoDB_ubuntu_nginx_ssh.md
Last active October 27, 2020 05:51 — forked from shivampip/MongoDB_ubuntu_nginx_ssh.md
MongoDB on Ubuntu 18.04 (nginx) SSH

Just follow these steps and teke ref of Refernce

  • Uninstall previous installation
sudo service mongod stop

sudo apt-get purge mongodb-org*

sudo rm -r /var/log/mongodb
@duyhenryer
duyhenryer / amazon-ec2-ftp.md
Created November 2, 2020 00:31 — forked from gunjanpatel/amazon-ec2-ftp.md
amazon ec2 LAMP and FTP installation and setup
@duyhenryer
duyhenryer / Install update WordPress puglins directly.md
Last active November 2, 2020 02:48 — forked from dianjuar/Install update WordPress puglins directly.md
Install update WordPress plugins without providing ftp access

Install WordPress plugins directly (without FTP)

Put this on your wp-config.php

/* That's all, stop editing! Happy blogging. */
define('FS_METHOD', 'direct');

Postgresql & PgAdmin

version: '3.5'

services:
  postgres:
    container_name: postgres_container
    image: postgres
    environment:
 POSTGRES_USER: ${POSTGRES_USER:-postgres}