Tuesday, 30 July 2013

Make chrome open a search from the address bar in a new tab (when you want it to)

Sometimes I want chrome to open a new tab for a search done in the address bar, but not all the time.

In order to do this without messing around with the chrome settings and making it a permanent feature, just press the Alt key before hitting return when you've entered your search into the search bar.

Wednesday, 3 July 2013

Fixing notepad++ file associations

I decided to move from using the ANSI version of notepad++ to the Unicode version but upon doing so I managed to royally screw up the file associations for files with the extensions .txt, .sql, .log etc.

The best I could manage was having them open with notepad.

Open with Notepad++ was missing from the right click context menu and when I tried to select a program to open text files with Notepad++ wasn't listed. Even when browsing to the location of the Notepad++.exe file this wouldn't work.

Turns out something got buggered in the registry settings.

For the key...

HKEY_CLASSES_ROOT\Notepad++_file\shell\Edit\command

this had been changed to some office type MS monstrosity.

I changed the value for the (Default) String and replace the file path to the path to where Notepad++ resides, in my case...

"C:\Program Files\npp\unicode\notepad++.exe" %1

note the "%1" refers to the file name being passed to the command.

This then allowed me to select Notepad++ from the open with context menu and then tell XP to remember the file association.

UPDATE: Something else stopped "Open with Notepad++" appearing so what I did was went through all registry keys searching for "Notepad++" and where an old file path appeared (I had paths for older versions of NPP appearing in "open with" shell commands) I replaced these with the correct file path for notepad++.exe.

Working ok now.

Thursday, 13 September 2012

Copy TOAD's Schema comparison sync script

TOAD does not allow you to copy the sync scripts created by it's schema comparison tool unless you shell out for the DBA Modules add in. All you can do is print it to a stupid xps file.

In order to get around this I created a small autoit script to copy the output to your clipboard.

Here is the code

Opt("WinTitleMatchMode", 1)

WinActivate("Toad for Oracle")

$Text=ControlGetText("Toad for Oracle","","[CLASS:TAdvToadSyntaxMemo; INSTANCE:1]")

ClipPut($Text)

If $Text Then 

   MsgBox(0,"pwnt","Copied to clip board")

Else

   MsgBox(0,"uh oh","Couldn't copy text. Has the schema comparison been run?")

EndIf

If need be, I might upload the compiled exe file.

Tuesday, 8 February 2011

I just received my first Arduino through the post. I went with the Arduino Duemilanove ATmega 328 which I bought on eBay from the seller arduino.hk who I can highly recommend. Their feedback speaks for itself.

I haven't had a chance to properly play around with it yet due to a house move but I will post something later on about it.

Friday, 31 December 2010

URemoteDesktop skipping 2 tracks on Rhythmbox

I downloaded an Android App called URemoteDesktop and when trying to skip a track on rhythmbox it skipped 2 instead of 1.

To fix this (Not sure if it buggers up something else so do this at your own risk), comment out the following lines in vd.sh.

xte "key XF86Back"
xte "key XF86Forward"

I'm guessing these are put in the if statement for programs that don't use XF86AudioPrev & XF86AudioNext.

Saturday, 13 March 2010

Streaming video from Ubuntu to Xbox 360 via BT Home Hub

Before my PS3 shit a brick and I replaced it with a Xbox 360, I tried to get Mediatomb streaming video from my Ubuntu machine to my PS3. Although it worked to some extent, there seemed to be a buffering issue. Videos would play for a few minutes then stop to load up more of the video.

While trying to set up uShare I came across the same problem. The obvious constant here was my router so while dicking around with the settings of my BT Home Hub I managed to solve the problem.

Here's what I did.
  1. Open the home hub's web page. The ip address should be 192.168.1.254.
  2. Click on Basic Config.
  3. Click on Wireless.
  4. Under "Wireless channel" change Channel selection to "Manual" and Channel to "11".
That's it. Give it a minute then crank up uShare.

Thursday, 11 March 2010

Using awk as a floor function

I was searching the internet trying to find out if awk had a floor function when I realised awk IS a floor function.



graham@graham-laptop:~$ x=3.5
graham@graham-laptop:~$ echo $x | awk -F. '{print $1}'
3
graham@graham-laptop:~$

You could always change $1 for $2 and it becomes a mod function.