# service transmission-daemon reload # usermod -aG debian-transmission dasomoli
download-dir은 다운로드 받을 디렉토리, rpc-username은 웹 인터페이스로 들어갈 때 로그인 할 ID, rpc-password는 그 Password이다. rpc-whitelist-enabled를 false 로 설정하면, 말 그대로 whitelist를 사용하지 않으므로, 어디에서든 접속이 가능하다.
접속은 기본은 9091 포트로 접속하면 된다. 위에선 9000으로 바꿨다. 하지만, 포트 번호를 치긴 귀찮으므로 apache2의 proxy를 이용해서 접속하자.
# vi /etc/apache2/sites-available/torrent.dasomoli.org.conf
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName torrent.dasomoli.org
ServerAdmin dasomoli@gmail.com
ProxyPass / http://localhost:9000/
ProxyPassReverse / http://localhost:9000/
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/torrent.log
CustomLog ${APACHE_LOG_DIR}/torrent.access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
이제 proxy 모듈을 enable하고, site를 enable한 후, apache2를 재시작하자.
이제 http://torrent.dasomoli.org 로 접속하면 된다.
당연히 미리 DNS설정은 되어 있어야 한다.
부팅 시에 Web UI 가 연결이 안되는 경우가 있는데, 이 때는 transmission-daemon을 reload 하면 된다. 수많은 해결(이라고 주장하는) 방법이 있지만, 가장 간단하면서 잘 동작하는 방법은 그냥 raspi-config에서 “Network at Boot:”의 “Wait for network”을 체크하는 것이다.
간단히 소개하면, 부동산, 특히 아파트 실거래가를 한눈에 볼 수 있고, 해당 아파트 주변에 어느 어느 학교들이 있는지, 거기까지 얼마나 걸리는지, 주변에 시설은 무엇이 있는지 등등을 보여준다. 공개된 데이터를 모아서 보여준다는데, 공개된 데이터를 가공해서 정말 쓸모있는 정보(!)를 만들었다. 대단하다! 요새는 인구 이동도 보여주던데, 대박이다. 헐.
그 앱 개발자가 내가 아는 사람의 지인인 듯 한데 페북에 뜨길래 눌러서 타임라인을 죽 보았더니, 예전에 읽었다는 책인 것 같다. 앱이 너무 좋아서, 그 개발자가 읽었다는 책도 읽어보고 싶어졌다.
C/C++에서 함수에 가변 인자를 사용할 때, 그 parameter의 타입을 컴파일러가 알 수 없기 때문에, 컴파일러가 좀 쉽게 알 수 있도록, int보다 작은 타입은 int 혹은 unsigned int로, float은 double로 promotion이 일어난다고 한다.
이를 무시하고, va_start(), va_args() 매크로를 사용하면, undefined behavior이다.
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 선풍기는 계속 돈다-_-;;
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