ADAM'S WEB PRESENCE

21 November 2006

Firefox Icon Whacking

Filed under: Nerd Notes — adam @ 8:12 pm

One annoyance I’ve been having with the otherwise very excellent Firefox web browser is it’s caching of favicons. When I change the icon on my website, Firefox will stubbornly continue to show the old one. It never updates its icons.

So here’s a method to clear all the icons out of Firefox’s bookmark file. I use Linux but this should also work on other UNIXes and OS-X.

First you have to find the bookmarks file which is usually located in ~/.mozilla/firefox/something where something is a rather cryptic name like 1biuu3xr.default. The bookmarks file is simply called bookmarks.html.

Make sure you have shut down all instances of Firefox then change to the directory containing the bookmarks file.

First make a backup of the file with this command. Don’t skip this step, it is important:

cp bookmarks.html bookmarks.backup.html

Now filter out the icons with sed like this:

cat bookmarks.backup.html | sed "s/ICON=\".*\"//g" > bookmarks.html

When you next start Firefox, you will see that all your bookmarks now have blank icons. As you visit each site, they will update to the current icon for that site.

I do not guarantee this will not mess up your bookmark file, but that is why we made a backup first.

Update 21-May-2008

I’ve noticed now that I am using Firefox 3.0, that this is no longer neccessary. Just clear your cache, reload the web page and then quit Firefox. Next time you load it up, the icon will be updated.


Using netcat with tar

Filed under: Nerd Notes — adam @ 8:46 am

This method will bulk copy files from one Linux machine to another. It will preserve all directory structures, links and permissions. It is very useful for backing up hard drives or transferring an entire directory to another machine.

For this example, the destination machine is 192.168.0.13 and I have chosen port 10001 but you can choose any port you like of course. Also you will need tar and netcat installed on both machines.

First, on the destination machine, run this command:

netcat -l -p 10001 | tar xv

And then on the source machine, run this command:

tar c * | netcat -q 1 192.168.0.13 10001

The ‘v’ option is, well, optional. I just like to view the progress of the operation as it goes.

If you want to do this over the Internet or through a modem, you might consider using the ‘z’ or ‘j’ option to compress the data on the way through.


wget and apt-get through a proxy

Filed under: Nerd Notes — adam @ 8:00 am

I recently needed to use wget and apt-get from the commandline on a customer’s Debian system but the site only allows internet access via a proxy. To get these very useful tools to play nice with the proxy, I needed to type this command (substituting the correct proxy settings of course):

export http_proxy="http://proxy.mydomain.com:8080/"

Seems simple but easy to get wrong. The quotes are important, the http:// and the trailing slash are also important otherwise apt-get will not work properly. http_proxy must be in lower case which is unusual for an environment variable.

If your proxy needs a login name, do this:

export http_proxy="http://user:password@proxy.mycomain.com:8080/"

There are also ftp_proxy, gopher_proxy and wais_proxy environment variables if you need them but I was only interested in HTTP for this task.


UPDATE - Proxy exceptions

If you don’t want to go through the proxy for certain addresses, use the no_proxy variable. This is a comma-separated list of domains which you do not want resolved via the proxy. Unfortunately wild cards are not supported (so you can’t just put 192.168.* :-( ) and the maximum number of entries in this list is 16. Here is an example:

export no_proxy="192.168.0.1,localdomain"

Of course, the proxy settings will be forgotten when you log out. To make the proxy setting a little more permanent, you can set your proxy variables in /etc/profile


15 November 2006

Adam Brody - dirty spammer ?

Filed under: General — adam @ 12:54 pm

Hey, its my first blog entry about blogging!!

Blog comment spam is nothing new, I get about 30 per day but a couple of strange blog comments over the last week have made me pause, such as this one from someone called Adam Brody:

I Googled for something completely different,
but found your page...and have to say thanks. nice read....

I initially thought it was a genuine comment but a couple of things made me suspicious:

  1. There was no email address given
  2. The comment was for my vanity page which has the comment feature turned off
  3. The wording was a bit vague, normally people give some idea of why they like my site or which article they are commenting about

I must say I approved the comment the first time, but when I got a second one, I checked my logs. Turns out whoever posted the comment didn’t even look at my site and the IP address matches some other comment spam I have recently received.

Then I checked Google and sure enough, there are loads of people’s blogs with exactly the same comment.

Due to the lack of links for porn sites, loan sharks or drug pushers, this would appear to be simply aimed at promoting the spammer’s own website and getting a little revenue from the Google ads therein. I don’t mind promoting genuine people’s sites but a vague comment cross-posted to every blog in sight is not something a genuine person would do.

UPDATE

While reading up on this a little, I found another theory from Pascal van Hecke that these posts are an attempt to manipulate my blog’s whitelist so future spams can evade detection. Not a bad thought.


5 November 2006

Cross platform Firefox and Thunderbird

Filed under: Nerd Notes — adam @ 1:32 pm

I have a PC which is dual boot. Some days I run Windows XP and other days I run Ubuntu Linux. I want to be able to read my email no matter which O.S. I am running and that includes being able to see all my mail folders, address book and everything. This technique does all that and as an extra bonus, I can also retain my web browser settings and bookmarks across both OSes!

SUMMARY

Using Mozilla Firefox web browser and Thunderbird email client, you can achieve fully cross-platform email and web browsing, you just have to put your profiles in a folder that is accessible and writable for both systems. This could be a network drive, or in my case, a local hard drive. I have partitioned my drive with:

  • An NTFS partition for Windows
  • An EXT3 partition for Linux
  • A FAT32 partition for any shared data which needs to be accessible by both systems

The profile will need to go on the FAT32 partition which on my PC is mounted as E: under Windows and /media/sda5 under Linux.

STEPS

  1. Make sure Thunderbird and Firefox are not running! I put that in bold because it is important. This will not work if you have the applications open.
  2. On the shared partition, create a folder called EMail and a folder called Firefox.
  3. Move your Thunderbird profile to the EMail folder. The profile is a folder full of stuff and can typically be found in C:\Documents and Settings\<your name>\Application Data\Thunderbird\Profiles on Windows or ~/.mozilla-thunderbird on Linux. It will have a funny name like “1biuu3xr.default”. I renamed mine to “adam.default” before I moved it to E:\EMail. Do this step on either Windows or Linux but not both.
  4. Edit the profiles.ini file. This can be found in C:\Documents and Settings\<your name>\Application Data\Thunderbird on Windows and ~/.mozilla-thunderbird on Linux. You will need to change the IsRelative entry to 0 and insert the path of your new profile folder in the Path entry. Here is what mine looks like for Linux:
    [General]
    StartWithLastProfile=1
    
    [Profile0]
    Name=default
    IsRelative=0
    Path=/media/sda5/EMail/adam.default
    

    and on Windows:

    [General]
    StartWithLastProfile=1
    
    [Profile0]
    Name=default
    IsRelative=0
    Path=E:\\EMail\\adam.default
    
  5. Finally, repeat steps 3 and 4 for Firefox. This time, the profile folder and profile.ini can be found in C:\Documents and Settings\<your name>\Application Data\Mozilla\Firefox on Windows and ~/.mozilla/firefox on Linux.

2 November 2006

Edgy Eft with 256MB RAM

Filed under: General — adam @ 12:02 am

Naturally as soon as Ubuntu 6.10 “Edgy Eft” was out, I wanted it. I went to install it on my test machine but found a little issue.

My test PC is an older machine and has 256MB of RAM, not a lot by today’s standards but should be enough to install a basic operating system right ?

Well, even though Ubuntu mentions 128MB as being the minimum memory requirement, the INSTALLER requires 256MB. My machine has onboard graphics, and the graphics eats 64MB of system memory leaving me with only 192MB. The standard installer will not run under these circumstances, it gets as far as the timezone configuration and then just freezes.

If you want to run Edgy with 256MB or less, you will need to get the text-mode installer which is available on the Alternate Install Disc. Which is what I have done. I now have a shiny new Edgy machine. I haven’t played with it much yet but so far it seems pretty nice.


Powered by WordPress