Ubuntu에서 Nvidia driver 깔기
장치가 인식되어있는지 확인:
$ ubuntu-drivers devices
driver 자동 설치:
$ sudo ubuntu-drivers autoinstall
참조 링크에 더 다양한 방법이 있다.
ref: https://linuxconfig.org/how-to-install-the-nvidia-drivers-on-ubuntu-18-04-bionic-beaver-linux
happy hackin'
Ubuntu에서 Nvidia driver 깔기
장치가 인식되어있는지 확인:
$ ubuntu-drivers devices
driver 자동 설치:
$ sudo ubuntu-drivers autoinstall
참조 링크에 더 다양한 방법이 있다.
ref: https://linuxconfig.org/how-to-install-the-nvidia-drivers-on-ubuntu-18-04-bionic-beaver-linux
happy hackin'
Visual Studio 2017에는 google test가 통합되었구나. 세상이 좋아지고 있다.
https://docs.microsoft.com/ko-kr/visualstudio/test/how-to-use-google-test-for-cpp
happy hackin'
기본적으로 ssh, autossh 등을 사용하면 됨.
systemd 내에서 autossh를 쓸 경우는 좀 tricky한 상황이 생기는 듯 (portforwarding 환경에서는 port forwading에 실패했을 경우 재시작할 때 제대로되지 않는다.
autossh는 자동재시작 등의 기능이 있는데 이것은 systemd에서 제공하는(아주 잘 하는) 기능이다. 두개를 섞으면 좀 이상해지는 것으로 보인다.
좀 검색을 해보니 ssh + systemd가 제대로 잘 동작하는 것으로 보인다.
좀더 시간을 두고 해결하는 것도 고려해보자.
/etc/systemd/system/secure-tunnel@.service 파일:
[Unit]
Description=Setup a secure tunnel to %I
After=network.target
[Service]
Environment="LOCAL_ADDR=localhost"
EnvironmentFile=/etc/default/secure-tunnel@%i
ExecStart=/usr/bin/ssh -NT -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -NR ${LOCAL_PORT}:localhost:${REMOTE_PORT} ${TARGET} -p ${TARGET_PORT}
# Restart every >2 seconds to avoid StartLimitInterval failure
RestartSec=5
Restart=always
[Install]
WantedBy=multi-user.target
/etc/default/secure-tunnel@jupiter 파일:
TARGET=jupiter
TARGET_PORT=2222
LOCAL_PORT=20022
REMOTE_PORT=22
부팅시 실행되게 활성화 및 시작:
systemctl enable secure-tunnel@jupiter.service
systemctl start secure-tunnel@jupiter.service
현재 상태보기:
systemctl status secure-tunnel@jupiter.service
상태 연속으로 보기:
journalctl -f -u secure-tunnel@jupiter.service
refs:
http://system-monitoring.readthedocs.io/en/latest/ssh.html
https://gist.github.com/thomasfr/9707568 -> autossh + systemd
https://gist.github.com/drmalex07/c0f9304deea566842490 -> 최종적으로 (약간 수정해서) 내가 사용한 방법 (ssh + systemd)
https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units -> systemd 관련 상세 설명
happy hackin'
problem:
Windows, MSVC 환경에서 min이나 max가 포함된 qt 파일(eg, qrandom.h 등)에서 다음과 같은 경고가 나온 후에, 괴상한 에러가 나면서 컴파일에 실패하는 경우가 발생했다.
warning C4003: not enough actual parameters for macro 'max'
solution:
windows.h가 include 되기 전에 다음과 같은 선언을 넣어준다.
#ifndef NOMINMAX
# define NOMINMAX
#endif
ref: https://stackoverflow.com/questions/6884093/warning-c4003-not-enough-actual-parameters-for-macro-max-visual-studio-2010
happy hackin'
choco install erlang --forcex86=true
이렇게 하면 설치는 제대로 되지만 shim이 잘못된 위치(64bit용 위치 즉, \Program Files\ 아래)를 가리키게 되어있어서 오류가 난다.
PS C:\ProgramData\chocolatey> erl
Cannot find file at 'c:\program files/erl9.0/erts-9.0/bin/erl.exe' (c:\program files\erl9.0\erts-9.0\bin\erl.exe). This usually indicates a missing or moved file.
tools/shimgen.exe를 사용해서 다시 생성하면 해결된다.
PS C:\ProgramData\chocolatey\bin> ren erl.exe erl.exe.ERROR
PS C:\ProgramData\chocolatey\bin> ..\tools\shimgen.exe -o C:\ProgramData\chocolatey\bin\erl.exe -p 'C:\Program Files (x8
6)\erl9.0\bin\erl.exe'
PS C:\ProgramData\chocolatey\bin> ren .\werl.exe werl.exe.ERROR
PS C:\ProgramData\chocolatey\bin> ..\tools\shimgen.exe -o C:\ProgramData\chocolatey\bin\werl.exe -p 'C:\Program Files (x
86)\erl9.0\bin\werl.exe'
제목을 'chocolatey에서 shim이 잘못되었을 때 새로 생성하는 방법'으로 할걸 그랬나?
happy hackin'
2018-10-23 추가:
오늘 새로 생긴 박스에 설정하면서 새로 깔아보니 아래와 같은 메시지가 보였다. 이것이 의미하는 바는... 저 5개의 실행파일 모두에 대해서 shimgen을 해 주어야한다는 것이다.
......
Installing erlang...
erlang has been installed.
Added C:\ProgramData\chocolatey\bin\erl.exe shim pointed to 'c:\program files/erl10.0.1/erts-10.0.1/bin/erl.exe'.
Added C:\ProgramData\chocolatey\bin\werl.exe shim pointed to 'c:\program files/erl10.0.1/erts-10.0.1/bin/werl.exe'.
Added C:\ProgramData\chocolatey\bin\erlc.exe shim pointed to 'c:\program files/erl10.0.1/erts-10.0.1/bin/erlc.exe'.
Added C:\ProgramData\chocolatey\bin\escript.exe shim pointed to 'c:\program files/erl10.0.1/erts-10.0.1/bin/escript.exe'.
Added C:\ProgramData\chocolatey\bin\dialyzer.exe shim pointed to 'c:\program files/erl10.0.1/erts-10.0.1/bin/dialyzer.exe'.
......
d3를 예제로 설명한다. 대부분의 npm package는 동일한 방법으로 사용가능하다.
npm을 이용해 d3 설치
cd /path/to/my_web_app
cd ./assets/
npm install --save d3
brunch-config.js 파일에 다음 내용 추가
npm: {
......
globals: {
......
"d3": 'd3'
}
}
이젠 app.js 파일에 등록됨.
다시 말해 app.js를 include하는 모든 페이지의 javascript에서 d3를 사용할 수 있다.
happy hackin'
window에서 emacs 직접 build 하는 방법:
(chocolatey에 포함된 emacs64 package 만드는 사람이 작성한 것)
https://github.com/zklhp/emacs-w64/wiki/Guideline-for-building-Emacs-in-MSYS2-MinGW-w64-system
happy hackin'
byobu 내에서 text-mode(=nox) emacs를 실행하면 기본 테마(특히 색상)가 적용되지 않는 것처럼 보이는데, 사실은 byobu의 기본 terminal 설정이 그냥 날(raw) screen이라서 컬러를 표시하지 못하는 것이다.
내 경우는 기본 login terminal에서 컬러표시가 잘되었으므로 아래와 같이 해서 컬러가 표시되게 했다.
$ echo $TERM
xterm-256color
$ echo 'set -g default-terminal "xterm-256color"' >> ~/.byobu/profile.tmux
refs:
https://unix.stackexchange.com/questions/240532/getting-256-colors-to-work-with-byobu
http://osmanov-dev-notes.blogspot.kr/2011/03/how-to-enable-color-prompt-in-byobu.html
happy hackin'
대충 map을 이용하면 되는데... 좀더 깔끔한 방법이 있다.
자세한 것은 참조 링크 참조.
결론은 아래처럼 NamedArgs를 mix.exs 의존성에 추가하고 필요한 모듈에서 use NamedArgs만 추가하면 끝.
def deps do
[
{:named_args, "~> 0.1.0"}
]
end
사용은 이렇게...
defmodule Talk do
use NamedArgs
def introduction(opts \\ [name: "Sarah", birthday: "1985-12-30"]) do
IO.puts "Hi my name is #{opts[:name]} and I was born on #{opts[:birthday]}"
end
end
refs:
https://blog.praveenperera.com/named-arugments-with-default-values-in-elixir/
https://github.com/mgwidmann/named_args
happy hackin'
emacs
emacs -mm
emacsclient
아래 방법들 중 하나로 한다.
emacsclient -c -F "'(fullscreen . fullboth)"
emacsclient -c -F "'(fullscreen . maximized)"
alias ecx="emacsclient -c -F \"'(fullscreen . maximized)\""
emacsclient -c -F "((width . 100) (height . 100) (left . 400))"
ref: https://stackoverflow.com/questions/20285965/how-can-i-launch-emacsclient-maximized-from-the-commandline
happy hackin'