Archive for the ‘OS-X’ Category.

Push SSH public keys to multiple host

I’m starting a new job where I need to have my SSH keys pushed to hundreds of Red Hat servers. The special sauce is a command called ssh-copy-id. However, using this command requires you answering a (yes/no) question, then shortly thereafter enter your password. Painful. Here’s how push your keys without the pain.
Continue reading ‘Push SSH public keys to multiple host’ »

Somewhat obscure OS-X keyboard shortcuts

I love these various shortcuts.  Most are somewhat obscure, or at least were to me.

To open Quick Look in full screen mode

 Command+Option+Y

To open a new Finder window (with no other finder windows open.) Hold down Command and Command + Tab until you get to the Finder. Once the Finder is highlighted, and with Command still held down, hold the Option key and then release the Command key. It’s easier than I make it sound. This will also work in other Apple apps, but if there are existing windows, it will take you to them rather than create new ones.

press Command - Tab to Finder - press Option - release Command

In Finder, to go to a specific path (Tab Completion works here too.)

Command+Shift+G

In Safari, Mail, and probably most Apple apps, you can lookup a word in the built in Dictionary.

Command+Control+d

In Terminal, if you hold the Option key, your cursor will turn into a small cross. You can then place your cursor anywhere in the command line. This is a great feature.

This isn’t a keyboard shortcut, but it is quite handy. To open a man page in preview.

man -t bash | open -f -a /Applications/Preview.app

Go forth and prosper with your newfound knowledge..

SSH Tips

SSH is one of those things I use every day, and maybe what I use most throughout the day. These are either things I didn’t know (escape sequences), or haven’t looked into before.

To get to the SSH escape sequences, you need a new line, followed by ~ and ?. That’s a newline (return), followed by a tilde and a question mark. This is what you get

Supported escape sequences:
  ~.  - terminate connection (and any multiplexed sessions)
  ~B  - send a BREAK to the remote system
  ~C  - open a command line
  ~R  - Request rekey (SSH protocol 2 only)
  ~^Z - suspend ssh
  ~#  - list forwarded connections
  ~&  - background ssh (when waiting for connections to terminate)
  ~?  - this message
  ~~  - send the escape character by typing it twice
(Note that escapes are only recognized immediately after newline.)

There are a lot of interesting things you can do with this. My favorite being if you ssh to host1.cainmanor.com then ssh to host2.cainmanor.com and then ssh to host3.cainmanor.com and host3.cainmanor.com locks up, you can newline ~~~. and the third session will be closed.

But wait!! There’s more
Continue reading ‘SSH Tips’ »

Force your Mac to boot into 64 bit mode

UPDATE…

Not all Macs that are capable of booting a 64 bit kernel will boot the 64 bit kernel. The Mini is one of those… (This is from Apple.) Getting those machines NOT on the list to boot into a 64 bit kernel is possible, but it’s beyond the scope of this article (it involves editing your boot.efi.)

Mac Pro (Early 2009)
Mac Pro (Early 2008)

Mac Pro (Original)  
iMac (Early 2009) 
iMac (Early 2008) 
iMac (earlier models)  
Mac mini (all models)  

Continue reading ‘Force your Mac to boot into 64 bit mode’ »

Record encrypted cable channels using your Mac

In Seattle, Comcast has been moving most of the channels from unencrypted QAM to encrypted QAM. That means that things I used to be able to record with my EyeTV and HD Homerun setup no longer work. I’ve heard rumors that you could install the Apple firewire SDK and record using the FireWire output of your cable box, but that seemed like a lot of work, and not very well supported.

Enter FireRecord. It makes it much simpler, but with caveats. To use it…

  1. Plug a firewire cable between your Mac (I use an older, slow Intel Mac Mini hooked into a QNAP Nas for storage) and your cable box. This is designed for most standard cable boxes – the FireRecord site has more information on supported boxes.
  2. Download and install FireRecord.
  3. Run the program, pick a channel and set the start and end time.
  4. Once the recording is done, you have a large file with a .m2t extension.  You need to massage it before it very usable.
  5. Download MPEG Streamclip. There are other solutions for the Mac, but they cost quite a bit more. I’ve not found a free solution.
  6. You need to install the QuickTimeMPEG2.component, which you have to purchase from Apple (~ $20/US.) When I ran the install program it said that I needed to install Rosetta for the program to run. Rather than do that, you can drill down into the package and find the file. It lives in the package as Archive.pax.gz. If you copy that file to your desktop, you can uncompress it by double clicking the file. Once you’ve got the resulting QuickTimeMPEG2.component file, just copy it to /System/Library/QuickTime (you’ll need to authenticate before copying it over.)
  7. Now you can use MPEG Streamclip to export the video to other formats.

That’s it. It’s crazy easy.

There are caveats

  1. You don’t get a guide. You need to know what channel and what time your program is.
  2. You can’t watch anything else while recording. The firewire port spits out what’s on your television. The flip side is that anything you can watch on TV you can record, even premium channels (not tested yet.)
  3. The resulting file is only tagged with the file name you gave it (i.e. Discover.m2t.) No fancy file tagging like you get with EyeTV, but a pass through MetaX can fix that.
  4. (NEW) Apparently you can’t turn off your cable box or your Mac will have trouble finding the device when you power it back on.