Resizing Mac Partitions on-the-fly

datePosted on 20:14, May 25th, 2007 by Many Ayromlou

As of OSX 10.4.6 you get a extra bonus if you use the terminal and run diskutil. The new addition is the function resizeVolume. Note that this command works only on Intel Macs with hard disks formatted using the GPT (GUID Partition Table) format with a journaled Hierarchical File System Plus (HFS+) file system. This is the default for Intel Macs’ hard disks.

To use the resizeVolume command, you need to get some information: you must be able to specify which partition you want to resize. You also need to know the partition’s size limitations, since it must be big enough to hold data already on the disk. To find the partition’s name, type diskutil list in Terminal. Press return and you’ll see a list of all the disks on your Mac. The one labeled /dev/disk0 is your boot disk. If you have other disks, they’re named disk1, disk2, and so on. Look under the Identifier header for the names of the disk’s partitions; for example, disk2s2. (Ignore any partitions labeled GUID_partition_scheme or EFI.)

Now you need to find out what size your new partition can be. Run this command: diskutil resizeVolume disk_identifier limits , replacing disk_identifier with your partition’s identifier. This will return the current size of the partition, as well as the minimum and maximum sizes you can use. For example:

For device disk2s2 Untitled:
Current size: 215822106624 bytes
Minimum size: 6691028992 bytes
Maximum size: 215822106624 bytes

Now that you know the disk’s name and size limits, prepare your command. It should follow this basic model:

diskutil resizeVolume disk_identifier partition_size second_partition_format second_partition_name second_partition_size

The first part of the command is, of course, the command itself: diskutil resizeVolume. Follow that with the identifier and size of the partition you’d like to split. Type in the size you want this partition to be, not what it currently is. So, for example, if you want the first partition to be 100GB, specify 100G . Finally, specify the format, name of your choosing, and size for the partition you want to create. Want more than two partitions? Just add additional arguments to your command.

Although you can resize the first partition, you can’t change its format—that’s why you don’t need to specify one for it. For each additional partition you wish to create, you must specify the format you want it to adopt. For example, type JHFS+ for journaled HFS+, HFS+ for unjournaled HFS+, MS-DOS for FAT32, UFS for Unix File System, and so on. You must specify the size for each partition. For example, to create a 100GB partition in journaled HFS+, you’d type JHFS+ new_partition_name 100G.

Here’s an example at work:

diskutil resizeVolume disk2s2 100G JHFS+ Part2 100G

This command splits a single partition in two. It specifies a size of 100GB for the first partition. Then it creates a new, second partition, named Part2, using the journaled HFS+ format, with a minimum size of 100GB. If there’s more empty space in the partition, the command will use it all. So if you split a 232GB partition, the above command would give you a first partition of 100GB and a second partition of 132GB.

The resizeVolume command occasionally fails. If it encounters any disk problems, it will stop, and you’ll need to run Disk Utility or another disk-maintenance program. If you have any system or special metadata files—which can’t be moved—in the section of your partition that you wish to reallocate, the command will also fail.

Streaming Quicktime from Nokia N800 Internet Tablet

datePosted on 14:55, May 25th, 2007 by Many Ayromlou

Let me start by saying that I found the recipe for this on Josh Lifton’s website. So most of the credit really goes to him. I’ve just simplified (and expanded) his method to cover generic quicktime streaming.

So basically what we want to do is to connect the N800 to a network, setup a quicktime server (or darwin streaming server for people who don’t have access to OSX server) and get the N800 to create a H.263 stream (audio and video) and send it to our server. Sounds easy right?

Here are the bits you need:

  • N800 Internet tablet
  • Mac (or PC) with Quicktime 7 (or higher) installed
  • A server box running OSX server (can be the same machine as above) or a PC running Darwin Streaming server.

Recipe for N800

Assuming you have the N800 powered up and setup for Network usage (wireless), here are the steps I followed to get the N800 prepped:

Put the application manager in “redpill” mode. Go to “Tools > Application catalogue”, click “New”, enter “matrix” into the “Web Address” field, click “Cancel”. Choosing the red pill will activate the red pill mode, obviously, and chosing the blue one will deactivate it.

Install Dropbear SSH Server and Client software onto your N800. Now ssh from the Mac (or PC) to your N800 and login as root (password is rootme by default). Change the password and make a note of it. On the N800 (through ssh and vi) edit /etc/apt/source.list file and either add the differences or replace the content with the following:

#maemo:name Nokia Catalogue
deb bora user
#maemo:name Nokia Catalogue (3rd party software)
deb bora user
#maemo:name Canola
deb bora user
#maemo:name Maemo Repository
deb bora free non-free extras
#maemo:name Maemo Extras
deb bora free non-free
#maemo:name Tuomas Kulve - Maemo - Bora
deb bora maemo
#maemo:name Kernel Concepts
deb bora free
#maemo:name MUlliNER.ORG Repository
deb bora free
#maemo:name Catalogue
deb bora user
#maemo:name Nokia Research Centre Cambridge
deb bora extras
#maemo:name tortoise catalogue
#deb bora user
#maemo:name quiver
deb bora main
#maemo:name maemo-hackers
deb bora main
#maemo:name FBReader repository
deb bora user
#maemo:name mg
deb bora user other

At this point reboot your N800 by issuing the reboot command from ssh window. Okay you’ve made it this far, good that means you have not bricked your machine yet :-). SSH back to your N800 and login with the new root password (remember we changed the password earlier). Now use the Application Manager and install the following packages (this is up-to-date as of May, 25, 2007):


Recipe for Streaming Server (QTSS)

The procedure described in this document was tested with the Apple QuickTime Streaming Server (QTSS) running on a Mac OS X 10.4.9 Server machine. Similar results are most likely possible with the open source Darwin Streaming Server (DSS). You have to find out where the streaming directory of the server is. By default on QTSS it is /Library/QuickTimeStreaming/Movies/ folder. We now need to create an SDP file that point our quicktime client at the stream. Think of the .sdp file as a stub file on the server that tells the client all the relevant information about the stream. I’ve succesfully used the following sdp file, just copy and paste the text using a text editor and save it in the Movies directory as a text file (ie: n800.sdp):

o=- 37 614155991 IN IP4
t=0 0
m=audio 5432 RTP/AVP 0
m=video 5434 RTP/AVP 96
a=rtpmap:96 H263-2000/90000
a=framesize:96 352-288

This SDP file can be used once the XX.XX.XX.XX address listed in the file (in two places) is replaced with the IP address at which the streaming server is located.

Soups Ready!

Be sure the default camera application is not running before the GStreamer pipeline is started. Once the N800 and QTSS have been configured as above, the only thing left to do is start the audio and video streaming from the N800 by running the following command from the terminal (either via SSH session or xterm application on N800):

gst-launch-0.10 gconfv4l2src ! video/x-raw-yuv,width=352,height=288,framerate=\(fraction\)15/1 ! hantro4200enc stream-type=1 profile-and-level=1001 ! video/x-h263,framerate=\(fraction\)15/1 ! rtph263ppay mtu=1438 ! udpsink host=XX.XX.XX.XX port=5434 dsppcmsrc ! queue ! audio/x-raw-int,channels=1,rate=8000 ! mulawenc ! rtppcmupay mtu=1438 ! udpsink host=XX.XX.XX.XX port=5432

This command (all one line) creates and starts playing a GStreamer pipeline that encodes the raw audio and video streams, stuffs them into RTP packets, and sends them to the streaming server (change the XX.XX.XX.XX addresses in two places to server IP address). Once the GStreamer pipeline has been started, the N800’s camera can be popped out without the default camera application starting up.

Now goto your quicktime client and choose File/Open URL from the menu and type the following: rtsp://XX.XX.XX.XX/n800.sdp (change the XX.XX.XX.XX to server IP address).


Set/Change the default Umask…

datePosted on 13:14, May 25th, 2007 by Many Ayromlou

Open Terminal, and then type this command, followed by the Return key:

defaults write /Library/Preferences/.GlobalPreferences NSUmask #

defaults write -g NSUmask -int #

The first sets the system default, the second sets the per-user default. The NSUmask may not be honored by software that has not been adapted for OS X. # is the umask (per umask(2)). It may, however, be in decimal instead of octal.

Speed up Sheets…

datePosted on 13:14, May 25th, 2007 by Many Ayromlou

Open Terminal, and then type this command, followed by the Return key:

defaults write NSGlobalDomain NSWindowResizeTime time

where time is a time in seconds from, say, .001 to 2.

Disable Guest login in AFS…

datePosted on 13:13, May 25th, 2007 by Many Ayromlou

Open Terminal, and then type this command, followed by the Return key:

defaults write /Library/Preferences/ guestAccess -bool false

Turn off Dashboard…

datePosted on 13:13, May 25th, 2007 by Many Ayromlou

Open Terminal, and then type this command, followed by the Return key:

defaults write mcx-disabled -boolean YES

This tells the system that you no longer wish to have Dashboard available. However, the Dashboard task is actually “owned” by the Dock, so to make your changes take effect, you need to restart the Dock. The easiest way to do that is to type this command into the Terminal (and press Return when done):

killall Dock

After the Dock restarts, hit F12 and you’ll see…nothing at all. If you run Activity Monitor, you also won’t find any Dashboard widgets in the list of tasks, even if you had several open when you ran the above command. Dashboard has been eliminated from your system, and won’t return until you tell it to do so. You can do just that by opening Terminal again, and typing this command:

defaults write mcx-disabled -boolean NO

Once again, you’ll have to use the killall Dock command to make the changes take effect. Once you do, though, you’ll find that Dashboard is back as usual—and any widgets you had opened on the Dashboard will still be open.

Transparent terminal windows…

datePosted on 13:12, May 25th, 2007 by Many Ayromlou

To change future Terminal windows’ transparency (0=invisible, 1=opaque) — in a shell, type this (on one line, change the 0.85 as preferred) then return:

defaults write TerminalOpaqueness ‘0.85’

Change the screenshots file format…

datePosted on 13:12, May 25th, 2007 by Many Ayromlou

To change the file type that OS X outputs when using the command + shift + 3 or command + shift + 4 (with or without the spacebar after) in Tiger launch Terminal, and depending on what file type you want outputted, type the appropriate line below followed by return:

defaults write type pdf
defaults write type png
defaults write type jpg
defaults write type tif

Quit Terminal. One caveat: You must restart your computer for the change to take effect right away. To revert to the default png format, type:

defaults write type png

as shown above, or delete the plist file in your user preferences folder (again, you need to restart). You can test out different formats, just remember to restart your computer when you are done or after each test.

Quit X11 without warning dialog…

datePosted on 13:11, May 25th, 2007 by Many Ayromlou

To quit X11 without presenting warning dialog type the following in Terminal application:

defaults write no_quit_alert true

See man page for Xquartz for more details.

Customize those tooltips…

datePosted on 13:11, May 25th, 2007 by Many Ayromlou

Tooltips are those ‘helpful’ yellow tags containing messages that sometimes appear when the mouse pointer hovers over controls in many programs. For various reasons, I sometimes find aspects of their implementation to be unsatisfactory. Fortunately, it turns out to be possible to tweak tooltip characteristics (at least in Cocoa apps) to some extent, by adding various properties to the .GlobalPreferences.plist file, or an individual program’s .plist file.

Some of the available properties (their functions are more or less self-explanatory) include:

defaults write -g NSInitialToolTipDelay -int 10000 (time in ms)
defaults write -g NSToolTipAutoWrappingDisabled -bool true (or false)
defaults write -g NSToolTipsFont -string fontname (substitute fontname)
defaults write -g NSToolTipsFontSize -int 10 (or some other font size)

Note that this will only affect programs launched after the change is made.

123... 62636465PreviousNext