Garmin Watch Face 수정

Motivation

최근 Garmin Watch Face 로 Crystal을 사용하고 있는데, 한글이 출력되면 더 사용하기 좋을 것 같다는 생각에, 한글을 추가해 보았다.

한글이 지원되지 않는 Crystal Watch Face
한글이 지원되는 Crystal Watch Face

개발 환경 설정

Eclipse 설치 (생략)

Connect IQ SDK 설치

https://developer.garmin.com/connect-iq/sdk/

PATH 설정

export PATH=$PATH:path/to/connectiq-sdk/bin

Eclipse Plug-in 설치

  1. In Eclipse, click the Help menu
  2. Choose Install New Software…
  3. Click the Add… button
  4. Add https://developer.garmin.com/downloads/connect-iq/eclipse/ to the Location field and click Add
  5. Check the box next to Connect IQ in the Available Software window and click Next
  6. Review the license agreement and click Finish
  7. Once the installation completes, restart Eclipse

SDK 설치

  1. In Eclipse, click the Connect IQ menu
  2. Choose Open SDK Manager
  3. Browse to or specify a path to a directory where the SDK will be saved
  4. Click the Download button next to the latest SDK release
  5. Review the license agreement, and click Agree
  6. Once the download completes, click Yes when prompted to use the new SDK version as your active SDK
  7. Close the SDK Manager

Eclipse 에서 디버깅, 실행

Start Simulator

Connect IQ -> Start Simulator

Run

Run -> Run As -> Connect IQ App

개발 참고 사항

Font 관련

Bitmap font 생성

  • http://www.angelcode.com/products/bmfont/ 에서 설치
  • Font Setting 에서 Font 선택, 사이즈 선택
  • Export Options 에서 Texture 를 png 로 변경
  • 화면에서 추출할 모든 글자 선택
  • Visualize 로 확인
  • Save bitmap font as… 후 nanum-gothic-kor-24.fnt 형태로 저장
  • 각각의 사이즈(16, 20, 24, 26, 28, 39) 별로 모두 fnt, png 파일 생성

Bitmap font 복사

각각의 Resource directory 에 복사할 필요가 있음

Font Resource 반영

XML 파일 수정이 필요함 (https://github.com/warmsound/crystal-face/pull/154/files 를 참고할 것)

References

Synergy 의 대안 Barrier

2대의 PC를 사용하고 있고, 1개의 키보드 마우스만 이용해서 2대를 조작하고 싶다면, 대부분 Synergy를 사용하고 있을 것이다. 나도 6년가량 Synergy를 사용하고 있었는데, 최근 개발 환경을 Ubuntu 18.04로 업그레이드하면서 무료로 사용하던 Synergy(이전 버전의 Synergy는 Open Source이다.) 가 제대로 동작하지 않아서 대안을 찾아보게 되었다.

여러 글들과 사용 경험들을 참고해서 골랐는데, 내가 찾은 대안은 Barrier이다. Barrier는 Synergy Fork이고 기능이 대부분 동일하기 때문에 쉽게 갈아탈 수 있는 장점이 있다. 게다가 github 에서 잘 유지보수되고 있다는 점도 엄청난 장점이다. Barrier는 https://github.com/debauchee/barrier 에서 확인할 수 있다.

Building on Linux

sudo apt update && sudo apt upgrade
sudo apt install git cmake make xorg-dev g++ libcurl4-openssl-dev \
                 libavahi-compat-libdnssd-dev libssl-dev libx11-dev \
                 libqt4-dev qtbase5-dev
cd barrier
./clean_build.sh
cd build
sudo make install  # installs to /usr/local/

Window Binary

https://github.com/debauchee/barrier/wiki

Synergy vs Barrier

  • Pros
    • Synergy는 Window 버전에서 한영키 문제가 있어서 새롭게 빌드를 해줘야 하는 불편함도 있었는데(무료 버전에서.. 정식 버전은 사용해보지 않아서..), Barrier 는 해당 버그가 없다.
    • Synergy 에서는 SSL 이 안되었는데(무료 버전에서), Barrier는 SSL 이 된다.
  • Cons
    • 딱히 없는 것 같다.

서버 설정

Ubuntu 18.04 sever version 64bit 설치

Node.js 설치

# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt-get install build-essential

Nginx php mysql 설치

sudo apt update
sudo apt install nginx
sudo apt install mysql-server
sudo mysql_secure_installation
sudo apt install php-fpm php-mysql
sudo vi /etc/nginx/sites-available/nanbean.net
sudo ln -s /etc/nginx/sites-available/nanbean.net /etc/nginx/sites-enabled/
sudo unlink /etc/nginx/sites-enabled/default
sudo nginx -t
sudo service nginx restart

FTP 설치

sudo apt-get install vsftpd
sudo vi /etc/vsftpd.conf
# enable write permission
write_enable=YES

Node.js app configuration with pm2

npm install pm2 -g
pm2 start myapp -n name
# start pm2 on boot
pm2 startup
# excute the last printed sentence
# save current process list
pm2 save

HTTPS 설정

sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-nginx
sudo certbot --nginx -d nanbean.net
# check auto renewal
sudo certbot renew --dry-run

crontab 설정

dynamic dns

기타

sudo apt install ffmpeg

oracle cloud

$ sudo fallocate -l 2G /swapfile
$ sudo chmod 600 /swapfile
$ sudo mkswap /swapfile

$ sudo swapon /swapfile
$ sudo vi /etc/fstab
// add below
/swapfile swap swap defaults 0 0

making node.js command line tool

디렉토리에서 아래 명령어를 수행한다.

$ npm init

아래와 같이 description 을 입력한다.

name: ccc
version: 0.0.1
description: ccc commad line too
$ vi package.json

package.json 파일을 열어서 아래 내용을 추가한다.(ccc-> command)

"bin": {
  "ccc": "./index.js"
},

index.js 파일을 열어서 아래 내용을 추가한다.

$ vi index.js
#!/usr/bin/env node
console.log('Hello, world!');

npm을 global로 설치한다.

$ sudo npm install --save async

필요한 module을 npm install을 통해 설치한다.

$ sudo npm install -g

텍스트큐브에서 워드프레스로 이전

7년 정도를 잘 사용해왔던, 텍스트큐브에 스팸이 너무 많이 달리고, 개발자 커뮤니티도 거의 죽어 있는 듯해서, 어쩔 수 없이 워드프레스로 이전했다.

텍스트큐브를 쓰면서 테마도 직접 만들고 개인적으로 필요했던 몇 가지 플러그인도 만들면서 잘 사용했었는데, 시원섭섭하다.

워드프레스도 나름의 문제는 있겠지만, 얼핏 살펴본 현재까지는 상당히 잘 되어 있는 듯하다. 물론 텍스트큐브도 잘되어 있지만, 지속적인 버전업이 없다는 것이 문제인 것 같다.

A2님이 만들어주신 TTXML 변환 플러그인을 통해 손쉽게 옮기긴 했는데, xml 내부의 <trackback>~<trackback> 를 제대로 parsing 하지 못하는 것인지, 중간에 오류가 발생해서, 오류가 발생한 트랙백만 4개 정도 삭제하니, 나머지는 정상적으로 import가 되었다.

이전 permanent link가 상당한 고민이었는데, 플러그인에서 텍스트큐브의 slogan을 워드프레스 내부의 permanent link로 컨버팅을 잘해주어서, 홈페이지의 내부의 URL만 wordpress 혹은 wp가 아닌 tt로 변경하니, 아주 잘 동작하고 있다.

워드프레스의 스킨을 수정하던지, 갤러리와 위키의 스킨을 수정하던지 해야 하는데.. 언제 수정할 짬이 날지 모르겠다.