Skip to content

Instantly share code, notes, and snippets.

View mokxter's full-sized avatar
:shipit:
Ship

Ian Cristopher Buena mokxter

:shipit:
Ship
View GitHub Profile
@mokxter
mokxter / Node and NPM installation.md
Last active December 8, 2016 07:29
Installing node and npm properly

This is just a personal gist for installing node and npm

Install nodejs from the repo / package manager of your choice

  1. $ sudo apt-get install nodejs

When you install node in ubuntu, it doesn't install as node rather it install as nodejs so we need to make a symbolic link from nodejs to node

  1. $ sudo ln -s /usr/bin/nodejs /usr/bin/node

Folder Structure

Motivations

  • Clear feature ownership
  • Module usage predictibility (refactoring, maintainence, you know what's shared, what's not, prevents accidental regressions, avoids huge directories of not-actually-reusable modules, etc)
@mokxter
mokxter / install-git-completion.sh
Created October 4, 2016 04:41 — forked from johngibb/install-git-completion.sh
Mac OS X - Install Git Completion
URL="https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash"
PROFILE="$HOME/.profile"
echo "Downloading git-completion..."
if ! curl "$URL" --silent --output "$HOME/.git-completion.bash"; then
echo "ERROR: Couldn't download completion script. Make sure you have a working internet connection." && exit 1
fi
@mokxter
mokxter / fix_siera.md
Last active December 8, 2016 07:39
Fix for fail capistrano deployment in OS Siera

This is just a gist for taking note about the issue with capistrano when you upgrade to OS Sierra

The straight forward solution is to add all keys to ssh

ssh-add -A

But this doesn't persist after a reboot so we can include it to our .bash_profile like this

ssh-add -A 2>/dev/null;

@mokxter
mokxter / compression.md
Last active December 12, 2016 04:33
Compressing files using tar

To compress using tar:

tar cjvf filename.tbz [files]

To uncompress:

tar xjvf filename.tbz

@mokxter
mokxter / secure copy.md
Last active February 23, 2017 06:23
How to use scp (secure copy)

To copy from the server

scp IP@USERNAME:REMOTEDIRECTORY LOCALDESTINATION
scp 172.0.0.1@ubuntu:~/filename.fileext ~/Download

/**
 * If you're using a pem file
 */

scp -i ~/.ssh/filename.pem USERNAME@IP/DOMAIN:REMOTEDIRECTORY LOCALDESTINATION

@mokxter
mokxter / .vimrc
Created February 15, 2017 15:36
My Vim RC
call pathogen#infect()
filetype plugin on
filetype plugin indent on
filetype indent on
" =============================================
set hidden
" =============================================
set history=1000 " remember more commands and search history
set undolevels=1000 " use many muchos levels of undo
@mokxter
mokxter / continue_download.md
Last active March 18, 2017 07:09
Continue download in wget, curl or Aria

#CURL

curl -L -C - -o "myfile.zip" "http://example.com/file.zip"

#ARIA

aria2c -c -m 0 -o "myfile.zip" "http://example.com/file.zip"

#WGET

wget -d -c --tries=0 --read-timeout=30 -O "myfile.zip" "http://example.com/file.zip"

@mokxter
mokxter / firefox_fix.md
Created April 27, 2017 12:46
Make firefox a bit faster in ubuntu / linux

go to about:config

search layers.acceleration.force-enabled

set value to true

@mokxter
mokxter / enospc.md
Created May 11, 2017 04:53
Fix for ENOSPC - Memory problem

Run this magic line

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

For Arch Linux add this line to /etc/sysctl.d/99-sysctl.conf:

fs.inotify.max_user_watches=524288

Then execute: