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 | |
/* Sources: | |
* https://github.com/erica/uidevice-extension/blob/master/UIDevice-Hardware.m | |
* https://github.com/squarefrog/UIDeviceIdentifier/blob/master/UIDeviceIdentifier/UIDeviceHardware.m | |
* http://theiphonewiki.com/wiki/Models | |
* http://www.everymac.com/systems/apple/iphone/specs/apple-iphone-5c-a1529-asia-pacific-australia-specs.html | |
* https://www.apple.com/ipad/LTE/ | |
* http://www.enterpriseios.com/device/iPhone6,1 | |
* http://stackoverflow.com/questions/12505414/whats-the-device-code-platform-string-for-iphone-5-5c-5s-ipod-touch-5 |
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 | |
# check if file-based sessions are enabled | |
file_storage=$(/usr/lib/php5/sessionstorage | grep '^files$' -c) | |
if [ "$file_storage" = "0" ]; then | |
exit 0 | |
fi | |
# first find all used files and touch them (hope it's not massive amount of files) |
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 | |
/** | |
* This is a better Psysh rc.php | |
*/ | |
$add_composer_autoloader = function(array $config) { | |
static $was_run = false; | |
if ($was_run) { | |
return $config; |
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/bash -e | |
# This scripts installs jq: http://stedolan.github.io/jq/ | |
JQ=/usr/bin/jq | |
curl https://stedolan.github.io/jq/download/linux64/jq > $JQ && chmod +x $JQ | |
ls -la $JQ |
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" |