Skip to content

Instantly share code, notes, and snippets.

View thegeek's full-sized avatar

Francesco Fienga thegeek

  • Nobody Knows ... the trouble i see ...
  • Naples
View GitHub Profile
@thegeek
thegeek / sub.py
Created March 19, 2019 14:02 — forked from ysegorov/sub.py
tornado's Subprocess class usage example
#!/usr/bin/python2.7
#-*- coding=utf-8 -*-
import shlex
import subprocess
from tornado.gen import coroutine, Task, Return
from tornado.process import Subprocess
from tornado.ioloop import IOLoop
@thegeek
thegeek / mgoExample.go
Created May 29, 2018 10:07 — forked from border/mgoExample.go
mgo example
package main
import (
"fmt"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"time"
)
type Person struct {
@thegeek
thegeek / git-server-centos7.md
Created April 24, 2018 07:39
Git Server CentOS 7

Configure Git Server on CentOS 7

Server

$ yum install git-core
$ sudo useradd git
$ sudo passwd git
@thegeek
thegeek / makefile
Created April 12, 2018 10:50 — forked from sohlich/makefile
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_NAME=mybinary
BINARY_UNIX=$(BINARY_NAME)_unix
@thegeek
thegeek / orhttp_example.go
Created April 10, 2018 13:08 — forked from Yawning/orhttp_example.go
How to dispatch HTTP requests via Tor in Go.
// To the extent possible under law, the Yawning Angel has waived all copyright
// and related or neighboring rights to orhttp_example, using the creative
// commons "cc0" public domain dedication. See LICENSE or
// <http://creativecommons.org/publicdomain/zero/1.0/> for full details.
package main
import (
// Things needed by the actual interface.
"golang.org/x/net/proxy"
@thegeek
thegeek / nginx.conf
Created August 9, 2017 07:44 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@thegeek
thegeek / openldap_passwd.py
Created July 29, 2016 10:21 — forked from rca/openldap_passwd.py
Python hashing and test functions for user passwords stored in OpenLDAP.
#!/usr/bin/env python
"""
http://www.openldap.org/faq/data/cache/347.html
As seen working on Ubuntu 12.04 with OpenLDAP 2.4.28-1.1ubuntu4
Author: Roberto Aguilar <roberto@baremetal.io>
"""
import hashlib
import os
@thegeek
thegeek / punk.py
Created July 8, 2016 19:48 — forked from briandeheus/punk.py
Don't be a punk, punk
import binascii
import struct
class Punk(object):
_END_CHUNK_TYPE = 'IEND'
_PUNK_CHUNK_TYPE = 'puNK'
_MAX_BYTES = 2147483647
_chunks = dict()

Keybase proof

I hereby claim:

  • I am thegeek on github.
  • I am ffi (https://keybase.io/ffi) on keybase.
  • I have a public key whose fingerprint is 48FA 6C1F C62D 3DF8 AA27 4C4D FEFE 7581 A69B 73E3

To claim this, I am signing this object:

wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
tar vxzf Python-2.7.3.tgz
cd Python-2.7.3
PREFIX=$HOME/local/python-2.7.3
export LD_RUN_PATH=$PREFIX/lib
./configure --prefix=$PREFIX --enable-shared
make
make install