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
/** | |
* Feed2JS using the Google Feed API | |
* | |
* Inspired by Feed2JS (http://feed2js.org) | |
* | |
* Author: Richard Davies (http://www.richarddavies.us) | |
* | |
* Example Usage: | |
* <!-- Requires the Google Loader and API key from http://code.google.com/apis/loader/signup.html --> | |
* <script src="https://www.google.com/jsapi?key=YOUR_KEY_HERE"></script> |
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 | |
if(!extension_loaded('apc')){ | |
die("APC extension is not enabled."); | |
} | |
function generate_class_map($size){ | |
apc_clear_cache('user'); |
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
# To relieve servers | |
##Imagine a robots.txt file like this (Google understands this format): | |
#User-agent: * | |
#Disallow: /detailed | |
#Disallow: /?action=detailed | |
#Disallow: /*/detailed | |
#Crawl-delay: 20 | |
## |
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 | |
# Usage: cpannti.sh <module_names> | |
# cpan (i.e. App::Cpan) does not provide a direct way to install modules without | |
# testing them, as you can do in the CPAN shell with: | |
# | |
# cpan[1]> notest install FooBarBaz | |
# | |
# App::Cpan uses CPAN::Shell under the hood to perform installation, so let's do |
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
This playbook has been removed as it is now very outdated. |
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
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
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 bash | |
# | |
# Invoke this bootstrap copying following command to the command line: | |
# | |
# bash < <(curl -s -L https://raw.github.com/gist/4174871/jetty-ondemand.sh) | |
# | |
# (this should be run as root) | |
# | |
# move to working dir. |
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 -w | |
# Really simple script to copy a file to an S3 bucket. | |
# Credentials are read from ~/.s3credentials, which should | |
# consist of two lines: the access key id and the secret key. | |
use strict; | |
use FileHandle; | |
use Net::Amazon::S3; |
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
# ssh-agent needs to be running and we need to export the SSH_AUTH_SOCK | |
# environment variable to point to its location in /tmp/ssh-something/agent.PID | |
# so, find the ssh-agent PID and derive the socket filename from it, and then | |
# find that file in its randomly-named directory in /tmp and export that for | |
# ssh to use. | |
set -x | |
SSH_AGENT_PID=`pgrep -n -u $USER ssh-agent` | |
if [ -n "$SSH_AGENT_PID" ]; then | |
guessed_ppid=`expr $SSH_AGENT_PID - 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 | |
INSTALL_ROOT="/opt" | |
INSTALL_FOLDER="$INSTALL_ROOT/elasticsearch" | |
echo "Installing OpenJDK 1.7.0 ..." | |
sudo yum install -y java-1.7.0-openjdk | |
echo "[Installing ElasticSearch...]" | |
cd ~ |