Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
This gist assumes:
function verify_app_store_in_app($receipt, $is_sandbox) | |
{ | |
//$sandbox should be TRUE if you want to test against itunes sandbox servers | |
if ($is_sandbox) | |
$verify_host = "ssl://sandbox.itunes.apple.com"; | |
else | |
$verify_host = "ssl://buy.itunes.apple.com"; | |
$json='{"receipt-data" : "'.$receipt.'" }'; | |
//opening socket to itunes |
<?php | |
// Put your device token here (without spaces): | |
$deviceToken = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; | |
// Put your private key's passphrase here: | |
$passphrase = 'xxxxxxx'; | |
// Put your alert message here: | |
$message = 'A push notification has been sent!'; |
sudo apt-get update | |
sudo apt-get install munin-plugins-extra | |
cd /etc/munin/plugins | |
sudo ln -snf /usr/share/munin/plugins/memcached_ memcached_bytes | |
sudo ln -snf /usr/share/munin/plugins/memcached_ memcached_counters | |
sudo ln -snf /usr/share/munin/plugins/memcached_ memcached_rates | |
sudo aptitude install libcache-memcached-perl | |
sudo /etc/init.d/munin-node restart | |
sudo tail -f /var/log/munin/munin-node.log |
<?php | |
use Monolog\Logger; | |
use Monolog\Handler\GelfHandler; | |
use Gelf\MessagePublisher; | |
/** | |
* Class to configure and return a Monolog instance | |
* | |
* @author Jeremy Cook | |
*/ |
<?php | |
// API access key from Google API's Console | |
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' ); | |
$registrationIds = array( $_GET['id'] ); | |
// prep the bundle | |
$msg = array |
#!/bin/bash | |
# for a blogpost on this, check: http://www.aktau.be/2013/09/22/detecting-interlaced-video-with-ffmpeg/ | |
# detect interlacing with the ffmpeg "idet" filter, the longer | |
# you let this run, the better, though it's never 100% accurate | |
# flags: | |
# -an = discard audio, we don't need it | |
# -f rawvideo = output raw video |
# read more at https://terrty.net/2014/ssl-tls-in-nginx/ | |
# latest version on https://gist.github.com/paskal/628882bee1948ef126dd/126e4d1daeb5244aacbbd847c5247c2e293f6adf | |
# security test score: https://www.ssllabs.com/ssltest/analyze.html?d=terrty.net | |
# your nginx version might not have all directives included, test this configuration before using in production against your nginx: | |
# $ nginx -c /etc/nginx/nginx.conf -t | |
server { | |
# public key, contains your public key and class 1 certificate, to create: | |
# (example for startssl) | |
# $ (cat example.com.pem & wget -O - https://www.startssl.com/certs/class1/sha2/pem/sub.class1.server.sha2.ca.pem) | tee -a /etc/nginx/ssl/domain.pem > /dev/null |