HOWTO: Silence your Samsung Galaxy S II’s camera shutter

It’s difficult to get good pictures of cats, especially easily-startled cats, with the phone camera always making that shutter noise.

Research on the Web produced the usual collection of half-right and all-wrong “solutions”, so I thought I’d share what I did to silence the camera shutter sounds on my phone.

Important notes:
. This requires a rooted device. I followed the rooting instructions I the sticky thread for my phone in the AndroidCentral forums. Root is required because we’ll be renaming a file in the /system partition.
. This worked for me on my Sprint Epic 4G Touch aka Samsung Galaxy SII running Android 2.3.6 (“Gingerbread”). The theory should work on any device but the specific details will likely vary by carrier, device and OS version.
. I assume absolutely no responsibility for any harm you do to your device. If you’re careful and read the instructions, you should be fine.

1. Install a file explorer app with root features. I like File Manager by Rhythm Software ( ) but there are many.
2. Open the file explorer app and navigate to /system/media/audio/ui.
3. Find the file named Shutter_01.ogg and rename it to something like Shutter_01.ogg.bak. In File Manager you’ll need to enable Root Explorer and Mount System Folders under Settings -> Root Settings; remember to turn those off when you’re done.
4. Launch the camera app and take a test picture. You’ll hear the “focus” beep but not the shutter sound.

Other camera apps may use the default sound or they may use sounds in their own resource directories. In that case, a little careful exploring or searching should be enough to find the audio file in question.

I hope this works for you.

Comments off

Windows essentials

I’ve had the need to set up three new Windows installations in the past couple of weeks (all XP, natch) and figured I would finally document my minimum set of essential tools for Windows.

  • 7-Zip – a free, open-source (GNU LGPL) Zip utility.
  • Windows PowerToys – specifically CmdHere and TweakUI. The former adds a context-menu item to folders and drives in Windows Explorer that opens a Command Prompt window (cmd.exe) to that folder or drive. The latter is a general purpose UI (user interface) tweaker that lets you adjust many aspects of Windows, from trivial (style of arrow on shortcut icon) to significant (X-Mouse style mouse tracking).
  • GnuWin32 utilities – specifically Core, Wget and Which. These are command-line tools adapted from Unix which are very useful when, well, working on the command line.
  • Notepad2 – a text editor, much much better than the stock Notepad that ships with Windows. Free. The “RC6″ version showed now includes an installer which replaces the stock Notepad.
  • Sysinternals – a suite of tools useful for programmers and others who need to hack into the internals of Windows. My favorites are PSExec, PSFTP and Handle.
  • Winkey – Add additional functionality to the Windows key (and it works with the Command key on Macs).

I’m sure there are more but those are the ones I have installed on the three Windows installations this week.

Comments off

Languages I Speak or at least Know

I am fluent in over six million forms of communication. Well, not really.

O’Reilly Books for code4lib2009 book raffle

(in mostly alphabetical order, with varying levels of expertise and necessarily incomplete)

  • Ant
  • Bash
  • Batch (Windows shell)
  • CSS
  • HTML
  • Javascript
  • MySQL
  • PHP
  • VBScript
  • XML
  • XSLT

Things I want to learn:

  • jQuery
  • node.js

Powered by Plinky

Comments (1)

Speeding up Safari (Mac) by turning off its cache

WARNING: This procedure worked for me but I do not guarantee it will work for everyone. Use at your own risk.

I primarily use Apple’s Safari browser, along with Google Chrome and Opera. Chrome is almost to the point where I might be willing to switch, but right now I’m very comfortable with Safari. With one major exception: after an hour or two of heavy use (multiple tabs and windows, reloading pages, lots of script-heavy pages) the browser’s performance drops to a level that is just unacceptable, especially on a 2.4GHz Core 2 Duo MacBook Pro with 4GB RAM. Page loads are sluggish and almost every click on a page results in a beachball for a few seconds. After a bit of Googling and experimenting I narrowed the problem to the browser cache. It seems that Safari’s mechanism for searching its cache is, let’s say, suboptimal.

Unlike most other browsers, Safari provides no user-accessible preference for adjusting or disabling its cache. So I looked deeper.

  1. Close all Safari tabs and windows. Don’t exit Safari, just close all its windows.
  2. Empty Safari’s cache: Safari menu -> Empty cache
  3. Exit Safari.
  4. Open Terminal*: Applications -> Terminal or Spotlight -> “Terminal”
  5. In the Terminal window, type:
    chmod a-w Library/Caches/
    (the above should be all one line; hit Return or Enter at the end of the line)
  6. Type: ls -al Library/Caches/
    (the above should be all one line; hit Return or Enter at the end of the line)
    You should see:
    -r--r--r-- 1 [your user name] staff 26624 Sep 28 17:33 Library/Caches/
    The details will differ, but the important part is -r--r--r-- which is Unix for “read-only for everyone”. That means Safari can’t write to its cache file, effectively turning it off.
  7. Relaunch Safari and browse normally. If your results are like mine, you’ll note that the sluggish performance of Safari after an hour or two of heavy use is now just gone.

*Just re-emphasizing the warning at the top of this post. If you follow these instructions exactly, nothing untoward should happen. However, Terminal is the window into the deepest, darkest inner workings of Mac OS X. It’s possible to really screw things up with a simple typo. If you have any doubt, don’t do it.

Comments off

SFGate with no comments: a Greasemonkey script

After a few months (sorry!) of downtime, my SFGate-NoComments Greasemonkey script is back up at Userscripts.

I realize the previous sentence makes very little sense to anyone but me, so I’ll expand it:

After a few months (sorry!) of downtime

You saw my to-do list(s), right?


The “comments” sections in SFGate (San Francisco Chronicle’s Web site) articles are disgusting, horrible, rude, homophobic (?!), racist and in every other way awful. I wanted a way to read stories on SFGate without even having to force myself not to look at the comments section.

Greasemonkey script

Greasemonkey is a mechanism by which arbitrary code can be injected into Web pages during load or after they are completely loaded. It’s available for almost every modern browser*. Some common uses for Greasemonkey scripts are adjusting font sizes and colors on pages where the Web developer apparently worked on a 30″ inch screen and has 20/10 uncorrected vision and the color sense of a three year old, removing page elements and otherwise enhancing usability of Web pages.

Userscripts is an online repository of thousands of user-submitted Greasemonkey scripts. I placed my script there when I first wrote it early this year.

How does it work, you ask? Pretty simple in concept, a real hair-tearer in execution. Using Greasemonkey scripts’ ability to access the structural elements of a Web page, and knowing (from examining the page source code) how comments sections are named and placed, my code goes through the DOM looking for specific items. When it finds them, it makes them disappear. This was made more difficult by the fact that SFGate is now using a third-party comments solution which loads after most of the rest of the page has already finished loading, so I had to make my code wait until the page, including comments, had fully loaded before executing. The result is that the comments links and sections do show for a second before disappearing, but I find that acceptable considering the outcome.

This was an interesting challenge for me and as usual, it was impossible until it became easy. I would be willing to look at extending or duplicating it for other sites with similarly offensive comments sections. Let me know in the comments below if you’re interested. Yes, I realize the irony.

*Greasemonkey for:

  • Safari/Mac: Greasekit** or NinjaKit. I haven’t tried NinjaKit yet.
  • Opera: Enable user scripts and point it to the directory where you’ve downloaded your scripts.
  • Chrome: Native support, just click “Install” from Userscripts pages.
  • IE: See links here. I haven’t tried any of these because I use IE only under extreme duress.

**Use this version of GreaseKit if you are on OS X Leopard. The current posted version was compiled for Snow Leopard.

Comments off