Skip to content

Instantly share code, notes, and snippets.

View snapo's full-sized avatar

snapo

View GitHub Profile
@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
# =======================
#!/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 / 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
@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 / 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
#!/bin/sh
# Author coreplayer2
# date 07/12/14
. /etc/init.d/tc-functions
# requires a connection to download advcomp.tcz if not found locally
################################################################
; NASM FUN
; Example 1 - Run code in another direction
push 0
push main
jmp main
call main
call main
call main
call main
for /F "delims===" %i in ('pip freeze -l') do pip install -U %i
@snapo
snapo / alpine-install.sh
Last active April 4, 2018 19:55 — forked from thde/alpine-install.sh
A script to install alpine linux on a dedicated server. Tested on Hetzner, Kimsufi / OVH
#!/bin/sh
set -ex
PATH=/bin:/sbin:/usr/bin:/usr/sbin
KEYMAP="us us"
HOST=alpine
USER=anon
ROOT_FS=ext4
BOOT_FS=ext4
@snapo
snapo / electrum.html
Created March 14, 2018 16:10 — forked from fransr/electrum.html
Simple port-scan using embed+onerror in Safari to send gui-commands to Electrum 3.0.4 without the need of any CORS-headers
<body>
<style>pre { white-space: inherit }</style>
<pre id="log"></pre>
<div id="ports" style="visibility: hidden; height: 0; width: 0;"></div>
<iframe src="about:blank" name="x" id="x" style="display: none;"></iframe>
</body>
<script>
var electrum = {
logbreak: function() { e = document.createElement('br'); document.getElementById('log').appendChild(e); },
log: function(s) { e = document.createElement('span'); e.innerText = s+" "; document.getElementById('log').appendChild(e); },