Thunderbird 3: Changing the toolbar back to the old settings

So I've installed Thunderbird 3 (on my parent's computer as a test mule) to try out the new features. So far so good, migration was smooth and I haven't noticed anything that has been lost.

The new toolbar? Gotta say I'm not a fan. They've removed a bunch of stuff that I use (like err, Reply and Forward) from the main toolbar and moved it into the details pane.

image
Trusty old and useful toolbar.

image 
The new not-so-useful 3.0 toolbar.

image
The new details pane containing the email action buttons.

Making the search more prominent is great, but moving the other stuff isnt. Why? Because I've gotta use a touchpad and it really sucks moving the mouse cursor around so much (if I didn't feel like using the keyboard shortcuts I mean) especially with a widescreen resolution where folders would be on the left and reply button on the far right.

Luckily, Mozilla have included a little tab to help haters like me migrate from one version to another.

image 
The Migration Assistant tab.

The first time you open Thunderbird 3, it'll display a "Migration Assistant" tab to give you some options. If you've still got it open, then click on "Use original toolbar" under the "New toolbar" heading.

If you've already closed it, you can find the assistant under the "Help" menu.

CSS: Make floated elements to push down items below it

Floating is a nice way of positioning elements, but most of the time you dont want it to have no weight on the page that elements below it will try to take up its display space.

For example:

<div>
  <ul class="list_wrap">
    <li style="float: left;">FLOAT A </li>
    <li style="float: left;">FLOAT B </li>
    <li style="float: left;">FLOAT C </li>
  </ul>
  <p>Content thats pushed up</p>
</div>

Will give you:

  • FLOAT A
  • FLOAT B
  • FLOAT C
Content thats pushed up

Example of retarded floating.

To fix that, its really simple! Just add "overflow: auto; width: 100%;" to "ul.list_wrap" and you've got yourself a winner!

  • FLOAT A
  • FLOAT B
  • FLOAT C

Content thats pushed up

Not so retarded floating.

[ Source ]

Disable Windows Live Messenger Web Bar" from Automatically Signing In

While viewing windowslive.ninemsn.com.au, I noticed a little notification showing me that I've signed in from somewhere else.

image

Thinking that I forgot to untick the "save my password" on another computer, I took a quick look to see where it was from.

image

OK, WTF? Since when do sites start logging me into MSN?

Scrolling down to the bottom of the page showed me this.

image

Despite being a small bar, I'd hate to have this load on EVERY PAGE that I viewed. It signed me in automatically on every news article page that I opened on that site, meaning if I viewed 3 articles in 3 tabs, I'd be signed into Messenger 4 times!

image

This is fucken stupid! Not to mention the bandwidth wasted when loading my contacts EVERY TIME I LOADED A PAGE!

So far, I have not been able to find an option to disable it. Although logging out does work, it also logs me out of my email (which I like to logged in at home).

I do hope that Microsoft add an option for disabling this web bar. It may be useful for some, but not me.

Using AdBlockPlus to Disable Messenger Web Bar

Viewing the dev site for the web API, I've found the file required to run this service.

http://www.wlmessenger.net/api/3.5/loader.js

Using AdBlockPlus on Firefox, block anything from "http://www.wlmessenger.net/*" and do not restrict it to the current domain.

image
Right click on the icon and select "Open blockable items".

image
Search for "loader" and it'll help you find this item.

image 
Select that filter and click "Add Filter".

That should do the trick fine.

[ Sources ]

Django: Automatically fill information into template context

Sometimes you need a variable in your templates thats required for every page in your site.

Inserting it into every return statement in every view is a bit too troublesome.

Its much easier to add it into a "Context Processor". This will automatically insert the data you specify into every template rendered.

So in your app, create a file called "context_processor.py" and define the processors you need.

def custom_info(request):  
  return { 'MY_CUSTOM_INFO' : 'blah blah blah', }

Now in your settings, include the preprocessor.

TEMPLATE_CONTEXT_PROCESSORS = (  
  'django.core.context_processors.request',  
  'myapp.context_processors.custom_info',  
)

In your template, use it like normal without needing to load anything.

<div>Data: {{ MY_CUSTOM_INFO }}</div>

Postgres SQL: phpPgAdmin comes up with "Login disallowed for security reasons"

blah

Edit "conf/config.inc.php" and search through the file for:

$conf['extra_login_security'] = true;

Set the value to "false" and logins should now work.

PHP: Get the longest string (or length) in an array

To quickly get the longest string in an array, use the following function.

function longest_string_in_array($array) {
  $mapping = array_combine($array, array_map('strlen', $array));
  return array_keys($mapping, max($mapping));
}

If you need the length of the longest string, use this little snippet.

$maxlen = max(array_map('strlen', $array));

[ Sources ]

Eclipse: Hide *.svn-base in Open Resource dialog

If you're using SVN to version control the source you're working with, you may notice in Eclipse v3.5 that the Open Resource dialog now shows you LOTS of *.svn-base files.

This is due to the filtering configuration in the plugins system has changed and plugins need to be updated.

The easiest way to hide those SVN files is to install Subclipse 1.6.x, which has been updated to work with the right filter configuration.

Drupal: Highlight errors in fieldset with form_set_error()

Using form_set_error() to display error messages, the first argument is the name of a field.

$form['height'] = array(
  '#type' => 'textfield',
  '#title' => 'Height',
);

Along with:

form_set_error('height', 'Error with height.');

image

Normally this is simple to define, but when using nested form items within fieldsets, this doesn't highlight the right item.

If the form was changed to nest the items:

$form['new'] = array(
  '#type' => 'fieldset',
  '#title' => 'New Image Size',
  '#tree' => true,
);

$form['new']['height'] = array(
  '#type' => 'textfield',
  '#title' => 'Height',
);

Using:

form_set_error('height', 'Error with height.');

image

Notice the height is no longer highlighted?

The reason is that the field argument requires some formatting to make it work with nested forms.

Using a stupid '][' to tokenise the fieldname, we can specify which item to highlight.

form_set_error('new][height', 'Error with nested height.');

image

This gives us the proper feedback we wanted.

[ Source ]

Regex: Remove Double Spacing

Example given in PHP, but since its regex it could be applied to other languages too.

$cleaned = preg_replace('/\s+/', ' ', $input);

This changes any double (or triple, quadrupal, etc) spacing into a single space.

Netgear DGN2000 Overheating Issues

Despite my dislike for Netgear routers (which have proven their unreliability and buggy-ness in the past with friends constantly having to restart their routers), I purchased the Netgear DGN2000.

Why? It was the only Wireless N-router with an ADSL modem that looked nice.

I purchased it in mid September and its currently been 2 months and 9 days since I've installed and used it. The device has been running every day and in a horizontal position.

Normally it runs very hot to the touch. So hot in fact that it heats up the wooden table that it sits upon. I've also seen some posts online that it browns the white sticker that is on the back of the device.

The issues started on a day where temperatures hit +35°C. The router would occasionally freeze up and require a reboot. Initially I thought it was my ISP, but then I realised it didn't happen when the air conditioning was on.

This wouldn't be so annoying if it happened every month or so, but it was starting to occur after every 5-10hrs of operation. Netgear peice of shit.

image 
Netgear, apparently featured in a movie called Dogma.

I've left it standing vertically, and it definitely runs alot cooler than it did while running horizontally. Now it looks like crap and takes up more space than it should. I cant even get the 2nd antenna to point upwards since the power/ethernet cables are in the way.

IMG_4945
The Netgear DGN2000 standing vertically and not able to fit in that gap.

Looking up this issue online returns quite a few number of posts which seem to display the same symptoms. The interesting ones are here:

Contacting support

I registered to Netgear to contact their support and let them know that their device is a hot pile of steaming shit. Upon their registration processed I was asked if I wanted to purchase one of their "service contracts".

image 
WTF @ the pricing!? Extortionists!

I'll wait for their reply, but I don't think that they'll send me out another device that doesn't overheat anytime soon.

Until then, Netgear, I salute to you this wonderfully appropriate icecream in the middle of the Australian summer.

image
In the words of a great prophet Eddie Murphy (Delirious):
I could drop my icecream in a pile of shit and eat it.
I would be like "It's just sprinkles"

Warranty Expiration Period

*Update 8/1/2012* I should have written this sooner, but fuck their warranty blows!

Here's the deal.

  1. Send back busted router within 2 year warranty period. It had about 2 months to go before it expired.
  2. The router was sent off, the store kept my receipt because it was over 1 year ago.
  3. It took about two weeks before they sent me a replacement router! In the meantime, that means I bought a new Billion 7700N as a replacement (which has been wonderful!)
  4. I get my replacement DGN2000, let the device collect dust since I didn't need it anymore.
  5. Couple of weeks later, decided to give it to my girlfriend because her wireless G was slow. Set up the DGN2000 and it ran perfectly overnight.
  6. The next morning, I was greeted with a flashing power light. Was scorching hot, bricked itself and was unaccessible through any port, did not connect to ASDL or reboot at all.
  7. NetGear customer support was less than helpful. Spent 40 minutes waiting on call waiting and they did not bother supporting the product as the warranty period was over, even though I had just received a replacement and it was brand new!

Bottom line, NetGear will happily give you a broken product and pretend it didn't happen. Fuck them.

Vista/Win7: Switcher, a Mac Expose clone for Windows

This nifty little Switcher application brings the Exposé functionality to Vista/Win7 capable computers.

image 
Currently opened windows which will update like the Aero peek thumbnails.

Although the default settings are a bit ugly, the application is highly configurable and it works well.

I prefer to replace the "Win + Tab" global hotkey, because seriously, who the hell uses that 3d flip crap?

Performance is a bit slow, but it isn't bad. Tinker with the transition speeds to see what works well for your computer.

The display and styling of the windows are customisable, so users can tweak background and hover settings to their liking. This is probably better since the default settings are a bit ugly. (This guide can provide you with some better looking styling.)

[ Source ]

Win7: Hide 'postgres' user from login screen

After installing Postgres SQL, there was a new user in the Win7 and it was annoying! It showed up everytime I wanted to log in, and hell why would I wanna log in as a database account?

To get rid of it, run command prompt as Administrator and paste in:

REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList" /v postgres /d 0 /t REG_DWORD /f

[ Source ]

Facebook emoticons list

While chatting to a friend on Facebook, I wanted to throw in an emoticon of someone in sunnies actin' all cool.

Realising that I actually had to SEND the message to test it, and not wanting to break the conversation, I peeked through the JS code a bit with Firebug.

Luckily I was able to find the JS emoticon map with the variable name of "Emote._emoteMap" in "aoa250bk.js".

The majority of the images are loaded off this sprite sheet and cut up using CSS (a clever way of keeping HTTP requests low).

 
The original link is here, but would be nice not to hotlink since it might change.

To try out the emoticons:

smile :-)
  :)
  :]
  =)
frown :-(
  :(
  :[
  =(
tongue :-P
  :P
  :-p
  :p
  =P
grin :-D
  :D
  =D
gasp :-O
  :O
  :-o
  :o
wink ;-)
  ;)
glasses 8-)
  8)
  B-)
  B)
sunglasses 8-|
  8|
  B-|
  B|
grumpy >:(
  >:-(
unsure :/
  :-/
  :\
  :-\
cry :'(
devil 3:)
  3:-)
angel O:)
  O:-)
kiss :-*
  :*
heart <3
kiki ^_^
squint -_-
confused o.O
  O.o
upset >:O
  >:-O
  >:o
  >:-o
pacman :v
colonthree :3

A few interesting ones I noticed that weren't in the sprite sheet were:

robot :|]
penguin <(")
putnam (the hell?) :putnam:
shark (^^^)
42[1] 42 :42:

*update - 03/05/2010*

  • Added 42

Office 2007: Save as Office 2003 compatible document format by default

Previously, Office has always provided backward compatibility with the .doc and .ppt file extension.

As of Office 2007, Microsoft made 2 majorly terrible decisions. The first was to change the UI to something that resembled my left scrotum and wasted more screen space than Paul Mason.

image
I know its not Paul Mason, but I just found this picture funny.

The second was to bring a new file extension and save it as default. Microsoft must of realised they pissed off several hundreds and thousands of people, because they release a compatibility pack allowing people with older versions of Office to open the new format. Install it here.

Luckily, they provided a way to change the default compatibility. Unfortunately, its hidden away in that stupid "Office" button that doesn't have a damn label.

image

  • First, click on that stupid Office orb thing in the top left corner.
  • This will show you a menu with some common tasks, but skip all that and go down to "Word Options" in the bottom. (For other applications such as Powerpoint and Excel, etc, it'll display their respective names)
  • Click into the "Save" category in the options and change the "Save files in this format" option to the older 2003 format.

image 

  • OK to save and close.
  • Do the world a favour and pass this onto every other poor soul that has to use Office 2007.

ExpanDrive/SftpDrive: Drive is not accessible. The network path was not found.

For months now I've given up on trying to get ExpanDrive to work on Windows 7 again. It just dies out without any valid explanation when I try to view the network drive.

image 
This is the only mangy undescriptive error you see.

I've tried:

  • reinstalling
  • manually removing entries in the registry related to ExpanDrive/SftpDrive
  • reverting back to old versions
  • running on different compatibility settings
  • experimenting with 32-bit and 64-bit releases of Windows
  • searching online to see what other people experienced
  • installing and running with UAC on AND off
  • running the Explorer process together with the taskbar process
  • and I've even tried contacting their support about the demo

Finally, I've got some free time to sit down and test it out with a new clean installation in a virtual machine.

After spending nearly an hour going through every single possible tweak which I've made to Windows 7 and resetting to trace down the problem (and believe me, I've made many MANY changes), I finally figured out which setting broke ExpanDrive.

In the Local Group Policy Editor (you can get to it by running "gpedit.msc"), navigate through:

  • Computer Configuration
  • Administrative Templates
  • Windows Components
  • then Application Compatibility

Find the option "Turn off Switchback Compatibility Engine" and if the current setting is "Not Configured", then this post wont solve your problem.

If it is set to "Enabled", then you're in luck! Set this back to "Not Configured" and reboot.

Your Expandrive should magically begin to work again without any problems.

Firefox: Remove wrong spelling from dictionary

image

OK so I've accidently added a word into my dictionary and I want to remove it.

Firefox doesn't seem to provide a place to remove it easily, so we're gonna have to poke around a bit in the profile folder.

  • Close all instances of Firefox.
  • Find your profile folder using these instructions.
  • Now open up Notepad.
  • Drag "persdict.dat" into Notepad and remove the word you accidently added.
  • Save and close.

Postgres SQL: Backup/Copy and restore data between databases or servers

In the console, type

pg_dump -h db.domain.com -U username database_name -a -i -f output_filename.txt -t table_name_1 -t table_name_2 -t table_name_3

The switches used are:

Switch Description

-h

Hostname of database.

-U

Username.

-a

Data only.

-i

Ignore version difference between pg_dump and running database server.

-d

Use INSERT instead of COPY.

-f

Output filename.

-t

Table name (can use more than once).

To restore the data back into the database, connect to it and then type:

\i output_filename.txt

This will execute the commands in the output file, inserting all the data into the database you're connected to.

mIRC: Activate Status window using script

The /window -a command will work for alot of things, but something that isnt documented is how to activate the status window.

To do that, use:

/window -a "Status Window"

Wii: Running games off a USB stick/drive

At time of writing, I had:

  • Wii firmware 3.3E on a PAL system.
  • Bannerbomb v1.08
  • HackMii v0.6
  • Kingston 8gb USB Data Traveller 100

A note I'd like to make early on:

From what I've read, this tutorial will work for anyone using the Wii firmware of 4.0 and earlier. Not too sure about 4.1.

This tutorial will not work for anyone running Wii firmware v4.2. You must download and use different things to get stuff working!

The instructions in this guide are ridiculously easy, only because a few brilliant minds have sat down and spent hours on ripping the Wii wide open and creating programs to it easier for us to do these sorts of things.

Hardware Requirements

  • Nintendo Wii, obviously (LU64, LEH250 or LAH113 serial Wiis are harder to deal with since they're newer)
  • WiFi connection for the Wii
  • An SD card
  • A compatible USB drive/stick with at least 4gb (check here)
  • A computer with internet connection

Software Requirements

Installing games

Lastly Firstly, you'll need WBFS Manager to format and copy images to your USB drive.

Before starting the program, insert your USB drive and ensure that the computer has detected it.

image 

Select the drive and click "Format" to format it.

Now that its WBFS ready, you can simply select "Browse" to select ISO images. When you're ready, click "Add" and it will copy the games to your USB.

A handy thing about WBFS Manager is that it also scrubs a tiny portion of the image to save some space for you.

While thats copying, you can start preparing your Wii for homebrew!

Setting up your Wii to run homebrew

Bannerbomb will allow for any code to be run on your Wii, making it easy for homebrew software to be installed and executed.

Extract the "private" folder from the Bannerbomb archive and place it onto your SD card (all files go into the root folder unless specified otherwise).

(start optional steps)

If you want to test your Wii for compatibility prior to installing the HomeBrew Channel, download this test application and extract "boot.dol" to your SD card.

Do not insert the SD card yet! Turn on your Wii and disable "WiiConnect24". Apparently Bannerbomb wont work properly if its enabled.

Go into the Wii settings, navigate through to "Data Management", "Channels" then finally "SD".

image

Insert the SD card and load "boot.dol".

If all went well, the test should execute and display a boring black screen. The test should take approximately 5 minutes to complete.

Now delete "boot.dol" from the SD card and prepare to install the Homebrew Channel.

(end optional steps)

Installing Homebrew Channel

Place "boot.elf" from the HackMii archive onto your SD card.

Start up the Wii and visit the SD card channel again to use Bannerbomb to run the HackMii installer.

Install the Homebrew Channel (HBC) using Bannerbomb. You can navigate using the Wii remote (held vertically) with the up/down arrows to select and A button to confirm.

(Optional) While you're at it, install BootMii if you want some sort of brick protection. BootMii isnt covered in this tutorial.

If all went well, no errors should be displayed. Exit and restart the Wii.

There should now be a new channel for the HBC, meaning now you no longer need Bannerbomb to install software.

Installing USB Loader capabilities

Now you're ready to set up the SD card for USB Loader GX.

Run USB Loader GX Installer. This will download the USB Loader GX application, install it onto your SD card and also set up your card with pathnames for use with the HBC.

Now that your SD card is ready for use with the HBC, we'll take the chance to also set up the USB loader software.

"cIOS38 (rev 14 by waninkoko)" and "Hermes cIOS222-223" (both listed here) are specialised "drivers" for the Wii that allow you to boot backups from USB loaders.

Extract the cIOS38 Installer contents to "SD:\apps\cIOS38_rev14" and the Hermes contents to "SD:\apps\cIOS222-223".

Go into "SD:\apps\cIOS38_rev14" and rename "cIOS38_rev14-Installer.dol" to "boot.dol".

Turn on your Wii, insert the SD card and start the HBC.

Run the cIOS38 installer first. Select "IOS249" (or "IOS36" if 249 isn't available) and press A to confirm. When prompted, select "Network Installation" to download the software from the internet.

image

When its done, reboot and install cIOS222-223. For the Hermes setup, install for "IOS 249". The other options will work fine if you select the default options.

Now you're homebrew and USB Loader GX ready!

Running USB Loader GX

Plug in the USB drive into the back of the Wii. Now when you run the HBC, select "USB Loader GX" from the list of applications.

The loader should work immediately. Select the game and play!

If in the case you see a countdown screen that says something like "Waiting for your slow USB device", unplug the USB drive and insert it into the other port. (I've wasted a few hours trying to figure that out!)

Now it is time to don your weapons from the Nintendo armoury and bring forth a mighty reckoning!

1142415686660

Sources

Changes - 18/11/2009

  • Moved WFBS steps to the beginning, to avoid disappointment when the USB drive isn't compatible.
  • Added hardware requirements list.
  • Added link to compatibility list.
  • Added some pictures to help guide the way.
  • Added IOS36 information from MedinaSoft's and Jess' comment. (Thanks guys!)
  • Reworded some sentences to make more sense.

Annual Computer Dust Cleanout

Summer is here and its time to shave off the fuzzy grey dust which has accumulated on my computer over the past year.

What to use

  • Vacuum cleaner
  • Screw driver (if needed to open the case)
  • Compressed air / Air brush

Image226Image227
Oldschool vacuum cleaner and a can of compressed air.

Exterior

Cleaning up the exterior is pretty straight forward. Using the vacuum cleaner with a soft brush tip to gently brush off the dust will clean things up in no time.

The soft brush will flick dust off the surface and prevent scratches from occurring.

Occasionally check to see that dust hasn't clogged up your brush so you're not just smearing dust over other parts of the computer.

Don't forget to clean the back of the case where the cables connect into. If your case sucks in cool air from underneath the case, be sure to check underneath and the dust filters also.

IMG_2578IMG_2579

Interior

After opening up the case, remember to clean the inside of the case as well as dust also sticks to the inside wall.

Although it is easier to see dust when the case is laying side down on the floor, the can will spit out a bit of fluid if not held upright.

Stand your case upright and prepare the can of compressed air.

The dust will just peel right off whatever you're spraying and into the air, so be sure to use the vacuum cleaner on the opposite side to suck up as much dust as it can.

Compressed air is much more useful for difficult objects such as heatsinks or fans where vacuum cleaner nozzles or toothpicks wont reach. Use quick hard sprays of air from the center of the heatsink push the dust chunks out from the resting place.

Also remember to clean your power supply unit as dust will also clog up the fans in there and cause overheating.

Another place to clean is underneath the video card where the heatsink/fan may reside. Its easy to forget this as its underneath and you can't really see it.

Refer to the picture of the heatsink on how it'll look like if you only used the vacuum cleaner to remove the dust. With the compressed air, just imagine it without dust. Much more quicker and effective than a cotton tip bud or toothpick!

Sorry forgot to take an "after" picture.

IMG_2523IMG_2526
My dad's computer which hasn't been cleaned in over 5 years.

*update 16/01/2011*

I managed to recover some photos from a dying memory card which had some photos.

IMG_5233 IMG_5236 IMG_5237 IMG_5239 IMG_5240

Result

Prior to the clean, core temperatures were averaging about 54° C.

image

Mission success!

USB Problems? I can fix it!

[09:03 AM] <@Marantz> My mouse doesn't work after reboot
[09:03 AM] <@Marantz> I have to unplug it

A few hours later...

[01:44 PM] <@Marantz> I've solved my USB problem
[01:45 PM] <@Marantz> I bought a new pc

<3 Genscripts

Win7: Share a folder to XP computer without requiring a password

Step 1. Sharing something

Get to the "File Sharing" dialog by either:

a) Share with
  • Right click on the folder you wish to share
  • Click on "Share with"
  • Click on "Specific people..."
b) Properties
  • Right click on the folder you wish to share
  • Click on "Properties"
  • Click on the "Sharing" tab
  • Click on "Share ..."

Now you should arrive to a screen that looks like this.

image

Step 2. Sharing with who?

Select "Everyone" if you want no fuss, no password sharing. The XP computer will be able to access your shared files across the network without any issues.

If you want to allow access to only a specific user, then the XP machine will be asked for a password before it is allowed access.

Click "Add" to add them, and click on the dropdown to modify what permissions they have (ie. Read and write).

Click "Share" to apply the settings and begin sharing.

Django: Query using group by and count

To group the results by a certain field and count the number of matches in each row, use values() to group and annotate(Count()) to count.

from django.db.models import Count

brands = Product.objects.get_everything_for_category(category)

# Make it group by manufacturers and count the number of products for each brand betwen $50 and $100
brands = brands.filter(price__gte = 50, price__lte = 100)

# http://docs.djangoproject.com/en/dev/topics/db/aggregation/#values
brands = brands.values('manufacturer').annotate(Count('manufacturer')).order_by('manufacturer')

To access the information within "brands":

{% for brand in brands %}
  <li>{{brand.manufacturer}} ({{brand.manufacturer__count}})</li>
{% endfor %}

Woohoo! Broke 500 hits in a day!

I started this blog as a way of organising little "notes to self". Didn't quite think that people would actually find it useful.

Summary (Twigs Tech Tips) 500 hits

Well, I suppose I have the recent release of Windows 7 to thank for the sudden spike in traffic. Wonder how long it'll actually last!

 
Copyright © Twig's Tech Tips
Theme by BloggerThemes & TopWPThemes Sponsored by iBlogtoBlog