This file contains 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
var cheerio = require('cheerio'); | |
var multiline = require('multiline'); | |
var domify = require('domify'); | |
var tmpl = multiline(function() {/* | |
<body> | |
<header> | |
<hgroup> | |
<h1>Header in h1</h1> |
This file contains 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
package com.intesso.commons; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.util.Properties; | |
import java.util.logging.Level; | |
import java.util.logging.Logger; | |
/** | |
* Generic Application Properties class that reads the properties file from the |
This file contains 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
# Raspberry PI Version herausfinden: | |
cat /etc/issue | |
# -> Debian GNU/Linux 7 \n \l | |
oder: | |
cat /etc/*-release | |
# -> PRETTY_NAME="Raspbian GNU/Linux 7 (wheezy)" | |
# install node.js on raspberry pi (wheezy) |
This file contains 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
# manual | |
http://wiki.ubuntuusers.de/SNMP | |
# install | |
# http://l3net.wordpress.com/2013/05/12/installing-net-snmp-mibs-on-ubuntu-and-debian/ | |
sudo apt-get install snmp snmpd | |
sudo nano /etc/snmp/snmp.conf | |
# comment out this line | |
> # mibs : | |
sudo nano /etc/snmp/snmptrapd.conf |
This file contains 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
# kill specific process, check with 'ps -aufx | grep node' | |
kill <pidnr> | |
# kill all node processes | |
killall -9 node | |
# terminate forever process, check with 'forever list' | |
forever stop <number 0..n> |
This file contains 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
touch starter.sh | |
chmod 754 starter.sh | |
nano starter.sh | |
# file content: | |
#!/bin/sh | |
if [ $(ps aux | grep $USER | grep node | grep -v grep | wc -l | tr -s "\n") -eq 0 ] | |
then | |
export PATH=/usr/local/bin:$PATH |
This file contains 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
nano /etc/apache2/ports.conf | |
>NameVirtualHost *:3080 | |
>Listen 3080 | |
nano /etc/apache2/sites-available/default | |
> <VirtualHost *:3080> | |
sudo service apache2 restart |
This file contains 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://www.digitalocean.com/community/articles/how-to-host-multiple-node-js-applications-on-a-single-vps-with-nginx-forever-and-crontab | |
https://www.digitalocean.com/community/articles/how-to-install-nginx-on-ubuntu-12-04-lts-precise-pangolin |
This file contains 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
# allow multiple domains | |
nano /etc/nginx/nginx.conf | |
# uncomment or add this in the http section: | |
> server_names_hash_bucket_size 64; | |
# configure new site | |
nano /etc/nginx/conf.d/intesso.com.conf |
This file contains 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
npm install forever -g | |
cd /path/to/your/node/app/ | |
forever start --spinSleepTime 10000 app.js | |
# Where --spinSleepTime 10000 refers to the minimum uptime (in milliseconds) between launches of a crashing script. This command will work for almost all cases. | |
# Now point your browser to http://[your-vps-ip]:[port] and see your app running. |