Skip to content

Instantly share code, notes, and snippets.

View KangOl's full-sized avatar
📷
Screenshot Debugger

Christophe Simonis KangOl

📷
Screenshot Debugger
View GitHub Profile
@KangOl
KangOl / openerp
Created July 5, 2013 09:38
openerp init.d script
#!/bin/bash
### BEGIN INIT INFO
# Provides: openerp
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start openerp daemon at boot time
# Description: Enable service provided by daemon.
# X-Interactive: true
=== modified file 'addons/web/static/src/js/chrome.js'
--- addons/web/static/src/js/chrome.js 2013-02-13 14:39:53 +0000
+++ addons/web/static/src/js/chrome.js 2013-02-19 22:08:07 +0000
@@ -1323,8 +1323,9 @@
},
on_hashchange: function(event) {
var self = this;
- var state = event.getState(true);
- if (!_.isEqual(this._current_state, state)) {
+ var stringstate = event.getState(false);
@KangOl
KangOl / gist:4533912
Created January 14, 2013 21:58
imapfilter: auto sort mailing list
bool = function(o)
if not o then
return false
elseif o == '' then
return false
elseif o == 0 then
return false
elseif #o == 0 then
return false
end
@KangOl
KangOl / whoami.sh
Created December 28, 2012 18:43
Script that return the name of the current ssh user
#!/usr/bin/env bash
if [ -z "$SSH_TTY" ]; then
exit 3
fi
LOGINTIME=`last -RF ${SSH_TTY:5} | head -n1 | awk '{print $6}'`
MATCH=`echo $USER $SSH_CLIENT | awk '{print " Accepted publickey for " $1 " from " $2 " port " $3 " ssh2"}'`
def get_fk_on(cr, table, ignored):
q = """ SELECT cl1.relname as table,
att1.attname as column
FROM pg_constraint as con, pg_class as cl1, pg_class as cl2,
pg_attribute as att1, pg_attribute as att2
WHERE con.conrelid = cl1.oid
AND con.confrelid = cl2.oid
AND array_lower(con.conkey, 1) = 1
AND con.conkey[1] = att1.attnum
#!/usr/bin/env python
import os
import sys
if len(sys.argv) > 1:
print os.getpid(), " ".join(sys.argv[1:])
else:
os.execv(sys.executable, [sys.executable] + sys.argv + ['hello', str(os.getpid())])