Search This Blog

To adblock users

Hello! If you see this, you are most likely using an ad blocker. (Or maybe you have JavaScript disabled. Or maybe my web server is down.) I have no problem with ad blockers; in fact I use one myself. If a site tries to deny me access unless I disable it, I just find a way to circumvent that. But if a site politely asks me to do so, but still allows access to the site, I disable it for the site. I am asking you to please do the same for this site. I can't make you, but I would appreciate it. Thank you! :-)

Sunday, September 19, 2010

Grow HFS+ partition on Mac OS X without Disk Utility

I have Boot Camp set up, and I had shrunk my main Macintosh HD partition to make room for an Ubuntu partition. Turns out I didn't really want it as much as I thought I did, so I used a GPartEd live CD to remove the partition. However, it wouldn't let me grow it back. Turns out GPartEd can't do that. I called AppleCare to ask what I should do, and I was actually on the telephone for a little over an hour. They told me to use Disk Utility to grow the partition. I tried, however, and it gave me the error message "Partition Failed with the error: Filesystem resize support required, such as HFS+ with Journaling enabled." They tried to help, but they weren't able to solve the problem. I came across this forum post, however, and it mentioned the diskutil command, more specifically the resizeVolume subcommand. I tried this, and it worked! Here's what to do if you ever have the same problem:
  1. Open Disk Utility.
  2. Select the volume you want to grow, and click Info in the toolbar.
  3. Note the Disk Identifier (from here on referred to as ????), and optionally quit Disk Utility.
  4. Open the Terminal.
  5. Type the following command: diskutil resizeVolume /dev/???? limits
  6. Note the Maximum Size (not the part in parentheses.)
  7. Type the following command: sudo diskutil resizeVolume /dev/???? [maximum size]
  8. Enter your password if prompted.
In Step 7, do include the GB after the size, but don't put the space in between.

Here's a screen transcript of what I did in the Terminal in case it helps (highlighted lines represent what I typed):

Thursday, May 13, 2010

Secret registry settings in Paint: Snap to grid

Did you know that Paint has a secret feature that lets you snap to an invisible grid? This has nothing to do with the grid that you can display when zoomed in. The only downside, however, is that it involves editing the Registry, and therefore only takes effect when Paint is loaded. (You can always, of course, save your picture and reload it when you want to change grid settings.) For your convenience, I have put together 10 regfiles, as follows:
  • OFF: Disables snapping to the grid. (Default setting.)
  • ON: Enables snapping to the grid.
  • 1-128: Sets the grid size to whichever number is chosen.
The registry values are in this key: HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Paint\View
SnapToGrid is the value you change (DWORD, 0 or 1) to turn the grid on or off. GridExtent (DWORD) is the value you change to set the grid size. It does not need to be a power of two, although all the regfiles I provided are. If you find yourself using a certain number a lot, but it isn't a power of two, you can make your own regfile for it.

I hope you find this useful!

Tuesday, February 16, 2010

Extend the 60-second limit in Sound Recorder

You know that annoying 60-second limit in Windows XP's Sound Recorder? (Vista doesn't have it, but don't get me started on what else it doesn't have...) Some suggestions people have are using the Decrease Speed function, clicking the Record button quickly after it stops, or simply using another program. However, if none of these options are doing it for you, I've got a more geeky solution involving a hex editor, such as XVI32, which I'll be using.

You can't really remove the limit, as it works by allocating enough memory for that long a recording, but you can increase (or decrease, if you really want to) the amount of recording time it gives you. Now, you can't go crazy and set it to 9,999,999,999 seconds or something, as you need to have enough memory. (Audacity gets away with this by recording to the hard drive.) 5 minutes, however, is more than enough for most purposes.

(If you're using XVI32, skip the next paragraph.)

First, you're gonna need to convert that to seconds. 5 × 60 = 300 seconds, or 0x12C. Inside the EXE, the limit is stored as a 4-byte long value. You may think that as 4 bytes would be 00 00 01 2C, but the bytes are reversed. Instead, it's 2C 01 00 00. It's confusing, I know, but it's just the way it is.

Anyway, make a copy of Sound Recorder, and open the copy in your hex editor. The limit is stored at address 0x628E, so goto (in XVI32, it's Address>Goto...) that address. Follow the instructions below:

If you're using XVI32:
  1. Go to Tools->Encode number...
  2. Type 300 (or however many seconds) in the text box.
  3. Select "longint (4 bytes)" on the left.
  4. Select "Overwrite at current adress [sic]" on the right.
  5. Click OK.
If you're using another hex editor:
  1. Switch to Overwrite mode if necessary, usually using the Insert key. You should be able to tell which mode you're in by looking at the status bar. It should say either Insert (INS) or Overwrite (OVR).
  2. Type in the four bytes you calculated above, such as 2C 01 00 00.
Now save, and run your modified Sound Recorder. It should give you a different limit, as seen in the "Length:" box on the right after clicking Record. Now, if you're so inclined, you can replace your original Sound Recorder with the new one.