Monday, February 12, 2007

Grub : Booting Windows XP Using Grub

This is how I boot Windows XP via Grub which was installed by the Kubuntu 6.10 CD

Added this entry to the end of the file /boot/grub/menu.lst :

title Microsoft Windows
map (hd0) (hd1)
map (hd1) (hd0)
root (hd1,0)
makeactive
chainloader +1


I'm told the map commands make Windows think it's the first hard drive (hd0). There are several variations of this command if this doesn't work for you.

You'll want to replace the bold values with your own settings which you should be able to see via "fdisk -l".

hd0 = first hard drive
hd1 = second hard drive
hd1,0 = second hard drive , first partition

Friday, February 09, 2007

How to change the Firefox error message page

If you're trying to change the Firefox error message page you won't find that option in the Preferences menu.

If you use Linux, click here.



The Firefox error message page is stored in web page (xhtml) file.

In Windows that file (netError.xhtml) is stored within the archive toolkit.jar

Browse to this folder C:\Program Files\Mozilla Firefox\chrome\

Then inside Explorer in the meu at the top you should have a Tools button



Click Folder Options and then click the View tab at the top




Now make sure the box that says "Hide extensions for known file types" is unchecked.

Click apply, then ok.

Right now would be a good time to make a backup copy of this file in case anything goes wrong.

The file toolkit.jar must be renamed to toolkit.zip so we can open it.

Select the file toolkit.jar and press F2 on the keyboard. Press backspace and the name toolkit.jar should erase, type in toolkit.zip and press enter. Windows will warn you with a pop up, ignore it.

Open the file toolkit.zip

Open the content folder

Open the Global folder

Find the file netError.xhtml

Extract this file to your desktop, my documents or where ever.

This is the file which generates the Firefox error message page :



You can edit this file with notepad and make whatever changes you desire. After you change the netError.xhtml page you MUST put it back into the toolkit.zip file.

To do this :
  1. Right click the custom netError.xhtml file you made, left click copy
  2. Open toolkit.zip, open the content folder, open the Global folder
  3. Right click, chose paste - or maybe go to Edit @ the top and chose paste. You may even be able to drag and drop the file into this window.
  4. If it ask you if you want to overwrite the old file chose yes

You MUST rename toolkit.zip back to toolkit.jar

You may have to restart Firefox to get the effect.

I changed mine to this :



Code :


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html [
<!ENTITY % htmlDTD
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
%htmlDTD;
<!ENTITY % netErrorDTD
SYSTEM "chrome://global/locale/netError.dtd">
%netErrorDTD;
<!ENTITY % globalDTD
SYSTEM "chrome://global/locale/global.dtd">
%globalDTD;
]>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>&loadError.label;</title>
</head>
<body>Problem Loading Page</body>
</html>






Linux / Ubuntu
How To change the Firefox Error Message Page


Update :
I recently did a system update and now the netError.xhtml is setup like on Windows (contained inside of toolkit.jar in the /opt/firefox/chrome/ directory). I basically had to the same steps as on Windows. Extract the file from toolkit.jar, edit it, re-add it to toolkit.jar then restart Firefox. If your setup is the same the below directions will not work.

I use Kubuntu Linux, it's a spin off Ubuntu which of course is based on the popular distribution Debian.

Kubuntu Ubuntu

On my machine the file netError.xhtml was located in :

/usr/share/firefox/chrome/toolkit/content/global/

This may be different on your machine. Try doing a file search for it if you can't find it there.

In my case I did this command to edit it :

sudo kate /usr/share/firefox/chrome/toolkit/content/global/netError.xhtml

Sunday, January 21, 2007

Ubuntu : Gnome - Mapping the Logitech Access Keyboard multimedia keys

An easy way to map the extra buttons of a Logitech Access Keyboard inside of Gnome.

Short version :

1. Click the System Menu, then Preferences and then Keyboard Shortcuts
2. Click the action you want to assign and then press they key(s) you are assigning this action to.

Note :
I wasn't able to assign actions to all the extra buttons at the top.

Note : When I changed my keyboard layout settings some of the other buttons started working. Find this in System -> Preferences -> Keyboard under the layouts tab.

Tip
:
To get ALT+F4 to work you may have to turn "F Lock" on by pressing the F Lock key which is to the left of the escape key. When "F Lock" is on the bottom led closest to the number pad should be on.

Long version + screen shots :

Tonight I came across the ever so famous Logitech Access Keyboard and decided to give it a shot in Ubuntu. I never expected any of the buttons to work however the Email, My Home and Search button all worked right after I plugged it in.

Logitech Access Keyboard

While researching this issue I noticed two schools of thought :
  1. edit some text file and map the keyboard manually
  2. download an application which will "manage" the extra keys for you, etc
However I found the Gnome Keyboard Shortcuts tool to suit most of my needs.



Preferences -> Keyboard Shortcut ->

Gnome Keyboard Shortcut tool image

I was able to map keys to adjust the volume, load my browser, start my email program and start the gnome search tool all with.

* I also discovered that ALT+F4 will not close the current window unless you've turned on "Function" by pressing the small F Lock key to the left of the escape key.

F Lock Key

When F Lock is "on" the bottom led light will be on. For me when FLock was off I was unable to close active windows with alt+f4.

F Lock led light

Tuesday, January 09, 2007

My Server Side Includes (SSI) Guide

I love server side includes (SSI). It's my most favorite thing in the whole wide world of making web pages.

Note : This is not a comprehensive SSI guide. What is server side includes ?

Here is my advice for using server side includes :

1. Ensure your server supports server side includes. Most paid servers do. Most free servers do not.

2. Add these lines to your .htaccess file :

Options +Includes
XBitHack on

3. Create the file to be read (inserted into another web page). I'll call that file ssi-read-file.shtml

With the option "XBitHack on" you shouldn't have to name the files with the extension .shtml - any extension should work. But name it .shtml just in case.

4. Inset the following code into the web page you want the contents of the file ssi-read-file.shtml to show up in. This may be your index.html file or some other web page.

<!--#include file="ssi-read-file.shtml" -->

5. Use a FTP program or some other means to change the permissions of the file in step 4 to 755 also known as -rwxr-xr-x (other permissions also work, play with this if you like)

Your SSI should now work. When you load the file from step 4 (index.htm, index.php, etc) the code from ssi-read-file.shtml shoud be displayed within it.

Apache SSI Guide

Friday, December 29, 2006

Detect Internet Explorer aka IE nag fun

A simple way to deliver content only to Internet Explorer is with the following code : 

<!--[if IE]>
HaHa you're using IE :P
<![endif]-->


Using this you can insert any code you want anywhere you want into a web page that only Internet Explorer will render.

Microsoft talks about this feature here.

Thursday, December 28, 2006

FireLog v1

This information is outdated. Please visit the official Firelog page.


Version 1.2
Released : Mar 22nd 2007

Firelog download

Firelog download backup

Firelog is a internet / firewall security "front end" developed for Puppy Linux.

Firelog v1 was released Dec 28th 2006
Firelog v1.1 was released Jan 4th 2007
Firelog v1.2 was released Mar 22 2007

The Puppy Linux forum thread for Firelog is here.

Click for full sized image !

Firelog screen menu shot

Please report all bugs to the Puppy Linux thread on Firelog

Thursday, December 14, 2006

UDP Port 25099 : Large BotNet !

Recently I was monitoring my networking traffic and noticed a lot of incoming connections from around the world on UDP port 25099. I asked the search engines about UDP port 25099 and found nothing.

Update : (3/7/2007) At some point since this post all traffic on UDP port 25099 has stopped. I imagine the botnet updated its client list and removed me from it since my computer is no longer responding to its commands.

After a bit of investigation I've come to the following conclusion.

Last week my anti-virus program picked up on a trojan and removed it. However this trojan had been in place for a while since it was stored in some backup files. It would have been found sooner but my normal anti-virus program (AVG) didn't detect it.

That trojan made me part of a bot network which uses UDP port 25099 to communicate. The other bots have no idea I've removed the trojan and continue to try and communicate with me.

Judging by the packet data right now the botnet is just trying to stay synced, I can see commands in their packets like get_peers, find_node, announce_peer.

The traffic load is fairly impressive - I would average about 1 request per second from computers around the world who are apart of this botnet.

So if you see a lot of traffic coming in on UDP port 25099 run a comprehensive virus / trojan scan on your system to make sure you're not infected.

Note : You can use Ethereal to monitor your traffic.

Tuesday, October 24, 2006

Wordpress theme keep changing ?

If your Wordpress theme keeps changing automatically here is a simple work around. Some people report "new themes" showing up or it changing back to the default Wordpress theme.

The solution I used goes like this :
  1. Copy the folder of your current theme
  2. Rename the old "default" folder to something else
  3. Rename the copy of your current theme "default"
Now every time Wordpress changes themes on you it should still load your current theme.

A downfall to this is when you update your template or images you have to do it for both copies of the theme.

If possible you might be able to make a symbolic link (a shortcut) if it's a Linux operating system using the a command like :

ln -s .../themes/theme_name .../themes/default

Please let me know if you have any errors.

Wednesday, October 18, 2006

Monday, October 16, 2006

How To Make Your Own Alternative Ad for AdSense

So recently I got tired of getting Google Public Service announcements and decided to look into this alternative ad thing. I decided that using a color that makes it a blank space isn't for me; it's not doing anything good for my pocket book - plus visitors will get different views of the site depending on when they visit.

So I set out to make my own alternative ad, this is actually VERY easy.

You only need 3 things :

1. An image the size of the ad block.
2. A simple html file which makes the image a link.
3. Insert this code into the third line of your adsense code (under your pub-0129103 number) :
google_alternate_ad_url = "http://yoursite.com/adurl.html";

Wha-la, you now have your own alternative ad showing whatever you want.
Technorati Tags
[ ]
[ ]
//]]>