Skip to content

Instantly share code, notes, and snippets.

View koryonik's full-sized avatar
🏠
Working from home

Damien Roch koryonik

🏠
Working from home
View GitHub Profile

Git cancel last commit

git reset HEAD~

Git cancel last pull

git reset --hard ORIG_HEAD 
@koryonik
koryonik / tips-ns-width-dig.sh
Last active October 18, 2016 19:49
Testing name servers
#Global test
dig mydomain.com
#List authoritative name servers
dig @8.8.8.8 +short NS mydomain.com
# Check MX configuration
dig mydomain.com MX
# list all records
@koryonik
koryonik / gist:732d08da2864675cf95a67216f2b8292
Created September 27, 2016 12:40
Filter Aggregation With Multiple terms
{
"size": 0,
"aggs": {
"agg_name": {
"filter" : {
"bool": {
"must": [
{
"term": {
"field1": "VALUE1"
@koryonik
koryonik / gist:f869b727982701509e32
Created January 5, 2016 11:06
Docker : kill all stopped or exited containers
docker rm $(docker ps -f status=exited -q)
@koryonik
koryonik / install_rasplex_osx.sh
Created October 26, 2015 19:42
Install Rasplex from OS X
# download img on https://github.com/RasPlex/RasPlex/releases
# here RasPlex-RPi.RP-0.7.1.img.gz
wget https://github.com/RasPlex/RasPlex/releases/download/0.7.1/RasPlex-RPi.RP-0.7.1.img.gz
# decompress archive
gunzip RasPlex-RPi.RP-0.7.1.img.gz
# find out what device you want to flash to, /dev/diskX (before & after mount sd card)
diskutil list
#install gearman server and libs
brew update
brew install gearman
# fixe perms if brew linking failed (http://stackoverflow.com/questions/26647412/homebrew-could-not-symlink-usr-local-bin-is-not-writable)
sudo chown damien:admin /usr/local/sbin
brew link gearman
# install php gearman extension
pecl install gearman
<?php
include 'vendor/autoload.php';
$pheanstalk = new Pheanstalk_Pheanstalk('127.0.0.1');
$pheanstalk->useTube('default');
$n = 1000000;
$start = microtime(true);
@koryonik
koryonik / fig.yml
Last active August 29, 2015 14:14 — forked from docteurklein/fig.yml
api:
build: fig/php
ports:
- '8000:8000'
working_dir: /src
volumes:
- backend:/src
entrypoint: [php, '-dextension=gearman.so', '-ddate.timezone=UTC']
command: '-S 0.0.0.0:8000 -t web'
links:
# brefore you will need to install Xcode and the Command-Line Tools and valid licence
brew update
brew doctor
brew install rbenv
brew install ruby-build
# see https://github.com/sstephenson/ruby-build/issues/377
brew uninstall openssl
@koryonik
koryonik / mavericks-flush-dns.sh
Last active August 29, 2015 14:05
Flush DNS on OS X Mavericks
dscacheutil -flushcache
sudo killall -HUP mDNSResponder