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
@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');
@duyhenryer
duyhenryer / Jenkinsfile
Created November 4, 2020 16:59 — forked from lferro9000/Jenkinsfile
Jenkinsfile with PHP pipeline for Jenkins 2
#!/usr/bin/env groovy
node('php') {
stage('Get code from SCM') {
checkout(
[$class: 'GitSCM', branches: [[name: '*/#your-dev-branch#']],
doGenerateSubmoduleConfigurations: false,
extensions: [],
submoduleCfg: [],
@duyhenryer
duyhenryer / .gitlab-ci.yml
Created November 4, 2020 17:02 — forked from superjose/.gitlab-ci.yml
This is an example of a .gitlab-ci.yml that is required for Continuous Integration on GitLab projects.
# Reference: https://www.exclamationlabs.com/blog/continuous-deployment-to-npm-using-gitlab-ci/
# GitLab uses docker in the background, so we need to specify the
# image versions. This is useful because we're freely to use
# multiple node versions to work with it. They come from the docker
# repo.
# Uses NodeJS V 9.4.0
image: node:9.4.0
# And to cache them as well.