Skip to content

Instantly share code, notes, and snippets.

View SalemHarrache's full-sized avatar
💭
🤤

Salem Harrache SalemHarrache

💭
🤤
View GitHub Profile
@SalemHarrache
SalemHarrache / phpbb_extauth.py
Created August 10, 2012 16:49
Ejabberd extauth : Authenticate phpbb users against PostgreSQL with Peewee
#!/usr/bin/env python
# Ejabberd extauth : Authenticate phpbb users against PostgreSQL with Peewee
# Original Author: Lukas Kolbe <[email protected]>
import sys
import logging
import struct
from hashlib import md5
@SalemHarrache
SalemHarrache / gist:3369094
Created August 16, 2012 10:22
virtual env setup at alwaysdata
## log via ssh
mkdir ~/modules/
## add modules to python path in your .bashrc
export PYTHONPATH=~/modules/
## source .bashrc
## install pip & virtualenv
easy_install-2.6 --install-dir ~/modules -U pip
easy_install-2.6 --install-dir ~/modules -U virtualenv
@SalemHarrache
SalemHarrache / gist:3369303
Created August 16, 2012 11:04
Pip management
# Output outdated packages
pip freeze | cut -d = -f 1 | xargs -n 1 pip search | grep -B2 'LATEST:'
# Upgrade all outdated packages
pip freeze | cut -d = -f 1 | xargs echo pip install -U
@SalemHarrache
SalemHarrache / gist:3369942
Created August 16, 2012 12:59 — forked from nautilebleu/gist:2953267
Use python 2.7 on Alwaysdata servers
# Get the binary from ActiveState.
$ mkdir ~/temp
$ cd ~/temp ; wget http://downloads.activestate.com/ActivePython/releases/2.7.2.5/ActivePython-2.7.2.5-linux-x86_64.tar.gz
$ tar xvf ActivePython-2.7.2.5-linux-x86_64.tar.gz
# Create a src directory at the root of your account.
$ mkdir ~/opt/ActivePython-2.7
# Install python 2.7
$ ActivePython-2.7.2.5-linux-x86_64/install.sh
@SalemHarrache
SalemHarrache / adeweb.py
Created September 5, 2012 21:38
Adeweb authentification
# install : sudo easy_install requests
# run : python adeweb.py
import re
import requests
def get_url_img(identifier, week, treeid):
url_img = 'http://adeweb.univ-lyon1.fr/ade/imageEt?identifier=' \
+ identifier + '&projectId=25&idPianoDay=0%2C1%2C2%2' \
'C3%2C4&width=1200&height=800&lunchName=REPAS&displa' \
'yMode=1057855&showLoad=false&ttl=1288453423104&disp' \
@SalemHarrache
SalemHarrache / gist:4061908
Created November 12, 2012 21:08 — forked from vshvedov/gist:1370650
Sublime Text Edit 2 for Debian (from PPA)
wget http://blog.anantshri.info/content/uploads/2010/09/add-apt-repository.sh.txt
sudo mv add-apt-repository.sh.txt /usr/sbin/add-apt-repository
sudo chmod o+x /usr/sbin/add-apt-repository
sudo chown root:root /usr/sbin/add-apt-repository
sudo add-apt-repository ppa:webupd8team/sublime-text-2
@SalemHarrache
SalemHarrache / HOW TO
Created December 8, 2012 18:06
iptables
sudo cp iptables_rules.sh /etc/init.d/iptables
#edit rules/port before
sudo chmod +x /etc/init.d/iptables
#run the script automatically during start up
update-rc.d iptables defaults
/etc/init.d/iptables start
@SalemHarrache
SalemHarrache / upload.py
Last active October 16, 2019 13:07
Anonfiles API upload with requests
#!/usr/bin/env python
from __future__ import unicode_literals, print_function
import requests
from clize import clize, run
URL = "https://anonfiles.com/api/hotlink"
@clize
#!/usr/bin/env python
#
# to install : sudo easy_install watchdog
#
import subprocess
import os
import time
import pynotify
from gobject import GError

installer gsteamer-tools:

sudo apt-get install gstreamer-tools

lancer le serveur web: