Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# requires py_interface
# http://www.lysator.liu.se/~tab/erlang/py_interface/
import sys, os, time
from py_interface import erl_node, erl_eventhandler
from py_interface.erl_opts import ErlNodeOpts
from py_interface.erl_term import ErlAtom, ErlBinary
[root@ip-XX-XX-XX-XXX proc]# cat cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 26
model name : Intel(R) Xeon(R) CPU X5570 @ 2.93GHz
stepping : 5
cpu MHz : 2933.483
cache size : 8192 KB
physical id : 0
@nivertech
nivertech / about.md
Created August 15, 2011 00:20 — forked from fogus/about.md
Programming Achievements: How to Level Up as a Developer
@nivertech
nivertech / ffmpeg.erl
Created September 1, 2011 16:06 — forked from maxlapshin/ffmpeg.erl
Nitrogen example for ffmpeg frontend
%% -*- mode: nitrogen -*-
-module (index).
-compile(export_all).
-include_lib("nitrogen_core/include/wf.hrl").
-include("video.hrl").
main() -> #template { file="./site/templates/bare.html" }.
title() -> "FFmpeg frontend".
@nivertech
nivertech / deployed.ruby.gems.09.2011.txt
Created October 16, 2011 19:14
Gem List Deployed in ruby applications monitored by New Relic, September 2011
Gem List Deployed in ruby applications monitored by New Relic, September 2011
Note: Efforts have been made to remove any "private" gems from this list. All gems in this list are publicly available on rubygems.org are are considered public. Please send an email to brian@newrelic.com if you feel that a gem on this list should not be made public.
Count Gem Name
----------------
7570 rack
7444 rake
7425 rails
7424 activesupport
-module(calltime_trace).
-behaviour(gen_server).
%% The purpose of this module is to continiously log calltime statistics
%% of a function calculated over short intervals. The tracing support of the
%% erlang runtime system is to trace entry and return from the function in
%% all processes. The tracing is aborted if the time it takes to process all
%% trace messages generated during an interval lags behind with more than a
%% full interval. If the tracing lags behind with a smaller amount of time
%% the logger attempts to compensate for the lag.
@nivertech
nivertech / redis_session_backend.py
Created December 3, 2011 22:57 — forked from mikeyk/redis_session_backend.py
A redis backend for Django Sessions, tested on Django 1.3+
from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.conf import settings
from django.utils.encoding import force_unicode
import redis
class SessionStore(SessionBase):
""" Redis store for sessions"""
def __init__(self, session_key=None):
self.redis = redis.Redis(
@nivertech
nivertech / getissues.py
Created December 24, 2011 16:57 — forked from todd/getissues.py
Download Hacker Monthly's Xmas Special off S3
import os
for i in range(19):
if i < 10:
os.system("wget http://s3.amazonaws.com/bearwithclaws.baconfile.com/hackermonthly-issue00%s.zip" % str(i+1))
else:
os.system("wget http://s3.amazonaws.com/bearwithclaws.baconfile.com/hackermonthly-issue0%s.zip" % str(i+1))
@nivertech
nivertech / Publish a message
Created January 19, 2012 21:50 — forked from linus/Publish a message
Server-side Events with Node.js and Redis
linus@Newton:~$ redis-cli
redis 127.0.0.1:6379> publish /updates.foo "hello there!"
(integer) 1
redis 127.0.0.1:6379>
@nivertech
nivertech / bbc_now_next_mqtt.rb
Created February 6, 2012 18:56 — forked from njh/bbc_now_next_mqtt.rb
Submit BBC Programme Now and Next to MQTT
#!/usr/bin/env ruby
require 'rubygems'
require 'json'
require 'net/http'
require 'uri'
require 'mqtt'
require 'pp'
NOW_NEXT_RADIO_URL = 'http://www.bbc.co.uk/iplayer/ion/multinownext/service_type/radio/format/json'