Skip to content

Instantly share code, notes, and snippets.

@demofly
demofly / node-package-build-and-install.sh
Last active August 29, 2015 14:00
Deployment Debian script for latest nodejs and npm
#!/bin/bash
apt-get -y install build-essential checkinstall fakeroot curl
src=$(mktemp -d) && cd $src
wget -N http://nodejs.org/dist/node-latest.tar.gz
tar xzvf node-latest.tar.gz && cd node-v*
./configure
fakeroot checkinstall -y --install=no --pkgversion $(echo $(pwd) | sed -n -re's/.+node-v(.+)$/\1/p') make -j$(($(nproc)+1)) install
dpkg -i node_*
wget https://www.npmjs.org/install.sh -O- | bash
@turboladen
turboladen / psql_encoding.sql
Created October 2, 2013 08:46
Script for dealing with creating Postgres databases that complain with: ``` PG::InvalidParameterValue: ERROR: encoding UTF8 does not match locale en_US DETAIL: The chosen LC_CTYPE setting requires encoding LATIN1. ``` ...when trying to create the production DB. Taken from: http://stackoverflow.com/questions/13115692/encoding-utf8-does-not-match-…
sudo su postgres
psql
update pg_database set datistemplate=false where datname='template1';
drop database Template1;
create database template1 with owner=postgres encoding='UTF-8'
lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0;
update pg_database set datistemplate=true where datname='template1';
@mondalaci
mondalaci / openvpn-on-openwrt.sh
Created April 4, 2013 00:54
OpenVPN configuration on OpenWrt
cat >> /etc/firewall << END
iptables -t filter -A input_wan -p udp --dport 1194 -j ACCEPT
iptables -I INPUT 1 -i tun+ -j ACCEPT
iptables -I FORWARD 1 -i tun+ -j ACCEPT
iptables -I OUTPUT 1 -o tun+ -j ACCEPT
iptables -I FORWARD 1 -o tun+ -j ACCEPT
END
/etc/init.d/firewall restart