SSH FileSystem on Mac

September 1st, 2009

You can mount remote directory using ssh protocol using fuse. Fuse is an interesting mechanism to build a filesystem at userspace, i.e., without changing the OS Kernel.
You can install fuse using fink on OSX, but it is convenient to MacFUSE package (usually shipped with VMWare Fusion). And then download statically compiled sshfs-static-XXX from here. I put it under /usr/local/bin, and renamed to sshfs.

Now you can mount remote directory using sshfs onto your local filesystem.

$ /usr/local/bin/sshfs userid@server:/path/to/remote/dir /path/to/local/dir -o auto_cache,reconnect

Unmount is also simple

$ unmount /path/to/local/dir

.

If you see this warning message

warning: ssh nodelay workaround disabled

you may ignore it because recent ssh client that is shipped in Leopard supports TCP_NODELAY by default.

Good thing about sshfs is that you can configure it to reconnect, and locally cache the file. This means that even when your network isn’t fast enough, you will only suffer local disk I/O, and the sshfs will background transfer the changed data (more technically, disconnected operation is supported).

Enjoy!

Scripting Microsoft Excel at OS X

September 1st, 2009

Microsoft has a good reference to their AppleScript support.

http://www.microsoft.com/mac/developers/default.mspx

Script for updating Cell Data on Numbers.app using AppleScript

August 31st, 2009

I run a bunch of experiments, and have to parse the log file.
I used to keep it in a text file and import it to Excel or use ploticus to create a graph.
However, these are really difficult once you have to run the same experiments over and over again,
calculate confidence intervals, geomeans, and etc.
I found that on OSX, AppleScript can update the data on Excel or Numbers file.
With this feature, whenever I produce an updated data, graphs will be created accordingly.

Here is a code piece that does that.
It basically updates (x, y) to v on table t.

on run argv
  set x to item 1 of argv as integer
  set y to item 2 of argv as integer
  set v to item 3 of argv as integer
  set t to item 4 of argv as integer

  tell application "Numbers"
    tell document 1
      tell sheet 1
        tell table t
          set value of cell x of row y to v
        end tell
      end tell
    end tell
  end tell
end run

How to run the script

  • Open spreadsheet file on Numbers.app. Tables must be in place.
  • Run following commands from the terminal (assuming that above code is store in number.scpt)

    $ /usr/bin/osascript number.scpt x y v t

I’ll add a new post with an AppleScript that works with Excel 2008.

Removing Mobile-Me from the Menu

August 12th, 2009

MobileMe menu appeared out of nowhere.

I do not remember I installed it, or agreed to install it.

I’m sure someone else will complain about it, so I decided to leave a note.

Anyway, the solution is simple.

1) press command key while dragging the MobileMe icon out of the menubar.

Only one step.

However, if you feel mad, and want to remove MobileMe from the preference pane,

Remove /System/Library/PreferencePanes/Mac.prefPane directory.

To be safe, you can change the name to something like Mac.prefPane- so that whenever you have an error, you can rename it back.

Using Java 1.6 on Mac OS X

July 24th, 2009

1. open /Application/Utilities/Java Preferences.app

2. drag drop the version you want to the top.

Now /usr/bin/java will point to the JVM version you chose at the top.

어스틴 자동차 메케닉 추천 리스트

September 7th, 2008

한국 유학생 분들이 처음에 미국에 정착 할 때 차 때문에 돈을 많이 낭비하게 되는 경우를 많이 봅니다.

아래 리스트는 개인적으로 잘 검증한(된) 곳들입니다.

아무데서나 차 고치시지 말고 믿을만한 데서 고치세요.

특히 딜러에 차 맡기는 짓은 .. 절대로 하지 마시길.

아래 리스트에 대해서 제가 금전적 이득을 얻는 것은 하나도 없음을 미리 밝힙니다.

혹시 안 좋은 경험이 있으셨으면 이곳에 답글로 남겨 주시면 제가 노력해보겠습니다.

  • 차 전반적인 문제 : JC AutoSpec – 여기 주인 John Long이 아주 유명한 Mechanic입니다. John은 좀 바쁘고 Dan하고 이야기 하시고 저를 잘 아니까 제 친구라 하심 됩니다. 단순 작업이 아니라 차에 대한 이해가 필요하고 믿을만하게 상담을 받으실 곳은 바로 이곳입니다.
  • 간단한 오일류 교환 : Mopac Automotives – Chuck 아저씨가 주인인데 제 이름을 기억할지는 모르겠으나 UT학생증 보여주고 누가 그러던데 한국 사람 싸게 해주더라 하시면 조금 할인 받으실 껍니다. 실력이 좋은 곳은 아니나 Local shop으로 20년 가까이 해온 곳이라 믿을만 하고 저렴합니다. 간단한 것들만 맡기세요.
  • 바디샵 : Jeffs Auto Body – Joe Sessler라는 사람 찾아서 역시나 제가 소개해줬다고 하세요. 바디샵 중에 최고입니다. 이 옆에 B&B도 잘한다고 하지만 양쪽에 해본 결과 Jeff가 한 10만배쯤 더 잘합니다. ㅋㅋㅋㅋ 이곳은 보험회사랑 연계되어 있지 않아서 소비자 위주로 해줍니다. OEM제품만 쓰고요 aftermarket이나 factory reconditioned 제품은 거의 사용 안합니다. 잘 모르시겠으면 꼭 oem만 쓰는지 확인하시면 됩니다.  약간 어스틴에서 멀지만 Sterling Auto Collision도 매우 잘 한다는 소문이 있습니다.
  • Muffler & Exhaust 등 배기류 : Muffin Muffler Shop 어스틴에 개업한지 30년 돼었습니다.
  • 타이어 & 휠 : Discount Tire Burnet과 Braker만나는 지점에 있는 곳이 잘합니다. 기술자 이름은 기억이 안나는데 Hunter장비가 완비 되어 있어서 Road force balancing 이런 거 매우 잘해줍니다. 코스코가 타이어는 싸게 파는데 거기서 공짜로 해주는 balancing은 거의 믿지 마세요. 그리고 코스코 애들이 추천해주는 그 어떠한 것도 믿지는 마세요.
  • Alignment : Camry 등 축 한개만 조절하는 차들은 Firestone이런데 가서 싸게 하시면 됩니다. 축 2개 이상 하시는데는 저 위에 JC AutoSpec에서 하시는게 좋구요 그곳에서 custom spec으로 조절도 가능합니다. 차에 민감하고 매우 정확한 alignment를 원하시면 한국교포분이 하시는 Soulspeed가 가장 장비(Hunter DSP) & 실력이 좋습니다.
  • Battery : Autozone에서 1) free testing 2) free charging 해주고요 제품을 사면 3) free installation 도 해줍니다. Duralast 제품이 저렴하고 쓸만합니다.
  • 중고차 Inspection: Auto PI 출장 서비스 좋습니다. 이거 잘 찾아 보면 UFCU 이런데에 할인 쿠펀들 돌아다닙니다.
  • 자동차 유리 Tint : 3M 제품을 쓰는 Sun Tint에서 하세요. Koenig에 있습니다.
  • 자동차 유리 : Safelite Auto Glass, Binswanger Glass Co 출장 서비스 해줍니다.
  • State Inspection : 아무데서나 하세요. 가격 균일가

이 외에 가격이 저렴할지라도 추천해드리지 않는 곳은

  • Jiffy, Midas, Meineke, Walmart 등등의 체인점들입니다.
  • 그리고 모든 딜러샵들. 딜러한테는 워런티 기간 중에만 하세요.

Austin Public Golf Courses

September 7th, 2008

List of public golf courses.

Municipal golf courses are affordable for students.

rpm vs dpkg, yum vs apt-get

September 3rd, 2008

If administrating different Linux distributions, sometimes it is quite confusing to remember package managers command.

This wiki page has listed up things nicely.

Very nice reference.

http://wiki.openvz.org/Package_managers

How to make subclipse plugin working on Eclipse 3.4 Ganymede

July 17th, 2008

Recent version of Eclipse 3.4 Ganymede and Subclipse 1.4 plugin doesn’t work out of the box.

I tested on Mac OS X both Leopard and Tiger.

Even after installing <code>svn-javahl</code> package using fink, and adding <code>-Djava.library.path=/sw/lib</code> to eclipse.ini doesn’t work.

Later I installed SVNKit library which was (optional) & “Beta” within Subclipse package, and changed javahl to SVNKit in Preference > Team > SVN.

And it works!

(below note added 7/30)

I realized upgrading svn, svn-client, svn-javahl to version 1.5 or above solve the problem using JavaHL.

Mac OSX에서 PDF reload 해주는 script (latex 쓸때 편함)

June 10th, 2008

PDFLatex쓰다가 내용 바꾸고 pdf를 refresh하려면 Mac에서 여간 불편한게 아니다. 
Adobe Reader나 Preview에는 Linux의 gv나 kghostview등에서 지원되는 자동 refresh 기능이 없어서 창을 닫았다가 열었다가 해야 한다. 
아니면 Safari에서 열어서 cmd-R로 refresh해주는 방법도 있는데 

TeXShop이란 놈을 발견했는데 AppleScript가 잘 돌도록 되어 있다. 
(Adobe Reader랑 Preview는 아래 처럼 안됨)

TeXShop이란 프로그램을 fink로 설치 하고 


tell application “TeXShop”
activate
close (every window whose name is “paper.pdf”)
end tell

이렇게 해주니까 paper.pdf를 닫는다. 이 script하나 만들어 놓고
open -a /sw/Applications/TeXShop.app paper.pdf 와 같이 쓰면
script로만 document를 refresh하는 효과를 가져 온다. 

이걸 Makefile에 넣어서 make pdf 하면 refresh하도록 해줬다. 
vimrc에 macro로 넣어주니까 단축키로 모든게 다 되어서 이제 매우 편하다. ㅋㅋ