sudo apt-get update -y
sudo apt-get install git-core build-essential -y
#!upstart | |
description "MyApp" | |
author "MyApp by charlie" | |
env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
respawn | |
start on runlevel [23] | |
stop on shutdown |
Three things to remember while configuring a couchapp to run as a web facing application. Below, I document the steps I took to deploy the example pages
app from couchapp.org.
-
set the vhost in
/etc/couchdb/local.ini
.[vhosts] home.btbytes.com = /pages/_design/pages/_rewrite
-
add vhosts entry to couchdb by visiting
configuration
page in futon app and adding a new section:
# Add this line to your software sources | |
deb http://debian.meebey.net/experimental/mono / | |
sudo apt-get update | |
# of course, apt-get remove mono-complete first... | |
sudo apt-get install mono-complete | |
# I installed monodevelop from apt just to get all the prereqs | |
sudo apt-get install monodevelop |
Recently I was asked to generate PDF invoices for an online shop. I looked at various PHP PDF generators, but wasn't particularly impressed with any of them.
Then I found (via Stack Overflow) a command-line HTML-to-PDF convertor called wkhtmltopdf, which uses WebKit (the same layout engine as Safari and Google Chrome) and therefore is very accurate.
There is a class for PHP integration on the Wiki, but I found it overly complicated and it uses temp files which aren't necessary. This is the code I wrote instead.
I used Smarty for generating the HTML for the PDF, but you can use any template engine, or pure PHP if you prefer.
Note: I originally tried to install wkhtmltopdf from source, but it's much easier to use the static binary instead.
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
Goal of this document is to describe how to setup a vpn tunnel with two pfSense boxes | |
having the same LAN subnet, for the purpose of this doc we'll use 192.168.1.1/24 on | |
both firewalls LAN interfaces | |
We have to make some dummy networks here to NAT to so as far as Site A will be concerned, | |
site B will be 192.168.2.0/24, and as far as Site B is concerened site A will be 192.168.3.0/24 | |
SiteA (LAN 192.168.1.1) | |
OpenVPN Server: | |
Standard Setup and we'll use 10.0.1.0/24 as the Tunnel Network (I can elaborate here later) |
# Upstart file at /etc/init/couchdb.conf | |
# CouchDB | |
start on runlevel [2345] | |
stop on runlevel [06] | |
pre-start script | |
chown -R couchdb /usr/local/etc/couchdb | |
chown -R couchdb /usr/local/lib/couchdb | |
chown -R couchdb /usr/local/var/log/couchdb |
object CheckCommand "check_wmi" { | |
import "plugin-check-command" | |
command = [ PluginDir + "/check_wmi_plus.pl" ] | |
arguments = { | |
"--inidir" = "$wmi_inidir$" | |
"-H" = "$host.name$" | |
"-A" = "$wmi_authfile_path$" | |
"-m" = "$check_mode$" | |
"-s" = "$wmi_submode$" |
#!/bin/bash | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 |