Bob's Notepad

Notes on projects I have done and things I have learned saved for my reference and for the world to share

Friday, October 26, 2007

Making a back up copy of OSX Leopard install disk on a SL-DVD

I got OSX Leopard tonight and I want to make a back up copy.... but there are a lot of weird things going on in the partitioning of the disk.... Not to mention it's more than 7GB. Of course, you know, a ton of that are language packs and such that you know that you are never going to use so let's shrink it down..... After searching google and experimenting with my own knowledge I've come up with this process.

Overview: Basically you just need to be able to edit what is on the CD. Of course, CD's are not read/write and if you create an ISO, it most likely will only mount read only. What we're going to do is create an brand new image that is read/write and then we'll dump what's on the entire DVD onto that image. Once we're in that position, we can delete things we don't need on the install CD. Once we have it the way we want it, we'll create another image for a 4.7GB DVD and copy it over to that.... then we can do what we want.

  1. Insert the OSX Leopard DVD
  2. Open Disk Utility
  3. Create "New Image"
    • Name can be anything
    • It's easiest to save on your desktop
    • Size: 8.0GB (Dual Layer)
    • Encryption: None
    • Format: Spare Disk Image

  4. Click the image you just created and then click the "restore" tab for that.
    Drag the "Mac OSX Install DVD" image into the source and then drag the image you just created into the destination field.
  5. Click Restore
  6. Go grab a soda . . . Take a Nap . . .
  7. Create an "Extras" folder (or whatever you want to name it) on your desktop. We will use this to dump things to that we don't need on the first install procedure.
  8. In Finder, go to to "Go To Folder" option under the "Go" menu and type in "/Volumes/[image name]/System" and click go. (Of course, replace image name with whatever you named your 8.0GB image above)
  9. Go into the Installation folder and then into packages and delete what you don't need and move what you may need later but not immediately (Language packs, printer drivers, etc can safely be deleted or moved to your extras).
  10. Drag the "Optional Installs" folder from the top of the CD tree into the extras folder you created above and delete from your image (we'll dump this to another DVD later, if desired)
  11. Empty your trash and then "Get Info" for your mounted image. If it's less than 4.5GB or so, continue... if not, go back and delete/move some more.
  12. Create 2 new images with the same settings as at the beginning of this how-to except both of these should be 4.7GB Single Layer DVD size (leopard-disc1 and leopard-disc2 would be good names for these). If you are an advanced user, you can create the size as custom and fill in variables that would hold the specific data that you have created - this would create smaller image files for archival purposes.
  13. Drag anything you dumped in to the extras folder into the disc2 mount in finder
  14. Click on your disc1 image in disk utility and click the restore tab.
  15. Repeat the same thing as we did above except your source is the image that we just deleted the extras off of and the destination is your disc1 image.
  16. Take another nap . . . You'll be well reseted for the install :)
  17. You can now burn directly from those 2 images.

Theoretically, If you want an ISO image, you can get DMGConverter ( and use that to convert your sparseimage files to DVD/CD Master files and then simply rename those with an ISO extension.

Labels: , , , ,

Reference Link

Monday, October 22, 2007

Automated SSH login using keys

I always seem to forget how to do this when I need to. When setting up an automated backup you obviously don't want the script to ask for a password so you set up a key pair.

Machine sending the backups (must be logged in as the user that will be doing the backups):

  • ssh-keygen -t dsa -b 2048 -f /any/directory/filename

Then you copy the resulting file (NOT the file with no extension) to the authorized_keys file on the receiving machine in the .ssh directory under the user that will receive the backups. If the authorized_keys file doesnt exist, just rename the file you copied... if it does exist, append it to that file.

If your using rsync, use this command:

rsync -e 'ssh -i /any/directory/filename' source/ user@host:/destination/

Labels: , , , , ,

Reference Link

Using WGET to retrieve all files of a certain type

wget -r -l1 -H -t1 -nd -N -np -A.mp3 -erobots=off -i ~/mp3blogs.txt

And here's what this all means:

-r -H -l1 -np These options tell wget to download recursively. That means it goes to a URL, downloads the page there, then follows every link it finds. The -H tells the app to span domains, meaning it should follow links that point away from the blog. And the -l1 (a lowercase L with a numeral one) means to only go one level deep; that is, don't follow links on the linked site. In other words, these commands work together to ensure that you don't send wget off to download the entire Web -- or at least as much as will fit on your hard drive. Rather, it will take each link from your list of blogs, and download it. The -np switch stands for "no parent", which instructs wget to never follow a link up to a parent directory.

We don't, however, want all the links -- just those that point to audio files we haven't yet seen. Including -A.mp3 tells wget to only download files that end with the .mp3 extension. And -N turns on timestamping, which means wget won't download something with the same name unless it's newer.

To keep things clean, we'll add -nd, which makes the app save every thing it finds in one directory, rather than mirroring the directory structure of linked sites. And -erobots=off tells wget to ignore the standard robots.txt files. Normally, this would be a terrible idea, since we'd want to honor the wishes of the site owner. However, since we're only grabbing one file per site, we can safely skip these and keep our directory much cleaner. Also, along the lines of good net citizenship, we'll add the -w5 to wait 5 seconds between each request as to not pound the poor blogs.

Finally, -i ~/mp3blogs.txt is a little shortcut. Typically, I'd just add a URL to the command line with wget and start the downloading. But since I wanted to visit multiple mp3 blogs, I listed their addresses in a text file (one per line) and told wget to use that as the input.

Labels: , ,

Reference Link

Tuesday, October 02, 2007

Blank DVD Compatibility

Every now and then I run into someone who is wondering why their burnt DVDs aren't playing in their player. Each time this happens I always go nuts trying to find the site that lets you search for DVD models and see what other user's have been using as far as media types and brands.

This is it:

Just a note from my experience -- As a rule of thumb, the less you pay for a DVD player, the more likely you are to be able to play the larger majority of blank DVDs. The cheap Target and Wal-Mart specials from CyberHome and Apex generally play whatever you throw at them and they usually support the most data formats (such as MP3, SVCD, VCD, etc).

Labels: , , , ,

Reference Link