Skip to content

Instantly share code, notes, and snippets.

Nam Nguyen namnm

Block or report user

Report or block namnm

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@namnm
namnm / init_ubuntu.sh
Created May 11, 2019
Install tools for a fresh Digital Ocean Ubuntu instance
View init_ubuntu.sh
# Permissions 0644 for '/root/.ssh/id_rsa' are too open.
chmod 400 ~/.ssh/id_rsa
# Update apt-get
sudo apt-get update
# Enable firewall
sudo apt-get install ufw
sudo ufw disable
sudo ufw allow 22
sudo ufw allow 80
@namnm
namnm / unomp-multipool-instructions.md
Created Oct 14, 2017
UNOMP multipool instructions
View unomp-multipool-instructions.md

UNOMP multipool instructions

Prepare machine

  • Make swap
sudo dd if=/dev/zero of=/mnt/myswap.swap bs=1M count=4000
sudo mkswap /mnt/myswap.swap
sudo swapon /mnt/myswap.swap
View mining-pool-comparison.md
@namnm
namnm / eslint.sh
Last active May 15, 2019
Run eslint on changed files only
View eslint.sh
git status -u --porcelain | egrep -h '^[^D]{2}.*\.js$' | cut -c 4- | xargs eslint
@namnm
namnm / subl_conf.json
Last active May 6, 2019
Config for Sublime
View subl_conf.json
{
"binary_file_patterns":
[
"*.doc",
"*.docx",
"*.eot",
"*.gif",
"*.gzip",
"*.ico",
"*.jar",
@namnm
namnm / trunc.js
Created Jan 15, 2016
js truncate method for string without cutting word
View trunc.js
String.prototype.trunc = function(n) {
if (this.length <= n) {
return this;
}
var truncated = this.substr(0, n);
if (this.charAt(n) === ' ') {
return truncated;
}
return truncated.substr(0, truncated.lastIndexOf(' '));
};
You can’t perform that action at this time.