Skip to content

Instantly share code, notes, and snippets.

  1. General Background and Overview
@irr
irr / gist:459203
Created June 30, 2010 20:51
turn off notify-osd
sudo mv /usr/share/dbus-1/services/org.freedesktop.Notifications.service /usr/share/dbus-1/services/org.freedesktop.Notifications.service.disabled
@irr
irr / gist:465661
Created July 6, 2010 17:32
unix time
% same as date +%s
Time = fun() -> {Megasecs, Secs, _Microsecs} = erlang:now(), ((Megasecs * 1000000) + Secs) end.
@irr
irr / gist:466742
Created July 7, 2010 14:11
running-tornado-in-production
# from: http://www.tornadoweb.org/documentation
# running-tornado-in-production
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
@irr
irr / gist:468447
Created July 8, 2010 19:08
nginx/apache/redis ubuntu rc.d
root@napoleon:/etc# find . -name "*nginx*"
./rc6.d/K20nginx
./ufw/applications.d/nginx
./rc0.d/K20nginx
./init.d/nginx
./rc4.d/S20nginx
./rc5.d/S20nginx
./rc2.d/S20nginx
./rc3.d/S20nginx
./rc1.d/K20nginx
@irr
irr / tsws
Last active September 6, 2015 15:58 — forked from dfletcher/tsws
Totally simple web server using Bash and netcat (nc)
#!/bin/bash
# --------------------------------
# Totally Simple Web Server (TSWS)
# --------------------------------
#
# (c) 2015 Dave Fletcher
# All Rights Reserved
#
# This is free and unencumbered software released into the public domain.
@irr
irr / gist:1220513
Created September 15, 2011 21:22
makefile for newLISP v.10.x.x on LINUX with readline and UTF-8 support (statically linked)
# makefile for newLISP v.10.x.x on LINUX with readline and UTF-8 support (statically linked)
OBJS = newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o \
nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o
CFLAGS = -Wl,static -static-libgcc -m32 -Wall -pedantic -Wno-strict-aliasing -Wno-long-long -c -O2 -g -DREADLINE -DSUPPORT_UTF8 -DLINUX
CC = gcc
default: $(OBJS)
@irr
irr / gist:1789094
Created February 10, 2012 12:05
iptables country-block
#!/bin/bash
### Block all traffic from AFGHANISTAN (af) and CHINA (CN). Use ISO code ###
ISO="af cn"
### Set PATH ###
IPT=/sbin/iptables
WGET=/usr/bin/wget
EGREP=/bin/egrep
### No editing below ###
@irr
irr / gist:1789100
Created February 10, 2012 12:07
iptables country-block2
#!/bin/bash
###PUT HERE COMA SEPARATED LIST OF COUNTRY CODE###
COUNTRIES="AK,AR"
WORKDIR="/root"
#######################################
cd $WORKDIR
wget -c --output-document=iptables-blocklist.txt http://blogama.org/country_query.php?country=$COUNTRIES
if [ -f iptables-blocklist.txt ]; then
iptables -F
BLOCKDB="iptables-blocklist.txt"
@irr
irr / gist:1958081
Created March 2, 2012 12:19 — forked from Ovid/gist:1957853
perlfind -- perldoc on steroids
#!/usr/bin/env perl
use strict;
use warnings;
use Carp qw(cluck);
use autodie ':all';
use Getopt::Long 2.33 qw(:config auto_help);
use File::Find::Rule;
use File::Basename 'basename';