Lowfokus
Archive for category Apple
No internal speakers OS X Lion
Posted by technohermit in OS X, System Preferences on 2011/09/07
I upgraded to Lion recently. It screwed up a lot of things on my Macbook Pro 2010 15″ i7, so I clean installed Lion. All has been going smoothly until today, when I came home from work and woke my laptop. Fired up Spotify, and there was no sound. Then I realized there were no internal speakers recognized. Oh boy.
It’s late so I will cut to the chase. I followed many posts in the Apple forums about permissions (always the first thing to try when something is amiss), PRAM reset, rename a plist key from false to true, etc. You can read about that stuff here:
https://discussions.apple.com/thread/3192295?start=0&tstart=0
Nothing worked. So I have an old Core2Duo 2007 mini, still with good ol’ Snow Leopard installed. I grabbed the com.apple.audio.coreaudiod.plist file from it, copied the contents and pasted them into the Lion’s com.apple.audio.coreaudiod file. Saved the file (you must do this from a sudo TextEdit session) and it worked. Probably deleting the file and rebooting would also work but I didn’t try that.
Here are the commands in Terminal to type (thanks to Chaindler from AD), followed by my contents of the working file:
1. Open Terminal
2. Type this “sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit"
3. enter your password
4. In textedit open /System/Library/LaunchDaemons/com.apple.audio.coreaudiod.plist
5. Copy all of the contents with command-a, and then paste them into a new file. Save that file as a backup.
6. Paste the following(everything between the start and end markers, but not the markers themselves):
<?xml version=”1.0″ encoding=”UTF-8″?><!DOCTYPE plist PUBLIC “-//Apple//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”><plist version=”1.0″><dict> <key>EnableTransactions</key> <true/> <key>Label</key> <string>com.apple.audio.coreaudiod</string> <key>ProgramArguments</key> <array> <string>/usr/sbin/coreaudiod</string> </array> <key>KeepAlive</key> <false/> <key>MachServices</key> <dict> <key>com.apple.audio.coreaudiod</key> <dict> <key>ResetAtClose</key> <true/> </dict> </dict> <key>UserName</key> <string>_coreaudiod</string> <key>GroupName</key> <string>_coreaudiod</string></dict></plist>
******End Marker—Do not copy this line**************************
7. Save
8. Reboot
Good luck!
There was a problem installing “Mac OS X”. Try Reinstalling.
Posted by technohermit in Apple, OS X on 2011/08/10
If you get this message after trying to clean install Lion from a USB drive (the install for me seemed to hang on my i7 MBP), you can try this as it worked for me:
1. Power off the machine.
2. Unplug the USB stick and power.
3. Replace the USB stick, but in a different USB port.
4. Hold down CMD-OPTION-P-R keys and turn the machine on (hold them until the machine reboots itself for a second BONG sound.) This resets the PRAM, if you want to google it
5. Hold down Option and select your USB installer.
Should bring you to the familiar language selection screen.
Hope that helps.
PS-Hey Apple. I applaud the diskless install, but why not let me choose clean install to begin with? Restarting and “upgrading” just broke crap. I broke more crap trying to get a fresh install. Not easy.
OS X and Reading Text
Posted by technohermit in OS X, System Preferences, Uncategorized on 2010/03/14
Apple’s OS X allows you to zoom in on your screen in a number of different ways. It also can read text to you, if you are so inclined. There are many ways to do this, depending on which hardware choice you made.
If you have a track pad on your Mac, and it supports gestures (all Intel versions do, and some late G4 PowerBooks) you can simply spread two fingers apart on the track pad to have it zoom text. To accomplish this with a mouse, If you’d like to zoom in on the entire screen rather than just make text bigger, hold down the control key (two keys left of the spacebar) and slide two fingers from the track pad’s button toward the screen. A third option is to hold down command (⌘) and hit + to make text bigger. Alternatively, command (⌘) – makes it smaller.
Even better, you can easily set up OS X to read selected text for you, using a keystroke combination that you define. It comes in handy to select some text, and then let the computer read the selected text to you as you continue to browse around a site. Naturally, if you cannot see the text to begin with, or have trouble reading from a screen for any number of reasons, this built in feature is priceless.
First, open System Preferences by clicking this icon in the Dock:
If it’s not in the Dock, open Finder, and find your Applications folder. Navigate to System Preferences and double-click to open. Once open, click the Speech icon, as shown below on Snow Leopard, it looks like a microphone:
Once there, check the box to “Speak selected text when the key is pressed”, then click on the Set Key button to create a keyboard shortcut to have the computer read text you have selected. This allows you to also deselect the text, while the computer keeps reading it, which is a pretty nice feature. You can then even navigate way from the page or text, and look at something else while you are listening to the text being read.
Virtual Box on Mac OS X
Posted by technohermit in Apple, Uncategorized, Virtualization, Windows on 2010/03/09

Oracle’s (formerly Sun’s) VirtualBox software is a virtualization software that allows you to run many operating systems on top of your OS X installation in real time. I’ve been running Apple’s Boot Camp with Windows 7 Ultimate, and decided it would still be beneficial to have an install of XP service pack 3 hanging around. I really didn’t feel like hacking Boot Camp was the best solution for having another OS on my system, so I started looking into alternatives. Surprisingly more than a few exist, although I decided on VirtualBox because, well, it’s free!
To start your installation, first download the software from the above link. Installation is as easy as a double-click, and a few prompt screens. Once complete, double-click the handy shortcut to your Applications folder, find the newly installed VirtualBox, and double-click that to start it running.
Help screens are well thought out, and tell you exactly where everything is to get started. They’ve also thrown in some nice pop-ups once you are up and running, to explain some shortcuts. More on that below. The first screen you see is the Details window, which is where you will find your various operating systems after you’ve installed them. It looks like this:
Next comes installation of your OS of choice, in this case I installed Windows XP SP2 (which I then updated to SP3 to be sure everything works properly.) There are some settings that need to be adjusted when you install, such as RAM and Hard Disk size. Simply click the “New” button in the upper left-hand corner to get started. VirtualBox walks you through the creation of the virtual machine and gives you allocation suggestions, which I modified to my liking. See screen shots below:
One thing I had to change were the video settings. XP would blue screen at the text phase of the installation on my MacBook Pro (mid-2008). I had the 2D Video Acceleration checked, and when I unchecked it, the installation proceeded without issues. You can see that the window warns you at the bottom to change a setting (Non-optimal Settings detected.)
I also changed the Video Memory to 64MB instead of the allocated 16MB. The installation went perfectly well after these minor changes, and the machine starts and shuts down promptly. Faster than a typical boot or shut down on a stand alone machine, for sure. It is also much quicker than having to log out of OS X and use Boot Camp. The price is right at $0.00, and if you find the need for Windows this might be the best solution out there on a budget.
Moving Around in Vim
Posted by technohermit in Apple, OS X, OS X Shell, Uncategorized, Unix, vi on 2009/11/19
I’ve written a couple of beginning UNIX for OS X entries, such as creating a .bash_profile and .bashrc file using vim. Here is another vim tutorial for moving around in the screen editor, so you can see just how powerful it’s commands can be.
This post will deal with mostly command mode, the default mode when you open vim (or an existing file with it.) To move the command marker around the file without entering INSERT mode consists of four basic keys. Moving to the next/previous word, to the beginning of a paragraph, etc. will require a bit more memorization.
You want to first familiarize yourself with the h, j, k, and l keys. The outer two (on a standard keyboard) move your cursor left or right one-character; h, to the left, and l to the right. j will move your cursor up to the next line, while k moves it down one line. The fact that you are in command mode means no changes are made to your text at this point. You can use the arrow keys for the same functionality, but getting used to the keys will help you keep your hands where they belong–typing and editing text.
Moving to the beginning of the current line is done by pressing O (zero). To move to the end of the current line press $. + moves your cursor to the beginning of the next line, and – moves you to the beginning of the previous line.
Next are some basic ideas for commands. Some will take a number argument, followed by a command. Some can be written with a number argument followed by another command. For example, x in command mode means delete a character. To delete a word, or the rest of a word if you are in the middle of one, you type dw. If you precede x with a number, n, vim will delete the following n characters from the line. The command to delete the next four characters would be written, simply, as 4x. To delete the next four words, you would type 4dw.
Vim is a very capable text editor once you learn more about its commands, and get used to bouncing between INSERT and command modes. Below you can find a table of common commands and their function, at least enough to get you on your way as a skilled vim user.
|
Movement Command |
Function |
|
h |
Move Left One Character |
|
j |
Move Down One Line |
|
k |
Move Up One Line |
|
l |
Move Right One Character |
|
0 |
Move to First Character Of Current Line |
|
$ |
Move to Last Character Of Current Line |
|
+ |
Move to First Character Of Next Line |
|
w |
Move to Next Word or Punctuation Mark |
|
W |
Move to Next Word |
|
e |
Move to End of Current Word |
|
E |
Move to End of Next Word |
|
b |
Move Back to Beginning of Word or Closest Punctuation |
|
B |
Move Back to Beginning of Word |
|
) |
Move to End of Current Sentence |
|
( |
Move to Beginning of Current Sentence |
|
} |
Move to Start if Next Paragraph |
|
{ |
Move to Start of Previous Paragraph |
|
Delete Command |
Function |
|
x |
Delete Current Character |
|
X |
Delete Character Immediately Left Of Cursor |
|
dw |
Delete Current Word |
|
10dw |
Delete Ten Words |
|
D |
Delete To End of Current Line (also d$) |
|
dd |
Deletes Current Line |
|
20dd |
Deletes Twenty Lines |
|
dG |
Deletes From Cursor to End |
|
u |
Undo (doesn’t work for single character deletion) |
Cron Jobs on OS X
Posted by technohermit in Apple, OS X Shell, Uncategorized, Unix on 2009/11/15
Since OS X Tiger, cron has been replaced by a utility called launchd, and three separate launch daemons. Rather than having to run crontab to manipulate scripts, they are run by launchd according to three separate directories inside of /etc/periodic.
The scripts contained in these folders are run at specified intervals by three preference files, in XML format, found in the /System/Library/LaunchDaemons folder. You can manipulate the .plist files with a text editor or Apple’s Property List Editor (if you’ve installed Developer Tools.) They are named, simply enough, com.apple.periodic-daily.plist, com.apple.periodic-weekly.plist, andcom.apple.periodic-monthly.plist. They are, by default, set to run at the same time as the old cron jobs, in the middle of the night. If you happen to shut down your Mac, it might be a good idea to change these intervals to a time when you’re sure the computer will not be shut down, as these jobs are important.
You will find a script in each of these folders called 999.local. This file is set to read-ony by default, and is for ”backwards compatibility with the old /etc/daily.local” according to the comments in the file. (I’m running Snow Leopard.) I’d recommend not modifying the scripts in the /etc/periodic folders, and creating a /etc/daily.local, /etc/weekly.local, and /etc/monthly.local file for your cron jobs, as you have the 999.local script in each of the daily, weekly, and monthly sub-directories of /etc/periodic to tell your scripts to run. Any future system updates could change the default files in those three directories, so if you modify those you may end up losing your scripts. Avoid that by setting up your own.
If you are running aTiger, the 999.local file may not exist, and you will have 500.daily, 500.weekly, and 500.monthly files inside their appropriate /etc/periodic directories. You should still create a daily.local, weekly.local, and monthly.local script file and place them in the /etc directory, and they will be called from the respective 500.* file.
Time Machine Not Backing Up Anymore? Try iBackup Instead.
Posted by technohermit in Apple, iBackup, OS X on 2009/11/08
[Check out iBackup here, if you hate to read.]
Well, what I thought was totally awesome the first time I ran it turned out to be not so good. OS X’s Time Machine let me down, and for the past three days I’ve been searching for a way to fix it. I managed to make a full backup to my FireWire drive the first time I ran it, and it seemed really cool. I am backing up to an external FireWire 400 drive, and trying to backup my MacBook Pro.
This is a notebook, and keeping Time Machine running didn’t seem like such a great thing for me. Keeping an external disk tethered to my MacBook Pro wouldn’t win any awards for mobility, for sure. I backed up, turned Time Machine off, and ejected my external drive. I was happy. A week later, I mounted the FireWire drive, and all seemed well. Turned on Time Machine, and it recognized the backup, I could flip through hourly backups, and it all looked great. I tried to run a new backup before going off to sleep, however, the next morning only 27KB had been transferred.
Obviously something went awry. No errors, no warnings, and the little backwards running icon in the menubar was still happily plugging along. What was apparent, though, is Time Machine had failed miserably. As I’ve looked deeper into this across many a forum, as well as various blogs, this is widespread and most users with difficulties such as this have moved to Snow Leopard 10.6.1. If you are running 10.6.0 and don’t have any issues with Time Machine, don’t update to 10.6.1. I did run across one cool widget that tells you Time Machines logs, called Time Machine Buddy.
I tried various things, from deleting the com.apple.timemachine.plist file in the Macintosh HD –> Library –> Preferences folder. This is a system-wide application and you won’t find a plist file in your home directory. I tried deleting the partial backup from my FireWire drive, and the alias file as well. I checked the .Trash folder on the FireWire drive to be sure there weren’t any remnants on the drive. Reboot after reboot, unmount and mount, nothing would fix it. So, as a last resort, I formatted the FireWire drive and started over. I made sure it was set up by the book. Nothing works to fix it, and the weird part is I never get an error. On my last attempt before looking into alternatives, I waited 6 hours to transfer 11KB. The furthest I ever had gotten was 5GB, which I thought would be it. Nope, stuck there for eternity. So, until Apple helps us out and gets it fixed, I’m moving on.
I found this sweet donationware application called iBackup. It doesn’t do nearly what Time Machine is supposed to, but for someone like me who just wants to backup my home folder, where my Sites, Downloads, Documents, etc. reside, it seems like it’s going to work out beautiful. 14GB of data transferred over to my FireWire drive in about 20 minutes, with no headaches. I like that. And it’s free for personal use, although I will probably throw the creator a donation because it’s what you should do when someone writes a handy application that you are going to keep using for eternity. I want them to keep publishing it, of course!
So here are some screenshots, you can read more about the Preferences and Plugins following the images (click to enlarge):
iBackup doesn’t support incremental backups, however, it does only copy items that have been modified. It uses straight up UNIX commands to copy your files, which you can see in the screenshot directly above, labeled Profile Preference 6. iBackup, on the initial backup uses the ditto command, and for subsequent backups (I’d rather they called them “synchronizations”), it uses rsync. As Apple has developers moving away from resource forks, rsync will be an easier tool to use for OS X consumers. If you hate the Terminal, this backup solution makes it quite easy to use a complicated command.
Other features I like to see, that Time Machine completely lacks, are the ability to backup to Windows hosted shares, via both AFP and SMB servers, ethernet connected drives, as well as encrypted sparse images. Quite nice. I must admit, I was going to try Time Machine down the road if I see Apple has fixed it’s problems, but something like iBackup for Mac is a product that will be tough to get me away from. Being able to use ethernet connected drives on my Gigabit network will certainly be a necessity; since I already own some LaCie drives, I never planned on buying a Time Capsule anyway.
Setup Your .bash_profile On OS X | A Sample Bash Profile
Posted by technohermit in Apple, OS X, OS X Shell, vi on 2009/11/07
This is another addition to my entry level OS X shell category. This one covers setting up a more detailed bash profile, so certain things are done by default when you open your Terminal.
We start by opening the Terminal in your ~/Applications/Utilities folder. If you don’t know what that means please start with this post, as it will show you a very basic beginning to the Terminal in OS X. Be sure you are in your home directory by typing pwd at the bash prompt and hit enter. It should look similar to this:
Next, we start vim opened to your .bash_profile. At the bash prompt type vim .bash_profile and hit enter. If the file exists, it will open it, if not it will create one for you. Your Terminal window should now look like this:
My screen shows one alias I created in my last tutorial. I like that one but technically it doesn’t belong in your .bash_profile, it belongs in a file called .bashrc. The .bash_profile is for your login shell options, and the .bashrc file is read for subsequent interactive shells; meaning a shell opened to type commands, not just to run a script from a file automatically. You can launch another shell on top of your login shell by typing the shell name at the prompt, i.e., bash, and then hitting enter.
This lesson will focus on login defaults, such as the PATH variable in your .bash_profile. In the process, we will be using vim, so if you are unfamiliar with that, practice makes perfect!
The PATH variable is where the system searches for binaries (shell scripts, programs, etc.) to execute. All UNIX systems provide a default path, but you can add to it. As you add scripts of your own creation and such, you probably want to create a directory in your home folder to store them. This way if you screw something up, it will affect you and not the system. For example, an erroneous rm command if you are in the /bin directory could be really bad news.
Let’s go ahead and first create a new directory called bin in your home directory. Create a new interactive shell by pressing ⌘-N. Type mkdir bin and hit enter. Now type ls and hit enter. You should see the new directory listed with your other folders:
This is where you can store any shell scripts that you create, as they are easy to find in this folder. In vim, type “i” without quotes to get you into INSERT mode. You will see –INSERT– at the bottom of your Terminal window. Now you can begin typing text. You should comment your script files, and your other various profiles so you know what something does if you ever need to edit. It’s just good programming practice to get the comments done as you progress with coding, not when you’re done!
To make a single line comment, the first character on the line needs to be the pound sign, #. Type in #Additional binary folders, and hit enter. Next, we set the PATH like so, to *add* to the default PATH: export PATH=$PATH:/Users/yourusername/bin
You can see in my screenshot below what the file should look like. Replace the yourusername with your actual username for your account. Mine is Tech, so that’s how it shows in my screenshot. Also keep in mind, that UNIX is case-sensitive:
Now you can save this by hitting the escape key, and typing :w then pressing enter. Let’s add some more commands to the profile. We can set a welcome message to the login, and set the shell’s timer to check for new mail. This really only matters if you use a text-only mail client, such as PINE or Alpine. It will not affect the OS X Mail client.
Set a message to display when you login with the echo command. This is a good command to know for the command line as well, as you can see certain system variable settings, such as your current PATH. You can do this by typing echo $PATH at the bash prompt and hitting enter. To use echo in your .bash_profile to set a welcome message, type echo followed by the message:
echo Welcome back, Mr Awesome! Your present working directory is: $PWD
looks like this when you log in:
To set the mail check timer, write a line in your .bash_profile like so: export MAILCHECK=30
The time set is in seconds, and OS X’s bash shell by default is set to 60 seconds. Your .bash_profile should now look similar to this:
Next time I will cover creating a simple shell script, and changing file permissions to run them. Also, I will try to cover some common aliases, as well as creating your .bashrc file, which is where we store the aliases. Thanks for reading, and if you have any suggestions or questions, please feel free to ask!
Using vim In OS X — A Text Editor Tutorial For Beginners
Posted by technohermit in Apple, OS X, OS X Shell, Uncategorized, vi on 2009/11/03
Here is a quick tutorial for people unfamiliar with text editors in UNIX. If you are just getting started with the Terminal in OS X, you probably need to create your .bash_profile and such, so that you can keep your settings upon logging out of the shell. I will show you how to create this file in a text editor called vim, which stands for vi IMproved.
Vim is a very powerful text editor, and if you have any experience in UNIX at all, you probably were shown pico, which is easier to use at first due to some of the commands being shown at the bottom of the screen as you work in pico’s buffer. In pico, there is no separation from command or input modes, also making it a bit less confusing. The buffer simply means what is shown on your screen, not yet written to disk. While a GUI text editor such as Microsoft Word or Apple’s Pages do not tell you that you are working in a buffer input mode, technically it is the same thing. If they crash, you lose what you changed if it was not saved prior to the crash.
Vim is a little obscure, yet extremely functional. You start vim by typing vi or vim at the bash prompt in Terminal. Terminal is located in your ~/Applications/Utilities folder by default on OS X. When it opens, you are by default in command mode. Vim shows you this startup screen, which has a bunch of tildes (~) on the left-hand side, and some version information in the center:
If you type something in, the startup screen goes away and the first tilde also disappears. The tilde characters simply clarify lines in the buffer. They will not print, they are just there showing you where the next lines are. Once started, you are by default in Vim’s command mode. If you type vim testfile.txt at the bash prompt, vim will open the file testfile.txt in whichever directory you are currently in. If testfile.txt doesn’t exist, vim will create the file and open into the edit buffer for you, skipping the welcome screen:
As shown in the screenshot (click to enlarge it, as with all screenshots on this blog), the buffer is in INSERT mode. By default, no matter what file you open or create, vim starts in command mode. It doesn’t ever show —COMMAND— at the bottom of the screen. Vim lets you know you aren’t in command mode by telling you that you are in INSERT mode.
To get back into command mode, which is where you will end up saving files to disk, changing the contents of vim’s 26 named buffers (consider them like the clipboard in a GUI text editor), moving around the screen, deleting lines, etc. Anything you want to do with the file besides type in text will generally be done in command mode. Let’s save this file now, so you can see how it works to get in and out of command mode.
First, hit the ESC key. On almost every keyboard ever, this will be the key at the very top-left corner of the keyboard. You should no longer see –INSERT– at the bottom of the Terminal window. Now type the following command, without the quotes: ”:w testfile.txt“. See screenshot below:
You can see at the bottom of the Terminal window that the write command was successful. You also see that three lines were written containing a total of 138 characters. You can verify the file was written by typing (again, without quotes) “:q“, and hit enter. This quits vim. At the bash prompt, type “ls” and hit enter. You should see your new file in the list of the directory. To remove (delete) the file, type “rm testfile.txt” and hit enter.
Now to create your .bash_profile, so you can save certain settings. When Terminal starts, it will read this file to load alias information, screen settings and such, if they are explained in this file. As you become more familiar with the Terminal and start to have preferences for certain things, i.e., showing hidden files when you get a list of a directory, you may want to create an alias for the ls command so it shows them by “default” because of your .bash_profile.
First, navigate to your home directory if you are not there now. You do this by typing the command “cd ~” at the bash prompt and hitting enter. Terminal will show your computer name, followed by your present working directory, and yourusername$, which is the bash prompt. You should see something like this:
Create your empty .bash_profile by typing “vim .bash_profile” and hitting enter. We will create a simple alias and save the profile. Then we will quit Terminal, restart it and verify the alias still works.
By default, the alias wouldn’t work again after you quit Terminal. If it is in your profile, it will work when you open a new Terminal, such is the point of having a profile. To type in what I show above, press the letter “i“ on your keyboard to put you in insert mode. Then type the following exactly:
dirA=”ls -lia”
Hit the ESC key, and type: “:w” to save the file. Now type “:q” to exit vim and return to the bash prompt. You can verify the file was written and it’s contents by typing “cat .bash_profile” and hitting enter:
Now quit and re-open Terminal. You should now be able to get a detailed list of your directory, showing hidden files, by typing dirA and hitting enter:
Next time I will show you how to navigate through text, delete lines and add or retrieve lines to and from the named buffers. If there are certain things you would like to learn about Terminal or vim, please leave comments below. Please also let me know if any of this could be better clarified, as I check my comments often and will respond promptly. Thanks for reading!
Common Shortcuts for OS X And Their Windows Equivalents
Posted by technohermit in Apple, OS X, Uncategorized, Windows on 2009/11/01
If you are new to OS X, there are a bunch of shortcuts that you’ll immediately recognize from Windows. If you don’t use shortcuts at all, you really are missing out, as they are much faster than using the mouse in most situations. I tout programs like LaunchBar and Colibri because they make your computer usage faster. It is no different for shortcuts built-in to the operating system, so you should really take advantage of them!
Here is a short list of the most common on both OS X and Windows:
Since Vista was launched, you can create keyboard shortcuts to your programs through the Shortcut Icons that a program creates. You do this by:
- Right-Click the shortcut icon for the program
- Left-Click Properties
- In the “Shortcut Properties” box, find “Shortcut” tab and Left-Click on that.
- Left-Click the “Shortcut Key” box., and type in a letter you want to start the program. For example, type P for Photoshop.
- The box should update to show CTRL-ALT-P, as all shortcuts created in this manner automatically must begin with CTRL-ALT.




























