This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scp -i <pemkey>.pem <filename>.zip ec2-user@<ip-addr>:/path/to/destination | |
ssh -i <pemkey>.pem ec2-user@<ip-addr> | |
sudo yum install unzip | |
unzip <filename>.zip -d /path/to/destination/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pm2 start path/to/app.js --name app_dev --log-date-format "YYYY-MM-DD HH:mm Z" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.getImageZip = function(req, res) { | |
var folder = req.params.id + '/'; | |
// var folderName = new Date().toISOString().replace('T', '_').split('.')[0]; | |
var folderName = folder; | |
var obj = req.query; | |
var array = []; | |
for (var key in obj) { | |
if (!obj.hasOwnProperty(key)) continue; | |
array.push(obj[key]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone git://github.com/creationix/nvm.git ~/.nvm | |
printf "\n\n# NVM\nif [ -s ~/.nvm/nvm.sh ]; then\n\tNVM_DIR=~/.nvm\n\tsource ~/.nvm/nvm.sh\nfi" >> ~/.bashrc | |
NVM_DIR=~/.nvm | |
source ~/.nvm/nvm.sh | |
# If nvm repo already exits | |
source ~/.nvm/nvm.sh | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* create an arrow that points up */ | |
div.arrow-up { | |
width: 0; | |
height: 0; | |
border-left: 5px solid transparent; /* left arrow slant */ | |
border-right: 5px solid transparent; /* right arrow slant */ | |
border-bottom: 5px solid #2f2f2f; /* bottom, add background color here */ | |
font-size: 0; | |
line-height: 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<schema name="dovecot" version="1.1"> | |
<types> | |
<!-- | |
IMAP has 32bit unsigned ints but java ints are signed, so use longs | |
--> | |
<fieldType name="string" class="solr.StrField" omitNorms="true"/> | |
<fieldType name="long" class="solr.LongField" omitNorms="true"/> | |
<fieldType name="slong" class="solr.SortableLongField" omitNorms="true"/> | |
<fieldType name="float" class="solr.FloatField" omitNorms="true"/> | |
<fieldType name="boolean" class="solr.BoolField" omitNorms="true"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## The biggest problem you are going to face with an EC2 micro instance while installing is the memory size of the box. Although ideal for keeping costs low | |
## it will create issues while installing with npm or getting other servers running on the same box. To get around that you need to add 'swap' or 'paging' space to the | |
## machine. This effectively takes some of the space used in memory and moves it to disk. Although slower its better than it stalling forever. This is what you need to do to make it work : | |
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024 | |
sudo /sbin/mkswap /var/swap.1 | |
sudo chmod 0600 /var/swap.1 | |
sudo /sbin/swapon /var/swap.1 | |
## This will create 1 GB of swap memory. You can increase it to something like 4 GB if you change count=4096. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo yum update -y | |
sudo yum install java-1.8.0-openjdk-devel -y | |
sudo vi ~/.bashrc | |
## ADD export command under: # User specific aliases and functions: 'export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk' without quotes(') | |
env | grep JAVA_HOME ## Will show JAVA_HOME env | |
cd /opt | |
sudo wget http://www-us.apache.org/dist/lucene/solr/8.5.1/solr-8.5.1.tgz | |
sudo tar zxvf solr-8.5.1.tgz | |
sudo cp /opt/solr-8.5.1/bin/init.d/solr /etc/init.d/solr | |
sudo mv /opt/solr-8.5.1 /opt/solr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo yum update -y | |
sudo yum install -y git gcc-c++ openssl-devel make | |
git clone git://github.com/creationix/nvm.git ~/.nvm | |
printf "\n\n# NVM\nif [ -s ~/.nvm/nvm.sh ]; then\n\tNVM_DIR=~/.nvm\n\tsource ~/.nvm/nvm.sh\nfi" >> ~/.bashrc | |
NVM_DIR=~/.nvm | |
source ~/.nvm/nvm.sh | |
nvm ls-remote | |
nvm install vx.x.x (v4.7.0) | |
nvm alias default vx.x.x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://redis.io/topics/quickstart | |
wget http://download.redis.io/redis-stable.tar.gz | |
tar xvzf redis-stable.tar.gz | |
cd redis-stable | |
make distclean | |
make # If this throws an error | |
# Do | |
cd deps | |
make hiredis lua jemalloc linenoise |