Archive for November, 2008
Getting Filevault on a HFS+ Case-Sensitive Filesystem
Posted by admin in Uncategorized on November 4, 2008
The OSX file vault feature will only let you activate it on your current home folder if you have a HFS+ case-insensitive file system. It will not let you activate it on a current HFS case-sensitive.
But there is a trick, when creating a “new” clean user it will allow you to enable filevault for that new user.
So, here is how you do it.
But before you try, make sure you have enough free space, try to get rid of huge files and folders, backup your data. (in this case, we will copy your data, so you will have 2 copies for safety)
Also clean your applications cache, such as firefox cache, camino, opera,
~/Library/caches/com.apple.Safari/Webpage\ Previews/ , etc…: and close most of your applications.
$ cd ~/Library/Caches
$ find ./ -name “Cache” -exec rm -rf {} \;
$ rm -rf ~/Library/Caches/com.apple.Safari/Webpage\ Previews/Incoming/*
Steps
1. Create another admin user, for example “admin”, with administrator privileges
2. login as that user.
3. move your old user folder.
$ cd /Users/
$ sudo mv myusername myusername.bak
3. delete your old user from the “Accounts” preferences pane.
4. then create it again and check the option to use filevault
5. Logout from “admin” and login again as newuser.
6. Now copy the old data to your home folder. ( will take a very long time for that)
update: You must use rsync instead of cp, so that you also copy your VERY important hidden files. such as .ssh .gnupg .vimrc .gem .gitconfig etc..
$ sudo /usr/bin/rsync -av /Users/myusername.bak/ /Users/myusername/
# watch out if you have files that should not change the ownership, such as server backups.
$ sudo chown -R myusername ~/
7. Logout and login again, for your preferences to take effect
8. If everything looks fine, you might just delete the backup folder.
$ sudo rm -rf /Users/myusername.bak
if you have any confusions let me know in comments.
FastSleep or Hibernate on OSX Leopard? ;)
Posted by admin in Uncategorized on November 1, 2008
First of all, what do I mean by safe sleep, fast sleep or hibernate?
Safe sleep is the way OSX sleeps to RAM and as well create a sleepimage (which is the size of your RAM). In case you run out of battery, so you can still resume from the image if the battery is dead, (and you have plugged it in
Provides very fast wake up, uses the battery while sleeping.
Fast Sleep is just sleep to RAM, same as safe sleep but no image creation, and if your battery is dead, the mac will cold boot. Provides very fast wake up same as safe sleep, uses the battery while sleeping.
Hibernate is when it uses the sleepimage all the time. Slower sleep and slow wake up, but it does not use battery at all…
So…
I found in this website http://alt.cc/jk/2007/08/07/safe-sleep-addendum/ this nice script that handles when to FastSleep or when to Hibernate.
you can get safe sleep with the command “$ sudo pmset hibernate 3″
I have modified the script it little :
#!/bin/sh MODE=`/usr/bin/pmset -g | grep hibernatemode | awk '{ print $2 }'` LEFT=`/usr/bin/pmset -g batt | grep Internal | awk '{ print $2 }' | awk -F % '{ print $1 }'` HIBERNATE=20 FASTSLEEP=50 echo "Running safesleep.sh => MODE: ${MODE} LEFT: ${LEFT}" >> /var/log/system.log if [ $LEFT -lt $HIBERNATE ] && [ $MODE != 3 ] ; then { echo "Less than ${HIBERNATE}% remains" >> /var/log/system.log echo "Setting Hibernate (hibernate mode 1)" >> /var/log/system.log `/usr/bin/pmset -a hibernatemode 1` LS=`ls -al /private/var/vm/sleepimage` echo "The sleepimage should be created:" >> /var/log/system.log echo "${LS}" >> /var/log/system.log } elif [ $LEFT -gt $FASTSLEEP ] && [ $MODE != 0 ]; then { echo "Greater than ${FASTSLEEP}% remains" >> /var/log/system.log echo "Setting FastSleep (hibernate mode 0)" >> /var/log/system.log `/usr/bin/pmset -a hibernatemode 0` `rm -rf /var/vm/sleepimage` } fi
save it as /Users/your_user_name/.crons/safesleep.sh
now make it permanent in a crontab to run every 10 minutes, but wait, anacron (osx default cron) only supports daily/weekly/monthly jobs! (unless you patch it)
I guess we’ll have to install fcron:
$ sudo port -d install fcron
$ sudo vi /opt/local/etc/fcrontab
@,runas(root) 10 sh /Users/your_user_name/.crons/safesleep.sh
$ sudo launchctl load -w /Library/LaunchDaemons/org.macports.fcron.plist
$ sudo launchctl start org.macports.fcron
that’s it.
enjoy
A new Virtual machine by Sun, Free!
Posted by admin in Uncategorized on November 1, 2008
I just found the new Virtual Machine Software released by SUN Microsystems. It’s called VirtualBox.
VirtualBox runs on Windows, Linux, Macintosh and OpenSolaris hosts and supports a large number of Guest Operating systems.
Im running windows XP on my macbook pro and it seems ok, thou OSX is really slow, when I run the virtual machine. (and yes, I install virtual box drivers and tools on the guest)
here is some VirtualBox Goodnes that explains baout the command line tool:
http://dkprojects.wordpress.com/2008/10/29/more-virtualbox-goodness-tackling-the-cli/

