This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(twit2). | |
-author('gdamjan@gmail.com'). | |
-export([start/0]). | |
%%% http://dev.twitter.com/pages/streaming_api_concepts#connecting | |
%%% TODO: | |
%%% - handle timeouts | |
%%% - handle errors | |
%%% - backoff (exponential, start 10 secs, up to 240 secs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/io.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#define INTERFACE "ppp0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
# -*- encoding: utf8 -*- | |
# references: | |
# http://doc.qt.nokia.com/4.6/stylesheet.html | |
# http://doc.qt.nokia.com/4.6/statemachine-eventtransitions.html | |
# http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/pyqt4ref.html | |
# http://www.ibm.com/developerworks/linux/library/l-pygen.html | |
normal_style = """ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sched.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <signal.h> | |
#include <sys/types.h> | |
#include <sys/wait.h> | |
#include <unistd.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a shell (bash) function. you need to add it to your bashrc or bash_profile file | |
# Create a PEP-370 Python virtual environment | |
function create_env () { | |
ENV=`readlink -f $1` || return 1 | |
mkdir $ENV || return 1 | |
mkdir $ENV/bin || return 1 | |
cat <<-EOF > $ENV/bin/activate | |
# first check if other env is active | |
[ x"$PYTHONUSERBASE" != x ] && echo "PYTHONUSERBASE already active from '$PYTHONUSERBASE'. Use 'deactivate' first." && return 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
## You must have a real routable IPv4 address for IPv6 rapid deployment (6rd) | |
## tunnels. | |
## Also make sure you have at least linux kernel 2.6.33 and you have enabled 6rd | |
## CONFIG_IPV6_SIT_6RD=y | |
PREFIX="2a02:2b64" # 6rd ipv6 prefix | |
GATEWAY=`dig +short 6rd.on.net.mk` # 6rd gateway host |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Leafnode NNTP Socket | |
[Socket] | |
ListenStream=127.0.0.1:119 | |
Accept=true | |
[Install] | |
WantedBy=sockets.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# A script to enable laptop power saving features for #! & Debian GNU+linux. | |
# http://crunchbanglinux.org/forums/topic/11954 | |
# List of modules to unload, space seperated. Edit depending on your hardware and preferences. | |
modlist="nsc_ircc uhci_hcd" | |
# Bus list for runtime pm. Probably shouldn't touch this. | |
buslist="pci i2c" | |
case "$1" in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(twitter_stream). | |
-author("gdamjan@gmail.com"). | |
%% Depends on: | |
%% ibrowse for http | |
%% couchbeam for couchbeam_json_stream (a fork of damienkatz json_stream_parse) | |
%% mochiweb for mochiweb_util:urlencode | |
-export([start/0]). |
OlderNewer