Bob's Notepad

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

Saturday, August 09, 2008

OSX is refusing to eject a CD

I had an ordeal tonight..... I needed to burn an ISO to a blank CD so I put a, what I assumed was blank, CD in my MacBook and Toast informed me that it was not writable. What was it? Some Windows CD, I guess. The problem was my machine refused to eject it. I clicked the eject button multiple times (both on the keyboard and in finder) and it just wouldn't do anything. I figured if I did a reboot of the machine I could eject it when it came back up -- wrong. Whatever was going on on this CD was confusing the hell out of OSX. After the reboot finder never loaded for me and half of my typical start up applications got stuck during boot up. I happened to have Disk Utility in my dock so I tried to open that and, again, no luck.

First thing to try (did not work for me):
  • Put the computer into sleep mode
  • Press the eject button on the keyboard


Second thing to try (this worked for me):
  • Power down your mac
  • Hold the mouse button (or trackpad button) down
  • While holding the button press the power button
  • After 30-120 seconds your mac should eject the CD
  • Let got of the mouse button and the machine should boot the OS


I will now list the three biggest wishes I have for Mac computers and despite how small and petty they seem they make a night and day difference to me (Please, Steve Jobs, take note):
  1. CD-Rom eject button and/or emergency pin hole
  2. Hard drive activity light
  3. Network (NIC) lights for activity and link

Labels: , , , , ,

Reference Link


Wednesday, November 07, 2007

100 Mac OSX Applications

Someone I've been following on Twitter posted a great list of his 100 top applications for Mac OSX. I wanted to link back to him from here. Click on the "Reference Link" at the bottom of this post.

Labels: ,

Reference Link


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 (http://www.versiontracker.com/dyn/moreinfo/macosx/32275) 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


Saturday, September 08, 2007

MythMusic with iTunes

Now that I am putting more effort into MythTV being the control of entertainment in my house, I've begun working on the MythMusic application. Currently I use iTunes on my iMac for my music library which syncs with my iPod and scrobbles tracks to Last.fm. The last thing I want is another application that I need to keep synced. Here are things I found to make life a little easier/

Trick #1: Share your iTunes Music folder via NFS

On my Mac I moved my iTunes store folder to /music-lib/ rather than the directory it uses by default. My primary reason for doing this was nothing more than the default folder contains a space in the name and this makes things a little harder for NFS. Once all your MP3 files are there, we need to set up the NFS share.... which really isn't all that hard. I used the following guide to do this:
http://mactechnotes.blogspot.com/2005/09/mac-os-x-as-nfs-server.html

Note: On Windows you could substitute this process to use Samba and adjust accordingly

Now you need to mount that share on all applicable MythTV machines. Currently I use Mythbuntu and I have a primary backend machine and 2 front end only machines. First thing you'll need to do is "apt-get install nfs-client" to allow Mythbuntu to connect to an NFS share. Once that's installed, create an empty directory to mount your music in. I created /mnt/music/ for my systems. Now add the following line into your /etc/fstab file on all of your myth machines:

SERVER:/music-lib /mnt/music nfs
(Substitue SERVER with your iTunes' machines IP address and adjust the share names as needed)

Now what's left is to go into the mythmusic settings and change the recordings directory to /mnt/music.

You're ready to listen to music!

Trick #2: iTunes Playlists

So MythMusic has an extreme lack of intuitive playlist editting.... actually, you can't even call it a playlist editor. I want an easy was to use my iTunes playlists. Two people have done an amazing job at a perl script that takes care of a conversion and imports the iTunes playlists into your mythconverg database.

http://www.mickelson.org/2006/11/07/mythmusic-mac-os-x-and-itunes/
http://simonster.com/mt/archives/000038.html

Grab that perl script and throw it on the machine that serves as your mythtv backend. On mythbuntu you need to install XML:Parser which can be done by "apt-get install libxml-parser-perl". Edit the variables at the top of that script and do a chmod +x on the perl script. If you have multiple machines, you will need to run the script different times with the hostname set as each of the myth machines you want the playlists to be active on.

Before you run that script, you need to make sure the iTunes library XML file is in your music-lib directory. I renamed mine to exclude spaces and then copied it to the music-lib directory on my iMac.

Run the script and you should now have playlists in MythMusic.

Trick #3: Automate Trick #2

I have a lot of smart playlists and I am often creating new playlists and, of course, always adding new music to my library. I don't want to have to do this everytime I make an update so I automated the process. I created a script on my iMac to copy the "real" iTunes XML file into the music-lib directory every hour. OSX has dropped the use of cron and replaced it with launchd. Here is a guide you can use to get this set up:
http://www.macdevcenter.com/pub/a/mac/2005/11/15/terminal5.html?page=3

Once that's set up, you need to set up a crontab on your myth system(s) to run the perl script. If you do this hourly, make sure you set your iTunes computer to copy the file before the crontab runs on your myth machines. For instance, make your itunes machine run on minuet 05 and the myth machines run on 08.

Now you're set.... things should automatically update for you.

Trick #4: Scrobble to your Last.fm account

I use Last.fm an awful lot and if I start using MythMusic over iTunes, I lose that scrobbling. I have not completed this yet (or even really began looking at it) but here is a link where you can get a patch. I need to figure out how to apply this on an active mythbuntu system. I'll report back when/if I come up with something :)

http://yaron.org/mythscrobbler/

Labels: , , , , , ,

Reference Link


Tuesday, June 26, 2007

Target Disk Mode (Macintosh)

For the last few days I have been pissed about not being able to boot an iBook from a USB CD-Drive. Apparently this is only possible by using a firewire external drive. The bigger issue is that God forbid anywhere local have a firewire IDE enclosure... hell, I had a hard enough time finding a firewire cable......
.... Then I learned about something that I will gladly trade the ability to boot from a USB drive. This little gem is called "Target Disk Mode". The uses of this are really endless. Basically any drive in a macintosh computer can be used as an external firewire drive. Yes, you can do backups of your hard drive this way..... AND it allows you to use the DVD drive of another macintosh as a firewire drive.... which means if you have an ibook with a dead optical drive, you can use the drive from another mac by starting that mac in this mode.

1. Make sure that the target computer is turned off. If you are using a PowerBook or iBook as the target computer, you should also plug in its AC power adapter.
2. Use a FireWire cable (6-pin to 6-pin) to connect the target computer to a host computer. The host computer does not need to be turned off.
3. Start up the target computer and immediately press and hold down the T key until the FireWire icon appears. The hard disk of the target computer should become available to the host computer and will likely appear on desktop. (If the target computer is running Mac OS X 10.4 Tiger, you can also open System Preferences, choose Startup Disk, and click Target Disk Mode. Then restart the computer and it will start up in Target Disk Mode.)
4. When you are finished copying files, drag the target computer's hard disk icon to the Trash or select Put Away from the File menu (Mac OS 9) or Eject from the File menu (Mac OS X).
5. Press the target computer's power button to turn it off.
6. Unplug the FireWire cable.

Labels: , , ,

Reference Link


Sunday, June 24, 2007

Macintosh Boot Commands

I always seem to forget these so I'm putting them here so I know where to find them next time I forget :)

Command-S Boot into Single User Mode
Command-V Boot using "Verbose" mode (shows all kernel and startup console messages)
X Reset startup disk selection and boot into Mac OS X Server
Shift Boot into "Safe Boot" mode, which runs Disk First Aid. A reboot will be required afterward.
Option Boot into Open Firmware to select a boot device
Command-Option-Shift-Delete Bypass internal harddrive on boot
T Boot into Firewire target disk mode
C Boot from the internal optical drive
N Start from the Network (NetBoot)
Command-Option-P-R Reset Parameter RAM (PRAM) and non-volatile RAM (NVRAM)
(mouse button) Eject (internal) removable media

ALSO: if you use open firmware password... you'll need this:
Startup Manager -accessed by pressing the Option key during startup
Enter commands after starting up in Open Firmware -press Command-Option-O-F key combination during startup.

http://docs.info.apple.com/article.html?artnum=106482

How to troubleshoot a computer with Open Firmware Password enabled
If you cannot access the Open Firmware Password application and need to troubleshoot your computer by:

Resetting the PRAM
Starting up in Single-user mode
Starting up in Verbose mode
Starting from CD-ROM

Then follow these steps:

Start up into Open Firmware by pressing and holding the Command-Option-O-F key combination during startup.
At the Open Firmware prompt, type: reset-nvram
Press Return.
When prompted for your password, enter it and press the Return key. It responds OK.
At the Open Firmware prompt, type: reset-all
Press Return.

The computer restarts and you are now be able to reset the PRAM and startup in Single-user mode, Verbose mode, or from CD-ROM.

Labels: , , ,

Reference Link


Sunday, March 11, 2007

Time Zone Updates

http://tf.nist.gov/general/dst.htm

Thanks to the all-knowing official-type people, they have made the world a better place by making us start DST three weeks early. Apparently none of these people realize that

1> This DOES NOT change the amount of daylight we have so their energy saving reason is mute

2> Computers have been programmed a certain way for years.... We should have anticipated the whole Y2K thing because its a numerical science... we COULDNT have anticipated whack-jobs changing the way our world runs.

At any rate, almost all of my servers and workstations updated flawlessly including Windows, Mac OSX, and Linux machines. A few, however, didnt -- mostly because they weren't running any type of automatic updates.

For my MythTV system (Debian based -- should work the same on other debian/ubuntu systems) I just downloaded a new tzdata deb file and installed it. Get the file from http://packages.debian.org/testing/libs/tzdata and then install it with "dpkg -i tzdata*"

I administer a RHEL4 machine (one of the last remaining -- someday it will become ubuntu, I swear) which did not do the update. Don't bother going to Red Hat's site... they step you through God knows what to accomplish something that really is not that hard.... oh, and God forbid their help page give you a link to the file -- you only get ease of use if you give them all your money. Anyway, get this file from rpmfind: ftp://rpmfind.net/linux/fedora/core/updates/6/i386/tzdata-2007c-1.fc6.noarch.rpm (yes, I am aware it's a fedora core rpm but it works quite well and you dont have to give Red Hat all your money). Once you have that file, run "rpm -i tzdata*" and once that completes, run "system-config-date" ... just reselect your timezone and exit and you're all set.

I don't see any reason why the above RHEL instructions won't work on other fedora, RHEL, or CentOS systems -- but I can't confirm.

Also, if you have a FreeBSD system, check this out: http://www.freebsd.org/cgi/cvsweb.cgi/ports/misc/zoneinfo/. I don't have any FreeBSD boxen but I found this link and figured I'd post it as well.

Mandrake/Mandriva users should be able to just do an update through urpmi ... but again, I don't have any of them boxens so I can't confirm :)

Windows: http://windowsupdate.microsoft.com"

Mac OSX:

  • Go to the Apple menu
  • Select Software Updates
  • Look for "Daylight Savings Time" update
  • Install it



Now I'm going to go enjoy my not-extra-hour-of-sleep.

Labels: , , , , ,

Reference Link


Tuesday, March 06, 2007

Linking to QTSS media from a webpage

So when you're using a QTSS server the best way to deliver your content is using RTSP... the problem is that browsers on windows do not understand the rtsp:// protocol by default so your viewers will have to take a bunch of different steps to get it to run -- which isn't good.

After searching the web for an easy solution to this problem, I found a trick that is almost too easy. Simple create a text file with a .mov extension and include a single line in that file:

RTSPtextRTSP://server/file.ext

Whenever Quicktime loads that mov file, it will realize that it is directing it somewhere else and automatically load the content from that file name.

Labels: , , , ,

Reference Link


Thursday, February 15, 2007

VPN for OSX and Windows with IPCop

I've found the easiest way to set up a VPN is to, first, use IPCop as your firewall/router. IPCop is an free linux distro that you boot the install CD and it automagically turns an old PC into a full function router and firewall.... It also has SNORT Intrusion Detection so you can download new IDS rules from snort.org and have it automatically filter traffic for spyware, intrusions, etc.

IPCop also has VPN services built in... the problem is: Windows is retarded. Windows does not behave the way standard VPN clients should so the easiest way to create a VPN is to use OpenVPN. There is a third party plugin at www.zerina.de that you can painlessly use to install an OpenVPN server. Put the tar.gz file on your IPCop box, extract it, and run the install script.... next thing you now, you have a configuration panel in your IPCop GUI (web configuration) to adjust the settings. All you need to do then is go to that panel, generate a certificate, and then generate certificates for each person that you want to access. Each person you will want to add as a roadwarrior (host to net) and then fill in a name for the connection and a password.

UPDATE 06/03/09 -- The latest Zerina installer package is restricted to IPCop version 1.4.18 but it does work on 1.4.21. All you need to do is edit the install script after unpacking and on line 46 you will see if [ ! "`echo $IPCOPVERSION | grep "1.4.18"`" ] -- just change that version number to 1.4.21 (current IPCop version as of this update). Follow everything else as normal

Once you add a connection and are back at the main OpenVPN Screen, click the first icon to the right of the connection to download a zip file that contains the certificate as well as a configuration file.

The best part is -- there are clients for Mac OSX and Windows that work painlessly. Here are the short howto's for each:

***WINDOWS***:

Step One:

Download the following file:
http://www.openvpn.se/files/install_packages/openvpn-2.0.7-gui-1.0.3-install.exe

Step Two:

Run that installation program and accept defaults for everything. Windows will warn you about a driver that has not passed the windows certification -- just click "Continue Anyway".

Step Three:

You will need a certificate generated if you have not received one already. The certificate will be contained in a zip file. There will be 2 files inside of that file and they will need to be put inside C:\Program Files\OpenVPN\config\ --- If you need to know how to do this, just double click the zip file and leave that window open. Then go to "My Computer" and select "Local Disk C:". Inside there you should see a Program Files folder. Open that and look for the OpenVPN folder -- then inside that look for the config folder. Open the config folder and then drag the 2 files from the zip file into this folder. Once they are in there, close all windows.

Step Four: Connecting

You're ready to connect to the VPN. In the tray by the clock in the lower right corner, you will see a new icon that will look like 2 computers with red monitors. The red indicates that you are not connected. Click the right mouse button on this icon and select "Connect" ... A window will pop up and ask you for your password. Enter your password and click OK. You will see the window do a bunch of stuff and then dissappear. You may or may not see a balloon window pop up saying you are connected.

Step Five: Use It


MACINTOSH OSX:

Step 1: Download Tunnelblick at http://www.tunnelblick.net/Tunnelblick-Tiger-2.0.1.dmg

Step 2: Open the DMG file to mount the image

Step 3: Run the "Tunnelblick-Complete.mpkg" file and follow the normal installation procedures

Step 4: Open finder and open the directory of your user name on the left side (usually the icon under the "desktop" icon). Open the "Library" folder. Create a new folder called "openvpn"

Step 5: Unzip the contents of your license file and place them in this new openvpn folder

Step 6: Rename the user-TO-IPCop.ovpn file to "openvpn.conf"

Step 7: You should see the tunnel icon on the menu bar next to the time. Click that icon and a menu drops down. Tell it to connect and it should ask you for your password (the password you gave your admin when creating your license file). You can save the password to your keychain file if you would like - but note this is less secure.

Step 7: If you see the "light at the end of the tunnel" in that icon, you are connected.

Links:

Labels: , , , ,

Reference Link