Skip to content

Instantly share code, notes, and snippets.

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

Adrian Fedoreanu phedoreanu

🏠
Working from home
View GitHub Profile
@phedoreanu
phedoreanu / apache ssh keys
Last active January 25, 2024 17:34
git PHP webhook
sudo mkdir -m 0700 /var/www/.ssh
sudo chown -R apache:apache /var/www/.ssh
sudo -u apache ssh-keygen (empty passphrase)
paste public key into repo manager
(git-repo) sudo -u apache git pull origin branch (this will create /var/www/.ssh/known_hosts)
call git_hook.php?branch=xxx
# First verify the version of Java being used is not SunJSK.
java -version
# Get the latest Sun Java SDK from Oracle http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u1-download-513651.html
wget http://download.oracle.com/otn-pub/java/jdk/7u1-b08/jdk-7u1-linux-i586.rpm
# Rename the file downloaded, just to be nice
mv jdk-7u1-linux-i586.rpm\?e\=1320265424\&h\=916f87354faed15fe652d9f76d64c844 jdk-7u1-linux-i586.rpm
# Install Java
@phedoreanu
phedoreanu / post-receive
Last active August 29, 2015 14:02
git init --bare ~/src. chmod +x ~/src/hooks/post-receive/
#!/bin/bash
source ~/venv/bin/activate
GIT_WORK_TREE=~/app/ git checkout -f
cd ~/app
python manage.py syncdb
python manage.py migrate
python manage.py collectstatic --noinput
app_restart
@phedoreanu
phedoreanu / gist:dd2e13c1261630be0670
Created July 8, 2014 09:13
chmod +x ~/src/hooks/post-receive/
#!/bin/bash
GIT_WORK_TREE=~/app/ git checkout -f
chown -R http:http ~/app
@phedoreanu
phedoreanu / brew ffmpeg install
Last active April 9, 2018 10:44
brew ffmpeg install with mp4 libfaac & fdk-aac & libvpx
brew install libvpx ffmpeg --with-libvpx --with-libfaac --with-fdk-aac
Raspbian Jessie:
./configure --enable-libfreetype --enable-gpl --enable-nonfree --enable-libx264 --enable-libass --enable-libmp3lame --enable-zlib --enable-postproc --enable-pthreads
#! /bin/bash
echo "OS X update"
softwareupdate -ia
echo "Brew update"
brew update && brew upgrade --all && brew cleanup
#echo "pip2 update"
#pip2 list -o > pip.txt
launchctl list | sed -E "s/(.*com.apple.*)//g" | sed '/^\s*$/d'
[Service]
ExecStart=
ExecStart=/usr/bin/docker daemon -H fd:// --bip=172.17.42.1/16
@phedoreanu
phedoreanu / requests.sh
Last active January 30, 2016 17:07
https GET request fails with SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:590)
#!/bin/bash
env ARCHFLAGS="-arch x86_64" LDFLAGS="-L/usr/local/opt/openssl/lib" CFLAGS="-I/usr/local/opt/openssl/include" pip install requests[security] urllib3
angular.module('file.upload', [])
.factory('fileSvc', ['$http', '$q', function ($http, $q) {
'use strict';
var factory = {};
factory.readFile = function (file) {
return $q(function (resolve, reject) {
if (!file)
reject('file= ' + file);