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

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'

grub은 일단 한번 부팅에 실패하면,  다음 부트시에는 무조건 부트 메뉴에서 대기하면서 사용자의 입력을 받는데, 여러가지 이유로 좀 귀찮다. 타임아웃을 주고 그냥 부팅 시도하게 하자.

/etc/default/grub 파일에 아래 내용 추가 후, sudo update-grub해주면 된다.

GRUB_RECORDFAIL_TIMEOUT=120      # wait for 120 sec.


ref: http://askubuntu.com/questions/178091/how-to-disable-grubs-menu-from-showing-up-after-failed-boot


happy hackin'


ubuntu 64bit에서 32bit package 설치하기 (예시):

$ sudo dpkg --add-architecture i386

$ sudo apt-get update

$ sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386

ref: http://selendroid.io/setup.html


happy hackin'

erlang string to term or expr

함수형 언어/Erlang 2015. 4. 7. 16:41 by manywaypark

string to term:

ErlTerms = "{a,b,c,d}.".

{ok,Tokens,_} = erl_scan:string(ErlTerms).

{ok,Term} = erl_parse:parse_term(Tokens).

Term -> {a,b,c,d}.


string to expression (and eval):

StrTerm = "fun() -> result_atom end.".

{ok,Tokens,_} = erl_scan:string(StrTerm).

{ok,[Expr]} = erl_parse:parse_exprs(Tokens).

erl_eval:expr(Expr,[]).

resulted in: {value,#Fun,[]}


refs:

https://github.com/skruger/Surrogate/issues/3

http://stackoverflow.com/questions/1974236/string-to-abstract-syntax-tree

http://stackoverflow.com/questions/2008777/convert-a-string-into-a-fun


happy hackin'

CapsLock을 Ctrl 키로 매핑하기.

tips & tricks 2015. 3. 11. 10:55 by manywaypark

이전 글에서도 일부 windows 관련 언급했지만, 여러 플랫폼에서 잘 정리된 것이 있어서 링크 공유.


내가 찾은 제일 간편한 방법:

Mac - system 설정에 선택 옵션이 있다.

Ubuntu - gnome-tweak-tool에서 설정.

Windows - ctr2cap 사용.  (관리자 권한의 명령행에서 ctr2cap /install 하면 설치되고 ctr2cap /uninstall 하면 제거된다)


refs:

* http://www.noah.org/wiki/CapsLock_Remap_Howto -> 여기 linux console부분에 나오는 방법은 두 키를 바꾸는 것으로 (HHKBP같은 일부 키보드의 경우 원치않는 결과가...)

* http://askubuntu.com/questions/462021/how-do-i-turn-caps-lock-into-an-extra-control-key


happy hackin'


ubuntu unity indicators

tips & tricks/Linux/Unix 2015. 2. 25. 11:17 by manywaypark

unity top panel에 추가 가능한 다양한 indicator들이 있다. 보통 top panel은 상단에 위치하고 indicator들은 우측에 배치된다.

대충 아래와 같이 하면 현재 설치가능한 indicator들을 볼 수 있는데,

apt-cache search indicator | grep ^indicator

실제로는 PPA로 제공되는 경우가 많다.

여기에서 다양한 indicator들을 찾을 수 있다.

http://askubuntu.com/questions/30334/what-application-indicators-are-available

나는 indicator-multiload, indicator-sensors 등을 설치했다.


ref: http://askubuntu.com/questions/29757/what-can-replace-system-monitoring-in-the-top-gnome-panel-in-unity


happy hackin'


2015-03-09 http://www.webupd8.org/2013/10/8-things-to-do-after-installing-ubuntu.html (여기에도 app indicator 들 소개하는 부분이 있다).

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

공지사항

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

05-05 21:13