Skip to content

Instantly share code, notes, and snippets.

View czj's full-sized avatar

Clément Joubert czj

View GitHub Profile
@czj
czj / nginx
Created July 17, 2011 10:00
Ubuntu Server 10.04 init.d file for nginx (installed by Passenger)
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
@czj
czj / gist:1136386
Created August 10, 2011 08:42
Auto-login bookmarklet for Boursorama Banque (site beta août 2011)
if (window.location != 'https://www.boursorama.com/connexion.phtml')
{
window.location = 'https://www.boursorama.com/connexion.phtml';
}
else
{
document.getElementById('login').value = "";
document.getElementById('password').value = "";
document.getElementById('identification').submit();
}
@czj
czj / gist:1136385
Created August 10, 2011 08:41
Auto-login for Banque Populaire Ouest
var base_url = "https://www.secure3.banquepopulaire.fr/amserver/UI/Login?realm=ENTAO-ENV00030&goto=https%3A%2F%2Fwww.ibps.ouest.banquepopulaire.fr%3A443%2Fcyber%2Fibp%2Fate%2Fportal%2Finternet.html";
if (window.location != base_url)
{
window.location = base_url;
}
else
{
document.getElementById('IDToken1').value = "";
document.getElementById('IDToken2').value = "";
@czj
czj / gist:1149177
Created August 16, 2011 14:11
BNP Paribas almost-automatic login
var url = "https://www.secure.bnpparibas.net/banque/portail/particulier/HomeConnexion?type=homeconnex&identifiant=secure_bnpparibas_net_20021206152735"
if (window.location != url)
{
window.location = url;
}
else
{
// Add your login here
document.logincanalnet.ch1.value = "";
@czj
czj / sabnzdb_upgrade.sh
Created September 27, 2011 09:40
SABnzdb+ auto-update script
#!/bin/bash
cd ~/bin
API_KEY=`cat SABnzbd/sabnzbd.ini | grep ^api_key | awk '{print $3}'`
PORT=` cat SABnzbd/sabnzbd.ini | grep ^https_port | awk '{print $3}'`
VERSION=`curl -s http://sabnzbdplus.sourceforge.net/version/latest | head -n1`
VERSION=${VERSION%?}
DIR="SABnzbd-${VERSION}"
GZ="${DIR}-src.tar.gz"
@czj
czj / gist:1251040
Created September 29, 2011 15:45
Custom .pryrc for OSX + Rails + polite
# This script is greatly inspired by Pry Everywhere by Luca Pette
# http://lucapette.com/pry/pry-everywhere/
# Use TextMate as default editor
Pry.config.editor = "mate -w"
# My pry is polite
Pry.hooks = {
:after_session => proc {
puts "\nGoodbye." if Pry.active_sessions == 1
@czj
czj / gist:1261139
Created October 4, 2011 08:20
CSS filtering for Google Reader (remove ads & useless links)
/*
http://www.google.fr/reader/*
*/
a[href*=feedburner],
a[href*=feedsportal],
img[src*=feedsportal] {
display:none !important;
}
@czj
czj / hosts
Created October 4, 2011 08:24
Hosts file for ads removal
127.0.0.1 da.feedportal.com
127.0.0.1 rss.feedportal.com
127.0.0.1 com.clubic.feedsportal.com
@clarkware
clarkware / lyrics.rb
Created September 10, 2012 20:05
Random Lyrics
#!/usr/bin/env ruby
# API Documentation at http://api.wikia.com/wiki/LyricWiki_API
require 'open-uri'
require 'json'
require 'tmpdir'
ARTIST = "Johnny Cash"
@czj
czj / gist:1263872
Created October 5, 2011 07:39
Script to encode with HandbrakeCLI (x264) 720p, high image quality, low file size
#!/usr/bin/env ruby
# encoding: utf-8
# x264 presets guide : https://forum.handbrake.fr/viewtopic.php?f=6&t=19426
X264 = "b-adapt=2:rc-lookahead=50:me=umh:bframes=5:ref=6:direct=auto:trellis=2:subq=10:psy-rd=1.0,0.10:analyse=all"
FORMAT = "--optimize --format mp4"
QUALITY = "--ab 64 --mixdown mono --quality 23 -e x264 -x '#{X264}'"
SIZE = "--width 1280 --height 720"
ARGV.each do |param|