git clone git://github.com/fd57d8aa59b1574ee7728edf128814d3.git docker-drupal-fpm
cd docker-drupal-fpm
mkdir -p /usr/local/share/dockervolumes/drupal # if you change this folder please update the run.sh
chmod +x run.sh && ./run.sh up
# --------------------------------------- | |
# Main Module | |
# --------------------------------------- | |
user nginx; | |
# This number should be, at maximum, the number of CPU cores on your system. | |
worker_processes 2; | |
pid /var/run/nginx.pid; | |
# Only log critical errors |
# lol redhat | |
su | |
# Install deps | |
yum install libyaml libyaml-devel openssl libxml2-devel bison libxslt-devel openssl-devel tcl tk libffi tcl-devel tk-devel libffi-devel | |
# Download Ruby | |
cd /usr/local/src/ | |
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz | |
tar -xvzf ruby-1.9.3-p392.tar.gz |
<?php | |
function getJsonPage($url) | |
{ | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
$result = curl_exec($ch); |
""" An example of a Linux daemon written in Python. | |
Based on http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/ | |
The changes are: | |
1 - Uses file open context managers instead of calls to file(). | |
2 - Forces stdin to /dev/null. stdout and stderr go to log files. | |
3 - Uses print instead of sys.stdout.write prior to pointing stdout to the log file. | |
4 - Omits try/excepts if they only wrap one error message w/ another. |
#!/bin/bash | |
set -e | |
set -x | |
if [ $1 == "master" ] | |
then | |
wget https://github.com/php/php-src/archive/master.zip -q -O master.zip | |
rm -rf php-src-master | |
unzip -q master.zip |
<?php | |
class SecureSessionHandler extends SessionHandler { | |
protected $key, $name, $cookie; | |
public function __construct($key, $name = 'MY_SESSION', $cookie = []) | |
{ | |
$this->key = $key; | |
$this->name = $name; |
Magic words:
psql -U postgres
Most \d
commands support additional param of __schema__.name__
and accept wildcards like *.*
\q
: Quit/Exit\c __database__
: Connect to a database\d __table__
: Show table definition including triggers[ | |
{name: 'Afghanistan', code: 'AF'}, | |
{name: 'Åland Islands', code: 'AX'}, | |
{name: 'Albania', code: 'AL'}, | |
{name: 'Algeria', code: 'DZ'}, | |
{name: 'American Samoa', code: 'AS'}, | |
{name: 'AndorrA', code: 'AD'}, | |
{name: 'Angola', code: 'AO'}, | |
{name: 'Anguilla', code: 'AI'}, | |
{name: 'Antarctica', code: 'AQ'}, |