See also: Heapify

Pages: 1

OS X Screen capture from Python/PyObjC

Looking through the unanswered Python questions on StackOverflow, I found one that seemed interesting.. "Python Get Screen Pixel Value in OS X" - how to access screen pixel values, without the overhead of calling the screencapture command, then loading the resulting image.

After a bit of searching, the best supported way of grabbing a screenshot is provided by the CoreGraphics API, part of Quartz, specifically CGWindowListCreateImage.

Since CoreGraphics is a C-based API, the code map almost directly to Python function calls. It's also simplified a bit, because PyObjC handles most of the memory-management (when the wrapping Python object goes out of scope, the underlying object is freed)

...

Read more

There are no comments on this post.

Hiding OS X system directories

After restoring a backup, the various OS X system folders became visible again (such as /bin /mach_kernel etc)

The following command (adapted from this post by Wowzera) will hide them again:

# Hide sym-links
SETFILECMD="/Developer/Tools/SetFile"
for cdir in /etc /tmp /var;
    do sudo $SETFILECMD -P -a V $cdir;
done
 
# Hide directories
for cdir in /bin /cores /mach_kernel /private /sbin /usr /Volumes; do
    sudo $SETFILECMD -a V $cdir;
done

Launch Terminal (in Applications, then Utilities), and paste the above script.

...

Read more

There are no comments on this post.

Pages: 1

RSS
Powered by Debian, Guinness, and excessive quantities of caffeine and sugar.