Aero Snap for Chrome

One hurdle that has always stopped me from adopting Chrome is something that I could easily fix in Firefox. That being, adding a little bit of padding above the tab bar, while maximized, so that you can instantly move your mouse upwards and drag downwards to restore the window. This is Aero Snap, a feature of Windows 7, and it’s great for moving browsers from monitor to monitor. The problem without this padding is explained in my Firefox article, here: http://digitaldj.net/2011/01/26/a-little-firefox-4-tweak-extra-padding-when-maximized/

The TLDR version: without the padding, when you have a full tab bar, you have to search for gaps in the tabs to pull down the window, otherwise you’ll end up dragging a tab off the bar. This makes it impossible to perform a reflex action, pushing the mouse to the top of the screen and pulling the window. After all, the time taken to acquire a target if it’s tiny is far longer than if it’s huge (Fitts’s Law).

In Firefox, the solution was simple. Since the UI is basically CSS, you can add an extension to dynamically tweak it. In Chrome, this is a little more complex since the skinning engine in Chrome only allows you to change images and not the actual look and feel of the UI. It’s all hard coded. Thankfully, Chrome is Open Source.

I figured it’d be pretty easy to grab the Chrome source, poke around and add a little tweak. However, I soon realized this is going to be rather tedious. Since the Chrome team pushes releases extremely often, compiling a new version with the tweak each time would be time consuming. An initial compile takes up to an hour on a fast machine, with subsequent compiles taking 5-10 minutes. This wasn’t really an option, so instead I thought maybe I could binary patch the file. This is that journey.

Setting up the initial development environment is fairly easy. The Chromium page has a fantastic How-To for the build instructions (http://www.chromium.org/developers/how-tos/build-instructions-windows). After I was up and running in Visual Studio, the initial compile took at least an hour. A long the lines I stumbled into an error with pyautolib. A fix outlined in Chromium Issue 83936 (http://code.google.com/p/chromium/issues/detail?id=83936) got me back on the right track and with a successful compile. Hooray!

Now it was time to find the code that dealt with building the UI. After doing some keyword searches (particularly “aero”), I found the file “glass_browser_frame_view.cc” which contained a set of constants outlined below:

Constants

The comment for ‘kTabstripTopShadowThickness’ was spot on for what I wanted: “… in maximized mode we push this off the top of the screen so the tabs appear flush against the screen edge.” After doing a quick search for references to the variable I found the method “NonClientTopBorderHeight”:

Method

The method basically determines the top border of thickness for the browser window. When it’s restored, there’s 11px of thickness (“kNonClientRestoredExtraThickness”). However, when maximized, there is no thickness and the tab’s shadow is removed, pushing it against the top edge of the screen. If we instead set this to 0, the tab’s shadow would be visible but would still result in the same dragging tab off bar problem. However, if we set it to 1, we have 1px of frame thickness, just enough for a mouse flick and drag. I gave this a shot, and after a short-ish compile, success!

Padding

Now for the more interesting bit: how on earth was I going to convert this into a generic binary patch without a lot of trial and error? Symbols, of course! Google publish the symbols for release versions of Chrome for debugging at http://chromium-browser-symsrv.commondatastorage.googleapis.com. I figured I could use WinDbg to load up a Release version of Chrome (15.0.874.120 in this case), add the symbols, search for the method then determine the file offset for better analysis in IDA.

So, I opened up WinDbg, attached to chrome.exe and searched for the offset of “NonClientTopBorderHeight” using command “x chrome*!*NonClientTopBorderHeight”. This gives back 4 different methods, all for different UI types. In this case, we want the GlassBrowserFrameView which is used for Aero. I presume OpaqueBrowserFrameView is used when Aero is disabled or for legacy Windows (i.e. XP).

WinDbg

Now that I had the offset and what the hex of the method looked like, I could use IDA to set things out a little more neatly in a flow chart:

IDA

What we see here is a flow chart of just the return statement of the method shown earlier. As numbered:

1: Check the “restored” variable. If false, jump to 2, else jump to 3.
2: Check IsMaximized(). If true, jump to 4, else jump to 3.
3: Box 3 is the result of being in a restored state. This is where it pushes the value 0x0B, which is 11 in decimal (the value of kNonClientRestoredExtraThickness). This gives the extra frame border.
4: Box 4 is the result of being in a maximized state. This is the negative of “kTabstripTopShadowThickness”
5: Add the thickness to the GetSystemMetricsCall (not important)

Fortunately, both “or esi, 0FFFFFFFFh” and “push 0Bh, pop esi” commands are exactly 3 bytes (0x83ceff vs 0x6a0b5e). Therefore, we can replace “or esi, 0FFFFFFFFh” (0x83ceff) with “push 01h, pop esi” (0x6a015e) without doing anything too fancy to the executable, just a simple binary replace. This would give us 1 pixel of frame border when maximized.

Huzzah, a binary patch! I haven’t yet created an automatic patcher, but all you need to do is open up chrome.dll in your favorite hex editor. This is located in “%LOCALAPPDATA%\Google\Chrome\Application\\chrome.dll”. You can then do a search for 0x83ceffeb036a0b5e (there should be only one occurrence) and replace it with 0x6a015eeb036a0b5e.

From here, I can either create a generic patcher or maybe something that launches Chrome and patches it in memory. At least the memory patching way wouldn’t require a patch each time Chrome is updated. More on that in the near future. I also want to change the default CTRL+T shortcut to duplicate a tab. Hopefully I can create a simple binary patch for that too.

, ,

TRIM Enabler for Lion

Also works for 10.7.2. Note that YOU NEED TO RE-PATCH when applying 10.7.2 as the extension is replaced during the update.

UPDATES REGARDING QUESTIONS AT THE BOTTOM OF THIS POST

OK. Now that Lion’s out, people want their SSD TRIM support back. I have one thing to say:

DO NOT USE TRIM ENABLER (VERSION 1.1 OR 1.2) TO ENABLE TRIM ON LION.

After a little inspection of this application, I found that instead of patching the file, it replaces an entire kernel extension. This means that when you use TRIM Enabler with Lion, it replaces a critical kernel extension, with lots of dependencies, with an older one (from Snow Leopard 10.6.8). This is bad. Very bad. While TRIM does become enabled, the kernel extension you now have has the potential to cause a ton of problems. That means anything from kernel panics, to disk I/O delays…and the dreaded spinning beach ball.

After confronting the developer, Oskar Groth (who I refuse to link to), via his blog’s commenting system, I was told that I was simply trolling and spreading fear (even though I offered the alternative I share here). Apparently, the next version of TRIM Enabler will correctly patch the file, instead of replacing it, but that hasn’t happened yet.

So, here’s the proper way to enable TRIM support. Run these commands in Terminal:

1. Backup the file we’re patching

sudo cp /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage.original

2. Patch the file to enable TRIM support

sudo perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00{1,20})[^\x00]{9}(\x00{1,20}\x51)|$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2|sg' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage

3. Clear the system kernel extension cache

sudo kextcache -system-prelinked-kernel

sudo kextcache -system-caches

4. Now Reboot!

a) If in the future you want to disable TRIM support

sudo perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00).{9}(\x00\x51)|$1\x41\x50\x50\x4C\x45\x20\x53\x53\x44$2|sg' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage

sudo kextcache -system-prelinked-kernel

sudo kextcache -system-caches

b) If something goes horribly wrong, restore the backup

sudo cp /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage.original /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage

All this patch does is simply replace the string “APPLE SSD” in the file IOAHCIBlockStorage with zeros. This happens to bypass the restriction of only allowing Apple branded SSDs. The backup of the original file is saved in the same directory as the original file.

To check if it worked, open up About This Mac, click the “More Info…” button then the “System Report” button. In the list on the left, choose “Serial-ATA”. Click on your SSD Drive and in the lower half of the screen you should now see “TRIM Support: Yes” instead of “No”.

Remember, if you have an older generation SSD, the hardware itself may not support TRIM …and therefore this patch won’t help you. This patch bypasses the restriction put in place by Apple to restrict TRIM support to Apple branded SSD drives.

You WILL need to re-apply this patch after each major update of OS X. That means for 10.7.1, 10.7.2, etc.

Credit where credits due, unlike the other TRIM Enabler, I originally found this on the InsanelyMac forums by digital_dreamer

As a note, the MD5 checksums for the original and patched file on 10.7.0 are as follows:

Original: 155b426c856c854e54936339fbc88d72
Modified: 945944136009c9228fffb513ab5bf734

If you have already used the other TRIM Enabler, you can do the following:
a) Attempt to copy and replace the extension from another Mac running the same version.
b) Attempt to copy and replace the extension from the Recovery partition (Open up Disk Utility and Mount Recovery HD)
c) Reinstall Lion
d) Wait it out till 10.7.1 and hope that the extension is replaced in the update (but it may not be), then re-patch the file

UPDATE

a) Applying this patch does NOTHING else other than enable TRIM for 3rd party SSD drives. If you start seeing other problems, they’re not because of this.

b) Using this patch has no effect on hard disk drives. Firstly, mechanical hard disk drives do not understand the TRIM command, so it is discarded. Secondly, the Apple driver isn’t stupid enough to send TRIM commands to your hard disk. It knows the difference between an SSD and a HDD.

c) The wiping free space option is ALWAYS greyed out, even on Apple based SSDs. As reported here, you can try using `fsck -ffy` in Single User Mode, but personally I haven’t tested it. I’m sure there isn’t too much to worry about, especially if your drive has garbage collection.

d) If TRIM isn’t enabled after patching either a) you didn’t follow the steps correctly or b) your drive doesn’t support TRIM. If your drive doesn’t support TRIM, there’s no need to revert the patch, it simply has no effect.

e) The TRIM patch is NOT vendor/model specific. You can patch the driver for any damn SSD drive. Hell, you can apply the patch if you only use HDDs, but that’d be a little silly.

f) Regarding RAID and SSDs on Mac. I’m not completely sure but…if you’re using Apple RAID then I assume TRIM will work as usual. If you’re using a hackintosh and using a RAID controller (i.e. Intel ICHR), then no, RAID will not work. In either case, you should use a drive with garbage collection.

UPDATE 2

Regarding SSD durability and comments by Hyram:

The durability of SSDs has sweet fuck all to do with Mac OS X TRIM. It’s a fact, and always has been, that SSDs aren’t as durable as hard disks. This is simply due it it being a new technology. SSDs fail often due to the wear on the cells incurred by reads and writes.

If you don’t know what TRIM is, you probably shouldn’t be using a 3rd party SSD drive. Many have reported these commands don’t work, but that simply isn’t true. It just shows that a lot of people here don’t know how to use Terminal, don’t know what Bash is, nor Perl. These aren’t the sort of people that should be messing around with this. Instead, buy a SSD drive that offers garbage collection….or a Mac with an Apple SSD.

There has also been some confusion about garbage collection and TRIM. TRIM is ALWAYS preferred over Garbage Collection and will likely yield better results. If you have garbage collection, you don’t necessarily need TRIM, but it’ll probably offer better performance and there’s always a chance there’ll be a degradation of speed over time. Therefore, when using Garbage Collection, you may have to take the drive out and do a secure erase so that everything is re-marked as free space.

A drive will never fail because you haven’t enabled TRIM, even if it doesn’t have garbage collection. They simply become slower and the speed is not restored until you perform a destructive erase on the drive. However, drives that support TRIM, but do not have GC, and do not have TRIM enabled (in the OS) may fail more quickly than without enabling TRIM. In a very basic sense, since the SSD is no longer told what data to free up, when writing new data it will also re-write the deleted data, essentially causing more write cycles and wearing down the durability of the drive. If TRIM were enabled, the new data would be written without the deleted data, and hence less write cycles and extended durability. This ONLY relates to the combination of a drive that supports TRIM with no GC, while TRIM is disabled in the OS

Running garbage collection and TRIM at the same time is NOT a problem. They’re designed to work together. You can look at it like so: TRIM is called by your OS each time space is freed up. Garbage Collection is run by the drive’s firmware when idle and determines which parts of the drive can be cleaned up and rearranged. TRIM is obviously more efficient and obviously the drive’s firmware is aware of the TRIM commands and accounts for this.

As for the statements by Hyram, I believe some of them to be completely false. While it’s true that using TRIM and garbage collection at the same time is essentially using two mechanisms to do the same thing, the firmware on your SSD drive is designed to handle these things. All SSD manufacturers, GC or not, recommend the use of TRIM.

There is zero evidence that Apple has specific code to handle their specific SSD hardware for reading and writing. TRIM is a standardized ATA command. However, it IS likely that Apple has designed their integrated SSDs (particularly in the Air) to not overheat. Basically, your SSD is likely to fail just as much in your MacBook as if it were surrounded by the same temperature in any other laptop.

,

WWDC Predictions REVISED

Yup, I’ll be at WWDC this year. With only 3ish weeks left, here are my predictions:

1/6/10 Revised

iPhone 4[S] Late October – Early NovemberLate November – Early December

  • World Phone. CDMA / LTE. Access any network, worldwide. True 4G.
  • 32/64GB Capacities. $199 / $299 respectively. Black / White.
  • NFC payment capabilities. Integration with Apple Retail Stores.
  • Apple A5 Dual Core CPU. Same 512MB RAM. Same battery life.
  • Edge-to-edge 4.0″ screen. Same resolution. Retina Display.
  • 8MP Camera. 1080p Video Recording.
  • Capacitive Home button area. Gestures.
  • “Slimmer”-ish.
  • Announced Early September

iOS 5 Early OctoberLate August

  • iPhone 3G support dropped.
  • Notifications revamp.
  • New ways of multitasking. Expose. Multitouch gestures.
  • Dashboard.
  • Photo Booth. Separate 99c app for next-gem devices.
  • Deeper voice integration.
  • Maps update. It’s a social network…for people.
  • iCloud: music, apps (preferences?), books, video.
  • “Wireless Sync” / Backup via cloud storage. Less reliance on desktop iTunes.
  • iWork. NAILED IT

Rsync 3.0.8, Windows and chown

Upon updating cwRsync to it’s latest version, I found that my daily backup script was failing. I’ve found the last couple of updates to Rsync becoming less Cygwin / Windows friendly due to changes with setting ownership of users and groups on files.

In particular, in 3.0.8, there was a change that issued a transfer error if it’s not possible to set uid or gid with chown (http://rsync.samba.org/ftp/rsync/src/rsync-3.0.8-NEWS). Obviously, this is ALWAYS going to produce an error on Windows, and is the source of my problems.

While the backup would transfer successfully, the log would be filled with the error message “uid 4294967295 (-1) is impossible to set on …” and the final exit code would report non-zero, making my script think something had gone horribly wrong. This is the changeset that introduces this error: http://www.mail-archive.com/rsync-cvs@lists.samba.org/msg06292.html

So, I went scouring through the rsyncd.conf man page and through the 3.0.8 source to figure out how to skip setting uid/gid on a file. Turns out you can! Although through a weird option called “fake super”. By looking at the source I found Rsync will only attempt to chown if it’s “root”. By default, on Windows, Rysync thinks it IS “root”, although it may not be the case. The “fake super” option forces Rsync to think it’s not running as a real super user and therefore skips attempting to chown files.

So, in short, to get cwRsync (or just Cygwin Rsync) working properly on Windows, you should add the following lines to either your global or module configuration:

uid = 0
gid = 0
fake super = yes

Huzzah, no more errors!

Browser JavaScript Performance Shootout

Intel Core 2 Duo T9300 @ 2.50GHz, 4GB DDR2-667, NVIDIA GeForce 8400M GS
Windows 7 Ultimate x64 RTM January 2011 Updates
x86 Browsers, No Add-ons, No Plugins, Blank Profiles
Idle CPU, Browsers tested individually, Browsers re-opened after each run of a test

Mozilla Firefox 4.0 Beta 10, Mozilla Firefox 3.6.12, Opera 11.01, Google Chrome 8.0.552.237, Google Chrome 10.0.651.0, Microsoft Internet Explorer 8.0.7600.16385, Microsoft Internet Explorer 9.0.8023.6000, Apple Safari 5.0.3 (7533.19.4), Apple Safari 5.0.3 (WebKit r76750)

SunSpider

Kraken

V8

SlickSpeed

The Numbers

The point? Chrome is fast. Firefox 4 ISN’T slow. IE9 is actually promising.

,

A Little Firefox 4 Tweak: Extra Padding When Maximized

I have a pet peeve with certain applications that decide that the title bar padding at the top of the window is now a waste of screen real estate.

A Safari beta was one of the first browsers to introduce the idea of using the title bar to hold a row of tabs. At first thought, you may think that this really has no disadvantage. More viewing real estate for the page, who DOESN’T want that?! Well, Apple backtracked on the idea before Safari 4′s release. Why? Well, the reason isn’t entirely clear (probably it’s indirectly against the Windows User Experience Interaction Guidelines) but other browsers latched on to the idea and half of the major players did it all wrong. The guilty culprits? Chrome and Firefox.

So, what did they do wrong exactly? Well, let’s set the scene: your browser is maximized and your tab bar is full of tabs. You want to restore the window to it’s un-maximized state. How do you do it!? You can’t just double click (or in Windows 7, click and drag) anywhere on the title bar. That’s where the tabs are. In fact, if you do so you often find yourself creating a new tab or dragging the tab off the bar to create a new window. Instead, you’ll have to reach over to the Restore button (top right) or find a small gap in the tabs that counts as clicking the title bar instead of the tab. This takes more time and mouse precision. It’s a stupid way of implementing it and there’s such a simple fix.

Of the other major browsers, Internet Explorer and Safari leave the title bar completely blank and intact. Opera on the other hand did it properly. When maximized, above the tab bar is a 3 pixel gap that counts as the title bar. The space is barely noticeable but it allows you to whip your mouse up to the top of the screen, without any precision movements, double click and restore the window. In fact, you don’t even need 3 pixels, 1 is more than enough!

So, today I moved over to Firefox 4 hoping that all my add-ons are now compatible. Horray! They are… and Firefox 4 really is a huge performance improvement… BUT it lacks that space above tabs when maximized. Doing a quick click and drag to restore the window results in pulling the tab off the bar. So, I wrote a 3 line CSS fix that overrides the padding-top of the tab bar to 1px when maximized and “Tabs on Top” is enabled. I bundled it into an extension and submitted it to addons.mozilla.org.

The extension is called “Extra Padding When Maximized” and can be found here: https://addons.mozilla.org/en-US/firefox/addon/extra-padding-when-maximize/

Hopefully, the add-on won’t break in future updates. It’s such a minor modification. Hopefully the Mozilla team will get around to implementing it at some stage.

, ,

ZFS, zpool v28, OpenSolaris / OpenIndiana b147, 4k drives and you

I went on a mission to try out the latest zpool version…which is in OpenIndiana b147. FreeBSD 9 will be introducing zpool v28 but not until at least near year.

I bought myself 9 Samsung HD203UI drives. These are “green” drives that use “Advanced Format” 4k / 4096 byte sectors.

I decided to setup a benchmark to test whether or not the fix outlined by Solarismen.de that outlines a fix to the zpool command that sets ashift to 12 instead of 9.

I went ahead and checked out the OpenSolaris source (which hasn’t been touched for a while now) and compiled zpool with the fix. You can find a version of zpool, which supports ashift 12 and zpool v28, right HERE.

If you want to do it yourself you can follow these steps and then use zpool-12 to create your zpools:

cd /tmp
hg clone ssh://anon@hg.opensolaris.org/hg/onnv/onnv-gate
cd onnv-gate/usr/src/cmd/zpool

ln -s /usr/lib/libuutil.so.1 libuutil.so
ln -s /lib/libdladm.so.1 libdladm.so

Edit zpool_vdev.c
Add:
	verify(nvlist_add_uint64(vdev, ZPOOL_CONFIG_ASHIFT, 12) == 0);
Below:
	verify(nvlist_add_uint64(vdev, ZPOOL_CONFIG_IS_LOG, is_log) == 0);

gcc -O2 -DTEXT_DOMAIN='"en_US"' -I/tmp/onnv-gate/usr/src/cmd/stat/common -I/tmp/onnv-gate/usr/src/common/zfs -I/tmp/onnv-gate/usr/src/lib/libuutil/common -I/tmp/onnv-gate/usr/src/lib/libdiskmgt/common -c *.c
cd ../stat/common
gcc -O2 -DTEXT_DOMAIN='"en_US"' -I/tmp/onnv-gate/usr/src/cmd/stat/common -I/tmp/onnv-gate/usr/src/common/zfs -I/tmp/onnv-gate/usr/src/lib/libuutil/common -I/tmp/onnv-gate/usr/src/lib/libdiskmgt/common -c timestamp.c
cp timestamp.o ../../zpool
cd ../../zpool
gcc -o zpool-12 *.o -L. -lzfs -lnvpair -ldevid -lefi -ldiskmgt -luutil -lumem -ldladm
cp zpool-12 /usr/sbin

I also followed a rule of performance found by sub.mesa where that RAIDZ and RAIDZ2 should only contain an optimal amount of disks. A RAIDZ should contain only 3, 5 or 9 disks and a RAIDZ2 should only contain 6 or 10 disks, etc.

I compiled bonnie++ 1.96 and decided to run the benchmarks on stock (untuned ZFS), no compression, no dedup. 9 drives in RAIDZ1.

Server specs:
Intel Xeon X3440
8GB DDR3 1066
HP SAS Expander (2x uplink to HBA)
LSI 9211-8i
Supermicro X8SIL-V

WITH ASHIFT = 9

Version  1.96       ------Sequential Output------ --Sequential Input- --Random-
Concurrency   1     -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
xobiusii-nas    16G   210  98 495776  54 312661  55   493  99 900717  52 900.3  20
Latency             46783us    1413ms     796ms   31988us   86977us     539ms
Version  1.96       ------Sequential Create------ --------Random Create--------
xobiusii-nas        -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16  6840  18 +++++ +++  9139  15  9368  23 +++++ +++ 10314  16
Latency             10390us     260us     128us    7648us      19us     131us
1.96,1.96,xobiusii-nas,1,1286031472,16G,,210,98,495776,54,312661,55,493,99,900717,52,900.3,20,16,,,,,6840,18,+++++,+++,9139,15,9368,23,+++++,+++,10314,16,46783us,1413ms,796ms,31988us,86977us,539ms,10390us,260us,128us,7648us,19us,131us

WITH ASHIFT = 12

Version  1.96       ------Sequential Output------ --Sequential Input- --Random-
Concurrency   1     -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
xobiusii-nas    16G   211  99 576021  66 312749  56   478  99 921569  53  1184  23
Latency             42479us    1160ms     888ms   38757us     182ms     479ms
Version  1.96       ------Sequential Create------ --------Random Create--------
xobiusii-nas        -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16  9079  24 +++++ +++ 11747  19 10605  28 +++++ +++ 11247  21
Latency             10675us     185us     166us    7853us     128us     241us
1.96,1.96,xobiusii-nas,1,1286033034,16G,,211,99,576021,66,312749,56,478,99,921569,53,1184,23,16,,,,,9079,24,+++++,+++,11747,19,10605,28,+++++,+++,11247,21,42479us,1160ms,888ms,38757us,182ms,479ms,10675us,185us,166us,7853us,128us,241us

I think the results show that in some areas the ashift has a significant boost in performance…but otherwise much the same. Best to apply the patch :) But also, I think that 4k sectors and ZFS has been greatly exaggerated. Sure, there seems to be a slight performance loss…but I think a lot of people having performance difficulties have a combination of both 4k sector drives and not having the magical number of drives in the RAIDZ/RAIDZ2 array. Note that by using ashift, you may have some difficulties importing zpool into another machine…maybe.

, , , ,

Unlimited Nudging and File Transfers for WLM 2011 15.4.3502.922

You heard it here first!

Just spent the last day or so messing in OllyDbg and IDA Pro to figure out where WLM 2011 limits simultaneous file transfers and delays between nudges.

Here’s the details:

Unlimited Nudging:
msnmsgr.exe Offset 0x003025F3
Change 8B87F0000000 to 33C040909090

Unlimited File Transfers:
msnmsgr.exe Offset 0x00224D82
Change 83F8037C to 909090EB

You will probably need to run A-Patch first as that patches a file that disables an integrity check on msnmsgr.exe.

I’ve contacted Ahmad at A-Patch about my findings…hopefully they’ll be in the next release :)

In the future…I hope to maybe port some of the other missing A-Patch features to WLM 2011 (like disabling Nudge shake)…but I also want to try and disable the new Microsoft link protection junk that occurs whenever you open an unverified link in your browser. Just give me a few more days ;)

Enjoy!

,

Forcing Feed Updates in Google Reader…Automagically

Since 2006 I had been looking for an RSS client that provided synced articles between multiple computers. Google Reader existed but in it’s early stages had a piss poor feature set. Instead, I tried out an open source project, Tiny Tiny RSS. Even though the project was in it’s infancy, it was filled with features albeit a bit buggy. Problem is that TT-RSS needed to be hosted on my own server. If my server goes down, I get no RSS updates.

A couple of months I switched to Google Reader, and although it STILL isn’t as packed with features, there are enough GreaseMonkey scripts out there to make it bearable. Google Reader is now my primary RSS reader.

BUT, there’s still one MAJOR problem with Google Reader. Google determines when your feeds are updated. If a feed has many subscribers it’s likely to be updated more often than those that only have a few. If you have custom RSS feeds you’ll find that these feeds are only updated every 12-24 hours. This sucks.

But why does it suck you ask? Well, consider fast moving RSS feeds. For example, your Twitter stream. If you subscribe to Twitter RSS and follow a handful of users, the chances are you’re going to be getting a fair few status updates per hour. Now, if the Twitter RSS feed only holds the past 30 entries and you’re getting about 60 updates an hour….and Google is only updating your feed once every 12 hours (because YOUR Twitter feed is unique to YOU)…you’re missing out on more than 600 entries!

Google provides you with a “Refresh” button that allows you to manually update the feed…but there’s no button to manually update all your feeds and there’s no way to specifically set a refresh interval for fast moving feeds. I found this unacceptable…so I conjured up a little PHP script to force refresh all my feeds. This way I can run it as a cronjob and refresh my feeds every 10 minutes.

Here’s the script: http://digitaldj.net/greader_forceupdate.txt

What do you do with it? Simple. Rename the file, changing the .txt extension to .php then edit the file adding in your Google username and password in the relevant fields. Set it up to run as a cronjob (php greader_forceupdate.php) or call it manually via a web server. If you are calling it from a web server make sure you change the path of $cookies_file to somewhere that isn’t web accessible (i.e. not in htdocs, wwwroot, public_html, you get the idea).

How does it work? Also, simple. It logs into Google Reader, stores your cookies in a file named greader_cookies.txt, grabs a list of your feeds then calls the Refresh button for every feed in your list.

How do I know it worked? You should be able to pick any feed in your list and click “show details”. The last updated time should be recent for every feed.

Note that feeds WILL NOT update if they have been updated within the past 10 minutes, so there’s no point in running the script more often than once every 10 minutes.

,

Video Game Music I Fell In Love With

The entire Ridge Racer R4 soundtrack, in particularly Kouta Takahashi – Urban Fragments. The entire soundtrack is fantastic which is why I uploaded it here (ripped from the original PSX CD, 192kBps 44.1kHz),. There’s also a remix of the intro track: Hiroshi Okubo – One More Win (also in the uploaded pack).


The Jazz Jackrabbit (and the sequel) menu music. Original MOD music from here (and the sequel here).

All of the Sonic music. In particular the ending to Sonic & Knuckles (or Sonic 3 & Knuckles, same thing). The credits mashup is awesome. The original VGMs: Sonic 1, Sonic 2, Sonic 3 & Knuckles

The Doom 3 theme. Linky.

This one’s a little obscure. The menu music from a leaked UT2003 beta. The menu music in the final version of the game was different but the ogg was kept in the game files, although never used. I loved it the first time I launched the beta.. Oh the days of drooling over the graphics of CTF-Maul. Link to the musics.

The Metal Gear Solid VR Missions (or Integral) intro music.

The Half-Life 1 Closing Theme (Link) music….and the remix of it in Half-Life 2 (Double Link) apparently called Tracking Device by Kelly Bailey. The original is probably better.


And finally, everyone’s favourite from Portal. Still Alive.

A little less game related…The intro to Windows XP and 98 music.

,