Skip to content

Instantly share code, notes, and snippets.

View namnm's full-sized avatar
🧩
Focusing

Nam Nguyen namnm

🧩
Focusing
View GitHub Profile
@namnm
namnm / init_ubuntu.sh
Created May 11, 2019 17:54
Install tools for a fresh Digital Ocean Ubuntu instance
# 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 October 14, 2017 15:24
UNOMP multipool instructions

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
@namnm
namnm / mining-pool-comparison.md
Created October 10, 2017 09:36
Mining pool comparison
@namnm
namnm / eslint.sh
Last active September 15, 2022 09:36
Run eslint on changed files only
git status -u --porcelain | egrep -h '^[^D]{2}.*\.js$' | cut -c 4- | xargs eslint
@namnm
namnm / subl_conf.json
Last active May 6, 2019 10:53
Config for Sublime
{
"binary_file_patterns":
[
"*.doc",
"*.docx",
"*.eot",
"*.gif",
"*.gzip",
"*.ico",
"*.jar",
@namnm
namnm / trunc.js
Created January 15, 2016 04:33
js truncate method for string without cutting word
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(' '));
};