Archive for July, 2005

25
Jul

Firefox userContent.css

This is a rather good file, and you can find it on your Windows system by browsing to:
%appdata%\Mozilla\Firefox\Profiles\profilename\chrome

By default there is an example file name userContent-example.css that contains commented out examples:
/*
* example: turn off "blink" element blinking
*
* blink { text-decoration: none ! important; }
*
*/

Effectively this is a global Cascading Style Sheet file that will be applied to every site that you visit.

Initially it’s hard to see the point in such a thing, but after a while it becomes apparent that this is a rather sneaky way to customise the entire www a little to your desires.

I have a pet hate for PDF files, the length of time it takes for Acrobat Reader to fire up, and the deceptive way that a lot of links point to them. So I like it when sites indicate that a link points to a PDF file. Too few sites do this though. That’s OK, with the userContent.css file we can create a stylesheet entry that will detect PDF files and add some text for us so that we can spot PDF links before we click on them:
/*
* Warns about PDF links
*/
a[href$=".pdf"]:after {
font-size: smaller;
content: ” [pdf]“;
}

Now whenever I see a link to a PDF file, that link is followed by the text: [pdf]

Lovely.

Here are some of the other things I’ve put in my userContent.css file:
/*
* Warns about PDF links
*/
a[href$=".pdf"]:after {
font-size: smaller;
content: ” [pdf]“;
}
/*
* Warns about new window links
*/
:link[target="_blank"]:after, :visited[target="_blank"]:after, :link[target="_new"]:after, :visited[target="_new"]:after {
font-size: smaller;
content: ” [new]“;
}
/*
* Warns about JavaScript links
*/
a[href^="javascript:"]:after {
font-size: smaller;
content: ” [js]“;
}
/*
* Hide MS Ads on TheRegister.co.uk
*/
div[id="ad"] {
display: none ! important;
}
/*
* Fixes bug in Firefox
*/
col {
display: none ! important;
}

To set up a userContent.css file, just add a text file named that to the chrome directory in your settings:
%appdata%\Mozilla\Firefox\Profiles\profilename\chrome\userContent.css

Within that you should place your CSS rules.

24
Jul

Remote Desktop Guide

I’m a terrible blogger, however that isn’t going to deter me from making random out of the blue posts… public note taking effectively :)

Today’s note is on how to configure and setup Remote Desktop Connection so that I can access my home PC (in London) when I’m on a business trip (in Redmond).

To complete this guide, you will need:
1) Web space with an ftp account to upload to.
2) A home Windows XP PC, firewall optional but recommended.
3) A remote Windows XP PC, such as your work laptop.

Step 1:

Configure your home PC to have a static IP address:
http://www.portforward.com/networking/static-xp.htm

Step 2:

Configure your firewall to permit TCP 3389 inbound, and then configure your home PC to enable Remote Desktop Connections:
http://theillustratednetwork.mvps.org/RemoteDesktop/RemoteDesktopSetupandTroubleshooting.html

Step 3:

Discover your home PC’s remote IP address:
http://checkip.dyndns.org/

Step 4:

Install Wget:
http://xoomer.virgilio.it/hherold/

You’ll want to add the directory that you place wget.exe in to your PATH environment variable so that you can call wget from anywhere.

Step 5:

Create two batch files in the C:\ directory:
ip.bat:
cd C:\WINDOWS\System32\GroupPolicy\Machine\Scripts\Startup
wget --output-document=ip.htm http://checkip.dyndns.org/
ftp -s:C:\ftp.scr

ftp.scr:
open ftp.yourwwwdomain.com
yourusername
yourpassword
cd public_html
put ip.htm
quit

FTP Scripts are roughly documented here btw:
http://support.microsoft.com/?kbid=96269

Step 6:

Assign the ip.bat script to startup when Windows starts up (and before a user logs in):
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/gptext_assigncomputerstartupscripts.mspx

Remember that the Group Policy editor can be reached with Windows Key + R and gpedit.msc

That’s it :)

Now you simply have to visit www.yourdomainname.com/ip.htm to see the IP address that your computer booted up with, and then open your Remote Desktop client, enter that IP and login to your WinXp box remotely :)

I haven’t done the above of course, I’ve strayed a little. Notably I don’t like the idea of placing my public IP address in a public folder on the internet, so I put it into a subdirectory that is .htaccess protected. I’m fairly sure you could figure this out for yourself though, you should be aware of your web server technology enough to know how to password protect a directory, and chances are that you might have IIS6, so me writing a guide would be useless.

I hope that the above helps someone though, it’s not as if you couldn’t find out this stuff, it’s just nice to have it all in one place as a quick step by step guide.