This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for FILE in $(find ./src/ -type f -name "*.php" | sed -e 's#/src/#/tests/#' -e 's#\.php$#Test.php#'); do | |
mkdir -p $(dirname $FILE) 2>/dev/null | |
touch "$FILE" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use POSIX qw(strftime); | |
$url = 'http://releases.ubuntu.com/14.04/ubuntu-14.04-server-amd64.iso'; | |
$check_delay = 300; | |
$|++; | |
while (1) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Symfony\Component\Console\Input\InputArgument; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Input\InputOption; | |
use Symfony\Component\Console\Output\OutputInterface; | |
// Use this if you are using knplabs/console-service-provider for Silex console applications | |
use Knp\Command\Command; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ThreadedStreamProcessor { | |
private $batch_size; | |
private $max_workers; | |
private $writer; | |
public function __construct($max_workers=null, $batch_size=10000) { | |
$this->max_workers = $max_workers?: max(1, $this->getCpuCores(true) - 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# This script prepares an Ubuntu VM that is hosted on Xen | |
# to be moved to a VMware server via the vCenter Converter | |
# | |
# WARNING!: This script will almost certainly mess up your VM | |
# so you should snapshot it in Xen first. Worst case, you will | |
# need to fix /etc/fstab and /etc/defaults/grub to get it working | |
# | |
# Note that unless you have my magic converter-helper-vm-x64.iso |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# Rsyslog Stats parser by Steve Kamerman | |
# To use: | |
# | |
# 1. Enable imstats in /etc/rsyslog.conf by putting this at the top: | |
# | |
# module(load="impstats" | |
# interval="300" | |
# severity="7" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ROOT_DIR="/u/apps" | |
KEEP_RELEASES=5 | |
echo "Cleaning releases folders (retaining $KEEP_RELEASES):" | |
for APP_DIR in $(find $ROOT_DIR -maxdepth 2 -type d -name releases); do | |
CURRENT_RELEASE=$(readlink -f "$APP_DIR/../current" | xargs basename) | |
echo " $APP_DIR (current: $CURRENT_RELEASE)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# HipHop for PHP scripted installation | |
# by Steve Kamerman, July 12, 2011 | |
echo -e "\e[00;31m**** Installing Prerequisites\e[00m" | |
sudo apt-get --yes install git-core cmake g++ libboost-dev libmysqlclient-dev libxml2-dev libmcrypt-dev libicu-dev openssl binutils-dev libcap-dev libgd2-xpm-dev zlib1g-dev libtbb-dev libonig-dev libpcre3-dev autoconf libtool libcurl4-openssl-dev libboost-system-dev libboost-program-options-dev libboost-filesystem-dev wget memcached libreadline-dev libncurses-dev libmemcached-dev libicu-dev libbz2-dev libc-client2007e-dev php5-mcrypt php5-imagick libgoogle-perftools-dev | |
echo -e "\e[00;31m**** Getting HIPHOP in 5 seconds ****\e[00m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# put this file in ~/.openstack/compute.conf | |
[openstack.compute] | |
username=your_user_name | |
apikey=your_api_key | |
auth_url=https://lon.auth.api.rackspacecloud.com/v1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
map = function() { | |
if (!this.fruits) return; | |
var skip_fruits = { | |
'Watermelon':1, | |
'Grapefruit':1, | |
'Tomato':1 // yes, a tomato is a fruit | |
} | |
for (var fruit in this.fruits) { | |
if (skip_fruits[fruit]) continue; | |
var obj = {}; |
OlderNewer