Skip to content

Instantly share code, notes, and snippets.

@fcwu
fcwu / pst
Last active August 29, 2015 14:05
ps as tree view
#!/usr/bin/env python
# usage:
# $ pst
# $ pst <pid>
# $ pst <command>
import sys
import subprocess as sp
import re
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()
@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 / 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 / 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;
< }
#!/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
/*************
Blue Theme
*************/
/* overall */
.tablesorter-blue {
width: 100%;
background-color: #fff;
margin: 10px 0 15px;
text-align: left;
border-spacing: 0;
@fcwu
fcwu / cdc-acm.c
Created October 20, 2013 14:06
Kernel 3.1.2 cdc-acm.c for ASUSTOR NAS
/*
* cdc-acm.c
*
* Copyright (c) 1999 Armin Fuerst <fuerst@in.tum.de>
* Copyright (c) 1999 Pavel Machek <pavel@ucw.cz>
* Copyright (c) 1999 Johannes Erdfelt <johannes@erdfelt.com>
* Copyright (c) 2000 Vojtech Pavlik <vojtech@suse.cz>
* Copyright (c) 2004 Oliver Neukum <oliver@neukum.name>
* Copyright (c) 2005 David Kubicek <dave@awk.cz>
* Copyright (c) 2011 Johan Hovold <jhovold@gmail.com>
@fcwu
fcwu / facebook_login.js
Created October 21, 2013 16:20
Quick login button for facebook via greasemonkey
// ==UserScript==
// @name facebook login
// @namespace http://123.123
// @include https://www.facebook.com/*
// @version 1
// @require http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.7.2.js
// @require http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js
// @resource bt http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css
// @resource bt-theme http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css
// @grant GM_addStyle
#!/bin/bash
# Before script...
# $ mkdir src
# $ amd-driver-installer-<version>-x86.x86_64.run --extract src
# $ cd src
# $ ./packages/Ubuntu/ati-packager.sh --buildpkg source
# change this script modalias 6600 to your graphic card
#
# run this script
#