Skip to content

Instantly share code, notes, and snippets.

@denji
denji / http-benchmark.md
Last active May 28, 2024 15:48
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)
@corny
corny / install_zend_guard.sh
Created April 3, 2013 14:16
Installation of Zend Guard 5.5.0 using PHP 5.3 and Ubuntu 12.04 (64 bit).
#!/bin/bash
cd /root
wget http://downloads.zend.com/guard/5.5.0/ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz
tar xzf ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz
cp ZendGuardLoader-php-5.3-linux-glibc23-x86_64/php-5.3.x/ZendGuardLoader.so /usr/lib/php5/20090626/
file=/usr/lib/php5/20090626/ZendGuardLoader.so
echo zend_extension=$file > /etc/php5/conf.d/zend_extensions.ini
chmod 644 $file
@techtonik
techtonik / chef-webui-reset.py
Created July 2, 2012 17:07
Chef - Reset WebUI admin password
"""Reset admin password in Chef Server WebUI by removing admin user from DB"""
# based on http://lists.opscode.com/sympa/arc/chef/2011-08/msg00151.html
import urllib2
import json
COUCHSERV = 'localhost:5984'
COUCHDB = 'http://' + COUCHSERV + '/chef/'
@Jach
Jach / number_hack.py
Created September 10, 2011 11:44
Overrides the Python integer five to be equal to four with ctypes magic
import sys
import ctypes
pyint_p = ctypes.POINTER(ctypes.c_byte*sys.getsizeof(5))
five = ctypes.cast(id(5), pyint_p)
print(2 + 2 == 5) # False
five.contents[five.contents[:].index(5)] = 4
print(2 + 2 == 5) # True (must be sufficiently large values of 2 there...)
@yinhm
yinhm / pptpd.sh
Created November 7, 2010 17:02
Automaticlly install pptpd on Amazon EC2 Amazon Linux
# Automaticlly install pptpd on Amazon EC2 Amazon Linux
#
# Ripped from http://blog.diahosting.com/linux-tutorial/pptpd/
# pptpd source rpm packing by it's authors
#
# WARNING:
# first ms-dns setting to 172.16.0.23, 172.16.0.23 was showing on my
# /etc/resolv.conf, I'm not sure this is the same on all Amazon AWS zones.
#
# You need to adjust your "Security Groups" which you are using too.