Showing posts with label Windows. Show all posts
Showing posts with label Windows. Show all posts

Colour Linux & Cygwin console searches with Colourised Grep

Grep is a wonderful tool useful for searching for all kinds of stuff but sometimes what you are searching for gets lost:



To get your console shell to add a little colour to your grep search terms add the following to your .bashrc or .profile or the like:

export GREP_OPTIONS='--color=auto'
export GREP_COLOR='1;33'
Now if you perform the same search again your output should be a little clearer:



And as an added bonus this works on Cygwin (the Windows Unix shell) as well as Linux!

Technorati Tags: , , , , , ,

Ever had your DVD or CD drive completely disappear in Windows XP?

I recently installed DaemonTools so that I could fire up an Ubuntu ISO without burning it to disk first but it didn't seem to work properly so I uninstalled it. That is when the problems started, my DVD drive completely disappeared from XP - it wasn't in Windows Explorer and didn't show up via Device Manager either!

I tried the "Add Hardware" wizard via the Control Panel but that didn't recognised my drive either so I was starting to get rather worried. After a search on the net I came across a thread on Annoyances.org regarding "all my CD rom drives suddenly dissappeared". This pointed to a solution script from the rather talented Doug Knox who has a script available to restore CD-Roms and DVDs in Windows.

Follow the above link and then save the page with the script on it to your desktop, then just double-click the script and it should pop up the following message:



Now just reboot and your DVD/CD drive should have been restored!

Technorati Tags: , , , , ,

Ever wanted to test your website on every version of Internet Explorer (IE)?

If you develop websites then you will be well aware of the browser incompatibilities that cause a whole world of pain when you are trying to get something to look the same in all browsers.

Normally you will be testing against IE 6 or 7, Firefox and Safari. Due to IE 7 introducing a load of new behaviour you would also want to test it on IE 6 but you can't have two different versions of IE installed on any one PC. You could turn to a number of virtualised Windows instances with different versions of IE installed but that sounds like a lot of work to me ;-)

What if you could install a simple program and then have the following versions of IE available?:

  • Internet Explorer 3.0
  • Internet Explorer 4.01
  • Internet Explorer 5.01
  • Internet Explorer 5.5
  • Internet Explorer 6.0
Here you go then: MultipleIEs

A blog post about installing multiple versions of IE on your PC by TredoSoft was the source of my information and it's got a lot more information about how it works and what doesn't.

Technorati Tags: , , , ,

How to control another PC without a KVM using Synergy

If you sometimes have your laptop next to your desktop PC you might find that you are hopping from one keyboard/mouse/trackpoint to the other. After a while this gets a little uncomfortable so wouldn't it be cool if you could use your desktop PC's mouse and keyboard on your laptop? Synergy is one such utility, this is how the Synergy team describe it:

Synergy lets you easily share a single mouse and keyboard between multiple computers with different operating systems without special hardware. It's intended for users with multiple computers on their desk since each system uses its own display.
Download Synergy from sourceforge and install it as normal on both you desktop PC (the server) and your laptop (the client). On your desktop PC, start Synergy (Start -> Programs -> Synergy -> Synergy) you will be presented with the following screen:



Click "Share this computer's keyboard and mouse (server)" then click "Configure..." to set up the layout of the screens. Your now presented with this screen:



The first thing you have to set up are the "Screens", these are the computer names that you have given to your desktop and laptop, in my case "cubik" is my desktop and "laptop" is my laptop (funny that!):



To select which PC you are controlling at any one time synergy lets you simply move your mouse to the edge of the screen in the direction of the other PC, your mouse pointer will then disappear from one screen and magically appear on the other! To enable this you need to set up the "Links".

Links are the descriptions of the layout of your machines, i.e. is your laptop on the left or right of your main screen - in my case I have my laptop to the left:



Once you have made your choices via the drop-down lists click the little "+" sign to add that link. You now need to set up the opposite of that link so that you can get control back to your desktop again:



Click "Ok" and then click "Start" to start the server (your desktop PC) listening for connections. Over on the other PC (your laptop) start Synergy and click "Use another computer's shared keyboard and mouse (client)" and type the name of the other PC in the box, in my case I enter "cubik" as that's the name of my desktop PC. Now click "Start" to attempt to connect to your server.

If everything is ok then you should be able to move your mouse over to the left-hand side of your desktop PC's screen and the mouse (and therefore the keyboard) will hop over onto your laptop's screen so that you can control that instead. If you want to return control back to your desktop PC then simply move the mouse pointer to the right-hand side of the laptop screen and the mouse will jump back again!

If you get stuck for any reason on the wrong PC, just right-click on the Synergy icon in the system tray and choose "Quit".

One added bonus is that your copy buffer transfers over to the other PC, try it out - select some text on one screen, then to copy it, mouse over onto the other screen and to paste it. This even works when switching from one screen running Windows to another screen running Linux!

Technorati Tags: , , ,

An update to my Thunderbird TNEF script for opening winmail.dat

Back in July I blogged about Opening winmail.dat (TNEF) files in Thunderbird (on Ubuntu). Well a colleague at work has 'refined' my script so that rather than it create a folder on your desktop it simply opens Nautilus to display the contents of the attachment.

This is the new version of the script:

#!/bin/bash

LOCATION=/tmp/winmail_$$.dat

mkdir $LOCATION
/usr/bin/tnef -C $LOCATION --save-body -f $1

nautilus $LOCATION
The interesting part of this script for me is the $$ - this special script variable is the process ID (PID) of the currently running script, so it makes a temporary file called winmail_<current process id>.dat. Other than that it's pretty similar to my original script apart from opening Nautilus at the end.

Now it's even easier to open and extract files from winmail.dat files!

I found out the reason for the $$ from here.

Technorati Tags: , , , ,

How to restore Windows XP's "Show Desktop" icon

I'm not sure of the exact details but it seems that on some installations of XP the "show desktop" icon is missing from the quick launch toolbar (next to the Start button). Most other applications are also available in the Start menus so it's pretty easy to restore them but not the Show Desktop icon.

The Techie Corner blog had the answer I was looking for - two different ways to restore the Show Desktop icon.

I preferred the second technique - throw the following command into Start ->Run:

regsvr32 /n /i:U shell32.dll
Your show desktop icon should have instantly appeared in the quick launch toolbar!

Technorati Tags: , , , ,

How to open Firefox Google searches in a new tab

I'm always using the built-in Google search box in Firefox to do my research. I used to click the 'New Tab' button (or CTRL-T) to open a fresh tab, then type in the box and hit return to open the results in my newly created tab.

I then found that it will open in a new tab automatically if you use Ctrl-Return rather than just Return when searching. That was a great improvement but if I forgot to hold down Ctrl I would wipe out my current tab with the Google search results.

Well I've found the ultimate solution from an 'Hacking Firefox' article on Computer World found via the excellent LifeHacker blog. It's an about:config value that makes the search results open in a new tab (in the same way that Ctrl-Return did).

To enable it, enter about:config in the location bar. Enter browser.search.openintab in the "Filter" text box and then double click the listed browser.search.openintab to change it's value from false to true:



Oh, and if you want the results to open in the current tab rather than a new tab for a particular search then you simply use Ctrl-Return instead of just Return! Joy!

Technorati Tags: , , , , ,

Getting Tomcat contexts to work in IntelliJ IDEA (and stop it starting Tomcat twice!)

If you run Tomcat within IDEA then you might have noticed a couple of things:

  1. Your application gets started, undeployed and then started again, increasing the start up time of Tomcat and reinitialising any load-on-startup servlets for a second time.

  2. Your carefully crafted <context> stanzas don't work as IDEA hasn't picked then up from either server.xml or META-INF/context.xml.
When you start Tomcat inside IDEA it copies the contents of your Tomcat conf directory to an IntelliJ system area (on Linux it's hidden in your home directory) and then runs Tomcat looking at those configuration files instead of the normal ones. In doing this it seems to ignore any context.xml files, any context stanzas of the server.xml and messes up any context files you might have in conf/Catalina/.

To get around this big mess and just use your Tomcat as if you ran it outside of IDEA you simply add a CATALINA_BASE environment variable to the configuration of Tomcat (within IDEA) pointing to your Tomcat directory:



Now when you start Tomcat within IDEA you should notice that your contexts are working correctly!

Technorati Tags: , , , ,

Opening winmail.dat (TNEF) files in Thunderbird (on Ubuntu)

 
UPDATE: I have an improved version of the script available here.

I'm not going to repeat the many, many websites taking (and complaining) about Microsoft's proprietary e-mail attachment format called TNEF.

I'm assuming that if you are reading this then you have found that these fixes are not working for you (or not possible to enforce). I'll also assume that the LookOut Thunderbird Add-on by Aron Rubin is also not working correctly for you (this was my experience on Ubuntu Edgy Eft).

The best solution I could come up with was getting Thunderbird to run a script to unpack the winmail.dat extension into a folder on your Ubuntu desktop.

It relies on the tnef command-line program, so make sure that is installed first (it's bundled with Ubuntu):

sudo aptitude install tnef
Below is my little script, save it in a file called 'tnef.sh' somewhere and make sure it's executable (chmod +x tnef.sh) - or just download it here.
#!/bin/bash

LOCATION=~/Desktop/winmail.dat

mkdir $LOCATION
/usr/bin/tnef -C $LOCATION --save-body -f $1
Now find an email in Thunderbird with a winmail.dat attachment. Double click it and select to open it with the newly saved tnef.sh file:



Look on your desktop - there should be a 'winmail.dat' directory with the full contents of the attachment.

Double-clicking on any future winmail.dat file will result in the contents of the attachment to also be added to that directory.

Technorati Tags: , , , ,

Where's dos2unix? In Ubuntu's tofrodos package!

I had a strange error recently to do with a bash script not running correctly. I couldn't see anything wrong with the file until I noticed that VIM was reporting that the file's type was DOS.

What I needed was to convert the downloaded file to UNIX file format using dos2unix but which package does it live in? A quick search of the Ubuntu packages database revealed tofrodos:

Converts DOS <-> Unix text files, alias tofromdos

DOS text files traditionally have CR/LF (carriage return/line feed) pairs as their new line delimiters while Unix text files traditionally have LFs (line feeds) to terminate each line.

Tofrodos comprises one program, "fromdos" alias "todos", which converts text files to and from these formats. Use "fromdos" to convert DOS text files to the Unix format, and "todos" to convert Unix text files to the DOS format.

This functionality is also available via the dos2unix/unix2dos symlinks.
To install it run:
sudo aptitude install tofrodos
And then use dos2unix and unix2dos to convert the file between the two different formats.

Technorati Tags: , , ,

Screen capture a single window with Alt-Print Screen? - I never knew!

I've known about the Print Screen (Prt Scr) button taking a full screenshot and saving it in the clipboard for ages (and with Ubuntu it pop ups a handy "save screenshot" window as well).

I never knew that you could hold down the Alt button at the same time and get a screenshot of just the currently highlighted window!

You learn something new everyday - well I do at least...

More info: Windows Print Screen Key

Technorati Tags: , , , ,

How to restore missing transitions and effects in Windows Movie Maker

I use Windows Movie Maker (WMM) to create little movies of my 2-year old daughter so that I can burn them to DVD. The source of the footage is from my digital camcorder that takes Mini DV tapes.

It had been quite a while since I last edited one of these tapes and so was now using my recently upgraded and reinstalled PC. I opened WMM last night to edit the tape only to be confronted with a message that all the transitions and effects were missing. I don't use many of these effects but fade in/out to black is a must.

I searched around on the internet today to try and find a solution and here is one way that got it working for me:

* Open Windows Explorer (Start -> Programs -> Accessories -> Windows Explorer)
* Browse to C:\WINDOWS\inf
* Locate moviemk.inf
* Right-click on it and select 'Install'
* Pop your WinXP (service pack 2) disk in let Windows reinstall WMM
* Fire up WMM and be amazed that everything is back to normal!

I'm so pleased that I got it working again so quickly, there are many people out there that seem to have the problem and can't find a fix for it - hopefully by blogging this there will be one more solution to try!

Technorati Tags: , ,

Wireless USB hub (UWB) - I gotta have one!

I don't normally post 'I read this and thought it was cool!' blog posts but I had to pass this one on...

First UWB Wireless USB Hub Ships (source DailyTech)

How long will it be before the USB port disappears due to the devices using UWB instead?

Makes me wonder if I should start investing in battery companies...

Technorati Tags: , , , ,

Tidy up your Windows PC with the excellent CCleaner

CCleaner is a free utility for Windows XP which will clean up your system and generally get your machine back in order. It can clean up Internet Explorer and Firefox histories, cookies and temporary files. It removes the temporary files and log files that Windows updates leave lying around and it also has an excellent registry cleaner built in. This is particularly good at getting rid of old problematic startup errors that occur after you've uninstalled certain applications.

I ran CCleaner for the first time on Thursday last week and it found 280MB of stuff that it wanted to delete! Most of that was internet cache files and Windows update rubbish, although I did have to uncheck it from deleting all my Firefox cookies. It also fixed about 90 issues with my registry. Just be careful to check all the settings prior to cleaning your system as it's pretty thorough ;)

CCleaner - Freeware Windows OptimizationIt's an excellent free tool and is now on my "must install" list!

Technorati Tags: , , ,

Increasing your USB gaming mouse polling rate with USB Mouserate Switcher 1.1 (usbmrs11.exe)

In my last post I talked about how to check your gaming mouse polling rate with a Windows utility called mouserate. You may have noticed that my polling rate was way above the standard 100Hz - in this post I'll tell you how I did it. This obviously only works with USB mice but there are not that many PS/2 gaming mice sold these days.

Important Disclaimer: Although I have not had any problems since running this patch, there have been reports on various gaming forums that people's mice or other USB devices have stopped working as a result of applying this patch. For some people it was fixed by choosing a slower patch rate but I wanted to mention this, as if you follow my instructions below and something goes wrong with your setup - your on your own... (it might be best to have a PS/2 mouse handy or know the keyboard shortcuts to revert the patch).

Ok with that disclaimer out the way, let's get stuck in and really ramp the polling speed up. First download USB Mouserate Switcher 1.1 by Anir. I had problems using the "Softpedia Mirror (US)" link but the "Softpedia Mirror (RO)" one worked fine. When you double-click usbmrs11.exe you are presented with a screen explaining what the tool can do. Clicking the "patch" button moves you to the screens that let you choose what speed you want to try. With each page it asks you if you want to change to that speed. It starts with 250 Hz/4 ms (slow), then 500 Hz/2 ms (medium), and then the fastest setting 1000 Hz/1 ms (the next page asks if you want to revert to the very slow Windows standard of 125Hz/8 ms).

If you answer "yes" to a question it patches the usbport.sys USB driver and asks you to reboot for the change to take effect. When you reboot is when you will find out if the patch has worked or if it has caused some or all of your devices to stop working.

If you have problems with any of your USB devices then try choosing a sightly slower setting first, if that doesn't work you will have to use the tool to restore the original Windows version - remember your USB mouse might not be working at this time, hence the reference to the PS/2 mouse above.

Once you've patched and rebooted, rerun mouserate to see what your new average polling rate is. Please leave me a comment below to let me know if it works (or not), and what average rate you are able to get. Also let me know if you think it makes your aiming and gaming any better.

Technorati Tags: , , ,

Check your gaming mouse polling rate with mouserate.exe

I'm not a big PC gamer but I do enjoy the odd hour online playing ET (Wolfenstein - Enemy Territory). Recently I've been disappointed with my accuracy and aiming, I just seem to always miss when in the middle of a frantic firefight.

I had read on an ET forum that a good way to improve your aim was to download and consume 'Aiming by RaZiel'. After reading some of the documentation and watching a couple of the movies in this pack I wanted to try and 'tweak' my mouse configuration.

One tip was to increase the mouse polling rate within Windows so that it would be read faster and therefore give a more accurate reading on the mouse's position. One way that you can check your mouse polling rate is with the rather handy 'mouserate' by Oliver Andreas Tscherwitschke.

It's a tiny download that contains a simple executable file that pops up a window which gives you an area in which to move your mouse around, and a list of the polled rate on the right-hand side (along with an overall average).

screenshot of mouserate window

When I first ran this program with my Microsoft optical Intellimouse plugged into the PS/2 port (via the green USB adapter) I got an average reading of just less than 100Hz. I then tried plugging the mouse directly into a free USB port and got pretty much the same readings so at least I know that the talk of PS/2 mice giving a steadier polling rate must only apply to 'true' PS/2 mice, not USB mice with PS/2 adapters.

Try it out and see what polling rate you get, I would be interested to hear what you have to say.

P.S. Have you noticed in the picture above that my polling rate is a fair bit higher than the 100Hz that I've talked about? More in a future post... ;-)

Technorati Tags: , , ,