Skip to content

Instantly share code, notes, and snippets.

View SalemHarrache's full-sized avatar
💭
🤤

Salem Harrache SalemHarrache

💭
🤤
View GitHub Profile
@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 / 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
#!/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:

@SalemHarrache
SalemHarrache / installer.sh
Created March 4, 2013 10:10 — forked from tahl/installer.sh
Android SDK + NDK + Eclipse and ADB Installer
#!/bin/bash
#
#This script is designed to install the Android SDK, NDK, and Eclipse in Linux Mint 11 and make it easier for people that want to develop for Android using Linux.
#Script written by @ArchDukeDoug with special thanks to @BoneyNicole, @tabbwabb, and @animedbz16 for putting up with me and proofreading and/or testing the script.
#I can be reached at dougw@uab.edu, twitter, or linuxrandomly.blogspot.com
#Script version: 1.0.5
#Changelog: 1.0.5 - Fixed the Android SDK search parameters to fit the new naming scheme on http://developer.android.com/sdk
i=$(cat /proc/$PPID/cmdline)
if [[ $UID != 0 ]]; then
echo "Please type sudo $0 $*to use this."
sudo rm -f /etc/X11/xorg.conf*
sudo -i
# wget -N http://kanotix.com/files/install-fglrx-debian.sh
DISPLAY= sh install-fglrx-debian.sh -z
#!/bin/bash
#
#This script is designed to install the Android SDK, NDK, and Eclipse in Linux Mint 11 and make it easier for people that want to develop for Android using Linux.
#Script written by @ArchDukeDoug with special thanks to @BoneyNicole, @tabbwabb, and @animedbz16 for putting up with me and proofreading and/or testing the script.
#I can be reached at dougw@uab.edu, twitter, or linuxrandomly.blogspot.com
#Script version: 1.0.5
#Changelog: 1.0.5 - Fixed the Android SDK search parameters to fit the new naming scheme on http://developer.android.com/sdk
i=$(cat /proc/$PPID/cmdline)
if [[ $UID != 0 ]]; then
echo "Please type sudo $0 $*to use this."
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext import admin, wtf
from flask.ext.admin.contrib import sqlamodel
app = Flask(__name__)
app.config['SECRET_KEY'] = '123456790'
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///test.sqlite'
db = SQLAlchemy(app)