Receiving Faxes in OSX
Today I setup a shared Fax modem on our OSX Server. Attached a USB modem and it recognized it just fine. Sending faxes was working great, but I couldn't get it to receive. No matter what I tried, it just wouldn't recognize that the phone line was ringing. According to Google a few other people had the same problem, but there were no solutions. So I dug around and found the problem. My modem was showing up as /dev/tty.usbmodem246802461. However, OSX expects it to be at /dev/tty.usbmodem. I couldn't find anywhere to configure it. I tried creating a symlink to it, but that didn't work. So what I ended up doing was modifying /usr/bin/fax and changing lines 37-38 from:
DEV=cu.usbmodem DEVANSWER=tty.usbmodem
To:
DEV=cu.usbmodem246802461 DEVANSWER=tty.usbmodem246802461
Then killed the efax process and now it works. WTF Apple?
MacBookPro "clunk" Solved! 2
Ever since I got this MacBookPro (15" Rev A. 7200 RPM HD) I had noticed the harddrive makes a "clunk" sound. Not really a click, it almost sounds like a marble dropping on a table. Coincidentally, some things like youtube videos would periodically freeze for no reason. I had tried all kinds of things over the years and nothing helped. People in forums have talked about it, some said it's normal, some said your drive is about to die. Well I just found hdapm!
I used that to set the APM (power management) to max performance and all my problems have gone away. Some tasks even seem a little faster, but it could be my imagination. Apparently, the OSX power management "better performance" doesn't really set true max performance on some hard drives. What was happening is the read head was periodically trying to park even when disk access was happening. So it was parking and then unparking right away. It does that to try and save power. Well my laptop is almost always plugged in, so I don't really need that.
ruby-nxt in MacTech Magazine
Check this out, MacTech did an article on using the LEGO MINDSTORMS NXT on a mac and talked about ruby-nxt. Even linked to my website. Unfortunately, they spelled my name wrong! :)
Ruby on Rails OSX Console Aliases 2
I found that every day when I goto work in the morning I do the same things whenever I go to work on a rails project:
- open firefox
- open iTerm
- cd ~/Code/railsprojectx
- mate .
- script/server
- open another tab in iTerm
- svn update
- goto http://localhost:3000
Sure it only takes a few seconds, but it wasn't very DRY. :) I figured I could create a shell alias to basically reduce all that to a single command. I also thought I'd finally start giving mongrel a try. So this is what I came up with for an rdev command (along with a bunch of my other rails related aliases):
alias rdev='svn update;mate .;mongrel_rails start -d;sleep 2;open http://localhost:3000;tail -f log/development.log'
alias ss='script/server'
alias sc='script/console'
alias sg='script/generate'
alias sp='script/plugin'
alias sr='script/runner'
alias rt='rake test'
alias rtu='rake test:units'
alias rtr='rake test:recent'
alias mr='mongrel_rails start -d'
alias mrs='mongrel_rails stop'Just stick that in your ~/.profile file and either reopen your console or run:
. ~/.profileBluetooth Serial Port To NXT in OSX 3
Some people have been confused as to how to use ruby-nxt in OSX. Some of the confusion was that I had posted instructions which only allowed connection FROM the nxt to the mac where the mac is the slave. To use ruby-nxt you need to initiate a connection from the mac to the NXT where the mac is the master. Here's some "simplified" step by step instructions:
- Turn on the NXT and make sure bluetooth is turned on. (you should see a bluetooth icon at the top left corner)
- Click the bluetooth icon in the menubar, select "Setup bluetooth device".
- When it asks for Select Device Type, choose "Any device".
- Select the NXT from the list, click continue.
- The nxt will beep and ask for a passkey, choose 1234, press orange button.
- click continue in osx, enter 1234.
- The NXT will beep again, press orange button to use 1234 again.
- The mac will complain "There were no supported services found on your device". Don't worry about that and click continue and then click Quit.
- In OSX click the bluetooth icon, select "Open bluetooth preferences", you should see the NXT listed, select it, then click "Edit Serial Ports".
- It should show NXT-DevB-1, if not click add, use Port Name: NXT-DevB-1, Device Service: Dev B, Port type: RS-232. Click Apply.
- You're done! You should now have a /dev/tty.NXT-DevB-1
Mindstorms NXT Bluetooth on OSX 7
Lego released the Mindstorms NXT Developer Kit today! I was bummed when I found out that the software that comes with it for OSX is PPC. Apps running under Rosetta are unable to access bluetooth so I couldn't play with in on my Macbook Pro. Now that the dev kit is available I plan on writing a ruby module to communicate with the NXT via bluetooth. First I had to figure out how to access it via a bluetooth serial port.
When I first got my NXT and found bluetooth no worky in NXT-G, I tried creating a serial port and connecting to it. It would connect, and show up as being on connection 0 on the NXT and no matter what I did, I couldn't get a message to show up in OSX. Connection 0 means the NXT thought it was a slave. It should still be able to send messages to it's master, yet I get nothing. Connections initiated on the NXT to the computer always came up Line is Busy.
I finally made a breakthrough today. I was doing some research and found that you can create an incoming bluetooth serial port and then connect to my computer from the NXT. Here's the steps:
Pair the NXT with OSX.
Go into the Bluetooth Preferences, Sharing tab and Add Serial Port Service. Give it a name (I made it NXT-Master). Set Type to RS-232. This will create a /dev/tty.NXT-Master device.
Open the device in OSX (this is important, otherwise you'll get a Line Is Busy message on the NXT) Just doing a cat /dev/tty.NXT-Master in a terminal will do it.
On the NXT, goto Bluetooth, My Contacts, Select your computer, Connect to whatever connection number you want.
Run a program on the NXT that sends a message to whatever connection number you chose.
Woot! The message should show up in terminal.
Flash on MacBook Pro = SLOOOOOW Audio Recording?
Here is a recording of me saying “This is a test. Testing, testing, 1, 2, 3”.
Why the hell does my voice sound like this when I record something using flash on my MacBook Pro? I think it has something to do with the Universal Flash plugin?
I’m trying to learn flash and flash communication server and I’m having the same problem. Yet it works fine on my mac mini. Driving me crazy until I remembered odeo was doing a flash based recorder too. Sure enough, happens here too.
Update: I figured out the problem. Run /Applications/Utilities/Audio MIDI Setup and change the Audio Input format on the Internal microphone to 44100.0 Hz. It was at 96000.0 Hz. I'm not sure if it was like that by default or got changed somehow.
SubEthaEdit for free
Check out BLOGZOT 2.0 on MacZOT.com. They’re running some kind of promotional thing where if enough people blog about it, they’ll give away 3,000 copies of SubEthaEdit from CodingMonkeys for free. That means MacZOT and TheCodingMonkeys will award $105,000 in Mac software. Even if enough people don’t blog about it, they’ll still offer it at a discount. I’ve used SubEthaEdit a few times using the free trial, but never enough to justify paying for it. With this promotion I just might get a copy. :)
Apple to 'Switch' to Windows? 1
Right. And Pigs to 'Fly' Out of My Arse.
Dvorak, stay away from the brown acid, man.
This is so preposturous, is it even worth debating? One thing you have to admit, Dvorak is great at getting attention. This article he wrote is going to be huge and everyone will be talking about it for some time, I'm sure.
Firefox ProfileManager in OSX
As a developer I often need to have seperate Firefox sessions open. In Linux all I had to do was change the command to run firefox with the -ProfileManager switch. Unfortunately it's not that easy in OSX since the icons in the Dock don't have commands behind them.
For a while I got by with running a shell script from the terminal, but that wasn't very nice. What I ended up doing was creating an apple script with the following line:
do shell script "/Applications/Firefox.app/Contents/MacOS/firefox -ProfileManager &> /dev/null &"
Save it as an application. Change it's icon. (In case you don't know how, it's a little odd in OSX you can copy one applications icon to another by right clicking on Firefox -> Get Info. Click the small icon in the top left, cmd-c to copy it, then Get Info on your apple script application, click the icon in the upper left and cmd-v to paste it). Drag it to the Dock and now whenever you click it, it should open a new firefox with the Profile Manager window allowing you to select a different profile.
One thing that sucks is that the Profile Manager window doesn't open in the foreground. Not sure how to fix it, but it's still better then having to goto a terminal to open a different profile.
Older posts: 1 2
Juju