Emacs – emacsclient can’t find socket problem…. solved

when you see this on Mac? just follow me~

emacsclient: can't find socket; have you started the server?
To start the server in Emacs, type "M-x server-start".
emacsclient: No socket or alternate editor.  Please use:

    --socket-name
    --server-file      (or environment variable EMACS_SERVER_FILE)
    --alternate-editor (or environment variable ALTERNATE_EDITOR)

i solved like this.

ln -s /Applications/Emacs.app/Contents/MacOS/bin/emacsclient ect

기본 emacsclient가 바라보는 소켓이 틀린가?

Tool – wireshark 설치

brew를 이용한 whireshark 설치 방법에 대해서 기술한다.


1) 기존 wireshark 삭제하기

$ sudo bash -c "$(curl -sL https://raw.github.com/x0b4dc0d3/wireshark-uninstall-osx/master/uninstall.sh)"

2) brew를 이용하여 설치하기

$ brew install wireshark

만약 GUI버전이 필요하다면 QT와 함께 설치 해주어야 한다.

$ brew reinstall wireshark --with-qt

Clojure – TCP Server Socket

ref

(require '[clojure.java.io :as io])
(import '[java.net ServerSocket])

(defn receive
  "Read a line of textual data from the given socket"
  [socket]
  (.readLine (io/reader socket)))

(defn send
  "Send the given string message out over the given socket"
  [socket msg]
  (let [writer (io/writer socket)]
      (.write writer msg)
      (.flush writer)))

(defn serve [port handler]
  (with-open [server-sock (ServerSocket. port)
              sock (.accept server-sock)]
    (let [msg-in (receive sock)
          msg-out (handler msg-in)]
      (send sock msg-out))))
(serve 8888 #(.toUpperCase %))

OS X – My SQL Socket Error.

I was getting some error while execute mysql.

It’s just socket error.

If you have /tmp/mysql.sock but no /var/mysql/mysql.sock then…

# cd /var 
# mkdir mysql
# cd mysql
# ln -s /tmp/mysql.sock mysql.sock

If you have /var/mysql/mysql.sock but no /tmp/mysql.sock then

# cd /tmp
# ln -s /var/mysql/mysql.sock mysql.sock

You will need permissions to create the directory and link, so just prefix the commands above with sudo if necessary.

you got this site :
http://stackoverflow.com/questions/4219970/warning-mysql-connect-2002-no-such-file-or-directory-trying-to-connect-vi