Fix “photos library is in use by another program” Error in OSX Photos

If database repair fails (holding cmd+option on Photos start-up) and you still get the “photos library is in use by another program” error, then you have to manually delete the lockfile.

  1. Find your Photos Library.  Most likely in /Users/[you]/Pictures/Photos Library.
  2. Right-click/ctrl-click the package and select “Show Package Contents”
  3. Navigate to the “database” folder
  4. Delete the “photos.db.lock” file
  5. Restart Photos

adb equivalents in shell with root access

For the benefit of others experiencing the same issue and arriving at this subject via Google and Co., here are some on-the-phone equivalents to running adb command on the PC:

Always start by getting a root shell on the phone:
user@pc$ adb shell
$ su –

To remount /system read-write (adb remount):
# mount -o remount,rw /dev/block/mtdblock3 /system

To uninstall an application (adb uninstall):
# rm /system/app/PackageYouNoLongerWant.apk
# pm uninstall

To put a file somewhere other than the SD-card (adb push):
Put the file on the SD-card as usual.
# mv /sdcard/file /where/you/want/to/put/the/file

Taken from this helpful post: link


A more detailed, and useful post given that a /dev mappings are not static:

Check how the /system partition is mounted as read-only (ro), In particular note the device

# mount | grep system

/dev/block/stl12 /system ext4 ro,relatime,barrier=1,data=ordered 0 0

Remount the partiton in read-write mode (rw)

# mount -o rw,remount /dev/block/stl12 /system

Finally check if it was mounted in read-write mode (rw)

# mount | grep system
/dev/block/stl12 /system ext4 rw,relatime,barrier=1,data=ordered 0 0

When done, do not forget to remount it read-only again, for safety reasons, obviously

# mount -o ro,remount /dev/block/stl12 /system

 Found in this post

Hide Folders in Finder

to hide: setfile -a V FolderName
to show: setfile -a v FolderName

How to make any salesforce page iframeable

Add ?isdtp=mn to your url

10.7.4 upgrade hackintosh

add Vendor /Device ID to /System/Library/Extension/AppleGraphicsPowerManagement.kext

my hackintosh masquerades as a MacPro5,1, so under that section, i add:



“10de” is the vendor trailing bits from the Graphics/Display output of System Info (0x10de)

“1086” is the device ID found in the same.


Install Nvidia drivers for OSX (must be done as MacPro5,1), and you should be good-to-go.

WordPress and the Dreaded “You do not have sufficient permissions to access this page.” Error

After cleaning a customer’s two WP instances after a PHP redirect hack, they asked me to obfuscate and harden their backup to decrease the likelihood that a second attempt would not be successful.

One task was to change the wordpress table prefix so that standard-named/dumb SQL injection attempts would not be successful. It was simple enough to get the parallel instance up and running, but after migrating their previous (and cleaned) table data, no one could login. No matter the access level, the login landing page would result in the dreaded error:

You do not have sufficient permissions to access this page.

Rather than start from zero, reinstall and configure all their plugins, reinstall and reconfigure their heavily customized theme, and most importantly, lose all of their users and post/page data, I needed to dig in and backtrack the issue.

The standard wordpress table namespace is “wp_“.

I picked some random names from popular culture to isolate their instance namespaces.

In order to migrate from one table namespace (standard OOTB “wp_“) to another (say, “foo_“), several foo_usermeta and foo_option values need to be updated to correctly reflect the target namespace.

The * in the following represents the new table namespace selected during setup.  The OOTB value will be wp_[value], which would need to be changed to foo_[value].

The following *_usermeta meta_key values need to be updated:

  • *_capabilities
  • *_user_level
  • *_dashboard_quick_press_last_post_id
  • *_capabilities

Keep in mind that *every* user will have these four meta_keys.  If you have hundreds of users, it would behoove you to write a quick SQL or PHP loop to iterate and update the values.

In addition, one must also change an option_name in the *_options table:

  • *_user_roles

I hope this saves someone out here some time, frustration and headache.

Hackintosh on Asus P8Z68-V Pro Gen3

If simply booting off the installer disk is not working, use “-v -x” as boot flag args in Unibeast.  On my build, USB devices (maybe the root hub?) would not initialize without those arguments; if you can’t use a keyboard or mouse, it’s pretty difficult to customize the install.

Use Unibeast with OSX 10.7.2 from App Store, creating USB installer.

Follow deadMetal’s instructions:

BIOS version is 3xxx series, meaning downgrading ran serious risk of bricking BIOS/mobo, so opting to use SpeedStepper for sleep/APM.

SpeedStepper for Lion 10.7.3:

When migrating (read: reinstalling for practice) my original install from a 300Gb spinning HDD I had laying around to a brand, spanking new Intel 520 SSD, I hit a few gotchas:

Got a kernel panic, wrt:

The stacktrace:

Kernel Extensions in backtrace(with dependencies):>0x2f5d0fff
The solution: delete it.
  1. restart in single-user mode. Add args on startup: -s
  2. in the root terminal after loading is finished, run the following:
    • mount -uw /
    • rm -rf /System/Library/Extensions/AppleTyMCEDriver.kext
    • exit