Nov
10
2008
0

Creating ISOs in Mac OS X

Here are step by step instructions on how to create an ISO from a CD or DVD in Mac OS X.

First, insert the CD/DVD and open terminal.

Type in:

drutil status

Your results may vary, here is what I see.

Last login: Mon Nov 10 09:45:51 on console
JBMac:~ John$ drutil status
 Vendor   Product           Rev
 MATSHITA DVD-R   UJ-857E   ZA0E

         Type: CD-ROM               Name: /dev/disk1
     Sessions: 1                  Tracks: 1
 Overwritable:   00:00:00     blocks:        0 /   0.00MB /   0.00MiB
   Space Free:   00:00:00     blocks:        0 /   0.00MB /   0.00MiB
   Space Used:   05:10:14     blocks:    23264 /  47.64MB /  45.44MiB
  Writability:

JBMac:~ John$

The part we are interested in is Name: /dev/disk1
If your drive is not /dev/disk1, you will need to use your drive’s name.

We now need to unmount the drive, this is done by typing:

diskutil unmountDisk /dev/disk1

You should see something like:

JBMac:~ John$ diskutil unmountDisk /dev/disk1
Unmount of all volumes on disk1 was successful
JBMac:~ John$ 

Now all we need to do is create the iso file. To do this we use the utility dd.

dd if=/dev/disk1 of=outputfile.iso bs=2048

Depending on the size of the disk, this may take some time. Once complete, you should see something along the lines of.

JBMac:~ John$ dd if=/dev/disk1 of=outputfile.iso bs=2048
26717+1 records in
26717+1 records out
54716928 bytes transferred in 60.473826 secs (904803 bytes/sec)
JBMac:~ John$

And your ISO file should be created. Test it with finder or using hdid in the terminal

Written by John Burns in: Mac OS X Tips |
Nov
04
2008
0

Screenshots in Mac OS X from the terminal

Following on from yesterdays post about screen shots, if you want to script a screen grab, the following command will work.

screencapture ~/Desktop/filename.jpg

Remember that you can get the list of options by using man:
man screencapture

Written by John Burns in: Mac OS X Tips |
Nov
03
2008
0

Screenshots in Mac OS X

The following key-presses will take a screen grab and save it to the desktop.  Add CTRL to the mix to save it to the clipboard for later pasting.

Full Screen
Command-Shift-3.

Selected Area
Command-Shift-4 Then click and drag to select the area to capture.

Selected window
Command-Shift-4 Then [space] Then click the window to capture.

Written by John Burns in: Mac OS X Tips |
Nov
02
2008
0

Flush DNS Cache on Mac OS X

Go to a terminal window and type:

dscacheutil -flushcache

Written by John Burns in: Mac OS X Tips |
Nov
01
2008
0

Editing your hosts file in Mac OS X

So you need to edit your hosts file?

It’s path is /etc/hosts but being a system file, you’ll need to use sudo to get to it.

Open a terminal and type:

sudo vim /etc/hosts

Now, you’re using the vim text editor.  Press i to go into insert mode.  You will know you are in insert mode because of the — INSERT — at the bottom of the window.

Make your changes and hit ESC to exit insert mode.

:w[enter] will write the changes to file.
:wq[enter] will write the changes to file and quit.
:q[enter] will quit if no changes have been made.
:q![enter] will quit and ignore changes that have been made.

Job done

Written by John Burns in: Mac OS X Tips |