// jQuery
$(document).ready(function() {
// code
})
/* | |
cdr_fifo_mongodb: A quick and dirty hack that consists of configuring asterisk’s | |
cdr_custom.conf to write to a named pipe, which will be then read by node and | |
then written into mongodb. | |
good alternative to cdr_mongodb, 'cause I couldn't make it work stable for 1.8 | |
*/ | |
var config = { | |
"dburl": "asterisk", /* user:pass@host/db */ | |
"collections": ["cdr"], | |
"fifo": "/var/log/asterisk/cdr-custom/cdr_fifo.csv", |
FROM ubuntu | |
RUN apt-get update | |
RUN apt-get install -y socat | |
VOLUME /foo | |
CMD socat UNIX-LISTEN:/foo/bar.sock - |
How to compile Mesos on your new Raspberry Pi 2 (which is amazing with 4 cores and 6x performance). Follows on from experiments in compiling for OS X
sudo apt-get install maven libsasl2-dev libapr1-dev libsvn-dev libcurl4-openssl-dev python-dev python-boto
export JAVA_HOME="/usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt"
export PATH=$JAVA_HOME/bin:$PATH
http://likemagicappears.com/projects/raspberry-pi-cluster/mesos-on-raspbian/
Bash is the JavaScript of systems programming. Although in some cases it's better to use a systems language like C or Go, Bash is an ideal systems language for smaller POSIX-oriented or command line tasks. Here's three quick reasons why:
- It's everywhere. Like JavaScript for the web, Bash is already there ready for systems programming.
- It's neutral. Unlike Ruby, Python, JavaScript, or PHP, Bash offends equally across all communities. ;)
- It's made to be glue. Write complex parts in C or Go (or whatever!), and glue them together with Bash.
This document is how I write Bash and how I'd like collaborators to write Bash with me in my open source projects. It's based on a lot of experience and time collecting best practices. Most of them come from these two articles, but here integrated, slightly modified, and focusing on the most bang for buck items. Plus some ne
/* $Id: upnpc.c,v 1.101 2014/01/31 13:18:25 nanard Exp $ */ | |
/* Project : miniupnp | |
MiniUPnPc | |
Copyright (c) 2005-2016, Thomas BERNARD | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
* Redistributions of source code must retain the above copyright notice, |
function import_extract_first { | |
echo "name:ID(Concept)" > concepts.txt | |
cat data-concept-instance-relations.txt | cut -d $'\t' -f 1 | sort | uniq >> concepts.txt | |
echo "name:ID(Instance)" > instances.txt | |
cat data-concept-instance-relations.txt | cut -d $'\t' -f 2 | sort | uniq >> instances.txt | |
echo $':END_ID(Concept)\t:START_ID(Instance) relations:int' > is_a.hdr | |
$NEO4J_HOME/bin/neo4j-import --into concepts.db --id-type string --delimiter TAB --bad-tolerance 13000000 --skip-duplicate-nodes true --skip-bad-relationships true \ |
#!/bin/bash | |
#shows traffic on the specified device | |
function human_readable { | |
VALUE=$1 | |
BIGGIFIERS=( B K M G ) | |
CURRENT_BIGGIFIER=0 | |
while [ $VALUE -gt 10000 ] ;do | |
VALUE=$(($VALUE/1000)) |
<?php | |
function to_str($obj) { | |
ob_start(); | |
var_dump($obj); | |
return ob_get_clean(); | |
} | |
function str_btw($string, $start, $end){ | |
$string = ' ' . $string; |
-- remove the driver to clean up -- | |
wlctl -i wl0 down | |
rmmod wl | |
insmod wl | |
-- set WPA2-AES encryption -- | |
wlctl -i wl0 wsec 4 | |
wlctl -i wl0 wpa_auth 128 | |
wlctl -i wl0 wsec_restrict 1 | |
wlctl -i wl0 eap 0 |