Skip to content

Instantly share code, notes, and snippets.

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

Pedro Papadopolis pedropapa

🏠
Working from home
  • Sydney, Australia
View GitHub Profile
Installing avconv with all dependencies for video conversion/encoding:
(macOS) brew reinstall libav --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid
Start encoding worker:
php app/console gearman:worker:run src/Core/VideoBundle/Worker/EncodeVideoWorker.php
Example of manually encoding an uploaded video:
avconv -i /usr/local/var/www/htdocs/Xys/xcorp/web/upload/video/encoded/e6/e0/e6e0082c-a38b-4984-93f6-15bc895f057c -acodec libvorbis -y /usr/local/var/www/htdocs/Xys/xcorp/web/upload/video/encoded/e6/e0/e6e0082c-a38b-4984-93f6-15bc895f057c.webm
@pedropapa
pedropapa / gist:5b0a4666f70d0567d7a7d98a5b5b84c0
Last active February 27, 2018 00:32
Xys PHP installation - Homebrew (macOS)
PHP 7.1:
brew install php71 --with-httpd24 --with-pdo-oci
brew install --build-from-source php71-imagick php71-apcu php71-gearman php71-igbinary php71-mcrypt php71-mongodb php71-opcache php71-pdo-dblib php71-pdo-pgsql php71-redis
PHP 5.6:
brew install php56 --with-httpd24
brew install --build-from-source php56-imagick php56-apcu php56-gearman php56-igbinary php56-mcrypt php56-mongo php56-mongodb php56-opcache php56-pdo-dblib php56-pdo-pgsql php56-redis
PHP 5.3:
brew install php53 --with-httpd24 --with-postgresql
@pedropapa
pedropapa / gist:20f1e5a7569b844b06fb9c496815b053
Created February 16, 2017 19:47
Redirect lan port to internal IP (macOS)
1. Go to system preferences > sharing.
2. Enable remote login.
3. Execute the following command on terminal: ssh -L lan_ip:lan_port:redirect_ip:redirect_port -N 127.0.0.1
4. Example: ssh -L 192.168.200.120:10000:mma-hmg:80 -N 127.0.0.1
@pedropapa
pedropapa / gist:6ccde75a1069546a1d0beeef65144afa
Last active May 26, 2017 14:14
Installing oracle's instantclient 12.1c and php (installed via brew) oci8 driver OS X
Prerequisites:
1. PECL installed: https://jason.pureconcepts.net/2012/10/install-pear-pecl-mac-os-x/
PHP 5.6
1. Go to http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
2. Click "Instant Client for Mac OS X (Intel x86) (32-bit and 64-bit)"
3. Download instantclient-basic-macos.*
4. Download instantclient-sqlplus-macos.*
5. Download instantclient-sdk-macos.*
6. Extract all packages.
f8bbcdcf0a30c780e516619fd88893d1
8fc758b5c164904d1292b0c41ebe9a49
c6f2c339da2677a780f50496183b4d76
8d86dca3a0e95a630f4cc3040883b57d
de7be52632359b65b00c5189448822c7
a333c413fa0fe98c0ac6864b1a3be4e8
9ddfda961f5f84cb437195677bae7753
a8cab95077cf66c58473f07130983e83
@pedropapa
pedropapa / conversation.html
Created August 14, 2017 12:37
Extrair quantitativos de conversa do whatsapp
<html>
<body>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script type="text/javascript">
function indexes(source, find) {
var result = [];
for (i = 0; i < source.length; ++i) {
// If you want to search case insensitive use
// if (source.substring(i, i + find.length).toLowerCase() == find) {
@pedropapa
pedropapa / ranking.txt
Last active September 9, 2022 09:39
SA-MP's contributors ranking
This file has been truncated, but you can view the full file.
1º: CuervO | Contributions: 6 | Views: 2413373 | Answers: 8342
Contributions:
FilterScript:
Advanced Inventory/Object Managament Script (DayZ Themed) [SQL;Dynamic;Beta] | Answers: 60 | Views: 24399
Spotlight for Helicopters [0.3c] | Answers: 32 | Views: 14345
Live Map Editor [DINI/ZCMD] | Answers: 29 | Views: 10998
Nanosuit | Answers: 6 | Views: 1490
GameMode:
[GM] Raven's Roleplay [2.5b] | Answers: 8069 | Views: 2324131
@pedropapa
pedropapa / extractor.js
Last active September 28, 2017 23:19
SA-MP forums contributors ranking extractor
/**
* How to run:
*
* 1. Open Google Chrome.
* 2. Open SA-MP forums url (http://forum.sa-mp.com/forumdisplay.php)
* 3. Open browser's console (Windows: ctrl + shift + i, MacOS: command + shift + i).
* 4. Copy & Paste this script in the console.
* 5. Hit enter to run the code.
* 6. Follow instructions shown.
*
@pedropapa
pedropapa / object.js
Last active October 1, 2017 17:14
RageMP's full mp object
{ versions: { core: '0.3 beta', net: 1 },
config:
{ maxplayers: 50,
name: '[:.:.Brazuca\'s Server.:.:] Minigames',
gamemode: 'minigames',
streamdistance: 500,
announce: true,
port: 22005,
password: 'changeme',
'max-ping': 200,
version: "3"
services:
rediscollab:
image: padraoix/redis
environment:
REDIS_TYPE: master
REDIS_CLUSTER: 'no'
deploy: