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 | |
#Provides add-apt-repository | |
sudo apt-get install -y python-software-properties | |
#use jtimberman's chef ppa for installation | |
sudo add-apt-repository ppa:jtimberman/opschef | |
sudo apt-get update | |
sudo apt-get upgrade -y | |
#This step asks for a chef server url to put in /etc/chef/client.rb | |
sudo apt-get install -y chef |
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 an example of a practical encoder and decoder for base-62 data in PHP | |
* It differs from the majority of examples in that it's fast enough for moderate data sizes, unlike multiprecision converters | |
* To be practical, base-62 encoding needs to use internal chunking and padding because base-62 does not fit exactly into any integral number of bits | |
* This means the output is not quite compatible with multiprecision conversions, | |
* but the encoded data retains all the desirable properties of base-62, so (unlike any base-64 encoding) it's URL, DNS, email address and pathname safe | |
* @author Marcus Bointon <[email protected]> | |
* @copyright 2011 Marcus Bointon | |
* @license http://www.opensource.org/licenses/mit-license.html MIT License |
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 | |
/** | |
* Premailer API PHP class | |
* Premailer is a library/service for making HTML more palatable for various inept email clients, in particular GMail | |
* Primary function is to convert style tags into equivalent inline styles so styling can survive <head> tag removal | |
* Premailer is owned by Dialect Communications group | |
* @link http://premailer.dialect.ca/api | |
* @author Marcus Bointon <[email protected]> | |
*/ | |
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 | |
/* | |
Folder structure: | |
/lib (fatfree files in here) | |
/temp | |
/ui (view templates) | |
/web (Doc root, static files and index.php) | |
If you're not using a .htaccess file, I found the default rewrites don't work in a vhost, had to change it to this: |
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 php | |
<?php | |
/** | |
* Extract a section of an apache or icecast log file between two dates | |
* Assumes that log lines are in chronological order | |
* Start and end dates can be in any format that strtotime can handle | |
* Reads from stdin, outputs to stdout, stats to stderr | |
* @author Marcus Bointon <[email protected]> | |
* @link https://gist.github.com/3749394 | |
* Example usage. Report the range of dates in a log file |
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 | |
### BEGIN INIT INFO | |
# Provides: logstash-shipper | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start daemon at boot time | |
# Description: Enable service provided by daemon. |
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
grep { | |
type => "syslog" | |
match => [ "syslog_program", "drupal" ] | |
add_tag => "Drupal" | |
drop => false | |
} | |
grok { | |
type => "syslog" | |
tags => [ "Drupal" ] | |
match => [ "@message", "^https?://%{HOSTNAME:drupal_vhost}\|%{NUMBER:drupal_timestamp}\|(?<drupal_action>[^\|]*)\|%{IP:drupal_ip}\|(?<drupal_request_uri>[^\|]*)\|(?<drupal_referer>[^\|]*)\|(?<drupal_uid>[^\|]*)\|(?<drupal_link>[^\|]*)\|(?<drupal_message>.*)" ] |
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 php | |
<?php | |
$mysqli = new mysqli('localhost', 'user', 'pass'); | |
if ($mysqli->connect_errno) { | |
echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error; | |
} | |
$out = false; | |
$output = array(); |
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
brew rm php56 && brew deps php56 | xargs brew rm | |
Uninstalling /usr/local/Cellar/php56/5.6.0... | |
Uninstalling /usr/local/Cellar/freetype/2.5.3_1... | |
Uninstalling /usr/local/Cellar/gettext/0.19.2... | |
Uninstalling /usr/local/Cellar/zlib/1.2.8... | |
Uninstalling /usr/local/Cellar/icu4c/53.1... | |
Uninstalling /usr/local/Cellar/jpeg/8d... | |
Uninstalling /usr/local/Cellar/libpng/1.6.13... | |
Uninstalling /usr/local/Cellar/libtool/2.4.2... | |
Uninstalling /usr/local/Cellar/unixodbc/2.3.2... |
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
$ brew doctor | |
Please note that these warnings are just used to help the Homebrew maintainers | |
with debugging if you file an issue. If everything you use Homebrew for is | |
working fine: please don't worry and just ignore them. Thanks! | |
Warning: Unbrewed dylibs were found in /usr/local/lib. | |
If you didn't put them there on purpose they could cause problems when | |
building Homebrew formulae, and may need to be deleted. | |
Unexpected dylibs: |
OlderNewer