Wednesday, February 21, 2007

Ubuntu hack for waking up your monitor

Sometimes, when I close the lid of my Dell E1505 laptop and open it again, the monitor doesn't resume and stays black instead. Today, I discovered a little hack to get the monitor working again instead of just doing a hard reboot. Press [Fn] + [Esc / Stand By] which suspends the computer, close the lid, open it, and bam...the monitor works and it decreases the chances of corrupt system files.

Wednesday, February 14, 2007

Google Pages Static Link rewriter script

On my Google Pages site, the links to my uploaded files suddenly stopped working. They changed from http://<myusername> to where they would give me a 404 Not Found Error. This script is devoted to changing the links back so I can access my files.

// ==UserScript==
// @name Google Pages Static Files
// @description Rewrite "static files" on GooglePages to point to correct locations
// @include http://**
// @version 0.1
// ==/UserScript==

//Get googlepages user to use in rewriting the links
var user = window.location.href.split(".")[0].replace("http://", "");

function() {
//Use XPath to find all <a> elements with href attrib
var links = document.evaluate('//a[@href]',document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);

//Rewrite all links with "" to <user>
for (i = 0; i < links.snapshotLength; i++) {
if ( links.snapshotItem(i).href.indexOf("") != -1 )
links.snapshotItem(i).href = links.snapshotItem(i).href.replace("", user + "");
}, true);

Install Google Pages Static Files script ( | mirror)

Saturday, February 3, 2007

Windows Live Mail Autofill script

Firefox 2 apparently can't fill in the username/password on the Windows Live Mail sign-in page so I wrote a short greasemonkey script to do so.

here is the source:
// ==UserScript==
// @name Windows Live Sign In
// @description Automatically sign in to Windows Live Mail cause Firefox can't
// @include*
// @include*
// @version 0.1
// ==/UserScript==

//add event listener to call my anonymous function after the page loads
function() {
//Get email address box and fill it
document.getElementById("i0116").value = "YOUR_USERNAME";

//Get password box and fill it
document.getElementById("i0118").value = "YOUR_PASSWORD";
}, true);

Install Windows Live Mail Autofill script (from
Install Windows Live Mail Autofill script (from mirror -- if is down)

To get the script to work, change the values for YOUR_USERNAME and YOUR_PASSWORD to their correct values. Then go to and test it out