mac

Prevent Terminal from timing-out SSH on Mac.

If you use Terminal application on Mac OS-X to connect over SSH, you have most probably been annoyed by closed connections. Following is a quick recipe to prevent timeouts:

Open Terminal

> sudo vi /etc/ssh_config

Edit the file to make lines 20-21 look like:
Host *
    ServerAliveInterval 5

Save file and restart Terminal. Your connections won't time-out nearly as frequently.

How to Enable Local SMTP (Postfix) on OS-X Leopard

OS-X Leopard comes pre-installed with a Postfix version. No need to install it via darwin ports or other such mess (actually uninstall it if you have previously manually installed it via ports or something similar). Postfix just needs to be enabled and following sequence of several easy steps explains how to do it:

 sudo vi /System/Library/LaunchDaemons/org.postfix.master.plist

add following line before the closing </dict> tag:

<key>RunAtLoad</key> <true/> <key>KeepAlive</key> <true/>

Start service with

$ sudo launchctl
launchd% start org.postfix.master

You can also start simply with "sudo postfix start" but the above command will start via launch sequence and test the configuration you edited in the previous step.

Check that SMPT is running:

telnet localhost 25

For more information, see: Mac OS X Manual Page For launchd.plist

Control Your OS-X Keynote Presentation from iPhone

If you are on a Wifi and both your mac and iPhone can access it, you can get free ride with controlling Keynote from your iPhone by using: Keymote, which in part uses Telekinesis iPhoneRemote.

Telekinesis actually uses iPhone Safari and Ajax so you need to point iPhone Safari to a specific address (https://192.168.74.104:5010/ by default). You can bookmark it as iPhone shortcut on iPhone desktop though, for easy launching.

XAMPP Runs As User Nobody on Mac

During my recent macbook pro upgrade, I had a sweet time automatically migrating my entire old macbook to the new one using Migration Assistant. The experience could not have been smoother - all my data and applications were moved without a hitch. Couple apps asked to re-enter serial numbers, but that's all.

However when I tried to start my XAMPP-packaged MySQL today (I usually develop on a Linux box, so do not use local MySQL that often) - it would not start. After some digging around I noticed that permissions on the MySQL data folder in /Applications/xampp/xamppfiles/var were wrong - it was owned by "admin" and MySQL could not write in it. I quickly changed ownership to the mysql user (that was present on my computer), but to my surprise - that did not help. After some more digging, I found that, apparently, XAMPP runs MySQL as "nobody", just like it does Apache. Somewhat uncommon, but oh well.

Following three commands fixed my after-migration problem:

cd /Applications/xampp/xamppfiles/var
sudo chown -R nobody:admin mysql
sudo chmod -R 775 mysql

How To Uninstall Cooliris from Safari on a Mac

Cooliris is one of these new gadgets that sound cool in somebody's blog review, but do not live up to an expectation when actually used. Let alone that it is not nearly as useful as it claims to be, Cooliris has been reported to significantly slow down Safari on Macs. Specifically - when viewing FLASH videos like on YouTube. These fellas must have done something terribly wrong.

In any case, the real sad part is - they don't have any human way of uninstalling it. So here is a quick tutorial of how to remove this weed from your computer and let your Safari breath again:

  • Close Safari
  • Trash the Cooliris Previews folder found in $LIBRARY/InputManagers/)
  • Trash the cooliris' .plugin file found in $LIBRARY/Internet Plugins

Depending on whether you installed Cooliris for just your user or system-wide, substitute $LIBRARY with /Users//Library or /System/Library.

Hope this works for you, too.

Measure Distances on Screen in Mac OS-X

Really nice and useful tool:
http://www.pixelatedsoftware.com/products/pixelstick/

Tools like this one are plenty, but this particular one has a great user-interface. Better than any other free one, I have seen.

Bring SFTP to OS-X: Magnetk ExpanDrive

Today is a great day for Macintosh users! Magnetk has released ExpanDrive - a tool allowing to mount remote servers as local drives over ssh/sftp. Their press-release promises to add more protocols. I am taking a not-so-wild guess here that S3 will be one of the first protocols to get in.

But back to Magnetk. In the past I have used the Windows version of the same tool they had - SftpDrive and have come to love it. It was actually one of the few things I used to miss from Windows. I remember e-mailing them and asking to give us, Mac users something like that, as well. They promptly e-mailed back saying it was in works. And here we are with ExpanDrive! Magnetk is clearly a company that lives up to its promises.

I have been evaluating ExpanDrive for couple hours now and it is AWESOME!. I am gonna try it for a day or two more and am definitely buying it.

P.S. To be completely fair, we have to mention that there is an open-source tool that aims at solving the same problem and it has been around for a while: MacFuse is its name. I have used it.

Well, quite honestly bare-naked MacFuse is not in the same league, at least for now (I suspect ExpanDrive is using MacFuse at least partially if not in its totality). I am always the first to favor an open-source alternative, but quite honestly, if you are serious about your SFTP needs (like: developing a web application on a remote server), ExpanDrive is well worth its modest price.

Installing GIT on OS-X In 3 Minutes

How to install GIT on OS-X in under 5 minutes:

curl http://kernel.org/pub/software/scm/git/git-1.6.3.3.tar.gz -O
tar xzvf git-1.6.3.3.tar.gz 
cd git-1.6.3.3
make configure 
./configure --prefix=/usr/local
NO_MSGFMT=yes make prefix=/usr/local all
sudo make install

Git should be installed on your OS-X now, which you can verify by issuing: git --version command in Terminal. However, it's a good idea to also pre-configure the default username and e-mail for your Git installation:

git config --global user.name "Your Firstname Lastname" 
git config --global user.email "username@example.com"
git config --global --list

I personally, also like to set:

git config --global color.ui "auto" 

The Infamous Apple Customer Care

Apple's products are usually of high quality, on the bleeding edge of innovation and always - cool. None of these characteristics are applicable to Apple retail service. Yes, stores are clean and cozy and the online store - very intuitive, but those are about the only positive things anyone can say about shopping at Apple. The producer of iPods has very outdated (hence weird) distribution rules. They are trying to protect regional distributors from the cannibalization of each-other's businesses, by enacting a plethora of constraints, governing who can sell what, where.

Couple days ago, I was looking for a Macbook Air with French keyboard layout for a buddy of mine. I called a local Apple store (one of the largest in the area) and inquired about the availability of a French layout. I got a very cold "no way" in response. Not willing to give up, I asked what would somebody need to do in the US, if he or she wanted to get a laptop with French keyboard layout.

"In order to get one, you will have to fly to Paris or Canada, at least" - was the "response of reason" that left me speechless.

Cruuuuhaaaaazyyyyy

Clear DNS Cache on OS-X

If you are a developer (just a nerd will do, too), you have definitely put a fake DNS entry or two in your /etc/hosts file, at one time or another. Few things are more frustrating than doing that and having to restart your computer for the change to pick up. If you are running a local dns server (e.g. BIND) a glitch like that can happen all the time.

No worries, though. The little command below, ran from the Terminal, will clear dns cache and let your changes be applied instantaneously:

> lookupd -flushcache

or on Mac OS-X 10.5.x (Leopard):

> dscacheutil -flushcache

P.S. I don't know how to do the same on Windows, but the same problem occurs on that platform as well, since it also uses local DNS cache. If you know a solution, feel free to leave a comment :).

Syndicate content