Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
VERBOSE=1
IPS_FILE="/tmp/elb_ips"
BACKEND_VCL="/etc/varnish/backend.vcl"
# Does not keep newlines, but it's ok
read -r -d '' BACKEND_TEMPLATE <<'EOF'
backend internal_elb_{ELB_NUM} {
.host = "{ELB_IP}";
.port = "80";
#!/usr/bin/env php
<?php
require __DIR__.'/../vendor/autoload.php';
use Aws\S3\S3Client;
$options = getopt('a:s:d:b:c:vh');
if (isset($options['h'])) {
<?php
namespace Shorty\FirstBundle\Repository;
interface ShortenedUrlRepositoryInterface
{
public function findLatestShortenedUrl($itemCount);
}
#!/usr/bin/env bash
# Because mysqlimport doesn't allow to append/prepend
# custom statements and we need to disable the foreign
# keys constraint which does not exist yet
if [ "$#" -lt 2 ]; then
printf "usage: %s database path_to_backup\n" $0
exit -1;
fi
SELECT CONCAT(
'SELECT ', GROUP_CONCAT(DISTINCT CONCAT(K.CONSTRAINT_NAME, '.', P.COLUMN_NAME,
' AS `', P.TABLE_SCHEMA, '.', P.TABLE_NAME, '.', P.COLUMN_NAME, '`') ORDER BY P.ORDINAL_POSITION), ' ',
'FROM ', K.TABLE_SCHEMA, '.', K.TABLE_NAME, ' AS ', K.CONSTRAINT_NAME, ' ',
'LEFT OUTER JOIN ', K.REFERENCED_TABLE_SCHEMA, '.', K.REFERENCED_TABLE_NAME, ' AS ', K.REFERENCED_TABLE_NAME, ' ',
' ON (', GROUP_CONCAT(CONCAT(K.CONSTRAINT_NAME, '.', K.COLUMN_NAME) ORDER BY K.ORDINAL_POSITION),
') = (', GROUP_CONCAT(CONCAT(K.REFERENCED_TABLE_NAME, '.', K.REFERENCED_COLUMN_NAME) ORDER BY K.ORDINAL_POSITION), ') ',
'WHERE ', K.REFERENCED_TABLE_NAME, '.', K.REFERENCED_COLUMN_NAME, ' IS NULL;'
) AS _SQL
FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE K
if [ -e /etc/apt/sources.list ] && grep -qai '^deb.*squeeze' /etc/apt/sources.list && ! grep -qai squeeze-lts /etc/apt/sources.list; then echo "
deb http://http.debian.net/debian/ squeeze-lts main contrib non-free
deb-src http://http.debian.net/debian/ squeeze-lts main contrib non-free
" >> /etc/apt/sources.list; fi; gpg --keyserver pgpkeys.mit.edu --recv-key 8B48AD6246925553; gpg -a --export 8B48AD6246925553 | apt-key add -; apt-get update; apt-get install bash; vi /etc/apt/sources.list
-----BEGIN CERTIFICATE-----
MIIDmDCCAoCgAwIBAgIEaXZGFjANBgkqhkiG9w0BAQsFADB0MQswCQYDVQQGEwJVUzEZMBcGA1UE
CxMQVXNlcm5hbWU6IGJndWVyeTFKMEgGA1UEAwxBXyBETyBOT1QgSU5TVEFMTCB1bmxlc3MgdGhp
cyBpcyB5b3VyIGNlcnRpZmljYXRlIChKTWV0ZXIgcm9vdCBDQSkwHhcNMTUwNjA5MDk0MjM2WhcN
MTUwNjE2MDk0MjM2WjB0MQswCQYDVQQGEwJVUzEZMBcGA1UECxMQVXNlcm5hbWU6IGJndWVyeTFK
MEgGA1UEAwxBXyBETyBOT1QgSU5TVEFMTCB1bmxlc3MgdGhpcyBpcyB5b3VyIGNlcnRpZmljYXRl
IChKTWV0ZXIgcm9vdCBDQSkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC01TE6fnQP
VQtoHyI85tVe5YQzxBsS0ZKwRNr7bWGplku1GOZoSGuR8sgnqiK7vrWk7io6ESbiB8X4EXBSsABR
rkhrwSZINIdAoJ4+ZZVCTDTpxKFXbLbXZze8+xP8PD78HDEr4HxXcbBCAM0W5IwnyfdPMhJQ2ZcF
sE2PfJDHwJ5RJDPXHljZUDhDyu4ZGp5fEt0o6CuDfpOsStcPGiGhcKiXv3vFUN9gEKMATPGLUd8N
PHPUnit 5.1.4 by Sebastian Bergmann and contributors.
Bgy\Tests\Commanding\ConventionalCommandHandler
[x] Handle method properly handles command
Bgy\Tests\EventStore\OptimisticConcurrencyPolicy
[x] If expected revision is any it should not throw any exception
[x] If no stream or empty is expected but actual stream is not, optimistic concurrency should failed
[x] If a revision is expected but the stream does not exist, optimistic concurrency should failed
[x] If a revision is expected but different from the actual, optimistic concurrency should failed
#!/bin/bash
# Author: Boris Guéry <guery.b@gmail.com>
usage() {
cat <<EOF
usage: $0 <command> [-h] [-y] [-vvv] [-d] [<args>]
Currently supported commands are:
push Push current database data to S3
pull Download latest database snapshot and remove existing one
EOF