Skip to content

Instantly share code, notes, and snippets.

Smowtion Thomanphan

View GitHub Profile
Thomanphan /
Created Jul 24, 2018 — forked from joerx/
redirect php-fpm output to nginx's error log
  • php process is wrapped like this: PHP file -> php-fpm -> nginx
  • basically means disable all facilities that catch output from the script on it's way to nginx
  • standard error output will the end in Nginx's logging facility

On CentOS

  • make sure your script does not set error_log
  • edit /etc/php-fpm.conf, disable line error_log = /var/log/php-fpm/error.log
  • edit /etc/php-fpm.d/www.conf, disable line starting with php_admin_value[error_log] = ...
  • restart fpm: systemctl restart php-fpm
View ssl-protocol-cipher.conf
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
View nginx.cnf
server {
listen 80;
rewrite ^(.*)$1 permanent;
server {
listen 443 ssl http2;
ssl_certificate /etc/nginx/paidssl/;
Thomanphan / svg2icns
Created May 20, 2018 — forked from zlbruce/svg2icns
covert svg to icns (with imagemagick)
View svg2icns
echo "*** SVG 2 ICNS ***"
if [ $# -ne 1 ]; then
echo "Usage: svg2icns filename.svg"
exit 100
echo "processing: $name"
View gist:6bee985f71f342a773b9d829ee8ab208
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xml:lang="en" lang="en" xmlns="">
<title>[VIP Exclusive] Gael Breton, Perrin Carrell – The Authority Site System $497</title>
<script src="/cdn-cgi/apps/head/yWhojLTrnH_uPURAVzoPEG9BKrM.js"></script><script type="text/javascript">
window.__cfRocketOptions = {byc:0,p:0,petok:"8ed06bfd0e09014cd52fcaddcb51474fc2d1b0ba-1524819050-1800"};
View gist:7af842360e2bd4f370c22b07f328f5a9
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xml:lang="en" lang="en" xmlns="">
<title>(GET) Persuasion Secrets of the World’s Most Charismatic and Influential Villains by Ben Settle</title>
<script src="/cdn-cgi/apps/head/yWhojLTrnH_uPURAVzoPEG9BKrM.js"></script><script type="text/javascript">
window.__cfRocketOptions = {byc:0,p:0,petok:"5ebaaa8dc2a7856d2056f97e9565b6ce6a9000be-1524818515-1800"};
Thomanphan / ResizeImage.php
Created Mar 26, 2018 — forked from egulhan/ResizeImage.php
Resize Image Class With PHP
View ResizeImage.php
// @source:
* Resize image class will allow you to resize an image
* Can resize to exact size
* Max width size while keep aspect ratio
* Max height size while keep aspect ratio
* Automatic while keep aspect ratio
View Fahrenheit to Celsius.html
<!DOCTYPE html>
<h2>JavaScript Functions</h2>
<p>This example calls a function to convert from Fahrenheit to Celsius:</p>
<p id="demo"></p>
function toCelsius(f) {
View Database.singleton.php
# Name: Database.singleton.php
# File Description: MySQL Singleton Class to allow easy and clean access to common mysql commands
# Author: ricocheting
# Web:
# Update: 2010-07-19
# Version: 3.1.4
# Copyright 2003
You can’t perform that action at this time.