Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

« Newer Snippets
Older Snippets »
Showing 1-3 of 3 total  RSS 

Access NTFS partition mounted on Linux from Mac OS X using Apple Talk

// Here's how I managed to access the NTFS partition that I've mounted read-only on my Linux box, using AppleTalk. Requires netatalk running on the Linux box.
// Add the following to AppleVolumes.default (or whatever file you use to define the netatalk mounts

/pathto/ntfspartition "Volume Name" -dbpath:/some/writeable/directory -options:ro

Repair Spy

Takes a screenshot and a webcam snapshot and emails them to flickr. Requires isightcapture. Hacked up to spy on the Apple repair team as they try to repair my Mac Book Pro's backlight for the second time.

#!/bin/bash
# requires isightcapture http://www.intergalactic.de/hacks.html

# path to save the images
PATH=/Users/default/

# flickr email address
EMAIL="yourflickremail+private@photos.flickr.com"

# tags to attach to each picture uploaded
TAGS="repair_spy"

TIMESTAMP=`/bin/date "+%y%m%d%H%M%S"`
FRIENDLY_TIMESTAMP=`/bin/date "+%Y/%m/%d %H:%M"`

#take pics
/usr/sbin/screencapture -mxC $PATHscreen_$TIMESTAMP.png
/usr/local/bin/isightcapture -t png $PATHisight_$TIMESTAMP.png

#post to flickr
/usr/bin/uuencode $PATHscreen_$TIMESTAMP.png $PATHscreen_$TIMESTAMP.png | /usr/bin/mail -s "Repair Spy Screenshot - $FRIENDLY_TIMESTAMP tags: $TAGS" $EMAIL
/usr/bin/uuencode $PATHisight_$TIMESTAMP.png $PATHisight_$TIMESTAMP.png | /usr/bin/mail -s "Repair Spy iSight Cature - $FRIENDLY_TIMESTAMP tags: $TAGS" $EMAIL


Toss this in your crontab like so, making sure to run it as the user that you provide to the Apple Techs

*/1    *       *       *       *       default /Users/default/repair_spy >& /dev/null

Check your Mac notebook's battery statistics

/usr/sbin/ioreg -p IODeviceTree -n battery -w 0 | grep IOBatteryInfo

or

ioreg -l -w0 | grep -i IOBatteryInfo
« Newer Snippets
Older Snippets »
Showing 1-3 of 3 total  RSS