Skip to content

Instantly share code, notes, and snippets.

/*************
Blue Theme
*************/
/* overall */
.tablesorter-blue {
width: 100%;
background-color: #fff;
margin: 10px 0 15px;
text-align: left;
border-spacing: 0;
#!/usr/bin/python
from lp_fish_tools.SomervilleShare import *
from lp_fish_tools.util import *
from datetime import date
import subprocess
import os
import ConfigParser
@fcwu
fcwu / add_usb3_switch_boot_parameter.patch
Created September 4, 2013 09:53
diff linux-lts-quantal-3.5.0/drivers/usb/host/pci-quirks.c orig/drivers/usb/host/pci-quirks.c
94,107d93
< u32 intel_xusb2pr = 0xFFFFFFFF;
<
< static int __init intel_xusb2pr_setup(char *str)
< {
< u32 value;
< if (kstrtoul(str, 16, &value)) {
< printk("Failed to convert value=%s\n", str);
< return 1;
< }
@fcwu
fcwu / bt-usb3
Created September 4, 2013 08:49
Put in /etc/pm/power.d to route BT to ehci
#!/bin/sh
# Allow the driver to put the audio hardware to sleep
# once the driver has been inactive for a second.
# This hook should work with at least the ac97 and hda codecs.
help() {
cat <<EOF
--------
$0: Intel Audio powersave parameters.
@fcwu
fcwu / 99-kylin.sh
Created July 26, 2013 09:54
dell-recovery phase 2 patch. Please put it into scripts/chroot-scripts/os-post/99-kylin.sh
#!/bin/dash
set -e
WDIR=/tmp/kylin
rm -rf ${WDIR}
Exit ()
{
echo "cleanup"
@fcwu
fcwu / power.sh
Created June 27, 2013 08:47
Linux power statistics
#!/bin/sh
echo "current average capacity full_capacity time_left"
factor=0.7
last_pwr=0
charge_full=`cat /sys/class/power_supply/BAT0/charge_full`
voltage_min_design=`cat /sys/class/power_supply/BAT0/voltage_min_design`
full_pwr=`echo "scale=5; $charge_full * $voltage_min_design / 1000000 / 1000000" | bc`
while [ 1 ]; do
voltage_now=`cat /sys/class/power_supply/BAT0/voltage_now`
@fcwu
fcwu / hello.py
Created June 17, 2013 03:34
python, gtk 3 and CSS
#!/usr/bin/python3
from gi.repository import Gtk, Gdk
import sys
class MyWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="Hello World")
self.set_name('MyWindow')
import wx
class MainWindow(wx.Frame):
def __init__(self, parent, title):
wx.Frame.__init__(self, parent, title=title, size=(200,100))
self.control = wx.TextCtrl(self, style=wx.TE_MULTILINE)
self.CreateStatusBar() # A Statusbar in the bottom of the window
# Setting up the menu.
filemenu= wx.Menu()