Skip to content

Instantly share code, notes, and snippets.

View pixline's full-sized avatar

Paolo T. pixline

View GitHub Profile
@pixline
pixline / test-raw.php
Last active December 19, 2015 20:49
Differences on exif_read_data() between raw PHP and WordPress 'wp_handle_upload_prefilter' filter. Raw PHP call will return $exif['Make'] and $exif['Model'] while WordPress filtered upload will set $exif['IFD0']['Make'] and $exif['IFD0']['Model']
<?php
print_r( exif_read_data( 'sucuri-test.jpg' ) );
/*
Array
(
[FileName] => sucuri-test.jpg
[FileDateTime] => 1374009774
[FileSize] => 38936
[FileType] => 2
#!/usr/bin/env bash
# args
MSG=${1-'deploy from git'}
BRANCH=${2-'trunk'}
# paths
SRC_DIR=$(git rev-parse --show-toplevel)
DIR_NAME=$(basename $SRC_DIR)
DEST_DIR=~/svn/$DIR_NAME/$BRANCH
@pixline
pixline / liquidsoap-homebrew.log
Created August 3, 2013 00:38
homebrew liquidsoap build fail log
1 pixline@white ~ % brew install liquidsoap :(
==> Installing liquidsoap dependency: objective-caml
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/objective-caml-4.00.1.lion.bottle.1.tar.gz
######################################################################## 100,0%
==> Pouring objective-caml-4.00.1.lion.bottle.1.tar.gz
🍺 /usr/local/Cellar/objective-caml/4.00.1: 1191 files, 210M
==> Installing liquidsoap dependency: ocaml-findlib
==> Downloading http://download.camlcity.org/download/findlib-1.3.3.tar.gz
######################################################################## 100,0%
Warning: MD5 support is deprecated and will be removed in a future version.
{
"name": "progetto",
"version": "1.0.0",
"devDependencies": {
"grunt": "~0.4.0",
}
}
@pixline
pixline / osxlocal.sh
Last active December 24, 2015 08:39
homebrew local setup
#!/bin/bash
homebrew_packages=(
freetype
jpeg
libpng
gd
zlib
openssl
unixodbc
@pixline
pixline / lightdm.conf
Created October 14, 2013 20:37
lightdm.conf guest support (sample)
[LightDM]
start-default-seat=true
guest-account-script=guest-account
[SeatDefaults]
xserver-command=Xorg
xserver-allow-tcp=false
greeter-session=lightdm-greeter
greeter-hide-users=true
greeter-allow-guest=true
@pixline
pixline / wheezypoint.sh
Last active December 25, 2015 13:18
debian7 raw internet point setup. of course it doesn't work, but it should :-) 1) debootstrap + kernel + grub 2) script 3) internet point!
#!/bin/bash
# running time measure
start_seconds=`date +%s`
# network check
ping_result=`ping -c 2 8.8.8.8 2>&1`
# architecture
arch=`uname -m`
# Script URLs
GUEST_URL="https://gist.github.com/pixline/6981710/raw/5bcc702616a8253b0ed90889dd31529962a89c37/guest-account.sh"
@pixline
pixline / colorbash-escape.sh
Created October 23, 2013 06:11
color bash techniques
# Text color variables
txtred='\e[0;31m' # red
txtgrn='\e[0;32m' # green
txtylw='\e[0;33m' # yellow
txtblu='\e[0;34m' # blue
txtpur='\e[0;35m' # purple
txtcyn='\e[0;36m' # cyan
txtwht='\e[0;37m' # white
bldred='\e[1;31m' # red - Bold
@pixline
pixline / .scrutinizer.yml
Created September 28, 2013 17:22
sample scrutinizer.yml config file for WordPress plugin
filter:
paths:
- 'lib/*'
- '/*'
excluded_paths:
- 'tests/*'
- 'examples/*'
tools:
php_mess_detector:
filter: