Skip to content

Instantly share code, notes, and snippets.

@meeuw
meeuw / vhost-local.site.conf
Created August 31, 2015 09:54
apache configuration for a local test site with hardcoded URLs
<VirtualHost *:80>
ServerName local.site
ProxyPass / http://local.site:81/ timeout=9999999
ProxyPassReverse / http://local.site:81/
RequestHeader unset Accept-Encoding
AddOutputFilterByType SUBSTITUTE text/html
Substitute s/www.site/local.site.nl/ni
Header edit Location ^http://www. http://local.
</VirtualHost>
#/etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifcfg-rh
dns=dnsmasq
#[keyfile]
#unmanaged-devices=mac:01:23:45:67:89:AB
@meeuw
meeuw / build.sh
Last active October 1, 2019 20:38
build php 5.2.10 on centos 6
#!/bin/bash
rpm -U http://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
yum update -y
yum install -y gcc wget tar gzip nasm zlib-devel perl ncurses-devel gcc-c++ libxml2-devel libmcrypt-devel bzip2-devel curl-devel libtidy-devel httpd-devel libtool-ltdl-devel mysql-server
# build freetype
mkdir -p /opt/php-5.2.10/freetype-2.6/src/
cd /opt/php-5.2.10/freetype-2.6/src/
wget http://download.savannah.gnu.org/releases/freetype/freetype-2.6.tar.gz
tar xzf freetype-2.6.tar.gz
#http://blog.alexjj.com/2014/04/quick-start-guide-to-dm-crypt-with-luks.html
cryptsetup benchmark
cryptsetup --cipher aes-xts-plain64 --key-size 512 --hash sha512 --iter-time 5000 --use-random --verify-passphrase luksFormat /dev/sda2
@meeuw
meeuw / .vimrc
Created December 13, 2015 14:54
set wildmode=longest,list
set tabstop=4
set shiftwidth=4
set expandtab
color beauty256
@meeuw
meeuw / parse_pbzx.py
Last active July 6, 2017 10:25 — forked from pudquick/parse_pbzx.py
Pure python reimplementation of .cpio.xz content extraction from pbzx file payload for OS X packages.without any third party tools
#!/usr/bin/python
# tar -Oxf /Volumes/install_app/Packages/Essentials.pkg Payload|python pbzx.py|tar t
import subprocess
import struct
import sys
def pbzx():
if sys.stdin.read(4) != "pbzx":
print "Not a pbzx stream"
@meeuw
meeuw / generateiso.py
Created January 28, 2016 20:08
Generate ISO for El Capitan from App Store without any 3rd party tools, I've tested it on Yosemite, most of the credits go to Gabriel L. Somlo
#!/usr/bin/python
import subprocess
import sys
import struct
def pbzx():
if sys.stdin.read(4) != "pbzx":
print "Not a pbzx stream"
sys.exit(1)
#!/usr/bin/python3
import tty
import termios
import sys
import subprocess
def getchar():
#Returns a single character from standard input
fd = sys.stdin.fileno()
old_settings = termios.tcgetattr(fd)
@meeuw
meeuw / password.py
Created February 22, 2016 10:46
Well, this requires some explaination :-) I don't like password less sudo because I'd like to have some confirmation before executing a sudo command. I've bound this script to a keyboard button so I can enter a hard to guess password at my command.
import subprocess
import time
time.sleep(.2)
password = subprocess.check_output(['secret-tool', 'lookup', 'keyboard', 'play'])
subprocess.call(['xdotool', 'type', password])
subprocess.call(['xdotool', 'key', 'Return'])
@meeuw
meeuw / proxy.py
Last active August 16, 2016 08:25
docker apache proxy
# docker build -t="dockerproxy" .
FROM whatever
RUN yum install -y httpd mod_ssl
ADD ./proxy.py /root/bin/proxy.py
CMD python /root/bin/proxy.py
EXPOSE 80 443
ADD *.crt /etc/pki/tls/certs/
ADD *.key /etc/pki/tls/private/