Skip to content

Instantly share code, notes, and snippets.

View bateller's full-sized avatar
🎯
Focusing

Brian A. Teller bateller

🎯
Focusing
View GitHub Profile
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.dan.me.uk/tornodes');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; Linux i586; rv:31.0) Gecko/20100101 Firefox/31.0');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$html = curl_exec($ch);
@bateller
bateller / New osTicket nginx settings...
Last active August 29, 2015 14:23
New/Old osTicket nginx settings
# Requests to /users/tickets/api/* need their PATH_INFO set, this does that
if ($request_uri ~ "^/users/tickets/api(/[^\?]+)") {
set $path_info $1;
}
# /api/*.* should be handled by /api/http.php if the requested file does not exist
location ~ ^/users/tickets/api/(tickets|tasks)(.*)$ {
try_files $uri $uri/ /users/tickets/api/http.php;
}
@bateller
bateller / gist:154c6e5d1f6e0e53e527
Last active July 1, 2020 23:11 — forked from boucher/gist:1750375
Stripe Example (Works with v2 of Stripe-PHP)
<?php
// Edited boucher/gist:1750375 to work with stripe-php v2
require 'stripe-php/init.php';
if ($_POST) {
\Stripe\Stripe::setApiKey("YOUR-API-KEY");
$error = '';
$success = '';
try {
if (!isset($_POST['stripeToken']))
throw new Exception("The Stripe Token was not generated correctly");
# Install linux update, followed by GCC and Make
sudo yum -y update
sudo yum install -y gcc make
# Install Nginx and PHP-FPM
sudo yum install -y nginx php-fpm
# Install PHP extensions
sudo yum install -y php-devel php-mysql php-pdo \
php-pear php-mbstring php-cli php-odbc \
#!/bin/sh
# Based on instructions found here: http://wiki.razuna.com/display/ecp/FFMpeg+Installation+on+CentOS+and+RedHat#FFMpegInstallationonCentOSandRedHat-InstallX264
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
cat > /etc/yum.repos.d/centos.repo<<EOF