Skip to content

Instantly share code, notes, and snippets.

View snapo's full-sized avatar

snapo

View GitHub Profile
#!/bin/sh
# Author coreplayer2
# date 07/12/14
. /etc/init.d/tc-functions
# requires a connection to download advcomp.tcz if not found locally
################################################################
@snapo
snapo / custom-tinycore.sh
Created February 28, 2016 22:36 — forked from dankrause/custom-tinycore.sh
Create a custom tinycore linux iso. Adjust the config at the beginning of the script, or supply a conf as the first arg. Requires xorriso.
#!/bin/bash
set -e
function cleanup() {
# clean up our temp folder
rm -rf "${TMPDIR}"
}
trap cleanup EXIT
@snapo
snapo / test.py
Last active August 29, 2015 14:16 — forked from christianroman/test.py
import cv2.cv as cv
import tesseract
gray = cv.LoadImage('captcha.jpeg', cv.CV_LOAD_IMAGE_GRAYSCALE)
cv.Threshold(gray, gray, 231, 255, cv.CV_THRESH_BINARY)
api = tesseract.TessBaseAPI()
api.Init(".","eng",tesseract.OEM_DEFAULT)
api.SetVariable("tessedit_char_whitelist", "0123456789abcdefghijklmnopqrstuvwxyz")
api.SetPageSegMode(tesseract.PSM_SINGLE_WORD)
tesseract.SetCvImage(gray,api)
print api.GetUTF8Text()
@snapo
snapo / hb-test.py
Created April 10, 2014 07:29 — forked from harlo/hb-test.py
#!/usr/bin/env python2
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9
@snapo
snapo / create-vhost.sh
Created January 23, 2014 17:47
Create Apache vhosts with default page
#! /bin/bash
#
# =======================
# MiJa Apache Vhost Script
# Vers. 0.000001pre alpha :-)
# Scripts create vhosts on a debian/ubuntu Apache installation
# Can be easy adopted to centos and suse/redhat
# Use it from shell with: ./mija.sh
# enter a domain my-new-website.com
# =======================