Showing posts with label mac. Show all posts
Showing posts with label mac. Show all posts

Saturday, January 5, 2008

Change Leopard Dock to 2D

This is old news by now, but essential. It changes that gratuitous 3D shinny Dock to a more plain and usable 2D version. I learned about this tip here (which also has screenshots).

From Terminal, type:

defaults write com.apple.dock no-glass -boolean true && killall Dock

Ta-Da. To undo change the true to false

Making Finder be more like 'ls -a'

Finder has this annoying habit of hiding files and extensions it thinks will confuse you. As if!

Show all files

By default Finder hides files that start with "." (dot) and perhaps others too. To see all files, in Terminal type this

defaults write com.apple.finder AppleShowAllFiles true && killall Finder

To revert, change the true to false. I originally bumped into this here.

Show all extensions

Finder sometimes likes hiding the file extention like ".html" from you. To fix this: go into Finder's preferences, click the Advanced, and then click "Show all file extensions"

Enjoy!

Friday, December 14, 2007

aspell for emacs and Mac OS X

Here's how to add a spelling checker to Emacs on Mac OS X. This will work for both terminal based or GUI based versions.

First, for goodness sake, install MacPorts. After it is installed from terminal do:

$ sudo port -v selfupdate
$ sudo port install aspell-dict-en

You can install other languages too. Take a look at "port search aspell" for the list.

Then just add the following line to your .emacs

(setq ispell-program-name "/opt/local/bin/aspell")

Load you your text (or html or xm) file and do M-x ispell

Oh yeah! You can read more on the Emacs commands here

Tuesday, November 6, 2007

Fun with iChat 4.0

In Mac 10.5, ichat 4.0 has some nerdy fun new features. I'm not sure if the AIM supports these directly and ichat is just enabling them or if they are ichat-proprietary. Either way, it's great. I don't use all the wacky ichat features - audio, video, screen sharing - yet.

Tabs

Finally! And they work very well. There are vertical "tabs" on a left sidebar. To enable you have to go to ichat preferences, messages, and check "Collect chats into a single window." it rules.

Invisible

by going invisible, you can see the status of your friends, but they can't see you and you can still send and receive messages. It's like a more aggressive "Away" status.

Oh yeah, I found a super minor "bug" too - ichat menubar icon missing 'invisible' status.

/me status messages

This only works when both parties are using ichat, but if you type /me something it sends a IRC-like status message. The best way to understand is to try it. I first read about it at tuaw.com

Async Message Handling

I'm not sure how this really works, but it appears that if you are offline and someone sends you a message, the next time you log in, you will get old messages that were sent while you were away (just like cell phone SMS). Yahoo IM has had this for long time.

Anyone got any details on this? Or is this just the sender resending the message. Either way, it's a good addition

Invoking Applescript on Messages

Ok I haven't tried this, but you can now invoke applescript in response to messages. So you could "auto-accept" new chats. Even better, if everything is set up correctly, you can make a "poor man's remote control" for your computer.

You can read more about this at MacWorld and TUAW

Wednesday, October 31, 2007

My First Mac OS 10.5 Review

So I've had leopard for about 24 hours now. The best things are: Finder, TimeMachine, and, uhh, Terminal. heh, I'm a nerd. Spaces is good too.

The UI: Mixed bag

Hmmm, well, it's a mixed bag. Lots of minor changes that are "fine," with others being good and bad

Good.

  • All windows now have the same theme. This is huge.
  • The annoying hidden right-side panels are gone

bad:

  • The dock has all sorts of annoying reflections
  • Doc and folder icons not nearly as clear as Tiger ones
  • Stacks is kinda silly. It only works in the doc and looks ugly.
  • Instead of button1, and button 2 (control-click), we now have click-and-hold (open stacks) and select-hit-spacebar (finder) modifications. Why two different invisible mechanisms? When can just agree that having two buttons is better. Oh well.

Finder: fast preview rules

Hey now, it's a lot better. Everything now has a real preview. Coverflow for folders is kinda cool. Hitting "space" on any item opens a fast preview. It's great for source files and pictures.

Time Machine: must have

Wow, this really works. You might want to buy a dedicated external hard drive for this. you plug it in, and it just works. Nothing to configure! Need to free up space? just go into hard drive and delete whatever backup you want. Multiple computers can use the same hard-drive (in fact, you might be able to do something tricky with firefire and have each computer backup each other.)

Spaces: good

Real virutal desktops! I have cheap machines that use main memory instead of dedicated graphics memory so I wondered how this work. I have to say switching between 1920x1280 virtual desktops is fast and painless. On my tiny 1024x768 laptop it is a godsend. The only down side is their is no small icon preview of the other desktop like you see in some other OS.

To turn it on, go into system preferences

Safari: much better

Safari V3 is a lot better. First I think/hoped they fixed a lot of annoying web-dev bugs. Lots of heavy ajax sites that didn't work or worked strangely in V2 now work. Also SVG is supported and easily 10x faster than firefox (more on this another time). I guess you can download V3 without leopard too.

AddressBook and Calendar and Mail: whatever

I don't use these much, but it's a bit odd how you can sync your address book with yahoo, and that yahoo doesn't have POP/IMAP for their email. Google has horrible contact management, but now has free IMAP/POP for email. Go figure.

iChat: tabs

You can have tabbed conversations, if you go into preferences. The "tabs" are really a sidebar. I don't use any of the fancy stuff so I can't comment.

UPDATE 01-Nov-2007: ichat let's you become "invisible" now. You can send and receive messages, but you don't show up as "online". excellent!

Terminal: tabs

Finally tabs. The font clarity and colors seems improved too.

Firewall: Off by Default

Leopard turns it off by default. Go into SystemPreferences:Security to turn it back on.

gcc: Still 4.0.1

It's still 4.0.1 but the build number is slightly different. boo. The reason is probably because Apple is working on a snazzy gcc replacement!

Scripting: All up to date!

Include are the latest versions of Python (2.5.1), Ruby (1.8.6), and PHP (5.2.4)!

Firefox: works, but...

It works, but only until I deleted my ~/Library/Application Support/Firefox directory. I must of had a bad plugin.


There you go. So far so good.

Sunday, September 2, 2007

ruby-mode for emacs

I'm not really a ruby guy, but recently I had to do some ruby hacking, which means I needed ruby-mode for emacs. Between the InterWeb, RubyGarden, and EmacsWiki, I couldn't find a clear, correct description of how to get ruby-mode. Here's my take.

Step 1: Why not upgrade emacs?

Did you know emacs finally released a new version?!

If you are using MacPorts, do this for a terminal (non-gui version). Do port variants emacs for other options.

sudo port install -v emacs

Step 2: Download the code

We are going to install our lisp code in ~/.emacs.d/site-lisp which I think is more-or-less standard, but you could use any directory.

export SITE_LISP=~/.emacs.d/site-lisp
mkdir -p $SITE_LISP
svn export http://svn.ruby-lang.org/repos/ruby/trunk/misc ${SITE_LISP}/ruby
emacs -batch -f batch-byte-compile ${SITE_LISP}/ruby

Don't forget that last step! That compiles the lisp code, and will make emacs run faster (handy if you re-indent a large file).

Step 3: Configure your .emacs

Add this to your .emacs. This is a complete rip from RubyGardens's Installing Emacs Extensions, with the exception of the first line.

;; ruby                                                                         
;; based on http://www.rubygarden.org/Ruby/page/show/InstallingEmacsExtensions  
;;                                                                              

(add-to-list 'load-path "~/.emacs.d/site-lisp/ruby")

 (autoload 'ruby-mode "ruby-mode"
     "Mode for editing ruby source files")
 (add-to-list 'auto-mode-alist '("\\.rb$" . ruby-mode))
 (add-to-list 'interpreter-mode-alist '("ruby" . ruby-mode))
 (autoload 'run-ruby "inf-ruby"
     "Run an inferior Ruby process")
 (autoload 'inf-ruby-keys "inf-ruby"
     "Set local key defs for inf-ruby in ruby-mode")
 (add-hook 'ruby-mode-hook
     '(lambda ()
         (inf-ruby-keys)))
 ;; If you have Emacs 19.2x or older, use rubydb2x                              
 (autoload 'rubydb "rubydb3x" "Ruby debugger" t)
 ;; uncomment the next line if you want syntax highlighting                     
 (add-hook 'ruby-mode-hook 'turn-on-font-lock)

Step 4: Get back to work

EOF

Wednesday, August 29, 2007

Compiling ImageMagick on Mac OS X using MacPorts

If you work with graphic formats, you probably are or will use ImageMagick. And if you are using a pre-built binary, at some point you'll bump into a limitation and will need to compile it yourself.

Normally, one might try and do the ./configure; make; make install cycle using their instructions, but the dependencies are really complicated. You might get a minimally functional version to work, but will be missing fonts and functionality (believe me I tried).

On linux et al, mostly like some type package manager is available and you can use that. On Mac, you have two choices, fink and macports to automate the pain. Personally I've found macports a bit easier to use, and it worked out of box.

However ImageMagick is a complicated program and I found macports needed a few tweeks to make the ultimate binary. Here's what you need to do to install. Advanced users might have already done the first two steps.

1. Install XCode and X11 SDK

Head over to Apple's Developer Connection and download xcode. You might need to create a user id. Anyways, it's a monster download of around one gig.

Open up the file, and click on the XcodeTools.mpkg and go through the install. Then open up the Packages directory and click on X11SDK.pkg and install that.

2. Install MacPorts

This is an adbridged version of the official page UsingMacPortsQuickStart. Refer to this page if you run into trouble.

Go to MacPorts.org (note its plural, not MacPort). And find the latest download. Make sure you pick the right version for your OS. Download it and install.

Open up a Terminal and do sudo port -v selfupdate

3. Install special libraries

These are not technically necessary, but they make life better. The change to freetype allows for TrueType font-hinting to be turned. It's turned off since it's patented, but you can turn it on. It makes certain fonts look better

The librsvg is for rastering SVG images. ImageMagick uses it, but it also provides a direct SVG to PNG encoder ('man rsvg').

This takes a a while. Like it's time to get lunch. Somehow most of GTK is being downloaded and linked (although you won't be using much if any of it).

sudo port -v install freetype +bytecode
sudo port -v install librsvg

4. Install ImageMagick

Finally, let's install it with lots of special formats turned on. It doesn't take that long.

sudo port -v install ImageMagick +graphviz +gs +wmf +jbig +jpeg2 +lcms

5. Quick Check

If all goes well, which identify shoudl return /opt/local/bin/identify and identify -list type should list a lot of fonts.

Now you are ready to get some work done!

6. Man pages

Oh you want manpages? Sheesh. Add export MANPATH="/opt/local/man:$MANPATH" to your ~/.profile

Sunday, August 19, 2007

Compiling pngcrush 1.6.4 on Mac OS X 10.4.10

Just in case you are trying to compile pngcrush 1.6.4 on Mac OS 10.4.10. Apple's version of as (the assembler, based on GAS 1.3.8) is retarded. Anyways, it's easy to patch up. Edit the pngcrush Makefile and replace the GAS_VERSION macro as such:
# OLD
#GAS_VERSION := $(shell as --version | grep "GNU assembler" | sed -e 's/GNU assembler //' -e 's/ .*//')

# MAC OS X
GAS_VERSION := $(shell echo "" | as -v 2>&1 | grep "GNU assembler" | sed -e 's/.*GNU assembler version //')

then do make, etc.

And if that doesn't work, change it to GAS_VERSION:= "Apple"

I'm sure this applies to other versions of pngcrush and other versions of OS X

Update 29-Aug-2007: You can use the most excellent macports to install this instead.

sudo  ports -v install pngcrush