[ OSX ]
by Patrick Jezek
@ 27.08.2011 16:26 UTC
Hmm...
usually you can remove Applications by dragging it to the Trash. But what about pkg files?
I found a blog entry how to remove them:
List identifiers [ID]:
pkgutil --pkgs | grep [name]
Remove package content:
sudo pkgutil --unlink [ID]
Show installed files (files modified by script aren't listed - afaik):
pkgutil --files [ID]
Forget about the package (only do this once you removed all it's content):
sudo pkgutil --forget [ID]
Finally I installed iFolder on a Debian squeeze box.

Advantages over Dropbox:
- you can host your files
- only your server limits the amount of space
- You can have more the one root folder (no need to use sym- / hardlinks)
Disadvantages over Dropbox:
- it requires mono to run (only a problem on Linux and OSX)
You can read more about iFolder here.
Just did again some graphing with rrd.
Thinking (googling) some metrics to graph I found some interesting articles:
- some nice rrd examples: link
- List of Cacti Scripts and Templates: link (I did not try them out yet!)
- 20 Linux System Monitoring Tools Every SysAdmin Should Know: link
- article about graphing spend cpu ticks: link
- opennms graph gallery: link
- tool to create color gradient steps: link (mentioned in the link above)
- pmacct could be used to get protocols out of network traffic: link (will try it, once I have more time)
And here are some pics:


(as this machine is idleing it graphs only between 0 and 5 %)

Btw: am using catcti to graph and some custom code to push metrics to cacti. Will post about it, once it is on github.
I just hat the issues that my external WD drive showed no partition to mount.
It contained a timemachine backup.
Luckily I found testdisk which could restore the partition table.
Here are some screen shots:


I like dropbox and I use it to sync stuff around my different boxes.
Btw. If you don't have dropbox installed, please use me as a referral.
Today I found an open source project sponsored by Novell called iFolder.
There is also a howto install on debian.
Hope I will find some time to play with it, at it allows me to be my own host of my files and still have the ease of "Dropbox" alike behavior.
Finally I found the time to test some of the new features of the upcoming Unity3d.
So far I am very impressed.
My favorite top 3 features are:
- Unified Editor

One Editor to build for Standalone, Web, iPhone, Android, XBox 360 and PS3
- Working Debugger (MonoDevelop)

What happens on runtime? Yeah: step over the code. Comes with build in "sync MonoDevelop project" button.
- Versioning
I could not test it with my current project. I fear that it's already grown to much to proper set up subversion as VCS afterwards.
If I would have to give a note: it would be 10 out of 10 points so far.
[ General ]
[ OSX ]
by Patrick Jezek
@ 25.07.2010 00:25 UTC
I finished my modifications to shiftit. The modification I made are small.
It supports now the resize window to 1024 x max. height.
It looks like this:

A super helper to find the virtual key code for the letter "C" was Peter Maurer's Key Codes.app.
[ General ]
[ OSX ]
by Patrick Jezek
@ 24.07.2010 19:00 UTC
Here is an example apple script which can resize a window to 1024 px wide and use the maximum screen height:
-- script based on:
-- http://stackoverflow.com/questions/273242/is-there-anything-like-winsplit-revolution-for-mac-os-x#2977827
-- hardcoded screen resolution:
property screenWidth : 1280
property screenHeight : 800
-- read screen resolution:
-- comment out next 2 line to speed up the script
-- if you use always the same screen hight
set screenWidth to (do shell script "system_profiler SPDisplaysDataType | grep Resolution | awk '{print $2}'")
set screenHeight to (do shell script "system_profiler SPDisplaysDataType | grep Resolution | awk '{print $4}'")
tell application "System Events"
set _everyProcess to every process
repeat with n from 1 to count of _everyProcess
set _frontMost to frontmost of item n of _everyProcess
if _frontMost is true then set _frontMostApp to process n
end repeat
set _windowOne to window 1 of _frontMostApp
set position of _windowOne to {0, 0}
set size of _windowOne to {1024, screenHeight}
end tell
It works from launchbar with "run in Background" or from the AppleScript Menu Bar for the last top most window.
[ General ]
[ OSX ]
by Patrick Jezek
@ 24.07.2010 18:22 UTC
I searched for tools to manage application windows with a short cut.
Thanks to a superuser.com article I found some nice apps.
This is the order in which I would try them out:
- shiftit (OOS, shortcuts, but still under heavy development)
- optimal-layout (has layouts, resize multiple windows at once)
- sizeup (shortcuts, knows spaces and multiple screens)
- breeze (shortcuts, settings per app possible)
- divvy (draw position rectangle, but uses a fixed grid)
- cinch (move window to a "hot" border to position)
I guess that only optimal layout would solve my most use case: browser window "resizeing" to 1024px with maximum of height possible.
There is also an app which remembers not only window positions but also some system settings based on the current location:
- airportlocation
Luckily I found also some hints how to the positioning with apple scripts:
Let's see if I can use launchbar with some custom scripts to fit all my needs.
I will blog a new post once I have my scripts ready.
Yes it works and I had it working on my old MacBook.
To follow good habits, I share here, how I did it on my new MacBook Pro.
...crap why didn't I write it down last time ;-)...
0. why?
- i can have a native IE6 and IE8 (with IE7 in simulated mode)
- i can run demo's in native speed
- you name it
1. Requirements
You have already installed OSX on a single Partion on your GUID enabled Volume.
I will use a Windows XP Professional 32bit and a Windows 7 Professional 64bit iso images from msdn.
This tutrial should work fine with retail builds.
2. Prepare installation media
Windows XP does not know about EFI so it will work out of the box.
Windows 7 knows EFI and tries to use it, but only supports Version 2 and will fail on the MacBook.
- Mount your iso (on my machine it's mounted on drive x:)
- download oscdimg (google for it)
- open a cmd prompt and change to the folder where you have oscdimg
- run this command: (you can change the target where the iso is created)
oscdimg -n -m -bX:\boot\etfsboot.com X:\ I:\en_windows_7_professional_x64_dvd_slimed_efi.iso

- burn the iso
3. make some space on your Mac
- open Terminal.app and get root with:
sudo su -
- check how many space you have with:
diskutil list
- resize your disk and create two new partitions.
pea-mbp:~ root# diskutil list
/dev/disk0
#: TYPE NAME SIZE
IDENTIFIER
0: GUID_partition_scheme *160.0 GB disk0
1: EFI 209.7 MB disk0s1
2: Apple_HFS OSX_SSD 159.7 GB disk0s2
pea-mbp:~ root# diskutil resizeVolume disk0s2 limits
For device disk0s2 OSX_SSD:
Current size: 159.7 GB (159697911808 Bytes)
Minimum size: 75.6 GB (75631452160 Bytes)
Maximum size: 159.7 GB (159697911808 Bytes)
pea-mbp:~ root# diskutil resizeVolume disk0s2 100G "MS-DOS FAT32" Win7
49G "MS-DOS FAT32" WinXP 10G
Started partitioning on disk0s2 OSX_SSD
Verifying disk
Resizing
Waiting for disks to reappear
Formatting disk0s3 as MS-DOS (FAT32) with name Win7
Formatting disk0s4 as MS-DOS (FAT32) with name WinXP
Finished partitioning on disk0s2 OSX_SSD
/dev/disk0
#: TYPE NAME SIZE
IDENTIFIER
0: GUID_partition_scheme *160.0 GB disk0
1: EFI 209.7 MB disk0s1
2: Apple_HFS OSX_SSD 100.0 GB disk0s2
3: Microsoft Basic Data WIN7 49.0 GB disk0s3
4: Microsoft Basic Data WINXP 10.7 GB disk0s4
4. Format the partitions
You need this steps only if one of your windows partitions is bigger then 32GB.
The installer of Windows XP (even with SP3) can't format FAT32 bigger then 32GB.
- download and burn sysrescd
- Insert sysrescd and reboot your compouter holding down the c key.
- On the bootprompt type:
freedos
- once at the freedos promt, format both c: and d: partitions with:
format /S c:
format /S d:
- type reboot to reboot the machine:
reboot
5. Install Windows XP
Insert your burned Windows XP image and reboot holding down C to boot the cd.
- Install Windows XP on the last partition.
Here it was labled E:. You can use the size of the partition to identify it.
- Windows will reboot
- Hold down alt key on the keyboard and choose "Windows" from the boot menu
- The system will fail to boot, but that is ok (it's windows after all)
6. Install Windows 7
Insert your burned Windows 7 image and reboot holding down c to boot the dvd.
- Accept the license and choose custom (advanced) install method.
- Choose the second last partition (should be Disk 0 Partition 3).
Here it was labled WIN7, the name I used when I formated the partition with freedos.
You can again use the size as a reference.
And hit "Format" as we need NTFS for windows 7.
- Hit "next" to start the installation
- On reboot hold alt key to show the boot menu
- choose Windows to finish the installation of Windows 7.
- repeat step 4 and 5 a second time
- finish the installation
7. Bootloader
Back on OSX install install rEFIt.
- Double-click on the “rEFIt.mpkg” package from the downloaded dmg
- I had also to run enable.sh
cd /efi/refit
./enable.sh
7. Make Window XP bootable
- Boot Windows 7 installation CD
- Choose "Repair your Computer"
- It will find some issues, let it "Repair and restart"
- repeat step 1 and 2
- This time select "Use recovery tools ..." and click next
- Choose "Command Promt"
- verify that Windows XP is on drive C:
dir c:
(it outputs only one folder: windows)
- fix the boot sector with:
bootsect /nt52 c: /mbr
- type exit to quit the command promt
exit
- Choose "reboot" and boot windows 7
8. Fix needed boot files
- boot Windows 7 and insert the Windows XP cd.
- open a command promt and copy over the needed boot fiels
copy e:\i386\NTLDR d:\
copy e:\i386\NTDETECT.COM d:\
- create the needed boot.ini file
notepad d:\boot.ini
- paste in the following
[boot loader]
timeout=0
default=multi(0)disk(0)rdisk(0)partition(4)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(4)\WINDOWS="Win XP" /fastdetect
- change the needed file attributes for boot.ini (again im command prompt)
attrib +R boot.ini
attrib +S boot.ini
attrib +H boot.ini
9. Finish the installation of windows XP
Reboot your machine and choose the third boot item
- finish the installation
10. Final steps
If you need drivers for your Mac, insert the snowleopard dvd.
I removed the "bootcamp services" as I don't use bootcamp in my setup
Now it's time to install all updates and the programs you need.

list of references:
[1] base for this tutorial
[2] hint about oscdimg
[3] refit
[4] easy boot cd (ebcd): fixing legacy boot blocks
[5] my howto costomize Windows XP
[6] sysresccd