Skip to content

Instantly share code, notes, and snippets.

View fvanderbiest's full-sized avatar

François Van Der Biest fvanderbiest

View GitHub Profile
@malteo
malteo / LocalStorageProvider.js
Created December 12, 2011 17:04
localStorage state provider for ExtJS 3
Ext.ns('Ext.ux.state');
/**
* @class Ext.ux.state.LocalStorageProvider
* @extends Ext.state.Provider
* A Provider implementation which saves and retrieves state via the HTML5 localStorage object.
* If the browser does not support local storage, an exception will be thrown upon instantiating
* this class.
* <br />Usage:
<pre><code>
@qrw
qrw / git commit
Created April 13, 2012 14:54
git:commit all modified files in one line
git add $(git ls-files -m)
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active June 20, 2024 14:04
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@boris317
boris317 / flask_tar.py
Created September 10, 2012 20:57
Stream a tar file with flask.
import os
from cStringIO import StringIO
import tarfile
from flask import Flask, Response
app = Flask(__name__)
def get_string_io_len(s):
@danriti
danriti / fdups.py
Last active April 1, 2016 11:53 — forked from miku/fdups.py
# http://stackoverflow.com/questions/748675/finding-duplicate-files-and-removing-them/748908#748908
import sys
import os
import mmh3
CHUNK_SIZE = 1024*1024
def check_for_duplicates(paths):
@kminiatures
kminiatures / gist:4f314baeb9cf6e0977ea
Last active September 10, 2018 11:51
munin temperature plugin. for Raspberry Pi and DS18B20
#!/bin/sh
case $1 in
config)
cat <<'EOM'
graph_title Temperature
graph_vlabel Temperature
temperature.label temperature
EOM
exit 0;;
@pmauduit
pmauduit / geohealthcheck.wsgi
Created October 24, 2014 09:05
Flask sample WSGI file for geohealthcheck
activate_this = '/var/www/pmauduit/private/GeoHealthCheck/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))
import sys
sys.stdout = sys.stderr
sys.path.insert(0, '/var/www/pmauduit/private/GeoHealthCheck/GeoHealthCheck/GeoHealthCheck')
from app import APP as application
@klokan
klokan / Dockerfile
Created January 29, 2015 01:13
GDAL in Docker - stable GDAL with JP2KAK, MRSID and ECW: https://registry.hub.docker.com/u/klokantech/gdal/
FROM debian:7
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get -qq update \
&& apt-get -qq -y --no-install-recommends install \
autoconf \
automake \
build-essential \
curl \
@zhujunsan
zhujunsan / Using Github Deploy Key.md
Last active June 4, 2024 10:08
Using Github Deploy Key

What / Why

Deploy key is a SSH key set in your repo to grant client read-only (as well as r/w, if you want) access to your repo.

As the name says, its primary function is to be used in the deploy process in replace of username/password, where only read access is needed. Therefore keep the repo safe from the attack, in case the server side is fallen.

How to

  1. Generate a ssh key
@pmauduit
pmauduit / config
Last active March 31, 2016 18:30
LXC cheat sheet
lxc.utsname = cont1
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = lxcbr0
lxc.network.name = eth0
lxc.network.ipv4 = 192.168.0.2/24
lxc.network.ipv4.gateway = 192.168.0.1
lxc.rootfs = /var/lib/lxc/cont1/rootfs