Skip to content

Instantly share code, notes, and snippets.

View liuw's full-sized avatar

Wei Liu liuw

  • Redmond
View GitHub Profile
@liuw
liuw / n
Created March 18, 2019 16:35
A script to run a command then notify completion
#!/bin/sh
# Uses notify-send command.
# Install ruby-notify on Debian
"$@"
ret=$?
cmd="$@"
lvl=normal
@liuw
liuw / mail-notify.sh
Created March 18, 2019 13:45
A script to show a pop-up for new mail
#!/bin/bash
# Depends on notify-send. Invoked from MDA (fetchmail etc).
while IFS= read -r line; do
#header="$header$line\n"
if [[ x$line = "xSubject:"* ]]; then
subject="$line"
fi
if [[ x$line = "xFrom:"* ]]; then
@liuw
liuw / ctype_async_raise.py
Created April 17, 2012 16:02
Nasty hack to raise exception for other threads
#!/usr/bin/env python
# liuw
# Nasty hack to raise exception for other threads
import ctypes # Calm down, this has become standard library since 2.5
import threading
import time
NULL = 0
diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
index 1b267e7..2a6f677 100644
--- a/arch/x86/xen/p2m.c
+++ b/arch/x86/xen/p2m.c
@@ -724,7 +724,9 @@ int m2p_add_override(unsigned long mfn, struct page *page,
return 0;
}
EXPORT_SYMBOL_GPL(m2p_add_override);
-int m2p_remove_override(struct page *page, bool clear_pte)
+int m2p_remove_override(struct page *page, bool clear_pte,