C/C++에서 함수에 가변 인자를 사용할 때, 그 parameter의 타입을 컴파일러가 알 수 없기 때문에, 컴파일러가 좀 쉽게 알 수 있도록, int보다 작은 타입은 int 혹은 unsigned int로, float은 double로 promotion이 일어난다고 한다.
이를 무시하고, va_start(), va_args() 매크로를 사용하면, undefined behavior이다.
C/C++에서 함수에 가변 인자를 사용할 때, 그 parameter의 타입을 컴파일러가 알 수 없기 때문에, 컴파일러가 좀 쉽게 알 수 있도록, int보다 작은 타입은 int 혹은 unsigned int로, float은 double로 promotion이 일어난다고 한다.
이를 무시하고, va_start(), va_args() 매크로를 사용하면, undefined behavior이다.
NAS를 어떻게 구축할까, OpenMediaVault를 쓸까, Raspbian 위에 그냥 만들까, 그러려면 뭘 깔아야 하나 찾다가 찾은 글.
http://www.spacek.xyz/mle/?p=357
뭘 설치했는지 꽤 잘 나와 있다. 좀 해보다 별로면 OpenMediaVault로 이미지 바꿔보지 뭐.
쓸만한 글을 찾을 때마다 이 글을 업데이트하겠다.
QuickBuild를 이용할 때, 굳이 사이트에 접속해서 빌드를 돌리지 않아도 RESTful API를 이용하면 빌드를 걸 수 있다.
http://wiki.pmease.com/display/QB61/Interact+with+Build+Requests#InteractwithBuildRequests-requestnewbuild 에 해당 내용이 정리되어 있다.
Basic authentication 시에 curl을 이용해서 요청하는 방법은 다음과 같다.
$ curl -X POST -u dasomoli:password -d@request.xml http://<Server>:8810/rest/build_requests
위의 예제에서 사용한 request.xml 은 다음의 형식을 가진다. <varlables> 안에 채울 내용은 해당 configuration에서 실행한 빌드의 variables(http://<Server>:8810/build/<Build id>/variables) 페이지에서 확인 가능하다.
<com.pmease.quickbuild.BuildRequest>
<!-- This element tells QuickBuild in what configuration to trigger build. -->
<configurationId>10</configurationId>
<!-- This element tells whether or not to respect build condition of the configuration.
If this is set to true, and if the build condition evaluates to false, build will
not be triggered. -->
<respectBuildCondition>false</respectBuildCondition>
<!-- This element is optional and is used to specify variables for build triggering. If
specified, it will override the variable with the same name defined in configuration
basic setting. -->
<variables>
<entry>
<string>var_name1</string>
<string>var_value1</string>
</entry>
<entry>
<string>var_name2</string>
<string>var_value2</string>
</entry>
</variables>
<!-- This element is optional and is used to tell QuickBuild to request a build promotion. -->
<promotionSource>
<!-- This element is optional and is used to tell QuickBuild that the source build resides on another
QuickBuild server. -->
<server>
<url>http://another-qb-server:8810</url>
<userName>admin</userName>
<password>admin</password>
</server>
<!-- Identifier of the source build to promote from -->
<buildId>697</buildId>
<!-- This element is optional and used to specify files to promote -->
<deliveries>
<com.pmease.quickbuild.FileDelivery>
<srcPath>artifacts/dir1</srcPath>
<filePatterns>**/*.jar</filePatterns>
</com.pmease.quickbuild.FileDelivery>
<com.pmease.quickbuild.FileDelivery>
<srcPath>artifacts/dir2</srcPath>
<filePatterns>**/*.war</filePatterns>
</com.pmease.quickbuild.FileDelivery>
</deliveries>
</promotionSource>
</com.pmease.quickbuild.BuildRequest>
Sample XML의 comment에서 확인할 수 있듯이 <promotionSource>내부는 생략 가능하다.

24시간 내내 돌리면 라즈베리 파이가 너무 뜨거울 것 같아서 USB 선풍기를 포트에 연결하고, 이걸 껐다 켰다 하려고 시도했다. 결론적으론 다른 USB 기기를 쓰지 않는다면, 전체 USB 포트를 껐다 켜는 방식으로 가능하다. 다른 USB 기기를 사용한다면, 실패. 아직 디바이스 드라이버에 커널 컴파일까진 시도하고 싶지 않다.
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=93463 쓰레드를 참고하면, hub-ctrl을 이용하면, 전체 포트 혹은 개별 포트를 껐다 켰다 하는 것을 할 수 있다. 그러나 개별 포트를 끄는 게, 실제 VBUS 전원까지 내리는 건 아니고, 그냥 못쓰게 할 뿐이다. 그래서, 전체 포트를 끄지 않는 한, 개별 포트를 꺼도 해당 포트 VBUS는 살아있기 때문에 USB 선풍기는 계속 돈다-_-;;
다음은 usb-ctrl의 설치 및 사용 방법이다.
라즈베리 파이에서 다음을 설치한다.
# apt-get install libusb-dev
다음으로 바이너리를 만든다.
# apt-get install git gcc
# git clone https://github.com/codazoda/hub-ctrl.c
# gcc -o hub-ctrl hub-ctrl.c -lusb
만든 바이너리를 적당한 곳(예를 들면, /usr/sbin/)에 설치한다.
# cp hub-ctrl /usb/sbin/
나의 경우 한 시간에 한번 정도, 50초 정도 돌게 하고 싶었다. /etc/cron.hourly 아래에 다음과 같은 스크립트를 만들어 실행 권한을 준다.
# vi /etc/cron.hourly/coolingusbfan
#!/bin/sh
hub-ctrl -h 0 -P 2 -p 1; sleep 50; sudo hub-ctrl -h 0 -P 2 -p 0
참고로, 다음 그림과 같이 포트 번호를 붙인다면,

라즈베리 파이 3 Model B의 경우, 다음과 같다고 한다.
Hub:Port — Controlled port(s)
0:1 — Controls the Ethernet port
0:2 — Controls all four USB ports (not the Ethernet)
0:3 — Controls USB Port 4
0:4 — Controls USB Port 2
0:5 — Controls USB Port 3
NAS를 위해, 외장 하드를 붙일 거라 이제 더는 위 스크립트를 사용하지 못한다.
개인의 경우는 대체적으로 설득 가능하다. 그러나, 모든 팀원이 그래서 모두를 설득해야 한다면, 팀 혹은 회사 차원의 문제다. 이런 경우, 개인을 설득하려 해도, “다들 그래요”, “그게 여기서 되겠어요?”, “그거 한다고 안바뀌어요”, “당신 때문에 내 코드가 못들어가고 있어요. 오늘 릴리즈인데, 당신이 책임질거요?” 따위의 말이나 듣는다. ‘협업 안되는 사람’이 되고.
내가 아는 어떤 회사가 그랬다. 요즘은 좀 바꾸려고 하는 것 같던데, 이런 사람들이 위에서 때리면, 제일 먼저 자기는 안그런다 하더라.
만약 당신이 동료를 향해 신경쓰이는 기분이 든다면 회사 혹은 팀의 경영 측면에서 문제가 있는 겁니다.
Eclipse는 내부적으로 Indexer가 돌아서 이를 이용해 찾고 싶은 File, Funtion decalaration/definition, symbol 등을 찾을 수 있다. 내가 자주 쓰는 단축키는 다음과 같다.
<html>
<head>
<meta http-equiv=”refresh” content=”0; url=./index.php”>
</head>
<body onload=”javascript:window.location=’./index.php'”>
Please follow <a href=”index.php”>this link</a>
</body>
</html>
참고: https://en.m.wikipedia.org/wiki/Meta_refresh
하나의 git repository로 체크 아웃을 한군데 하는게 아니라 여러군데에 하고 싶을 때 쓴다. 브랜치를 아예 물리적으로 다른 경로로 나누어서 작업하고 싶을 때라던지 용도는 매우 다양하다.
curl -b cookie.txt -c cookie.txt http://blog.dasomoli.org/