- Assuming that you have already installed php and apache
- Install xDebug php extension
# Ubuntu 16.04, php 7.0
sudo apt-get install php-xdebug
# Ubuntu 14.04, php 5.6
sudo apt-get install php5-xdebug
| First install pip for Python2. Download the get-pip.py file from https://bootstrap.pypa.io/get-pip.py | |
| $ cd <download location> | |
| $ sudo -H python ./get-pip.py | |
| Installing pip also installs Python3 | |
| To run Python3 | |
| $ python3 | |
| Install pip3 by just executing the same file as in the step above, but this time using Python3 | |
| $ sudo -H python3 ./get-pip.py |
| # Ask for the user password | |
| # Script only works if sudo caches the password for a few minutes | |
| sudo true | |
| # Install kernel extra's to enable docker aufs support | |
| # sudo apt-get -y install linux-image-extra-$(uname -r) | |
| # Add Docker PPA and install latest version | |
| # sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 | |
| # sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list" |
| # coding:utf-8 | |
| from elasticsearch import Elasticsearch | |
| import json | |
| # Define config | |
| host = "127.0.0.1" | |
| port = 9200 | |
| timeout = 1000 | |
| index = "index" |
| // This is super slow though: http://jsperf.com/summing-objects/2 | |
| var sumObj = function (object) { | |
| if (Object.keys(object).length) { | |
| var firstKey = Object.keys(object)[0]; | |
| var clone = Object.assign({}, object); | |
| delete clone[firstKey]; | |
| return parseInt(object[firstKey]) + sumObj(clone); | |
| } |
| #!/bin/bash | |
| ##################################################### | |
| # Name: Bash CheatSheet for Mac OSX | |
| # | |
| # A little overlook of the Bash basics | |
| # | |
| # Usage: | |
| # | |
| # Author: J. Le Coupanec | |
| # Date: 2014/11/04 |
| input { | |
| file { | |
| path => "/var/log/nginx/access.log" | |
| type => "nginx-access" | |
| sincedb_path => "/var/log/.nginxaccesssincedb" | |
| } | |
| } | |
| input { | |
| file { | |
| path => "/var/log/nginx/error.log" |
| –ctrl a c -> create new window | |
| –ctrl a A -> set window name | |
| –ctrl a w -> show all window | |
| –ctrl a 1|2|3|… -> switch to window n | |
| –ctrl a ” -> choose window | |
| –ctrl a ctrl a -> switch between window | |
| –ctrl a d -> detach window | |
| –ctrl a ? -> help | |
| –ctrl a [ -> start copy, move cursor to the copy location, press ENTER, select the chars, press ENTER to copy the selected characters to the buffer | |
| –ctrl a ] -> paste from buffer |
# Ubuntu 16.04, php 7.0
sudo apt-get install php-xdebug
# Ubuntu 14.04, php 5.6
sudo apt-get install php5-xdebug
| #!/usr/bin/python | |
| import psycopg2 | |
| import psycopg2.extras | |
| from pyes import * | |
| import argparse | |
| import traceback | |
| import math | |
| def ResultIter(cursor, arraysize=100): | |
| # An iterator that uses fetchmany to keep memory usage down |
| # Elasticsearch Cheatsheet - an overview of commonly used Elasticsearch API commands | |
| # cat paths | |
| /_cat/allocation | |
| /_cat/shards | |
| /_cat/shards/{index} | |
| /_cat/master | |
| /_cat/nodes | |
| /_cat/indices | |
| /_cat/indices/{index} |