View mkdtemp.php
<?php | |
/** | |
* Create a directory in the system temp directory with a hard-to-predict name. | |
* Does not have the guarantees of the actual BSD libc function or Python tempfile function. | |
* @param string $suffix Append to the new directory's name | |
* @param string $prefix Prepend to the new directory's name | |
* @return string The path of the new directory. | |
*/ | |
function mkdtemp($suffix = '', $prefix = 'tmp') |
View rmtree.php
<?php | |
/** | |
* Delete a file or directory recursively. | |
* @param string $path | |
*/ | |
function rmtree($path) | |
{ | |
if (is_dir($path)) | |
{ |
View lsflags.c
// compile with gcc -std=c99 -Wall lsflags.c -o lsflags | |
#include <errno.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
#include <unistd.h> | |
#include <sys/stat.h> |
View site_init.py
""" | |
Decorate SCons Environment constructor so that Homebrew paths are always included. | |
""" | |
from functools import wraps | |
import SCons.Environment | |
# Homebrew install directory | |
homebrew = '/opt/homebrew' |
View gist:9009942
<?php | |
function master() | |
{ | |
$num_partitions = 10; | |
// not every system has this :( | |
//setproctitle("Parallel master: {$num_partitions} partitions"); | |
$workers = []; |
View package_mod_auth_openid.sh
#!/bin/bash | |
# Ubuntu version of package: http://packages.ubuntu.com/trusty/libapache2-mod-auth-openid | |
# FPM man page: https://github.com/jordansissel/fpm/wiki | |
# FPM instructions for autotools: https://github.com/jordansissel/fpm/wiki/PackageMakeInstall | |
# install build-time dependencies | |
# yes, apache2 is a build-time dependency, otherwise APXS breaks: | |
# "checking Apache version... configure: error: /usr/bin/apxs2 says that your apache binary lives at /usr/sbin/apache2 but that file isn't executable." | |
sudo aptitude -y install \ |
View Main.hs
module Main where | |
{- | |
Utility to automatically install and patch the Mac OS X version | |
of Unreal Tournament 2004 from the Mac demo and patcher | |
and PC installation disc images and CD key. | |
Can automatically download the demo and patcher. | |
see: http://lowetechlabs.com/UT2004-WIN2OSX/ | |
see: http://forums.macnn.com/showthread.php?t=292620 |
View sitecopy.sh
#!/bin/bash | |
wget \ | |
--execute robots=off \ | |
--no-check-certificate \ | |
--mirror \ | |
--html-extension \ | |
--convert-links \ | |
--backup-converted \ | |
--page-requisites \ |
View EC2-Describe-IAM-policy.json
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Action": [ | |
"ec2:Describe*" | |
], | |
"Effect": "Allow", | |
"Resource": "*" | |
} |
View detect_wordexp.py
#!/usr/bin/python | |
""" | |
Look for binaries on $PATH that use the wordexp() POSIX libc function. | |
Only looks at dynamically linked binaries. | |
Works on Mac OS X and Linux systems, Python versions 2.4 to 3.4. | |
""" | |
import subprocess | |
import os | |
import sys |
OlderNewer