Skip to content

Instantly share code, notes, and snippets.

1) Load the u3g(4) driver:
# kldload u3g
# kldstat
Id Refs Address Size Name
...
7 1 0xffffffff81b6e000 5ffb u3g.ko
2) Set the driver to load at boot:

FreeBSD 10 Nodejs setup with nginx, mongodb, redis and monit

This my receipe for installing a complete nodejs server on FreeBSD 10. The parameters used in this configuration are for a very small private server that I use for demo purpose only, so for a production server, you should somehow set the limits in pair with your ressources.

I use monit so I don't have to write rc scripts for node and it should take care of process lifecycle management for me. Alternatives exists such as supervisord or circus.

Installing mongodb

@nkhine
nkhine / index.html
Last active December 17, 2015 21:59 — forked from johan/index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>d3.js Spinny Globe from Mike Bostock's SVG Open 2011 keynote</title>
<script src="http://mbostock.github.com/d3/d3.js"></script>
<script src="http://mbostock.github.com/d3/d3.geo.js"></script>
<style type="text/css">
svg {
@nkhine
nkhine / graph.json
Created September 28, 2012 10:52 — forked from jdonaldson/graph.json
Force-Directed Layout (with tipsy labels)
{"nodes":[{"name":"Myriel","group":1},{"name":"Napoleon","group":1},{"name":"Mlle.Baptistine","group":1},{"name":"Mme.Magloire","group":1},{"name":"CountessdeLo","group":1},{"name":"Geborand","group":1},{"name":"Champtercier","group":1},{"name":"Cravatte","group":1},{"name":"Count","group":1},{"name":"OldMan","group":1},{"name":"Labarre","group":2},{"name":"Valjean","group":2},{"name":"Marguerite","group":3},{"name":"Mme.deR","group":2},{"name":"Isabeau","group":2},{"name":"Gervais","group":2},{"name":"Tholomyes","group":3},{"name":"Listolier","group":3},{"name":"Fameuil","group":3},{"name":"Blacheville","group":3},{"name":"Favourite","group":3},{"name":"Dahlia","group":3},{"name":"Zephine","group":3},{"name":"Fantine","group":3},{"name":"Mme.Thenardier","group":4},{"name":"Thenardier","group":4},{"name":"Cosette","group":5},{"name":"Javert","group":4},{"name":"Fauchelevent","group":0},{"name":"Bamatabois","group":2},{"name":"Perpetue","group":3},{"name":"Simplice","group":2},{"name":"Scaufflaire","group":2},
@nkhine
nkhine / fiddle.css
Created September 6, 2012 10:05 — forked from zalun/fiddle.css
body {
font-family: Helvetica, Verdana
}
p {
padding: 7px 10px;
}
#demo {
border: 1px solid #999;
}
@nkhine
nkhine / jquery.doubletap.js
Created August 9, 2012 12:23 — forked from asgeo1/jquery.doubletap.js
doubletap event for jquery
//based on blog post that I saw here: http://www.sanraul.com/2010/08/01/implementing-doubletap-on-iphones-and-ipads/
(function($){
$.fn.doubletap = function(fn) {
return fn ? this.bind('doubletap', fn) : this.trigger('doubletap');
};
$.attrFn.doubletap = true;
$.event.special.doubletap = {
setup: function(data, namespaces){
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<title>Creating SVG groups with D3.js</title>
</head>
<body>
<div id="d3group"></div>
<script type="text/javascript">
@nkhine
nkhine / README.md
Created July 12, 2012 12:36 — forked from mbostock/.block
Twitter SVG Logo
@nkhine
nkhine / index.html
Created July 10, 2012 11:54 — forked from eugenepyvovarov/index.html
Google Maps + D3
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script type="text/javascript" src="http://github.com/mbostock/d3/raw/v1.8.4/d3.js"></script>
<style type="text/css">
html, body, #map {
width: 100%;
@nkhine
nkhine / debt.csv
Created July 10, 2012 10:34 — forked from mbostock/.block
The Euro Debt Crisis
creditor debtor amount risk
Britain France 22.4 3
Britain Greece 0.55 0
Britain Italy 26 0
Britain Portugal 19.4 0
Britain United States 345 1
France Germany 53.8 1
France Greece 53.9 0
France Ireland 17.3 0
France Italy 366 0