Skip to content

Instantly share code, notes, and snippets.

View marcoslopes's full-sized avatar

Marcos Antonio Lopes marcoslopes

  • Brisbane, Australia
  • 04:37 (UTC +10:00)
View GitHub Profile
@marcoslopes
marcoslopes / portforwarding.md
Created November 2, 2015 00:48 — forked from kujohn/portforwarding.md
Port forwarding in Mavericks

Port Forwarding in Mavericks


Since Mavericks stopped using the deprecated ipfw (as of Mountain Lion), we'll be using pf to allow port forwarding.

####1. anchor file Create an anchor file under /etc/pf.anchors/<anchor file> with your redirection rule like:

@marcoslopes
marcoslopes / chat.py
Created October 25, 2015 07:02 — forked from lbolla/chat.py
import sys
import tornado.ioloop
import psycopg2
import psycopg2.extensions
io_loop = tornado.ioloop.IOLoop.instance()
conn = psycopg2.connect('dbname=mytest user=lbolla password=secret')
conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT)
@marcoslopes
marcoslopes / Mac::Pomodoro
Last active August 29, 2015 14:24
Mac::Pomodoro
#!/bin/sh
#
####################################
# Pomodoro
####################################
showHelp () {
echo "-------------------------------";
echo "Pomodoro Command Line Interface";
echo "-------------------------------";
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface EsId {
}