Skip to content

Instantly share code, notes, and snippets.

@hktechn0
hktechn0 / replace_htmlentity.py
Created November 6, 2009 15:11
Replace HTML character entity reference
import re
import htmlentitydefs
def replace_htmlentity(string):
amp = string.find('&')
if amp == -1:
return string
entity = re.compile("&([A-Za-z]+);")
entity_match = entity.findall(string)
#!/bin/sh
export DISPLAY=:0
Xvfb -screen 0 1280x1024x24 > /dev/null 2> /dev/null &
sleep 5
fluxbox > /dev/null 2> /dev/null &