Sunday, February 26, 2017

(require 'scala-mode-auto)
(require 'ensime)

#+RESULTS:

(add-to-list 'auto-mode-alist '("\\.sc$" . scala-mode))
(add-to-list 'auto-mode-alist '("\\.scala$" . scala-mode))

(add-hook 'scala-mode-hook 'ensime-mode)
* org babel mode scala

#+begin_src scala :exports both :results output
def helloworld() = {
  println("Hello there")
  println("한글로처리2")
}
helloworld()
#+end_src

: Hello there
: 한글로처리2

emacs - org babel mode - using paramer ex. sql (from:Introduction to Literate Programming)

--> from:
 http://www.howardism.org/Technical/Emacs/literate-programming-tutorial.html





Introduction to Literate Programming

Welcome to a brief tutorial on literate programming in org-mode.
The following began as the basis for a workshop for the PDX Emacs Hackers meetup, but since everyone couldn’t attend, I decided to expand it into a tutorial. I assume you understand the basics of Emacs and as well as familiarity with org-mode for creating exported documents.
As you probably know, Org is pretty large, and the features for writing, evaluating and connecting blocks of source code in a document are extensive, and documenting them all is a daunting task. I hope this tutorial is a good start, but if I glossed over something you feel I should include, please let me know.
Warning: The examples are pretty lame.
--
# -*- coding: utf-8 -*-
#+STARTUP: content
#+LANGUAGE: ko
#+PROPERTY: header-args:sql :engine postgresql :export results :cmdline -p 5432 -h localhost -U kys -d emacsdb PGPASSWORD=pass1234

* example-1. use parameter in the document level defind '#+PROPERTY'
#+BEGIN_SRC sql 
select eng_name, title, fullname from springschema.phonebook;
#+END_SRC


#+RESULTS:
| eng_name  | title | fullname |
|-----------+-------+----------|
| So Wonju  | 대리  | 지원호   |
| Mr.Jung   | 사원  | 김지원   |
..


** example-2. use parameter in the org-heading section of ':PROPERTIES:'
 :PROPERTIES:
 :LANGUAGE: sql
 :engine: postgresql
 :exports: results
 :cmdline: -p 5432 -h localhost -U kys -d emacsdb PGPASSWORD=pass1234
 :END:

#+begin_src sql
select eng_name, title, fullname from springschema.phonebook;
select "select version()";
#+end_src

#+RESULTS:
| eng_name  | title | fullname |
|-----------+-------+----------|
| So Wonju  | 대리  | 지원호   |
| Mr.Jung   | 사원  | 김지원   |
..


* example-3. use in specified src block values
#+BEGIN_SRC sql :engine postgresql :exports results :cmdline -p 5432 -h localhost -U kys -d emacsdb PGPASSWORD=pass123
select eng_name, title, fullname from springschema.phonebook;
#+END_SRC

#+RESULTS:
| eng_name  | title | fullname |
|-----------+-------+----------|
| So Wonju  | 대리  | 지원호   |
| Mr.Jung   | 사원  | 김지원   |

 ※ :results:output 가 있으면 raw 로 encoding 없이 출력된다.
(※ ':results:output' means output without encoding) 


Thursday, February 23, 2017

google notice to blogger users - with cookie

유럽 연합 법규는 유럽 연합 방문자에게 블로그에 사용되는 쿠키에 대한 정보를 제공하도록 규제하고 있습니다. 또한 대부분의 경우 이러한 법규는 사용자의 동의를 얻도록 요구합니다.


이 규제를 준수할 수 있도록 Google은 귀하의 블로그에 Google이 특정 Blogger를 사용하며 Google 애널리틱스와 애드센스 쿠키를 비롯한 Google 쿠키를 사용한다는 것을 알리는 공지사항을 추가했습니다.


귀하는 이 공지사항이 블로그에 실제로 적용되고 표시되도록 할 책임이 있습니다. 타사 제품의 기능을 추가하는 등 다른 쿠키를 사용하는 경우 이 공지사항이 귀하에게 적합하지 않을 수 있습니다. 이 공지사항 및 책임에 대해 자세히 알아보기

Font for Emacs - Korean, Chinese-Hanyu

> chinese font
       (set-fontset-font fontset 'hangul '("Gulim" . "unicode-bmp"))


> korean font
        (set-fontset-font fontset 'hangul '("NanumBarunGothic" . "unicode-bmp"))

> japnese font

;; -- 0
;(set-face-font 'default "Monaco-12")
;(set-fontset-font "fontset-default" '(#x1100 . #xffdc) "NanumGothicOTF-15")
;(set-fontset-font "fontset-default" 'kana  "Hiragino Kaku Gothic Pro-14")
;(set-fontset-font "fontset-default" 'han   "Hiragino Kaku Gothic Pro-14")

(defun xftp (&optional frame)
  "Return t if FRAME support XFT font backend."
  (let ((xft-supported))
    (mapc (lambda (x) (if (eq x 'xft) (setq xft-supported t)))
          (frame-parameter frame 'font-backend))
    xft-supported))

(when (string-equal my-system-is "MAC")
  (set-face-attribute 'default nil :family "DejaVu Sans Mono" :height 160) ; 140
;  (set-face-font 'default "Monaco-14") ; 12
;  (set-face-attribute 'default nil :height 160)
;  (face-remap-add-relative 'default :family "Bitstrem Vera Sans Mono" :height 180)

   ;; -- 1
  (set-fontset-font "fontset-default" '(#x1100 . #xffdc) '("DejaVu Sans Mono" . "iso10646-1"))
;  (set-fontset-font "fontset-default" '(#xe0bc . #xf66e) '("나눔고딕코딩" . "iso10646-1"))

  ;(set-fontset-font "fontset-default" 'latin  '("Monaco-14" . "unicode-bmp"))
  ;(set-fontset-font t 'latin (font-spec :family "나눔고딕코딩" :size 18)) ; 16
  ;(set-fontset-font "fontset-default" 'latin (font-spec :family "NanumGothicCoding" :size 22))
  ;(set-fontset-font "fontset-default" 'latin (font-spec :family "Bitstrem Vera Sans Mono" :size 22))
  (set-fontset-font "fontset-default" 'latin (font-spec :family "DejaVu Sans Mono" :size 22))

  ;; -- 2
  (set-fontset-font "fontset-default" 'han (font-spec :family "STHeiti" :size 24))
  ;(set-fontset-font "fontset-default" 'han (font-spec :family "Microsoft YaHei" :size 24))

  ;; -- 3
  ;(set-fontset-font "fontset-default" 'kana (font-spec :family "STSong-24" :size 22))
;  (set-fontset-font "fontset-default" 'kana (font-spec :family "Monaco-16" :size 22))

  ;; -- 4
  (set-fontset-font "fontset-default" 'hangul (font-spec :family "나눔고딕코딩" :size 14))
 )

(when (string-equal my-system-is "GIG")
;   (set-face-font 'default "Monaco-12")

;; bad
;   (set-fontset-font "fontset-default" '(#x1100 . #xffdc)  '("NANumGothicCoding" . "unicode-bmp"))
;   (set-fontset-font "fontset-default" '(#xe0bc . #xf66e)  '("NanumGothicCoding" . "unicode-bmp"))

;; bad
;   (set-fontset-font "fontset-default" '(#x1100 . #xffdc)  '("NanumGothicOTF" . "iso10646-1"))
;   (set-fontset-font "fontset-default" '(#xe0bc . #xf66e)  '("NanumGothicOTF" . "iso10646-1"))
   (set-fontset-font "fontset-default" '(#x1100 . #xffdc)  '("NanumBarunGothic" . "iso10646-1"))
   (set-fontset-font "fontset-default" '(#xe0bc . #xf66e)  '("NanumBarunGothic" . "iso10646-1"))

   (set-fontset-font "fontset-default" 'kana  '("Hiragino Kaku Gothic Pro" . "iso10646-1"))
   (set-fontset-font "fontset-default" 'japanese-jisx0208 '("Hiragino Kaku Gothic Pro" . "iso10646-1"))
   (set-fontset-font "fontset-default" 'katakana-jisx0201 '("Hiragino Kaku Gothic Pro" . "iso10646-1"))

   (set-fontset-font "fontset-default" 'han '("Microsoft YaHei". "unicode-bmp"))
   ;(set-fontset-font "fontset-default" 'han '("NanumGothicCoding". "unicode-bmp"))

   (set-fontset-font (frame-parameter nil 'font) 'cjk-misc '("Microsoft YaHei" . "unicode-bmp"))
   (set-fontset-font (frame-parameter nil 'font) 'bopomofo '("Microsoft YaHei" . "unicode-bmp"))
   (set-fontset-font "fontset-default"    'gb18030 '("Microsoft YaHei". "unicode-bmp"))
   (set-fontset-font (frame-parameter nil 'font) 'symbol '("Microsoft YaHei". "unicode-bmp"))

   (set-fontset-font t 'han (font-spec :family "Microsoft Yahei" :size 16))
   ;(set-fontset-font t 'han (font-spec :family "NanumGothicCoding" :size 16))

   (setq face-font-rescale-alist '(("Microsoft Yahei" . 1.4) ("WenQuanYi Zen Hei" . 1.4)))

;; -- this xfp will crash !!
;   (when (xftp)
;     (let ((fontset "fontset-default"))
;       (set-fontset-font fontset 'latin  '("DejaVu Sans Mono" . "unicode-bmp"))
;  ;    (set-fontset-font fontset 'latin  '("NanumGothicCoding" . "unicode-bmp"))

;  ;    (set-fontset-font fontset 'hangul '("NanumGothicCoding" . "unicode-bmp"))
;       (set-fontset-font fontset 'hangul '("SeoulHangangB" . "unicode-bmp"))
;  ;    (set-fontset-font fontset 'hangul '("SeoulNamsanM" . "unicode-bmp"))

;       (set-face-attribute 'default nil :font fontset :height 110)
;      )
;    )


   (when (xftp)
     (let ((fontset "fontset-default"))
;       (set-fontset-font fontset 'latin  '("DejaVu Sans Mono" . "unicode-bmp"))
        (set-fontset-font fontset 'latin  '("DejaVu Sans Mono-14" . "unicode-bmp"))
;  ;    (set-fontset-font fontset 'latin  '("NanumGothicCoding" . "unicode-bmp"))

;       (set-fontset-font fontset 'hangul '("Gulim" . "unicode-bmp"))
        (set-fontset-font fontset 'hangul '("NanumBarunGothic" . "unicode-bmp"))

;        (set-fontset-font fontset 'hangul '("Gulim" . "unicode-bmp"))
   ;    (set-fontset-font fontset 'hangul '("NanumGothicCoding" . "unicode-bmp"))
;       (set-fontset-font fontset 'hangul '("SeoulHangangB" . "unicode-bmp"))
;  ;    (set-fontset-font fontset 'hangul '("SeoulNamsanM" . "unicode-bmp"))

;       (set-face-attribute 'default nil :font fontset :height 110)
      )
    )

;; -- this xfp not tested
;   (when (xftp)
;     (let ((fontset "fontset-default"))
;       (set-fontset-font fontset 'latin  '("DejaVu Sans Mono" . "unicode-bmp"))
;  ;    (set-fontset-font fontset 'latin  '("NanumGothicCoding" . "unicode-bmp"))

;  ;    (set-fontset-font fontset 'hangul '("NanumGothicCoding" . "unicode-bmp"))
;       (set-fontset-font fontset 'hangul '("SeoulHangangB" . "unicode-bmp"))
;  ;    (set-fontset-font fontset 'hangul '("SeoulNamsanM" . "unicode-bmp"))

;       (set-face-attribute 'default nil :font fontset :height 110)
;      )
;    )
  )

;;;; ----------------------------------------------------------------------
;; test -- 1
(cond
 ((string-equal system-type "windows-nt") ; Microsoft Windows
  (when (member "DejaVu Sans Mono" (font-family-list))
    (add-to-list 'initial-frame-alist '(font . "DejaVu Sans Mono-12"))
    (add-to-list 'default-frame-alist '(font . "DejaVu Sans Mono-12"))
    )
  )
 ((string-equal system-type "darwin")   ; Mac OS X
  (when (member "DejaVu Sans Mono" (font-family-list))
    (add-to-list 'initial-frame-alist '(font . "DejaVu Sans Mono-12"))
    (add-to-list 'default-frame-alist '(font . "DejaVu Sans Mono-12")))
  )
 ((string-equal system-type "gnu/linux") ; linux
   (when (member "DejaVu Sans Mono" (font-family-list))
    (add-to-list 'initial-frame-alist '(font . "DejaVu Sans Mono-12"))
    (add-to-list 'default-frame-alist '(font . "DejaVu Sans Mono-12"))
;    (set-face-attribute 'default nil :family "Source Code Pro" :height 130) ; 120
   )
  )
 )

;;;; ----------------------------------------------------------------------
;; test -- 2
;; -- this is DejaVu Good looking
;(add-to-list 'default-frame-alist '(font . "DejaVu Sans Mono-12"))
;(set-frame-font "DejaVu Sans Mono-12" nil t)

;; -- not as good as DejaVu - its test now
(add-to-list 'default-frame-alist '(font . "Source Code Pro-13"))
(set-frame-font "Source Code Pro-13" nil t)

;; -- not as good it's just old fashion style
;(add-to-list 'default-frame-alist '(font . "lucidasanstypewriter-12"))
;(set-frame-font "lucidasanstypewriter-12" nil t)

(set-face-attribute 'default nil :family "Source Code Pro" :height 130) ; 120


;;;; ----------------------------------------------------------------------
(defun my-font-middle ()  (interactive)
  (set-face-font 'default "Monaco-12")
  (set-fontset-font "fontset-default" '(#x1100 . #xffdc)  '("NanumGothicOTF" . "iso10646-1"))
  (set-fontset-font "fontset-default" '(#xe0bc . #xf66e)  '("NanumGothicOTF" . "iso10646-1"))
  (set-fontset-font "fontset-default" 'kana  '("Hiragino Kaku Gothic Pro" . "iso10646-1"))
  (set-fontset-font "fontset-default" 'japanese-jisx0208 '("Hiragino Kaku Gothic Pro" . "iso10646-1"))
  (set-fontset-font "fontset-default" 'katakana-jisx0201 '("Hiragino Kaku Gothic Pro" . "iso10646-1"))
  (set-fontset-font "fontset-default" 'han '("Microsoft YaHei". "unicode-bmp"))
  (set-fontset-font (frame-parameter nil 'font) 'cjk-misc '("Microsoft YaHei" . "unicode-bmp"))
  (set-fontset-font (frame-parameter nil 'font) 'bopomofo '("Microsoft YaHei" . "unicode-bmp"))
  (set-fontset-font "fontset-default"    'gb18030 '("Microsoft YaHei". "unicode-bmp"))
  (set-fontset-font (frame-parameter nil 'font) 'symbol '("Microsoft YaHei". "unicode-bmp"))
  (set-fontset-font t 'han (font-spec :family "Microsoft Yahei" :size 16))
  (setq face-font-rescale-alist '(("Microsoft Yahei" . 1.4) ("WenQuanYi Zen Hei" . 1.4)))
)

(defun my-font-big ()
  (interactive)
  (set-face-font 'default "Monaco-14")
  (set-fontset-font "fontset-default" '(#x1100 . #xffdc)  '("NanumGothicOTF" . "iso10646-1"))
  (set-fontset-font "fontset-default" '(#xe0bc . #xf66e)  '("NanumGothicOTF" . "iso10646-1"))
;  (set-fontset-font "fontset-default" '(#x1100 . #xffdc)  '("NanumGothicCoding" . "iso10646-1"))
;  (set-fontset-font "fontset-default" '(#xe0bc . #xf66e)  '("NanumGothicCoding" . "iso10646-1"))
  (set-fontset-font "fontset-default" 'kana  '("Hiragino Kaku Gothic Pro" . "iso10646-1"))
  (set-fontset-font "fontset-default" 'japanese-jisx0208 '("Hiragino Kaku Gothic Pro" . "iso10646-1"))
  (set-fontset-font "fontset-default" 'katakana-jisx0201 '("Hiragino Kaku Gothic Pro" . "iso10646-1"))
  (set-fontset-font "fontset-default" 'han '("Microsoft YaHei". "unicode-bmp"))
  (set-fontset-font (frame-parameter nil 'font) 'cjk-misc '("Microsoft YaHei" . "unicode-bmp"))
  (set-fontset-font (frame-parameter nil 'font) 'bopomofo '("Microsoft YaHei" . "unicode-bmp"))
  (set-fontset-font "fontset-default"    'gb18030 '("Microsoft YaHei". "unicode-bmp"))
  (set-fontset-font (frame-parameter nil 'font) 'symbol '("Microsoft YaHei". "unicode-bmp"))
  (set-fontset-font t 'han (font-spec :family "Microsoft Yahei" :size 16))
  (setq face-font-rescale-alist '(("Microsoft Yahei" . 1.6) ("WenQuanYi Zen Hei" . 1.6)))
)

;(my-font-big)
;(my-font-middle)
;; M-x list-fonts

Friday, October 28, 2016

Upgrade Ubuntu Desktop/Server from 16.04 (Xenial Xerus) to 16.10 (Yakkety Yak)

http://www.ubuntugeek.com/upgrade-ubuntu-desktopserver-from-16-04-xenial-xerus-to-16-10-yakkety-yak.html (Posted on October 24, 2016 by ruchi)

Open the "Software & Updates" Setting in System Settings.
Select the 3rd Tab called "Updates".

Set the "Notify me of a new Ubuntu version" dropdown menu to "For any new version".
Press Alt+F2 and type in "update-manager" (without the quotes) into the command box.
Update Manager should open up and tell you: New distribution release ‘16.10' is available.

If not you can also use "/usr/lib/ubuntu-release-upgrader/check-new-release-gtk"
Click Upgrade and follow the on-screen instructions.

Install the update-manager-core package if it is not already installed.
Make sure the Prompt line in /etc/update-manager/release-upgrades is set to normal.
Launch the upgrade tool with the command sudo do-release-upgrade.
Follow the on-screen instructions.


--

--> emacs
if you got emacs error with libpng12.so.0

 : emacs: error while loading shared libraries: libpng12.so.0: cannot open shared
 : object file: No such file or directory

- if error or not registered
sudo apt-get install libpng12-0
 : E: Package 'libpng12-0' has no installation candidate

- download and manually install
  https://launchpad.net/ubuntu/yakkety/amd64/libpng12-0/1.2.54-1ubuntu1

 amd64 build of libpng 1.2.54-1ubuntu1 in ubuntu xenial PROPOSED produced these files:
 libpng12-0_1.2.54-1ubuntu1_amd64.deb (113.7 KiB)

sudo dpkg -i libpng12-0_1.2.54-1ubuntu1_amd64.deb

Monday, August 08, 2016

mysql 에서 인코딩 및 migration 때 고려사항

How to successfully migration mysql v.3x to v.5.x

mysql 에서 글자셋은 3~4가지 영역에서 영향을 줄 수 있는데요,

1. mysql DB service daemon 시작때 옵션으로 지정해 '전체 서비스 영역'으로 강제하는 방법
(직접 소스 컴파일 설치했을 경우 character set 이 불분명한 경우도 있음)
  : daemon, log, service check, --with option, configure  ..

2. mysql.cnf 혹은 my.cnf 에서 'daemon 영역', 'client 영역'에서 charset,
   init_connect=set 으로 collation 지정하는 방법,
  : check System configuration file

3. db 와 table 에서 생성시 지정하는 방법(관리자, 사용자지정) 이 있습니다.
  : show variables like 'c%';
  : ...

4. 글자셋과 관련해 Service 와 Client가 자동설정 (예를들면 auto handshake) 하거나
   혹은 하지못하게 강제하는 방법이 있는데, 이는 연결 클라이언트에세 초기 연결시
   SET collation, SET NAMES 같은 방법으로 지정하고 이후 작업을 수행하는
   상황입니다.
  : php, asp, c, find & grep with 'SET keyword'

문제는, mysql v.3x -> v5.x 로 가면서 3가지 영역에서 많은 부분이 add & depricate
됐고, 각각의 사용자 DB/Table 또한 생성때 개별 설정이 가능하기 때문에 다중사용자
환경에서 일치하지 않는-깨지는 현상은 당연한 상황입니다.

굳이 분리한다면, 1은 Engineer, 2는 Admin, 3은 User, 4는 Programmer 에서 영역에
분산된 것으로, 각각에서 charset 관련된 걸 나열하고 해당 mysql 버전과 호환이
되는지 확인하면 됩니다.

이후에, backup & restore dump 때 호환이 가능하도록 글자셋 변경을 지정하여
수행하면 되고, 만약 두 버전간 dump된 파일에서 변환을 수행할 수 없다면, iconv
같은 변경을 해줘야 합니다.  또한 일부 애플리케이션에서는 글자셋을 수동으로
지정한 경우가 많은데, 이럴 경우 해당 프로그램 또한 검토해야 합니다.


사족으로 말씀드리면, mysql 에서 Enterprise Edition 영역을 둬서, 소스보다는
'서비스 영역'으로 Enterprise 환경에서 System Integration 을 따로 지원케
했는데요, 이런 추세에 영향을 받아 Postgres 에서 v8,v9에서 Enterprise 를
도입했죠. 흔히 말하는 '적정기술수준'에서 mysql 이 postgresql 를 각성시킨게 아마
이부분일 겁니다.

Oracle XE installation in Windows 10

Windows 10에 오라클 설치 후 정상작동하지만 재부팅 후 혹은 네트워크 설정 변경 후 서비스가 작동하지 않거나 접속이 안되는 경우

- tnsnames.ora 설정을 변경하면, 시스템 레지스터리에 반경하기 위해서는 시스템 권한 상승이 필요하다.

- 하지만, 오라클에서 레지스터리 적용을 위해서는 UAC 가 장동되는 상태에서는 재설정이 반영되지 않으므로 UAC를 껐서 시스템 영역에 적용 후 재작동을 확인하고 다시 UAC를 다시 켜야한다.

--
A few days ago some of my former colleague installed  Oracle XE on windows 10 which is brand new computer. A few days later he installed and setup every thing but Oracle XE service wan't running.

 He changed computer name and network interface ip which is not the reason for failed startup service he presume. And I thonght he is right but we didn't installed it before Windows 10. So, we changed tnsnames.org, System Environment of OS,

Then, we turned of UAC which is blocking us from changing windows hosts file.
After boot service and sqlexploer is successfully connect!

Monday, May 30, 2016

BrowserAddonsView v1.05 - Web browser addons/plugins

http://nirsoft.net/utils/web_browser_addons_view.html

BrowserAddonsView v1.05 - Web browser addons/plugins

Monday, May 23, 2016

emacs client for Mail - mu4e

;;;; Google mail 을 사용하기 위해서는 google 에서 [보안이 약한 기기에서 접속 허용]을 승인해 줘야만 접속할 수 있다.
;;;; all set then --> M-x mu4e

;;;; ----------------------------------------------------------------------

;;;; src: https://github.com/djcb/mu

;;;; ----------------------------------------------------------------------
;;;; ref. mu4e - http://qdot.github.io/conf_emacs/
;(require 'mu4e-vars)
;
;(when linux-p
;  (setq mu4e-mu-binary "/home/qdot/usr/bin/mu"))
;
;(when macosx-p
;  (setq mu4e-mu-binary "/opt/homebrew/bin/mu"))
;
;(setq mu4e-maildir "~/Mail") ;; top-level Maildir
;(setq mu4e-html2text-command "w3m -dump -T text/html")
;(setq mu4e-view-prefer-html t)
;(setq mu4e-use-fancy-chars t)
;(setq mu4e-get-mail-command "offlineimap")
;(setq mu4e-update-interval 300)
;(setq mu4e-attachment-dir  "~/Downloads")
;
;(when (fboundp 'imagemagick-register-types)
;  (imagemagick-register-types))
;(setq mu4e-view-show-images t)
;(setq mu4e-view-show-addresses t)

;;;; ----------------------------------------------------------------------
;;;; config. http://www.djcbsoftware.nl/code/mu/mu4e/Gmail-configuration.html#Gmail-configuration
(require 'mu4e)

;; default
;; (setq mu4e-maildir "~/Maildir")

(setq mu4e-drafts-folder "/[Gmail].Drafts")
(setq mu4e-sent-folder   "/[Gmail].Sent Mail")
(setq mu4e-trash-folder  "/[Gmail].Trash")

;; don't save message to Sent Messages, Gmail/IMAP takes care of this
(setq mu4e-sent-messages-behavior 'delete)

;; (See the documentation for `mu4e-sent-messages-behavior' if you have
;; additional non-Gmail addresses and want assign them different
;; behavior.)

;; setup some handy shortcuts
;; you can quickly switch to your Inbox -- press ``ji''
;; then, when you want archive some messages, move them to
;; the 'All Mail' folder by pressing ``ma''.

(setq mu4e-maildir-shortcuts
    '( ("/INBOX"               . ?i)
       ("/[Gmail].Sent Mail"   . ?s)
       ("/[Gmail].Trash"       . ?t)
       ("/[Gmail].All Mail"    . ?a)))

;; allow for updating mail using 'U' in the main view:
(setq mu4e-get-mail-command "offlineimap")

;; something about ourselves -- change this
(setq
   user-mail-address "google_Accoiunt@gmail.com"
   user-full-name  "Yongsu Guo"
   mu4e-compose-signature
    (concat
      "Alex Bender\n"
      "http://youngsu.blogspot.kr\n"))

;; sending mail -- replace USERNAME with your gmail username
;; also, make sure the gnutls command line utils are installed
;; package 'gnutls-bin' in Debian/Ubuntu

(require 'smtpmail)
(setq message-send-mail-function 'smtpmail-send-it
   starttls-use-gnutls t
   smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))
   smtpmail-auth-credentials
     '(("smtp.gmail.com" 587 "alex.bender@gmail.com" nil))
   smtpmail-default-smtp-server "smtp.gmail.com"
   smtpmail-smtp-server "smtp.gmail.com"
   smtpmail-smtp-service 587)

;; alternatively, for emacs-24 you can use:
;;(setq message-send-mail-function 'smtpmail-send-it
;;     smtpmail-stream-type 'starttls
;;     smtpmail-default-smtp-server "smtp.gmail.com"
;;     smtpmail-smtp-server "smtp.gmail.com"
;;     smtpmail-smtp-service 587)

;; don't keep message buffers around
(setq message-kill-buffer-on-exit t)

fcitx language, xim setting, Gnome Key change

* fcitx language, xim setting, Gnome Key change
----> Fxitx input 설정
  1. 시스템 설정 > 언어지원 >  한국어, 중국어(간체) (, 러시아어, 일본어) 추가

  2. 시스템 기본 언설 설정을 "English" 로 둔다. 혹은 "한국어"로 바꾼다.
   영어를 맨위로 사용할 경우 시스템 메뉴는 영어를 사용하게 된다. 단, 재부팅 후 적용된다.

  3. 시스템 설정 > 하드웨어 > 키보드  로 이동한다.
     [바로가기] - [자판입력] 에서 입력소스 --> [텍스트 입력창] 으로 간다.
     여기에서, [+] 키를 선택해서
     [한국어] / [Pinyin(Fcitx)] / [Hangul(Fcitx)] 를 추가한다.

  4. 기본설정 변경 --> [한국어]
     [다음 입력 소스로 전환 전경] -> Alt + Space (한/중/영 세 언어간 이동을 말하는 키)
:    [이전 입력 소스로 전환] -> [사용하지 않는다] 혹은 [Shift + Alt + Space] 로 바꾼다.
     [[file:img/key_fcitx_v1.png]]

     기본설정 변경 --> [Pinyin(Fcitx)] (위에서 [한국어] 를 선택하고 해도 된다)

  alt-space 는 emacs 키와 겹치므로 기존에 키가 지정된 것을 지운다.

 :  keyboard > global setting > window > window active > disable alt-space
 :  키보드 > 전역설정 > 윈도우즈 > disable alt-space
 :  alt-space is Set Mark Command
 :  It is bound to <C-kanji>, C-SPC, M-SPC.
 :  (cua-set-mark &optional ARG)


  5. fcitx 설정 -> [입력기 설정] - [전역설정] - [입력기 전환]
    -> ConfigureFcitx --> [Global Config] 혹은 [전역설정] 항목

    (1) 입력기 전환 (Trigger Input Method) => Hangul - Shift+Space 가 되도록 한다.
    (2) Extra key for trigger input method 를 선택하고 Ctrl+Shift 를 선택하도록 한다.
    (3) 입력기 사이의 스크롤은 Ctrl+Shift 가 되도록 한다.
     [[file:img/key_fcitx_v0.png]]


6. 키 사용방법:
  > Alt+Space  -->  [영문 -> 중국어 -> 한국어] 3 개를 차례로 전환한다.
  > L_Shift = (Ctrl+Shift) --> 한-영 toggle, 중-영 toggle (단, 현재 입력기가 중국어나 한국어일때만 작동)
  > Shift+Space --> 한-영 toggle 이며, 중-영 toggle
    Shift --> 위 Shift+Space 키와 동일.

 ※ 위에서 설정이 안 될 경우, ~/.config/fcitx , ~/.config/fcitx-qimpanel 백업을 복구한 다음에 사용.
    테스트 하기 전 rebooting 할 것, rebooting 후 fcitx 가 서비스가 완전히 올라온 다음에 테스트 할 것 (- not necessary but sometimes it resolve some errors)



7. backup & restore

cd ~/.config
tar cvf fcitx_dist.tar fcitx
tar cvf fcitx-qimpanel_dist.tar fcitx-qimpanel/



* Hud , search box
  > turn off search box ; file, web, <-- use other tool (see below sections)
    (Unity Tweak Tool 섹션 참조)

  > turn off the search box that appears when I press Alt or Hangul Key
    ; System Settings --> Keyboard --> Short-cuts. --> 실행아이콘
     --> [허드를 표시할 키] --> "한/영키 + Backslash" 로 변경
     --> [검색] --> "Alt+백스페이스" 로 변경

  > system config > keyboard > 바로가기 > 실행아이콘 > 검색 (백스페이스 - 사용안함) , 허드를 표시할 키 (백스페이스 - 사용안함)

Monday, May 16, 2016

postgres - pgmodeler installation in ubuntu with source compile

* postgres - pgmodelear

** new version
 > download: https://github.com/pgmodeler/pgmodeler

sudo apt-get install qt-sdk
sudo apt-get install qttools5-dev
sudo apt-get install libpq-dev
sudo apt-get install libxml2-dev

 > compile
:  sudo apt-get install qt4-qmake  <-- actuall qt50qmake use
sudo apt-get install gcc-4.7
sudo apt-get install libqt4-dev
sudo apt-get install xml2
sudo apt-get install libpq5
sudo apt-get install libqp-dev
sudo apt-get install libpq-dev
sudo apt-get install pkg-config

unzip pgmodeler-develop.zip
cd pgmodeler-develop/

qmake -qt=5 pgmodeler.pro
make
make install
sudo make install


No declaration for attribute connect_timeout of element connection sslmode="disable" auto-browse-db="false"/>

> https://github.com/pgmodeler/pgmodeler/issues/829
$ diff -u /usr/local/share/pgmodeler/conf/defaults/connections.conf /usr/local/share/pgmodeler/conf/connections.conf
#+begin_src
--- /usr/local/share/pgmodeler/conf/defaults/connections.conf   2016-04-17 17:02:45.540901204 -0700
+++ /usr/local/share/pgmodeler/conf/connections.conf    2015-12-30 21:58:24.234252027 -0800
@@ -4,7 +4,7 @@
            Unexpected results may occur if the code is changed deliberately.
 -->
 <connections>
-       <connection alias="local-db" host="localhost" port="5432" dbname="postgres"
-               user="postgres" password="postgres" connection-timeout="2"
+       <connection alias="local-db" host="localhost" port="5432" dbname="postgres"
+               user="postgres" password="postgres" connect_timeout="2"
                sslmode="disable" auto-browse-db="false"/>
 </connections>
#+end_src


> https://github.com/pgmodeler/pgmodeler/issues/823
-- vi ~/.config/pgmodeler/connections.conf
#+begin_src
<?xml version="1.0" encoding="UTF-8" ?>
<!--
  CAUTION: Do not modify this file directly on it's code unless you know what you are doing.
           Unexpected results may occur if the code is changed deliberately.
<connections>
        <connection alias="local-db" host="localhost" port="5432" dbname="postgres"
                user="postgres" password="postgres" connect_timeout="2"
                sslmode="disable" auto-browse-db="false"/>
</connections>
-->
<connections>
       <connection alias="local-db" host="localhost" port="5432" dbname="postgres"
               user="postgres" password="postgres" connection-timeout="2"
                sslmode="disable" auto-browse-db="false"/>
</connections>
#+end_src

The file connections.conf changed in the new release (0.8.2-beta1) and if you're upgrading an installation on your machine it's probably that you' re using the old version of the mentioned file.

The solution: look for the file connections.conf in your local settings storage.

    Linux: /home/[user]/.config/pgmodeler
    Windows: C:\User\[user]\AppData\Local\pgmodeler
    Mac OS X: /User/[user]/Library/Preferences/br.com.pgmodeler

Open the file in a text editor and replace any occurrence of connect_timeout by connection-timeout. Start the application again and it should stop to raise the errors.


** add program shortcuts to unity launcher in ubuntu

- from: http://ubuntuforums.org/showthread.php?t=1972410

1. create a text file "pgmodeler.desktop"

-- /home/guo/bin/desktop/pgmodeler.desktop
 > png available from https://avatars1.githubusercontent.com/u/2207918?v=3&s=400


2. run pgmodeler in terminal then quit
 > unitiy launcher icon apper with ? icon


3. change icon or modify
check if ther was created in pgmodeler.desktop
ls -alh ~/.local/share/applications/pgmodeler.desktop
if there is already created file (pgmodeler.desktop) it will like as following.

edit it or create one.

--> from
#+begin_src
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=pgModeler - PostgreSQL Database Modeler 0.8.2-beta1
Icon=pgmodeler.png
Path=/usr/local/bin
Exec=pgmodeler
StartupNotify=false
StartupWMClass=pgmodeler
OnlyShowIn=Unity;
X-UnityGenerated=true
#+end_src

--> to
modify as following ~/.local/share/applications/pgmodeler.desktop
#+begin_src
[Desktop Entry]
Name=pgmodeler
Comment=pgmodeler for PostgreSQL
Exec=/usr/local/bin/pgmodeler
TryExec=/usr/local/bin/pgmodeler
Icon=/home/guo/bin/icon/pgmodeler.png
StartupNotify=false
Terminal=false
Type=Application
Categories=Database; Misc
#+end_src

rerun pgmodeler and fix it to the launcher


4. locate file for future restall and backup
sudo updatedb
locate pgmodeler.desktop

~/.gnome/apps/pgmodeler.desktop
~/.local/share/applications/pgmodeler.desktop
~/bin/desktop/pgmodeler.desktop

Sunday, May 08, 2016


[조세도피처의 한국인들 2016]54명 명단 공개(1) 진로, 대우, YBM, 보루네오

http://newstapa.org/33226

 

[조세도피처의 한국인들 2016]54명 명단 공개(2) IT 업계, 수퍼개미, 박물관장과 목사까지..

 http://newstapa.org/33202

Saturday, April 09, 2016

mono - csharp in linux - ubuntu linux version

* mono

** mono-gmcs
sudo apt-get install mono-gmcs

which gmcs
: /usr/bin/gmcs


** mono-develop
  http://www.mono-project.com/
  For a nice IDE to work in try monodevelop

sudo apt-get install mono-complete
sudo apt-get install mono-devel
sudo apt-get install monodevelop

or -> sudo apt-get install mono-devel mono-complete monodevelop

edit/create new launcher items in Unity by hand?

from: http://askubuntu.com/questions/13758/how-can-i-edit-create-new-launcher-items-in-unity-by-hand

Updated: 2015-Dec

For Ubuntu 15.10 or 14.04 LTS (11.10 or later, with Unity (3D))
NOTE: This can replace the function of an existing icon, or (once created) can be searched for (from Dash icon) to add to current button-bar.

First make your OWN copy of any of the .desktop files you want to modify. It is MUCH safer, and then you can always delete and start over.
        (list all files)
        ls /usr/share/applications/*.desktop

Example: Mozilla Firefox, firefox.desktop
        (do this once, or after deleting any failed attempt)
        cp /usr/share/applications/firefox.desktop ~/.local/share/applications

Then carefully change any wording, or add additional options.
        (edit the file)
        gedit ~/.local/share/applications/firefox.desktop &
Note: The ampersand '&' releases the command line immediately.

--

For 11.04 and earlier:

Unity does support custom launchers from .desktop files. To create custom launcher from a .desktop file you need to create a *.desktop file for your program.
gedit ~/.local/share/applications/name.desktop

--

monodevelop startup with error message
Could not save solution: /usr/lib/monodevelop/bin/MonoDevelop.sln.
example 
** fix ubuntu launcher icon in Unity
Q. How can I edit/create new launcher items in Unity by hand?
A. from -- to ++ modify

-- ~/.local/share/applications
#+TITLE: monodevelop.desktop
#+begin_src 
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=MonoDevelop
Icon=monodevelop
Path=/data/qesdes/tmp
Exec=monodevelop /usr/lib/monodevelop/bin/MonoDevelop.exe <---- change this
StartupNotify=false
StartupWMClass=MonoDevelop
OnlyShowIn=Unity;
X-UnityGenerated=true
Comment=
Terminal=false
#+end_src

++ ~/.local/share/applications
#+begin_src 
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=MonoDevelop
Icon=monodevelop
Path=/data/qesdes/tmp
Exec=monodevelop %F
StartupNotify=false
StartupWMClass=MonoDevelop
OnlyShowIn=Unity;
X-UnityGenerated=true
Comment=
Terminal=false
#+end_src

Saturday, January 16, 2016

remove unwanted service - Be Carefull!!

* remove unwanted service
http://www.hecticgeek.com/2012/06/few-things-to-speed-up-ubuntu/


* compiz and unity-tweak-tool
sudo apt-get install unity-tweak-tool
sudo apt-get install unity-webapps-common

unity-tweak-tool &
  > Window Manager > General >
    General > Window snapping > turn off
    General > General > turn off [Animations]

** disabling-zeitgeist
http://askubuntu.com/questions/45548/disabling-zeitgeist

zeitgeist-daemon --quit
cd /usr/bin/
sudo mv zeitgeist-daemon zeitgeist-daemon.bak
sudo mv zeitgeist-datahub zeitgeist-datahub.bak


* disable avahi
from: http://askubuntu.com/questions/339702/network-service-discovery-disabled-what-does-this-mean-for-me

- Network service discovery disabled: What does this mean for me?
Every time at boot I get a message “Network service discovery disabled. Your current network has a .local domain, which is not recommended and incompatible with the Avahi network service discovery. The service has been disabled.”

A-1.

It looks like avahi-daemon is started when the network connection is established
(/etc/network/if-up.d/avahi-daemon). This notification is informing you that
mDNS (Avahi) has been disabled. It's only used for a small number of
applications that only work on the local network, it won't adversely affect your
internet connection or DNS.  The most well known use for mDNS is sharing music
with Rhythmbox (or iTunes) over your LAN. It's an Apple technology, but it's
largely been ignored in favour of uPNP or DLNA.

To disable it, you must edit the file /etc/default/avahi-daemon as root:

sudo -i
gedit /etc/default/avahi-daemon

and add this line (or change it if already exists to):
AVAHI_DAEMON_DETECT_LOCAL=0

Source: http://ubuntuforums.org/showthread.php?t=1632952


A-2.
According to the Avahi wiki there are two workarounds:
In /etc/avahi/avahi-daemon.conf uncomment and change the line with domain name to
domain-name=.alocal
Second one:
In /etc/nsswitch.conf delete a [NOTFOUND=return] text.


* disableDeja-dup backup
sudo apt-get autoremove deja-dup

How to change the background colour of a window?

 How to change the background colour of a window?
http://askubuntu.com/questions/68003/how-to-change-the-background-colour-of-a-window
First install dconf-editor if you dont have it already:
sudo apt-get install dconf-tools
And then run the dconf editor:

sudo dconf-editor

Browse to org.gnome.desktop.interface and locate: gtk-color-scheme

Edit the property to the colours of your choosing:

 >> add with it
bg_color:#ebe0be;selected_bg_color:#737370;base_color:#ffd39b
or
bg_color:#f0f1f2;selected_bg_color:#4677f0


The colours are in hexadecimal in the format #RedRedGreedGreedBlueBlue
For example:
    Black = #000000 (None of any colour)
    White = #ffffff (The maximum
    of every colour) Red = #ff0000 (Red Only)
Happy Customising!

(add-hook 'org-mode-hook 'css-color-turn-on-in-buffer)

로그인 후 Launchear 가 사라질 때 - 재설정

* 로그인 후 Launchear 가 사라질 때 - 재설정
 sudo reboot
 sudo apt-get update
 sudo apt-get install --reinstall ubuntu-desktop
 sudo apt-get install unity
 sudo apt-get install compizconfig-settings-manager
 dconf reset -f /org/compiz/
 setsid unity
 gconf-editor
 sudo gconf-editor
 sudo apt-get install gconf-editor
 sudo gconf-editor
 ps -ax
 dpkg -l |grep remmina
 dpkg --list |grep gstream
 dpkg -l |grep avahi
 sudo vi /etc/default/avahi-daemon
 dpkg -l |grep deja-dup
 sudo apt-get autoremove deja-dup
 sudo apt-get autoremove eja-dup-backend-gvfs
 dpkg -l |grep deja
 dpkg -l |grep deja-dup
 sudo apt-get autoremove deja-dup
 sudo apt-get autoremove indicator-messages
 dpkg -l |grep zeit
 sudo apt-get purge libzeitgeist-2.0-0 rhythmbox-plugin-zeitgeist zeitgeist-core zeitgeist-datahub
 dpkg -l |grep Telepathy
 sudo apt-get purge telepathy-haze
 sudo apt-get purge libfolks-telepathy25:amd64
 sudo apt-get purge libtelepathy-glib0:amd64
 sudo apt-get purge libtelepathy-logger3:amd64
 sudo apt-get purge telepathy-idle telepathy-indicator telepathy-logger telepathy-mission-control-5 telepathy-salut
 sudo apt-get purge rhythmbox rhythmbox-plugin-cdrecorder rhythmbox-plugin-magnatune rhythmbox-plugins unity-lens-music unity-scope-gmusicbrowser unity-scope-musicstores librhythmbox-core9
 sudo apt-get remove geoclue geoclue-ubuntu-geoip geoip-database whoopsie


packages

* libreoffice
sudo apt-get install libreoffice-base
sudo apt-get install libreoffice-sdbc-postgresql

-> connection string for postgres: postgresql://localhost:5432/emacsdb

* thunderbird
enigmail

USER_ME@gig:~$ gpg --version
gpg (GnuPG) 1.4.18

enigmail 1.8.2 message
> This is the last version of enigmail to support this version of GnuPG. Future version only work with GnuPG 2.0 and newer.
We therefore recommend that you upgrade to the lastest version of GnuPG 2.0.x.


* pdfsam
  A tool to split and merge pdf documents


* sudo apt-get install arc-theme
webbrowser-app
sudo apt-get install webbrowser-app

Postgres

* postgres
- postgres
  > Client Installation
 sudo apt-get install postgresql-client
 psql -h server.domain.org database user
 SELECT * FROM table WHERE 1;

- To install the server locally use the command line and type:
  apt-cache search postgres
  ...

- pgadmin3
sudo apt-get install pgadmin3

- Basic Server Setup

: this connects as a role with same name as the local user,
: i.e. "postgres", to the database called "postgres" (1st argument to psql).

sudo -u postgres psql postgres

Set a password for the "postgres" database role using the command:
\password postgres


sudo -u postgres psql postgres -h localhost
ALTER USER USER_ME WITH PASSWORD 'MY_PASS_IS';


cd /usr/share/postgresql/9.4/extension


- Create database
 To create the first database, which we will call "mydb", simply type:
 sudo -u postgres createdb mydb


 > Install Server Instrumentation (for PgAdmin) for Postgresql 8.4 or 9.3

PgAdmin requires the installation of an add-on for full
functionality. The "adminpack" addon, which it calls Server
Instrumentation, is part of postgresql-contrib, so you must install
that package if you haven't already:

sudo apt-get install postgresql-contrib

  Then to activate the extension, for ""Postgresql 8.4"", run the adminpack.sql script, simply type:
 sudo -u postgres psql < /usr/share/postgresql/8.4/contrib/adminpack.sql

For "Postgresql 9.3"+ install the adminpack "extension" in the "postgres" database:
 sudo -u postgres psql
 CREATE EXTENSION adminpack;

 sudo -u postgres psql < /usr/share/postgresql/9.4/extension/adminpack--1.0.sql

- Alternative Server Setup

 sudo -u postgres createuser --superuser $USER
 sudo -u postgres psql
 postgres=# \password $USER
 sudo -u postgres createdb $USER
 psql
 create database amarokdb;
 pgadmin3
 sudo vi /etc/postgresql/9.4/main/pg_hba.conf

# Database administrative login by Unix domain socket
local   all             postgres                                peer
to
# Database administrative login by Unix domain socket
local   all             postgres                                md5

sudo /etc/init.d/postgresql reload

cd /etc/postgresql/9.4/main/

$ sudo vi pg_hba.conf
# "local" is for Unix domain socket connections only
#local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
#
# TYPE  DATABASE    USER        IP-ADDRESS        IP-MASK           METHOD
host    all             all             10.10.50.0    255.255.255.0      md5


$ sudo postgresql.conf
add
  listen_addresses = '*'

then
sudo /etc/init.d/postgresql reload


To create a database with a user that have full rights on the database, use the following command:

sudo -u postgres createuser -D -A -P myuser
sudo -u postgres createdb -O myuser mydb

sudo /etc/init.d/postgresql reload
sudo /etc/init.d/postgresql restart

# "local" is for Unix domain socket connections only
# local   all             all            trust
#
# IPv4 local connections:
#host    all             all            127.0.0.1/32         md5
host    all             all             0.0.0.0/0            md5
host    emacsdb         USER_ME             0.0.0.0/0            md5
host    USER_ME             USER_ME             0.0.0.0/0            md5
# host all all ::1/128 md5 host all postgres 127.0.0.1/32 md5
#
# TYPE  DATABASE    USER        IP-ADDRESS        IP-MASK           METHOD
#host    all             all             10.10.50.0    255.255.255.0      md5


- pgmodeler
http://sourceforge.net/projects/pgmodeler/files/latest/download

Pranten

 Pranten