Skip to content

Instantly share code, notes, and snippets.

Paris ptheofan

  • Berlin
Block or report user

Report or block ptheofan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ptheofan /
Created Aug 5, 2019
Batch (parallel) Process mp3 files in a folder with #1 ffmpeg (rebuild mp3), mp3gain (normalize), lame (set to cbr)
# Rebuild mp3 file
find . -name '*.mp3' | parallel 'ffmpeg -y -i {} -c:a libmp3lame -b:a 128k {.}.temp.mp3 && mv {.}.temp.mp3 {}'
# normalize
find . -name '*.mp3' | parallel 'mp3gain -a -k {}'
# cbr (or find the equivalent flags for ffmpeg and do it in one step)
find . -name '*.mp3' | parallel 'lame -m j -b 128 --cbr -q 0 {} {.}.temp.mp3 && mv {.}.temp.mp3 {}'
ptheofan /
Last active Jul 20, 2019
Create SSL nginx certs
# Author: Paris Theofanidis
# Purpose: All the steps to create an SSL certificate
if [ -z "$1" ]
echo "Provide the name of the certificate to be generated.";
echo "To generate a certificate for "
echo " mydomain.test"
ptheofan / cloudflare_https_prefix.php
Created Mar 21, 2017
Cloudflare flexible SSL - trick PHP scripts to identify HTTPS when cloudflare reports it was HTTPS request
View cloudflare_https_prefix.php
Go to your php.ini for the web scripts (pointless for cli scripts)
Make the following adjustment
auto_prepend_file = full/path/to/clousflare_https_prefix.php
reload/restart php service (or apache if running via apache)
How this works
ptheofan /
Last active Mar 31, 2016 — forked from stephanetimmermans/ubuntu-compass-ruby
Install Compass+Ruby on Ubuntu 14.04
# for ZSH users
sudo apt-get update
sudo apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties
sudo apt-get install -y libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
# switch to BASH
exec bash
curl -L | bash -s stable
# (if you get error follow the on screen instructions to add the signatures)
ptheofan / NestedSetToArrayExample.php
Last active Jun 13, 2018
Yii2 NestedSets class trait as a nice helper to use with any class that uses the NestedSets behavior
View NestedSetToArrayExample.php
* NestedSets in SQL - How to export a nested set subtree or tree into Yii2 Menu widget and as
* JsTree valid DataSet (nested format).
class Category extends \yii\db\ActiveRecord
* @return array
You can’t perform that action at this time.