Skip to content

Instantly share code, notes, and snippets.

drink more water

samayo samayo

drink more water
View GitHub Profile
samayo / 1nginx.conf
Created Sep 13, 2019 — forked from josephbolus/1nginx.conf
Wordpress Nginx Config
View 1nginx.conf
# ---------------------------------------
# Main Module
# ---------------------------------------
user nginx;
# This number should be, at maximum, the number of CPU cores on your system.
worker_processes 2;
pid /var/run/;
# Only log critical errors
samayo /
Created Oct 17, 2018 — forked from mohamed-el-habib/
drupal fpm with nginx and mysql


git clone git:// docker-drupal-fpm
cd docker-drupal-fpm
mkdir -p /usr/local/share/dockervolumes/drupal # if you change this folder please update the
chmod +x && ./ up
samayo /
Created Jun 20, 2016 — forked from lukearmstrong/
Install enough to get Ruby and Sass working on RHEL/CentOS
# lol redhat
# 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/
tar -xvzf ruby-1.9.3-p392.tar.gz
samayo / phpixie-stats.php
Created May 10, 2016 — forked from AndrewCarterUK/phpixie-stats.php
Script used to verify fraudulent installs on PHPixie.
View phpixie-stats.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
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.
samayo /
Created Nov 3, 2015 — forked from scottpnelson/
Automatic MySQL database setup from .env file contents


This script will automatically create a new MySQL database for you by reading your MySQL database name, host name, and user credentials from your .env file. This allows you to keep your database details safe, in a single location. Ideal for deployment and security.


1. Download to your project root directory 2. You can modify to set the following: - ENV_FILE (the relative path to your .env file -- e.g. ENV_FILE="./.env.local") - DEFAULT_MYSQL_HOST (the host name of your MySQL server -- e.g. "localhost") - DEFAULT_MYSQL_ADMIN_USERNAME (the administrator username of your mysql server -- e.g. "root" (note: this is typically NOT the MySQL username of your app). This should be no longer than 16 characters. Some versions of MySQL allow for longer lengths. You can modify the MAX_MYSQL_USERNAME_LENGTH variable to change this length. - DEFAULT_MYSQL_ADMIN_PASSWORD (the administrator password of your mysql admin user -- e.g
samayo /
Last active Aug 28, 2015 — forked from kelunik/
set -e
set -x
if [ $1 == "master" ]
wget -q -O
rm -rf php-src-master
unzip -q
View SecureSessionHandler.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
View countries.json
{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'},