Skip to content

Instantly share code, notes, and snippets.

View jersub's full-sized avatar

Jérémy Subtil jersub

View GitHub Profile
@jersub
jersub / gist:7869100
Created December 9, 2013 08:31
Unlock Chromium's SQLite databases when your profile is corrupted. From kyron: http://www.google.com/support/forum/p/Chrome/thread?fid=46cbd32bea7f4fec00048665de6e82de&hl=en
IFS="
"
for I in `file ~/.config/chromium/Default/*|grep SQL|cut -f1 -d:`; do echo '.dump' | sqlite3 $I > ${I}.sql && rm $I && sqlite3 $I < ${I}.sql && rm ${I}.sql ; done
@jersub
jersub / gist:3772965
Created September 23, 2012 20:34
SSL CSR generation
openssl genrsa -out domain.com.key 2048
openssl req -new -keydomain.com.key.key -out domain.com.csr
@jersub
jersub / fabfile.py
Created September 26, 2011 21:43
Management of multiple gallery3 instances with Fabric
import os
import re
from fabric.api import lcd, hide, local, puts
CONTRIB_DIR = 'gallery-contrib'
GALLERY_REPO = 'git://github.com/gallery/gallery3.git'
GALLERY_CONTRIB_REPO = 'git://github.com/gallery/gallery3-contrib.git'
DATABASE_PREFIX = 'gallery_'
@jersub
jersub / httpd.conf
Created May 15, 2011 12:02
How to avoid the following Apache error : "apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName"
ServerName localhost
@jersub
jersub / Makefile
Created May 12, 2011 19:01
Set of Bazaar scripts for another agile development process.
BIN=agile_create-repo agile_update-mirrors
PREFIX=/usr/local
install:
@install -v $(BIN) $(PREFIX)/bin
uninstall:
@for bin in $(BIN); do \
rm -fv $(PREFIX)/bin/$$bin; \
done;
@jersub
jersub / 60-lxc.conf
Created May 7, 2011 11:18 — forked from pklaus/create-lxc-container.sh
Automates the steps to set up LXC containers with virtualized environments on Ubuntu Linux
net.ipv4.ip_forward=1
net.ipv4.conf.eth0.proxy_arp=1
@jersub
jersub / generate_mac_address.sh
Created April 14, 2011 22:08
Generates a random MAC address and prints it to stdout.
#!/bin/sh
openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'
DEBUG ::2011-03-15 10:45:37::utils.py:60::TNArchipelVirtualMachine.set_automatic_libvirt_description (10540f28-4ee8-11e0-b5c4-001851944646@labo.tld/hypervisor)::generated XML desc is : <domain type="openvz"><name>test-openvz</name><uuid>10540f28-4ee8-11e0-b5c4-001851944646</uuid><memory>0</memory><currentMemory>0</currentMemory><vcpu>1</vcpu><os><type arch="x86_64">exe</type><boot dev="hd" /></os><on_poweroff>destroy</on_poweroff><on_reboot>restart</on_reboot><on_crash>restart</on_crash><features /><devices /><description>10540f28-4ee8-11e0-b5c4-001851944646@labo.tld::::rn29FU9s00wHRa0419L7rZTtFg6aT3HZ</description></domain>
ERROR ::2011-03-15 10:45:37::utils.py:141::<archipel.archipelVirtualMachine.TNArchipelVirtualMachine object at 0x2121e90>.iq_define: exception raised is : internal error Could not exec /usr/sbin/vzctl
@jersub
jersub / gist:869123
Created March 14, 2011 13:40
Archipel error while using an OpenVZ URI for libvirt
INFO ::2011-03-14 14:26:55::utils.py:62::TNArchipelHypervisor.initialize_modules (hypervisor@labo.tld/arthur)::PLUGIN: loaded plugin action_scheduler
INFO ::2011-03-14 14:26:56::utils.py:62::TNArchipelHypervisor.connect_libvirt (hypervisor@labo.tld/arthur)::connected to libvirt uri openvz:///system
ERROR ::2011-03-14 14:26:56::utils.py:66::TNArchipelHypervisor.__init__ (hypervisor@labo.tld/arthur)::we are sorry. but your hypervisor doesn't support libvirt virConnectDomainEventRegisterAny. And this really bad. I'm sooo sorry
@jersub
jersub / Main.java
Created May 27, 2010 18:05
Displays a frame with a Processing applet fitting the frame borders, having palettes on top, but that are still under the menu bar.
/*
* Copyright (c) 2010 Jérémy Subtil. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the