This is a simple chat-like program using pub-sub pattern, backed by PostgreSQL's LISTEN/NOTIFY command.
publish message to foo
channel from user nickname
.
$ python pub.py foo nickname
PUBLISH to channel #foo
DROP TABLE IF EXISTS foo; | |
CREATE TEMPORARY TABLE foo (x FLOAT); | |
INSERT INTO foo VALUES (1); | |
INSERT INTO foo VALUES (2); | |
INSERT INTO foo VALUES (3); | |
INSERT INTO foo VALUES (4); | |
INSERT INTO foo VALUES (100); | |
SELECT avg(x), tmean(x, 2.0), tmean(x, 1.5) FROM foo; |
fake_fuse () { | |
echo "hello faker fuse" | |
apt-get -y install libfuse2 | |
cd /tmp ; apt-get download fuse | |
cd /tmp ; dpkg-deb -x fuse_* . | |
cd /tmp ; dpkg-deb -e fuse_* | |
cd /tmp ; rm fuse_*.deb | |
cd /tmp ; echo -en '#!/bin/bash\nexit 0\n' > DEBIAN/postinst | |
cd /tmp ; dpkg-deb -b . /fuse.deb | |
cd /tmp ; dpkg -i /fuse.deb |
I will maybe someday get around to dusting off my C and making these changes myself unless someone else does it first.
Imagine a long-running development branch periodically merges from master. The
git log --graph --all --topo-order
is not as simple as it could be, as of git version 1.7.10.4.
It doesn't seem like a big deal in this example, but when you're trying to follow the history trails in ASCII and you've got several different branches displayed at once, it gets difficult quickly.
$ tar xvf netatalk-3.0.5.tar.bz2 | |
$ cd netatalk-3.0.5 | |
$ ./configure \ | |
--with-init-style=debian \ | |
--with-cracklib \ | |
--without-libevent \ | |
--with-pam-confdir=/etc/pam.d \ | |
--with-dbus-sysconf-dir=/etc/dbus-1/system.d | |
$ checkinstall --pkgname=netatalk-3.x --pkgversion="$(date +%Y%m%d%H%M)" --backup=no --deldoc=yes --default --fstrans=no |
global | |
nbproc 1 | |
maxconn 65536 | |
defaults | |
timeout connect 5s | |
timeout queue 5s | |
timeout server 30s | |
timeout tunnel 1h |
gem "nestful" |
var express = require('express'), | |
httpProxy = require('http-proxy'), | |
app = express(); | |
var proxy = new httpProxy.RoutingProxy(); | |
function apiProxy(host, port) { | |
return function(req, res, next) { | |
if(req.url.match(new RegExp('^\/api\/'))) { | |
proxy.proxyRequest(req, res, {host: host, port: port}); |
-- For documentation on these functions, please see blog post at: | |
-- http://www.databasesoup.com/2012/10/determining-furthest-ahead-replica.html | |
-- determines current xlog location as a monotonically increasing numeric. | |
CREATE OR REPLACE FUNCTION xlog_location_numeric(vcloc text default NULL) | |
RETURNS numeric | |
LANGUAGE plpgsql | |
as $f$ | |
DECLARE cloc text; | |
floc text[]; |