Playing with userChrome.css and userContent.css in Firefox

Posted by knorby on January 25, 2008 under XUL, css, design, firefox, google, internet, mozilla, web design | Read the First Comment

A little while ago, I started playing around with the userChrome.css and userContent.css files in Firefox, and I have been rather pleased with the results. As far as I can tell, few people know about these files (perhaps I am mistaken, but most people I know have never seen them before). The files are located in the chrome folder in a given profile. On Linux at least, the path to that is
~/.mozilla/firefox/{weird alphanumerical sequence}.your_profile_name/chrome

On Macs, the profile directory is in
~/Library/Application Support/Firefox/Profiles
I don’t care about windows…
The arrangements of profiles is what I consider to be one of the prime examples of why Firefox isn’t a great piece of software. If I ever want to edit my profile, I have to remember the my profile begins with an r, or at least view all the other profiles, when I tab complete on the folder. For some reason, using unique profile names wasn’t enough for Firefox; it attaches an 8 letter alphanumeric sequence before the name of the profile. I really see no reason for this extra bit of crap. Perhaps it allows for profile name changes more easily, but it is not like people really futz around with different profiles too often. Given that there are things that a user might want to edit in the directory, this crap seems unnecessary. The directory structure inside the .mozilla folder doesn’t make too much sense either, but I won’t go into that now. In general, I use Firefox, because I believe it to be the best browser out of a series of really awful software packages. Maybe I am horribly naive, but the browser doesn’t seem like such an achievement in software to warrant the amount of attention Mozilla gets (or the money). That aside, one can do some nice things with Firefox.

The userChrome.css and userContent.css files allow a user to change the default css for the XUL in browser.xul (I think it applies to all XUL, but I haven’t tested that or bothered to look it up) and the default css used in the browser for sites. These files must go into the chrome/ directory of a user’s profile. There are example files already in there, which just need to renamed to get you started. There is a page on these files on the Mozilla website as well as some additional examples. I haven’t done much to userChrome.css; I got rid of the throbber (thing in the top right corner, which likes to spin) and I set my url bar to have a fixed width font. Those mods are both in the example file. The userContent.css file is a little more fun… As outlined in the example file, you can get rid of annoying tags, like marquee and blink. I added a rule to remove text decoration from links except for hover:

a { text-decoration: none ! important }
a:hover { text-decoration: underline ! important }

The ! important part lets a page’s css override my own (update: whoops, opposite is true; the programmer in me must have remembered it that way since I read “! important” as “not important”). It sometimes tricky to spot out the links, but I appreciate the overall aesthetic it produces. There is also a way to set it to only apply to individual pages. I choose to modify my google search results:

@-moz-document url-prefix(http://www.google.com/) {
.g {
border-bottom: 1px solid grey ! important;
padding-bottom: 1em;
}

}

As of now, I forgot why I made the url prefix just google.com as opposed to google.com/search, but I must have had a reason. Either way, my experience has shown me that the g class is not used elsewhere on google. Anyway, this snippet adds a line between each search result. Here is a screen shot of the end result:

Google Search Result CSS Tweak

Naked College Students… On Tonight’s News!

Posted by knorby on January 18, 2008 under Chicago, TV, humor, media, uchicago | Be the First to Comment

I spotted three local new crews today when I went to watch the UofC annual polar bear run today. It is a naked run in the quads, as part of the Kuviasungnerk and Kangeiko festival here. Events in the festival are normally early in the morning all week to celebrate winter or something dumb like that; I have never attended any of these and I expect I never will. Anyway, it finishes up with the naked run. It is 28F outside, so it is a challenge of sorts, but it is mostly an excuse for some to streak in the quads. There are always a few photographers out there, and the pics have made it to internet in various forms (see video from last year). I was surprised today to see the local news show up. I saw cameras for CBS, FOX, and WGN. It is just a little bit creepy. Slow news day or whatever, but it seemed at least a little bit odd to me. Any runners pretty well gave up there privacy, but it seems a little bit on the wrong side. Either way, it was good for a laugh. I think I might have been in one of the few pans they did of the crowd…

Update: Here are some news stories about it:

Maybe more to come…

What’s with the US Cellular Ad About Some Woman’s Illiterate Father?

Posted by knorby on January 14, 2008 under TV, rants | Read the First Comment

One of the current US Cellular commercials has a girl explaining  how she was apprehensive to go to college, because her dad is illiterate (she says that she has to read bills and mail to him). She goes on to explain that someone at a US Cellular store helped her dad read bills and other mail. If you watch enough TV, you have probably seen it. Every time I see it, I wonder what US Cellular is going for exactly. The story is so pathetic, it seems like it is probably true. Who would make that ad up? I come away just thinking US Cellular is weird for advertising that. Besides, the point of the ad is that someone at some US Cellular store was nice and willing to help this idiot guy out; its not in anyway a reflection of the company as a whole other than that they employ someone decent. A good employee would provide good customer service; helping out illiterate guys has nothing to do with cell phones.  US Cellular has always struck me as a confused company; that view has only been re-enforced.

Verifying Techcruch’s Claims about Network Solutions

Posted by knorby on January 10, 2008 under blogs, internet | 2 Comments to Read

TechCrunch ran an article a few hours ago (its about 11PM in Chicago as I write this) titled Network Solutions Using Questionable Tactic to Sell More Domain Names, which claims that Network Solutions, the domain registrar, was using its powers as a registrar in questionable ways to reserve any domain searched on their site, thus locking the searcher into buying it from them for much more than they could get otherwise. I thought this believable, but I decided to put this claim to the test for the fun of it, and it is looking much less true, or at least different from what was reported.

I searched for the domain “THISISABOGOUSDOMAIN-NETWORKSOLUTIONSSUCKS.COM”, as I wanted something that was not going to have been taken, and it was not something I would want. Obviously, if Network Solutions put any filters on the domains they pull this scam on, this one wouldn’t be one. Since they loose nothing from doing it, they have no reason to not pull it for every one. I did my first test using whois on my computer, which appears to search verisign databases:

Whois Server Version 2.0

Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.

No match for “THISISABOGOUSDOMAIN-NETWORKSOLUTIONSSUCKS.COM”.
>>> Last update of whois database: Fri, 11 Jan 2008 04:20:40 UTC <<<

NOTICE: The expiration date displayed in this record is the date the
registrar’s sponsorship of the domain name registration in the registry is
currently set to expire. This date does not necessarily reflect the expiration
date of the domain name registrant’s agreement with the sponsoring
registrar. Users may consult the sponsoring registrar’s Whois database to
view the registrar’s reported date of expiration for this registration.

TERMS OF USE: You are not authorized to access or query our Whois
database through the use of electronic processes that are high-volume and
automated except as reasonably necessary to register domain names or
modify existing registrations; the Data in VeriSign Global Registry
Services’ (“VeriSign”) Whois database is provided by VeriSign for
information purposes only, and to assist persons in obtaining information
about or related to a domain name registration record. VeriSign does not
guarantee its accuracy. By submitting a Whois query, you agree to abide
by the following terms of use: You agree that you may use this Data only
for lawful purposes and that under no circumstances will you use this Data
to: (1) allow, enable, or otherwise support the transmission of mass
unsolicited, commercial advertising or solicitations via e-mail, telephone,
or facsimile; or (2) enable high volume, automated, electronic processes
that apply to VeriSign (or its computer systems). The compilation,
repackaging, dissemination or other use of this Data is expressly
prohibited without the prior written consent of VeriSign. You agree not to
use electronic processes that are automated and high-volume to access or
query the Whois database except as reasonably necessary to register
domain names or modify existing registrations. VeriSign reserves the right
to restrict your access to the Whois database in its sole discretion to ensure
operational stability. VeriSign may restrict or terminate your access to the
Whois database for failure to abide by these terms of use. VeriSign
reserves the right to modify these terms at any time.

The Registry database contains ONLY .COM, .NET, .EDU domains and
Registrars.

Just for reference, there is a six hour time difference between Central (where I am) and UTC. Also, my clocks are in 24 hour time. Anyway, I then went to networksolutions.com and did a search there. It was about 22:23 Central.

I then got the results. It was marked as available, of course.

The test begins….

I tried godaddy first. This test was immediately after the search at 22:25, so I didn’t expect it to change that fast necessarily, but I figure if it was going to happen, it was going to happen soon…

Whois confirmed the same a minute later…

No match for “THISISABOGOUSDOMAIN-NETWORKSOLUTIONSSUCKS.COM”.
>>> Last update of whois database: Fri, 11 Jan 2008 04:26:33 UTC <<<

Time passed, but still nothing… Godaddy kept on giving me the same page, and about an hour later, whois still said nothing:

No match for “THISISABOGOUSDOMAIN-NETWORKSOLUTIONSSUCKS.COM”.
>>> Last update of whois database: Fri, 11 Jan 2008 05:16:42 UTC <<<

According the the TechCrunch story, they only can keep it for 5 days before they have to pay for it, so it seems like if they can’t get it in an hour, there isn’t much point. It is quite possible that they cut it out as soon as anyone said anything, but that seems dubious. Its all very strange…

Explorations of Hello World Perversion

Posted by knorby on under Linux, Python, coding, humor, javascript | 6 Comments to Read

What follows is probably the most perverse shell script I have ever written. I decided to write a script that somehow implemented Hello World for a bunch of languages. I didn’t include Java, because the installation of java on the machine I wrote this script on was somehow messed up. Plus, Java sucks hard. I didn’t do any javascript either as Rhino was messed up (see last sentence), and spidermonkey wasn’t installed. I included far too many, but I will gladly add more if someone bothers to write some. You can also download the file. Wordpress messed a few things up, which I tried to correct, so download the file copy if you actually want to try thing thing out. Also, you might need to install some stuff unless you are in the UofC CS department Linux clusters. I apologize to the world for what my boredom can cause…


#!/usr/bin/env bash
#====================================
echo "Bash:"
bash << EOF
echo "Hello World!"
EOF
#====================================
echo "Python:"
python << EOF
print "Hello World!"
EOF
#====================================
echo "C:"
TMPFILE="/tmp/stupidgcc.c"
TMPOUTPUT="/tmp/stupidgcc"
touch $TMPFILE
cat > $TMPFILE << EOF
#include <stdio.h>
int main(){
printf("Hello World!\n");
return 0;
};
EOF
gcc -o $TMPOUTPUT $TMPFILE
$TMPOUTPUT
rm $TMPFILE $TMPOUTPUT
#====================================
echo "Ruby:"
ruby << EOF
puts "Hello World!\n"
EOF
#====================================
echo "Perl:"
perl << EOF
print "Hello World!\n"
EOF
#====================================
echo "C++:"
TMPFILE="/tmp/stupidg++.cpp"
TMPOUTPUT="/tmp/stupidg++"
touch $TMPFILE
cat > $TMPFILE << EOF
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}
EOF
g++ -o $TMPOUTPUT $TMPFILE
$TMPOUTPUT
rm $TMPFILE $TMPOUTPUT
#================================
echo "Haskell:"
ghci -e 'print "Hello World!"'
#================================
echo "Awk:"
echo '' |awk '{ print "Hello World!" }'
#================================
echo "Fortran77:"
TMPFILE="/tmp/stupidFortran.f"
TMPOUTPUT="/tmp/stupidFortran"
touch $TMPFILE
#http://www.roesler-ac.de/wolfram/hello.htm#Fortran77
cat > $TMPFILE << EOF
C Hello World in Fortran 77
PROGRAM HELLO
PRINT*, 'Hello World!'
END
EOF
f77 -o $TMPOUTPUT $TMPFILE
$TMPOUTPUT
rm $TMPFILE $TMPOUTPUT
#=======================================
echo "Tcl:"
tclsh << EOF
puts "Hello World!"
EOF
#=======================================
echo "Octave:"
octave -q << EOF
printf("Hello World!\n");
EOF

On “The Daily Show” and “The Colbert Report” Return

Posted by knorby on January 8, 2008 under TV, comedy, culture, media | Be the First to Comment

I wasn’t sure what to think when I heard that The Daily Show and The Colbert Report were returning to the air but with completely improved shows, As most people know, the writers’ strike knocked the late shows off the air, and like many, I felt the hit most with these two shows. As tonight’s shows pointed out, the writers are not exactly salt of the earth blue collars fighting for basic workers rights. Of all things, it is probably not the worst picket line to cross. Still, I found it a bit surprising that Stewart and Colbert joined the other late night hosts in going back. I really didn’t know what they had in mind. After tonight’s show, I am mixed….

Of the two, I thought Stewart handled it much better. He implied that he really didn’t want to be doing the show. For ’solidarity,’ the show’s name was changed to A Daily Show.  He focused most of the show on the details of the strike and ripped a bit into the producers. I particularly liked his bit on Viacom suing YouTube (so Google) for 1 billion dollars, comparing them to a child for choosing such an absurd sum. It seems like a fairly accurate portrayal. Even with all that he did about the strike on his show, it still seems wrong. Clips still went up online, and though I cannot check, I am sure the episode is available for download on iTunes. Doesn’t really show support for the studios if from their perspective, they are just making a hit show with a smaller budget.

I thought the way Colbert handled it was almost offensive. He spent a fair amount of the show sticking to his usual act. He stuck in character and went on about he is being perfectly consistent by breaking the picket lines. He spent a while showing how no writers meant no written material. No shit. In short, he didn’t use his relative job security to make any criticisms. It was just business as usual. It seemed like many of the jokes and rips he made were borrowed from Stewart. I really found the show surprising and disappointing.  Colbert did his time on Second City, and he always seemed to be able to rip into people far more than Stewart. Colbert, go back to Strangers with Candy, where you had some principles.

The late shows were all suffering as a result of the strike in ways that will leave permanent. I watched them because I happened to be watching Futurama and South Park on Comedy Central before they came on. I got used to not watching it, and I wasn’t really missing them after a week or so. If they hadn’t gone back on the air now, the shows might have gone under as well. It seems like their motivation for going back on the air was to save the show. All the writers striking are risking their jobs and their shows too; I don’t see why they should do differently.

Mac OS X Leopard Installer Bug

Posted by knorby on January 7, 2008 under Apple, IT, personal, uchicago | Be the First to Comment

I suppose this isn’t a bug per say, but I did file a bug report about it today, because it seems like a glaring problem. Anyway, here is the problem in story form.

I have been helping install Leopard on many of the maclab’s computers recently, where we have both intel machines and G5s. Aside from some of the differences in architecture, there are differences between the two. For one, the setup utility doesn’t play the setup video on the G5s. I really enjoy the video for some reason, but it is getting old, but it looks like I won’t be watching it for a while as the intels are all setup. Anyway, as we were installing, we ran into the same basic problem on many of the machines. At the screen to select a partition to upgrade, or any drive for that matter, nothing appeared. Although it came up on a few intel machines, I was able to get it to work by going into disk utility and attempting to erase the drive. An error came up that said the resource was busy, and when I exited, the drive was there. When I tried this trick on the G5s, I got the same error but no results. On some machines, I played around in disk utility and terminal for a while, and eventually something came up. It seemed like some dark voodoo was going on. I was getting about half the G5s to install, and most of the time, I had do play around for a while. Fortunately, the installer has a terminal, so if you think to do so, you can get some insight as to what is going on. The installer runs fsck_hfs with the -y option set, which has it repair any problem found on the partition. It came up on a few of the intels, because the computers just had more use for whatever reason, but they were still new, so the fixes were fast. The G5s have had a lot more use, so the partitions are far more likely to need repairs. Once we realized the problem, we could just periodically run ps aux to see when it had finished. There might be some absurd bit of shell script using something like ps aux|grep fsck_hfs|grep -v grep (no pgrep on the install disk) and some other junk, but there is little point. I am not calling into question Apple’s wisdom for making partition repairs at the installer—that makes sense—the problem is that the installer never really indicates what is going on. It seems like such as easy find to me after we got it, but I doubt the average Apple customer. Apple is supposed to be the user-friendly company that makes everything fun and easy. They are the guys who play the “doo doo doo” song after the install! It seems they could at least say what is going on with the drive. Did they just not test the installer? I am sure plenty of people who upgrade from tiger will need to do some disk repair. Granted, most people don’t run something like radmind every night or use their machine as intensely as it gets used in a lab, but I am sure this problem will crop up somewhere. Really, the strange thing was that we didn’t find anything on mac forums or anything like that. Maybe we are just bad searchers…

Although I haven’t confirmed this, I believe you have to open one of the other programs like disk utility or terminal in order to refresh the installer, so it can see the disk after the install. I think the installer on ubuntu is more user-friendly then the leopard one, at least judging off this problem. As I said, I ended up filing a bug report. It seemed like they try pretty hard to limit bug report filers to mac techs. I had to login to my ADC account, and they required a far more technical report than most. Such is Apple.

Update: I was doing a tiger install today, and I noticed that Apple included a message in the install. Seems like a bug to me….

My Current Projects

Posted by knorby on January 4, 2008 under Python, coding, javascript, personal | Read the First Comment

This post is really for myself. I started a new project for myself last night, just another simple utility, mostly for my own use, that shouldn’t take me anytime at all. I say that before I start most things, but I think it will probably be true in this case. Anyways, I have a pretty large pile of projects that I have to work on or complete, and I wanted to make a list so that I might be able to judge which ones to work on and to just have a list.

(Mostly) Completed/There is Always More to Do

  • pyXSD – pyXSD was my first big project. It was what I worked on at ORNL as a student intern over the summer of 2006, between high school and college. It was also my first program in Python, my favorite language. It is an XML Schema Validator, which works in some funky ways. It fills a small void in th python+xml world, but it still has a few bugs to work out, and there are a few features I would like to add. It has stayed at 0.1 for some time now, and I don’t know when I will get back into it. I have been kind of hoping for a few people to submit some changes, but only one person has (and that was barely anything). I really just can’t get excited about this project anymore. I don’t use XML Schema (RelaxNG all the way!); I really don’t have a reason to do much more with it. I am guessing it will stay at 0.1 for a while….
  • ACLUofC Website – I mostly included this one, because I didn’t want this section to be one item long. There is really very little to this site. It has a simple design that I am mostly happy with, considering that I did it fairly fast. It needs content still, but I don’t really worry about that one too much.

Almost There, but Still Needs Some Work

  • xmlViewer – My project at ORNL over the summer of 2007. Basically, it is an xml-based expert system to create an editor for a specific xml format. The system is currently written in javascript. It is a really nice system, and there is a lot in it that I am proud of. It just has a few bugs at the moment. I have been planning to write an xhtml editor with it as well, as I figure it could really do some interesting things. It also needs a better name.
  • lambdaCarte – I was working on a project for a class, and I needed a nice command-line menu system in which I could associate actions, which usually are small. I did some quick searching, but I didn’t find any python packages that did just what I needed. I wrote it mostly in a night, and it seems to work surprisingly well. It needs a lot of cleanup, but it works. It’s really simple, but such things just make life easier.
  • DOIT Fortune Library - I am not going to try and justify this thing’s existence here, mostly because I have none. It is not as much a project as it is a mission; I feel it is my duty to make available in any form I can conjure (that doesn’t take that much time and requires no money) to spread a list of bad ambiguous sex jokes from USENET I found when playing on the twenex.org computer. There are few things to work out on what I have so far, but I have been planning to make a DOIT of the day rss feed, and I recently started to look into making a DOIT facebook app. I must DOIT to the world.

Partially Complete

  • xmlTools – I wanted to work with xml from the command line or in scripts, and there isn’t any easy to use toolset that I am aware. It is written in python and it uses the lxml library. A bunch of them work, but it needs further tests, and there are a few functions I want to add.
  • pySchedule – A python scheduling library. I haven’t touched this thing in a while.
  • packagemapWriter – A simple utility to create packagemaps for google code search. It is really a simple utility; I just wanted to something to pass the time over this last break, and I wanted it for some of my projects.
  • deviceXmlFileSync – I have a bunch of gadgets with file storage, specifically mp3 players. I often will get a new album and need to load it on to several different devices, but I don’t remember which ones I have put it on. This python utility helps to queue up transfers. I haven’t worked on it in a while.
  • fireScraper – The project resulting from the method I outlined to screen scrape using Firefox from the command-line. Still has a lot of work to be done, but I have already done much of the needed work.
  • Political Networks – A research job I have.
  • rstDocs – I write a lot of technical documents in reStructuredText (rst). Basically, I wanted something like google docs to write rst on and render it (except just for me and maybe some friends). I started this thing a couple nights ago. It was partly an excuse for me to play around with php.
  • New Print System Interface – I work in the Mac and Linux Lab at the UofC, where we have a print monitor to prevent users from printing things they didn’t write and to enforce a quota. As staff, we have to be able to make exceptions and correct errors. We also have to maintain kiosks so that users can select which jobs they want to print. I started to rewrite it to use ajax techniques as opposed to a simple php script with a page refresh every few seconds. I also wanted to add a few possible actions that maclab tutors and users could use on documents.

Barely Scratched

  • xmlDebt – I didn’t want to use any of the account tracking software I found, and it seemed like something simple enough to code, so I started on one, but I guess my love for accounting is not that great….
  • rsoFundTracker – Simple system designed for RSOs (clubs at UofC). Financially, most have a lot in common, as they all have to fight..err…..deal with ORSCA.
  • cssExtended – Basically, I think css sucks. It would if it was written using JSON instead, and it would be nice if the selectors included XPath and regular expressions. I started outlining this format, and a javascript engine to implement it. I was also thinking of writing a python script to implement it in  the xhtml server-side or to files after any changes are made. I was also thinking of calling it jss.

So now I have a list to remind me of all the things I started so I don’t start more when I want to code. For the ACM, Cord and I have been working on PhoenixForge, a gforge server for UofC students wishing to work on projects on campus. Hopefully, it will cause me to be more productive.