Skip to content

Instantly share code, notes, and snippets.

View ivan-loh's full-sized avatar
🍌
Chilling

Ivan Loh ivan-loh

🍌
Chilling
View GitHub Profile
@ivan-loh
ivan-loh / registry.sh
Created October 29, 2015 08:03
registry server
#!/bin/bash
# Add Required repository
sudo add-apt-repository -y ppa:keithw/mosh
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get update -y && sudo apt-get upgrade -y
sudo apt-get install -y htop build-essential nodejs mosh
sudo npm install -g pm2 servers
@ivan-loh
ivan-loh / compute.sh
Last active October 29, 2015 11:43
compute server initialization
#!/bin/bash
sudo apt-get install -y curl python-software-properties python g++ make
# Add Required repository
sudo add-apt-repository -y ppa:keithw/mosh
sudo add-apt-repository -y ppa:chris-lea/zeromq
sudo add-apt-repository -y ppa:chris-lea/redis-server
@ivan-loh
ivan-loh / lsservers-sample.png
Last active October 29, 2015 12:47
pretty print my server listing
lsservers-sample.png
@ivan-loh
ivan-loh / search-server.sh
Last active October 30, 2015 09:38
creating a search server using elastic search
#!/bin/sh
sudo add-apt-repository -y ppa:keithw/mosh
# Prepare Installation for Elasticsaerch
sudo add-apt-repository -y ppa:webupd8team/java
wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb http://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list
sudo apt-get update -y && sudo apt-get upgrade -y
sudo echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections
@ivan-loh
ivan-loh / gist:ee0d96c3795e59244063
Last active March 3, 2021 13:26
Node.JS ( & pm2 ) Process Memory Limit
# Plain Ol' Node
node --max-old-space-size=1024 app.js # increase to 1gb
node --max-old-space-size=2048 app.js # increase to 2gb
node --max-old-space-size=3072 app.js # increase to 3gb
node --max-old-space-size=4096 app.js # increase to 4gb
node --max-old-space-size=5120 app.js # increase to 5gb
node --max-old-space-size=6144 app.js # increase to 6gb
# For pm2
pm2 start app.js --node-args="--max-old-space-size=1024" # increase to 1gb
@ivan-loh
ivan-loh / docker.md
Last active November 8, 2015 14:51
Docker Cheatsheet ?
Commands Description
docker run <image-name> Run specific image
docker exec -it <image-id> bash Get shell of running image
docker images List local images
docker build -t . Building Docker Images from Context
docker tag <image-id> <Docker Hub accountname>/<image-name>:<version> Tagging Images
docker push <Docker Hub accountname>/<image-name> Push image to Docker Hub
docker pull /
@ivan-loh
ivan-loh / install_scala_sbt.sh
Last active November 9, 2015 15:37 — forked from visenger/install_scala_sbt.sh
Scala and sbt installation on ubuntu 12.04
#!/bin/sh
# one way (older scala version will be installed)
# sudo apt-get install scala
#2nd way
sudo apt-get remove scala-library scala
wget http://www.scala-lang.org/files/archive/scala-2.11.7.deb
sudo dpkg -i scala-2.11.7.deb
sudo apt-get update
#!/bin/bash
sudo apt-get install libtool pkg-config build-essential automake autoconf uuid-dev
wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.6.tar.gz
tar xvzf libsodium-1.0.6.tar.gz
cd libsodium-1.0.6
./configure
make && make check
sudo make install
@ivan-loh
ivan-loh / install_lua.sh
Last active August 22, 2024 23:18
lua specific version installation for osx
curl -LO http://www.lua.org/ftp/lua-5.1.5.tar.gz
tar xvzf lua-5.1.5.tar.gz
cd lua-5.1.5/src
make macosx
sudo cp lua /usr/local/bin/lua
@ivan-loh
ivan-loh / request.lua
Created November 16, 2015 04:21
sample lua http get
local http = require "socket.http"
local data = ""
local function collect(chunk)
if chunk ~= nil then
data = data .. chunk
end
return true
end