manywaypark's Blog
개발, 검색, 함수

alias가 아닌, 원래(vanilla) 명령어를 실행하게 한다. 

command라는 command도 같은 역할을 함.


refs: 

  • http://serverfault.com/questions/480271/backslash-at-the-beginning-of-a-command
  • http://www.cyberciti.biz/faq/bash-shell-temporarily-disable-an-alias/

happy hackin'


ProGit 전자책을 만들어 보자

tips & tricks 2016. 4. 14. 15:57 by manywaypark

내 경우는 아래 처럼 하면 됐다.

$ git clone https://github.com/progit/progit2-ko.git

$ cd progit2-ko

$ \curl -sSL https://get.rvm.io | bash -s stable --ruby

$ source ~/.rvm/scripts/rvm

$ bundle install

$ asciidoctor-pdf-cjk-kai_gen_gothic-install

$ bundle exec rake book:build


rvm 받을 때 GPG 어쩌구 하면 이렇게 해준다.

$ command curl -sSL https://rvm.io/mpapis.asc | gpg --import -


2018-02-01 추가:


현재 ubuntu 16.04, ruby2.3 환경에서 pdf 생성하려고 하면 아래와 같은 에러가 발생한다.

dhpark@boo:~/hacking/progit2-ko$ bundle exec asciidoctor-pdf -r asciidoctor-pdf-cjk-kai_gen_gothic -a pdf-style=KaiGenGothicKR progit.asc

/var/lib/gems/2.3.0/gems/prawn-templates-0.0.3/lib/prawn/templates.rb:246:in `<top (required)>': can't modify frozen Array (RuntimeError)

        from /var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.11/lib/asciidoctor-pdf/converter.rb:6:in `require'

        from /var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.11/lib/asciidoctor-pdf/converter.rb:6:in `<top (required)>'

        from /var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.11/lib/asciidoctor-pdf.rb:3:in `require_relative'

        from /var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.11/lib/asciidoctor-pdf.rb:3:in `<top (required)>'

        from /var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.11/bin/asciidoctor-pdf:4:in `require'

        from /var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.11/bin/asciidoctor-pdf:4:in `<top (required)>'

        from /usr/local/bin/asciidoctor-pdf:23:in `load'

        from /usr/local/bin/asciidoctor-pdf:23:in `<main>'

dhpark@boo:~/hacking/progit2-ko$ 


참고 링크에서는 prawn 버전을 낮추면(2.2 -> 2.1) 해결된다고 되어있는데, gem repository에 2.1 버전이 없다. Orz.


ref: https://github.com/asciidoctor/asciidoctor-pdf/issues/782

happy hackin'



Ubuntu box를 AP로 써보자

tips & tricks/Linux/Unix 2016. 3. 28. 14:50 by manywaypark

참고 링크 보면 금방 따라할 수 있다.

Network Manager에서는 잘 되는데, 아직 Ubuntu GUI에서는 간편하게 할 수는 없다 (KDE 등에서는 간편하게 설정할 수 있다고 함).

ref: http://ubuntuhandbook.org/index.php/2014/09/3-ways-create-wifi-hotspot-ubuntu/


[Mac] byobu on max osx

tips & tricks/Mac 2016. 3. 21. 21:15 by manywaypark

byobu는 내가 쓰는 macport에서는 package로 제공되지 않는구나. Orz

homebrew에서는 지원되는듯...

여튼 아래에 설치로그를 남긴다. 

$ git checkout https://github.com/dustinkirkland/byobu.git

......

$ cd byobu

$ autoreconf -i

configure.ac:6: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:

configure.ac:6: http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation

Makefile.am: error: required file './ChangeLog' not found

autoreconf: /opt/local/bin/automake failed with exit status: 1

$ touch ChangeLog

$ autoreconf -i

......

$ make

......

$ byobu

readlink: illegal option -- f

......

$ sudo port install tmux coreutils

......

$ byobu

--> success!!


ref: http://apple.stackexchange.com/questions/64395/byobu-using-invalid-readlink-f-option-on-os-x-mountain-lion


happy hackin'

ssh-copy-id가 없을 때

tips & tricks 2016. 3. 19. 21:10 by manywaypark

ssh-copy-id가 없을 때 (mac에는 기본으로 깔리지 않는 듯),

(그냥 대상 호스트의 authorized_keys 파일에 pubkey를 추가하기만하면 되는데 이 생각을 왜 못했을까? Orz)

cat ~/.ssh/id_rsa.pub | ssh user@machine "mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys"


ref: http://www.commandlinefu.com/commands/view/188/copy-your-ssh-public-key-to-a-server-from-a-machine-that-doesnt-have-ssh-copy-id


happy hackin'

problem

win32환경에서 qt/mingw를 사용해서 빌드할 때 아래 같이 moc.exe 를 못찾겠다고 하면서 컴파일 실패하는 경우가 있다.


......

compiling ../../qwt/src/qwt_thermo.cpp

compiling ../../qwt/src/qwt_wheel.cpp

moc ../../qwt/src/qwt_dyngrid_layout.h

/usr/bin/sh: C:\Qt\5.3\mingw482_32\bin\moc.exe: command not found

Makefile.Release:368: recipe for target 'moc/moc_qwt_dyngrid_layout.cpp' failed

mingw32-make[2]: *** [moc/moc_qwt_dyngrid_layout.cpp] Error 127

mingw32-make[2]: Leaving directory 'C:/Users/dhpark/hacking/qwt-code/build-qwt-Desktop_Qt_5_3_MinGW_32bit-Release/src'

mingw32-make[1]: *** [release-all] Error 2

Makefile:38: recipe for target 'release-all' failed

mingw32-make[1]: Leaving directory 'C:/Users/dhpark/hacking/qwt-code/build-qwt-Desktop_Qt_5_3_MinGW_32bit-Release/src'

Makefile:45: recipe for target 'sub-src-make_first-ordered' failed

mingw32-make: *** [sub-src-make_first-ordered] Error 2

14:27:20: The process "C:\Qt\Tools\mingw482_32\bin\mingw32-make.exe" exited with code 2.

Error while building/deploying project qwt (kit: Desktop Qt 5.3 MinGW 32bit)

When executing step 'Make'

14:27:20: Elapsed time: 03:23.


solution

sh의 문제로 파악됨. 즉, 다른 sh가 compile 과정에 개입되어서 생기는 문제임.

Qt/MingW 설치 디렉토리 이외의 sh를 사용하지 못하게 PATH에서 Cygwin, MSYS등을 제거한다.


ref: http://www.qtcentre.org/threads/947-Problem-with-make-(can-t-call-moc-exe)


happy hackin'

Reverse SSH Tunneling

tips & tricks 2015. 9. 16. 18:41 by manywaypark

한쪽에서 접속하면서 역방향 연결을 하는 방법이 있지 않을까?

https://www.howtoforge.com/reverse-ssh-tunneling


이런 거도 있고,

http://superuser.com/questions/37738/how-to-reliably-keep-an-ssh-tunnel-open


최종적으로 원하는 형태:

https://www.async.fi/2013/07/autossh-with-ubuntu-upstart/


참고로, cygwin에서도 됨.


happy hackin'



pgloader - from mysql to postgresql

tips & tricks 2015. 8. 21. 17:08 by manywaypark

mysql에서 postgresql로 이전하는 방법에 대해 간략히 기술한다.


# 소스 받고 빌드하기

⟫ apt-get install sbcl unzip libsqlite3-dev make curl gawk freetds-dev libzip-dev

⟫ git clone https://github.com/dimitri/pgloader.git

⟫ cd pgloader

⟫ make pgloader


# pgloader 사용 해서 옮기기

⟫ sudo -u postgres build/bin/pgloader mysql://user:password@localhost/from_db postgresql://user:password@localhost/to_db


# schema만 덤프

⟫ sudo -u postgres pg_dump -s to_db > /tmp/schema_for_postgresql.sql


# TODO

덤프한 schema 파일을 열어보면 실제로는 동일한 것들이 중복되어 있는 경우가 있다 (ENUM 등). 수작업이 좀 필요한 부분이다.

schema를 깔끔히 정리하고, 관련 code를 변경한다.


추가적으로 erlang 사용자는 sqerl을 사용하면 인생이 조금 편해질 것이다.


refs:

  • http://pgloader.io/
  • http://pgloader.tapoueh.org/howto/pgloader.1.html
  • https://github.com/chef/sqerl


happy hackin'

PostgreSql index 생성

tips & tricks 2015. 8. 21. 14:42 by manywaypark

PostgreSql에서는 table creation시에 index를 생성할 수 없다.

다만 primary key나 unique는 자동으로 index가 생성된다.


ref: http://stackoverflow.com/questions/6239657/postgresql-can-you-create-an-index-in-the-create-table-definition


happy hackin'

unity-tweak-tool

tips & tricks/Linux/Unix 2015. 5. 14. 18:12 by manywaypark

System Settings에서 보다 더 세세하게 Ubuntu desktop을 제어하고 싶은가?

그렇다면 unity-tweak-tool을 써보라.


ref: https://apps.ubuntu.com/cat/applications/unity-tweak-tool/


2015-07-13: 비슷한 이름의 ubuntu tweak이라는 도구도 있다 (직접하기 귀찮은 구버전 커널들 지우기 등을 자동으로 해준다). 

happy hackin'

1 2 3 4 5 6 7 8 ··· 16 
분류 전체보기 (306)
잡담 (20)
함수형 언어 (65)
emacs (16)
java (18)
tips & tricks (154)
사랑 (1)
가사 (0)
독서 (4)
mobile (6)
비함수형 언어 (2)

공지사항

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

05-02 08:48