- 不安定版(sid)のイメージを /var/cache/pbuilder/base.cow に作成する
sudo cowbuilder --create
- Debian 6.0 (squeeze) のイメージを /var/cache/pbuilder/squeeze.cow に作成する
sudo cowbuilder --create --distribution squeeze --basepath /var/cache/pbuilder/squeeze.cowil
*filter | |
# deny all inbound | |
:INPUT DROP [0:0] | |
:FORWARD DROP [0:0] | |
# accept all outbound | |
:OUTPUT ACCEPT [0:0] | |
# accept already connected sessions |
# Zone Apex / Naked Domain / Root Domain redirect to the www subdomain by nginx | |
# Here is a part of nginx config file | |
# | |
# For example on Debian 6 (Squeeze) | |
# /etc/nginx/site-available/default | |
# | |
server { | |
listen 80; ## listen for ipv4 | |
listen [::]:80 default ipv6only=on; ## listen for ipv6 |
tr ' ' '\n' |
var http = require('http'); | |
http.createServer(function (req, res) { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.end('Hello World\n'); | |
}).listen(1337, "127.0.0.1"); | |
console.log('Server running at http://127.0.0.1:1337/'); |
// Triangle.js | |
// | |
// Pick up 3 side numbers a[i] to make a triangle from n numbers. | |
// Find the maximum circumference of triangles. | |
// | |
// Constraints : | |
// 3 <= n <= 100 | |
// 1 <= a[i] <= 10^6 | |
var TRI = {}; |
if (typeof Object.create != 'function') { | |
Object.create = function (obj) { | |
var F = function () {}; | |
F.prototype = obj; | |
return new F(); | |
}; | |
} |
// factorial.js for node.js | |
BD = require("./bigdecimal"); // https://github.com/jhs/bigdecimal.js | |
ONE = new BD.BigDecimal.ONE; | |
// Usage : factorial(BD.BigDecimal("number")) | |
factorial = function (n) { | |
if (n.compareTo(ONE) == 0) { | |
return ONE; | |
} else { | |
return n.multiply(factorial (n.subtract(ONE))); |
// mathcontext & bigdecimal.js is http://stz-ida.de/index.php?option=com_content&id=18 | |
load("mathcontext.js"); | |
load("bigdecimal.js"); | |
ONE = new BigDecimal("1"); | |
// Usage : factorial(new BigDecimal("number")) | |
function factorial (n) { | |
if (n.compareTo(ONE) == 0) { | |
return ONE; | |
} else { |
# Usage: coffee factorial.coffee _number_ | |
bi = (require "./bigdecimal").BigInteger # github.com/jhs/bigdecimal.js | |
ONE = bi '1' | |
n = bi (process.argv[2] or= '100') | |
# factorial (BigInteger) returns BigInteger | |
factorial = (x) -> | |
if x.compareTo(ONE) is 0 | |
ONE | |
else |