Skip to content

Instantly share code, notes, and snippets.

@jwcobb
jwcobb / SynologyLetsEncrypt.md
Last active November 16, 2020 10:59
Automatic SSL renewal with Let’s Encrypt on DSM 5.x / Synology Diskstation via Dreamhost with dns-01 verification
@jwcobb
jwcobb / Install.markdown
Last active February 19, 2021 18:38
Install NGINX, MariaDB 10.1, and PHP 7.1 stack on macOS Sierra using MacPorts

Install NGINX, MariaDB 10.1, and PHP 7.1 stack on macOS Sierra using MacPorts

I keep most of my configuration stuff in a local Git repository so I can track changes and I symlink to those from where they should be so you will see commands such as

 sudo ln -s ~/Documents/configs/PHP/fat-tony.local/php71.ini /opt/local/etc/php71/php.ini 

If you don’t have a similar setup, just copy your configuration files to where they need to be.

I like to prepend some of the commands with time just for curiosity’s sake to see how long it takes.

@jwcobb
jwcobb / Install MAPP stack on El Capitan using MacPorts.md
Last active September 15, 2016 12:53
Install MAPP (MAMP) stack on El Capitan using MacPorts – Apache 2, Percona (MySQL), & PHP 5.6

Install MAPP (MAMP) stack on El Capitan using MacPorts

I keep most of my Apache/PHP/Percona (MySQL) configuration stuff in a local Git repository so I can track changes and I symlink to those from where they should be so you will see commands such as

 sudo ln -s ~/Documents/configs/PHP/fat-tony.local/php56.ini /opt/local/etc/php56/php.ini 

If you don’t have a similar setup, just copy your configuration files to where they need to be.

I like to prepend some of the commands with time just for curiosity’s sake to see how long it takes.

@jwcobb
jwcobb / uploadEticketsForAnOrder.php
Last active September 2, 2015 19:53
Hacky workaround for apparent Guzzle issue when uploading JSON body > 1MB
function uploadEticketsForAnOrder(array $array = [], $token, $secret)
{
$orderId = $array['order_id'];
$url = 'https://api.ticketevolution.com/v9/orders/' . $orderId . '/deliver_etickets';
$data_string = '{"etickets":' . json_encode($array['etickets']) . '}';
$stringToSign = 'POST ' . preg_replace('/https:\/\/|\?.*/', '', $url) . '?' . $data_string;
$signature = base64_encode(hash_hmac('sha256', $stringToSign, $secret, true));
@jwcobb
jwcobb / iTunes-Match-idea.markdown
Last active August 29, 2015 14:01
Using iTunes Match with more than 25,000 songs

Will this iTunes Match strategy work?

Update: I have moved this over to my own site where I will post updates regarding whether or not this works.

I have an iTunes library that exceeds the 25,000 song limit for iTunes Match even when you subtract the purchased songs from the total. For argument’s sake, and because this isn’t a mine-is-bigger-than-yours contest, lets call it 30,000 ripped songs.

I would like to utilize iTunes Match, but I do not want to split my library into two separate libraries as suggested by many articles including @flargh’s recent “iTunes Match Limit: What to do when you hit 25,000 songs.”

Let me clarify…

Allow me to clarify that “I do not want to split my library into two separate libraries” comment…

@jwcobb
jwcobb / gist:6801475
Last active December 24, 2015 12:59
Search performer and list events
require_once 'Zend/Loader/Autoloader.php';
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->registerNamespace('Zend_');
$autoloader->registerNamespace('Ticketevolution_');
$autoloader->setFallbackAutoloader(false);
$cfg['params']['apiToken'] = (string) 'TOKEN';
$cfg['params']['secretKey'] = (string) 'KEY';
$cfg['params']['apiVersion'] = (string) '9';
@jwcobb
jwcobb / gist:5853928
Created June 24, 2013 21:50
Fetch, filter, sort and display TicketGroups form Ticket Evolution API
// Set up the TicketEvolution webservice object
$tevoWebservice = new TicketEvolution\Webservice($cfg['ticketevolution']['params']);
/**
* Wrap the entire fetching/listing of tickets in a try/catch for safety
*/
try {
$options = array(
'event_id' => $eventId,
);
@jwcobb
jwcobb / MonkeyFighter.php
Created June 14, 2013 23:21
Attempting to convert [MonkeyFighter](https://github.com/TeamOneTickets/Monkey-Fighter) to dynamically handle all grawlix replacements in order to un-censor words.
/**
* Symbols that could be used to replace letters
*
* @var string
*/
protected $_grawlix = '[!@#$%&*-]';
/**
* Associative array of replacements to make
@jwcobb
jwcobb / gist:5043199
Last active December 14, 2015 06:29
Removes unwanted spaces from barcode input fields on EventInventory.com
// ==UserScript==
// @name EI Barcode De-Spacer
// @namespace TeamOneTickets
// @include https://www.eventinventory.com//Basic/AirBillManager/Barcode.aspx*
// @description Removes unwanted spaces from barcode input fields because EI doesn't know how to RegEx
// @copyright Team One Tickets & Sports Tours, Inc.
// @version 1.0
// @license BSD
// ==/UserScript==
@jwcobb
jwcobb / gist:4507788
Last active December 10, 2015 23:09
Editors at CNET were forced to rescind a product award after their parent company stepped in. http://www.buzzfeed.com/jwherrman/every-tech-journalists-worst-nightmare
sudo echo "127.0.0.1 www.cnet.com" | sudo tee -a /etc/hosts