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

windows product key 보기

tips & tricks/Win 2019. 8. 1. 22:21 by manywaypark

Single board computer나 embedded device에 미리 설치되어 나오는 윈도우즈의 경우 product key를 따로 제공하지 않는 경우가 있다.

command line에서 아래처럼 하면 볼 수 있다.

wmic path SoftwareLicensingService get OA3xOriginalProductKey

 

ref: https://www.groovypost.com/howto/find-your-windows-10-product-key/

 

How to Find your Windows 10 Product Key

Microsoft has made every effort to make Windows 10 licensing convenient. That said, there are times where product activation might not work according to plan. Whether you want to perform a new install or transfer your Windows 10 license to a new computer;

www.groovypost.com

happy hackin'

참고 링크에 있는 것을 요약한다.


  • broadcast - channel내의 모든 client들에게 전송
  • broadcast_from - 메시지를 발송한 client를 제외한 channel내의 모든 client들에게 전송
  • push - 메시지를 발송한 client에게만 전송

다르게 생각해보면 broadcast = broadcast_from + push


ref: https://www.reddit.com/r/elixir/comments/4t6k6w/phoenix_what_is_the_difference_between_broadcast/


happy hackin'

eshell buffer 내용 지우기

emacs 2019. 1. 16. 16:43 by manywaypark

개발 도중에 eshell buffer에서 server 프로그램 등을 실행하는 경우가 있는데 가끔 며칠 동안 로그가 쌓이면 텍스트 검색 등이 무지하게 느려진다.

다음 함수를 *scratch* buffer 등에서 한번 eval(C-x, C-e)해주거나 초기화 과정에서 eval될 수 있도록 설정한 후에 eshell buffer에서 clear를 입력해주면 버퍼가 깨끗이 비워진다.

(defun eshell/clear ()

  "Clear the eshell buffer."

  (let ((inhibit-read-only t))

    (erase-buffer)

    (eshell-send-input)))

이걸 왜 여태껏 모르고 살았던 거지? Orz.


ref: https://emacs.stackexchange.com/questions/12503/how-to-clear-the-eshell


happy hackin'


PS. 컥... eshell/clear는 기본 함수구나.... eshell-truncate-buffer(C-c C-t)를 쓰면 될듯.

https://github.com/cpitclaudel/emacs/blob/master/lisp/eshell/esh-mode.el

Emacs Shell에서 PATH 문제

tips & tricks/Mac 2018. 11. 3. 00:17 by manywaypark

예전에는 이 문제가 안생겼던거같은데, 모하비 업그레이드 후에 생긴것같다.

purcell의 emacs.d를 사용하면 자동으로 exec-path-from-shell을 호출하는 것으로 보이는데 이상하다.


일단 향후 해결을 위해 글을 남김.


TBD


refs: 

https://emacs.stackexchange.com/questions/10722/emacs-and-command-line-path-disagreements-on-osx

https://emacs.stackexchange.com/questions/461/configuration-of-eshell-running-programs-from-directories-in-path-env-variable

http://ergoemacs.org/emacs/emacs_env_var_paths.html

docker에 redmine 설치하기

tips & tricks 2018. 11. 1. 16:35 by manywaypark

기본적으로 container 두 개를 postgresql, redmine으로 실행하면 된다.

두 container를 연결하는 것말고는 뭐 특별한 것은 없다.

아래 참조 링크에서는 backend DB로 MySQL을 사용하는데 나는 Postgresql을 선호하므로 Postgresql을 썼다.


최초 설정:

docker run --name my.postgres -e POSTGRES_PASSWORD=DB_PASSWORD_HERE -d -p 5432:5432 postgres

docker run -d --name my.redmine -p 3000:3000 --link my.postgres:postgres redmine


이제 http://localhost:3000 에 접속하면 redmine을 사용할 수 있다. 최초의 user/password는 admin/admin이다.


이후 실행:

docker start my.postgres my.redmine


NOTE: 여기서 사용한 postgres image는 container를 commit해서 image를 만들어도 data가 보존되지 않는다. (참고 링크 2번 참고)


ref:

http://pseg.or.kr/pseg/infoinstall/6103

https://stackoverflow.com/questions/27377876/docker-postgres-with-initial-data-is-not-persisted-over-commits


happy hackin'

apt-cyg라는 간단한 script를 깔면 된다.


설치:

$ wget https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg

$ install apt-cyg /bin


사용:

$ apt-cyg install emacs


refs:

https://stackoverflow.com/questions/9260014/how-do-i-install-cygwin-components-from-the-command-line

https://github.com/transcode-open/apt-cyg


happy hackin'


qmake file 에서의 INSTALLS

tips & tricks/Qt 2018. 10. 26. 14:01 by manywaypark

qmake 파일에서 INSTALLS에 뭔가 추가할 때는 한번에 하나씩해야한다.

problem:

.lib 파일과 .dll을 각각 /path/to/install의 하위에 설치하려는 (제법 멋진) 의도를 가진 아래 코드는 (n)make install 했을 때 제대로 동작하지 않고 .lib 파일만 설치된다.

    target_lib.path  = /path/to/install/lib

    target_lib.files = $${DESTDIR}/*.lib

    target_dll.path  = /path/to/install/bin

    target_dll.files = $${DESTDIR}/*.dll

    INSTALLS += target_lib target_dll


solution:

이렇게 두 종류의 파일 타입을 각각 써줘야 제대로 동작한다.

    target_lib.path  = /path/to/install/lib

    target_lib.files = $${DESTDIR}/*.lib

    INSTALLS += target_lib

    target_dll.path  = /path/to/install/bin

    target_dll.files = $${DESTDIR}/*.dll

    INSTALLS += target_dll


happy hackin'


PS. 몇년이나 지난 코드에서, 그동안 사용할 때마다 dll은 수동 복사했던 project file에서 발견함. Orz.


개발용 Windows VM

tips & tricks/Win 2018. 10. 21. 22:11 by manywaypark

MS에서 개발 환경이 구축된 VM을 배포하는구나.

https://developer.microsoft.com/ko-kr/windows/downloads/virtual-machines


여태 나만 모른 건가?


happy hackin'

Qt + MSVC 2017

tips & tricks/Qt 2018. 10. 16. 18:00 by manywaypark

현재 기준(VS2017)으로 설명한다. 

일단 VS를 설치하면 기본적으로는 VC가 안깔린다. 

요즘은 다들 C++ 따위 쓰지 않나봐. Orz.

VC 설치:

Visual Studio Installer에서 Visual Studio Community 2017 > (More 밑의) Modify > Desktop development with C++ 을 선택해서 VC를 설치한다.

Qt 설치:

Qt 설치 시에 msvc 어쩌구 하는 component들 중에서 2017 관련이 보이면 그걸 설치하고, 없으면 2015 관련을 설치한다 (2015와 2017은 호환된다고 어디서 봤다).


매번 헷갈리네. 이건 내 문제가 아니라 MS 문제일지도...


happy hackin'


refs: 

  • https://forum.qt.io/topic/78962/how-to-use-qt-with-visual-studio-2017/12
  • https://stackoverflow.com/questions/45164515/how-to-use-visual-studio-2017-with-qt-to-develop-gui-applications


@impl true

함수형 언어/Elixir 2018. 7. 12. 12:42 by manywaypark

현재 내가 사용하는 elixir version은 1.6.5이다.

1.5.0의 changelog에 나오는 내용이므로 1.5.0 이상의 버전에서는 다 적용될 것으로 예상됨.


callback의 구현임을 명시적으로 알려줄 때 "@impl true"를 함수의 앞에 써준다.


sample:


defmodule MyApp do

  @behaviour Plug


  @impl true

  # 이 함수 `init/1`은 문서화에서 제외된다. 암묵적으로 @doc false로 설정된다.

  def init(_opts) do

    opts

  end


  @impl true

  @doc """

  여기 내용은 그대로 문서화에 적용됨

  see `Plug.call/2`

  """

  def call(conn, _opts) do

    Plug.Conn.send_resp(conn, 200, "hello world")

  end

end



- callback이 아닌 함수에 @impl 사용하면 에러.

- 어느 하나의 함수에 @impl을 적용했다면 그 모듈 내의 모든 callback에서 @impl을 써주지 않은 함수에 대해 경고.


ref: https://elixir-lang.org/blog/2017/07/25/elixir-v1-5-0-released/


happy hackin'


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

공지사항

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

04-24 07:36