Skip to content

Instantly share code, notes, and snippets.

@Fake51
Fake51 / gist:865603
Created March 11, 2011 08:04
Syntax check all .php files in folder and subfolder
find . -iname '*.php' -exec php -l '{}' \; | grep '^No syntax errors' -v | less
@Fake51
Fake51 / gist:865611
Created March 11, 2011 08:13
Find .php files modified less than 120 minutes ago
find . -mmin -120 -iname '*.php'
@Fake51
Fake51 / gist:2588645
Created May 3, 2012 19:37
Typical php configure settings
./configure --prefix=/usr/ --with-config-file-path=/usr/lib/php --with-apxs2=/usr/bin/apxs2 --enable-fpm --with-openssl --with-zlib --enable-bcmath --with-bz2 --enable-calendar --with-curl --enable-exif --with-gd --with-mhash --enable-intl --enable-mbstring --with-mcrypt --with-mysql --with-mysqli --enable-pcntl --with-readline --enable-soap --enable-sockets --with-xmlrpc --enable-zip --enable-mysqlnd --with-pear --with-pdo-mysql=mysqlnd
@Fake51
Fake51 / gist:2727401
Created May 18, 2012 20:19
typical installs to make php compilation work (typical install from other gist)
apt-get install apache2-prefork-dev mysql-server libicu-dev libxml2-dev libbz2-dev libcurl4-openssl-dev libpng12-dev libopenjpeg-dev g++ libmcrypt-dev libreadline-dev
@Fake51
Fake51 / Web project composer setup
Last active December 17, 2015 06:19
Base web project composer setup
{
"name": "fake51/composer",
"description": "Base web-project composer setup",
"config": {
"bin-dir": "bin"
},
"autoload": {
"psr-0": {
"": "src"
}

Install Graphite on Ubuntu or Debian in a VirtualEnv

Note

This guide is for Graphite 0.9.10 and Debian 7.

Preparations

@Fake51
Fake51 / Infoscreen autostart for raspberry pi
Last active June 14, 2016 05:19
Raspbian: autostart browser on desktop init
# edit this file to add what you want to startup on desktop init
# /etc/xdg/lxsession/LXDE/autostart
#
# grabbed from http://alexba.in/blog/2013/01/07/use-your-raspberrypi-to-power-a-company-dashboard/
@lxpanel --profile LXDE
@pcmanfm --desktop --profile LXDE
#@xscreensaver -no-splash
# avoid screensaver/shut off on no activity
Serious, this is messed up. That browsers get something so simple wrong is mindnumbing. Anyway, solution is:
Content-Disposition: attachment; filename="[ascii-only-filename]"; filename*=UTF-8''[urlencoded-utf8-filename]]
# verify that certificate and chain will work
openssl verify -verbose -purpose sslserver -CAfile <file containing both root and intermediates> <file containing signed cert>
# verify that private key and certificate match - compare output
openssl x509 -noout -modulus -in server.crt | openssl md5
openssl rsa -noout -modulus -in server.key | openssl md5
# connect to web server and verify certificate
openssl s_client -connect example.com:443 -CApath /etc/ssl/certs/
@Fake51
Fake51 / Frontend work
Last active December 12, 2015 14:35
Javascript libraries
js libraries
- Promises: bluebird
- DOM: lodash
- templating: t.js/mustache
- charts: smoothie charts
- responsive: W/mediatizr/Henka
- Events: events.js
- localstorage: strg.js
- sessionstorage: strg.js
- cookies: strg.js