여리군의 홈페이지~♡

 

 

MyBookLive 를 사용하면서

가끔 putty를 이용해서 ssh로 접속해서 작업을 하곤 합니다.

 

이럴때 한글 파일명이나, 한글로 주석을 달게되면 글자 깨짐현상이 발생하는데요.

MyBookLive에 Putty로 접속시 한글이 깨지는 현상을 해결했습니다.

 

MyBookLive에 putty로 접속 후 아래의 명령을 입력합니다.

 

# nano ~/.bashrc

 

이중 아래와 같이 되어있는 부분을 찾습니다.

 

# speed up grep
export LC_ALL=C

 

이부분을 아래와 같이 바꿔줍니다. 

 

# speed up grep
export LC_ALL="ko_KR.UTF-8"

 

컨트롤 + O, 엔터, 컨트롤 + X를 차례로 눌러서 종료합니다.

 

 

끝!

(부가효과로 날짜형식(LC_TIME), 원화표시(\) 등이 전부 한국식으로 바뀝니다.)

 

 

<< 아래는 접속 당시의 세션에만 적용되는 내용입니다. putty를 껐다켜면 되돌아가므로 더 좋은 방법을 위에 소개했습니다. >> 

 

 

MyBookLive에 putty로 접속 후 아래의 명령을 입력합니다.

 

# locale

 

아마 아래처럼 나올겁니다. (정상입니다.)

 

LANG=
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=C

 

다음 두개의 명령을 차례로 입력합니다.

 

# export LANG="ko_KR.UTF-8"

# export LC_ALL="ko_KR.UTF-8"

 

아무 반응이 없는 것이 정상입니다.

 

 

아래 명령을 입력해서 다시 확인해봅니다.

 

# locale

 

그러면 아래처럼 나와야 한글이 제대로 보입니다.

 

LANG=ko_KR.UTF-8
LC_CTYPE="ko_KR.UTF-8"
LC_NUMERIC="ko_KR.UTF-8"
LC_TIME="ko_KR.UTF-8"
LC_COLLATE="ko_KR.UTF-8"
LC_MONETARY="ko_KR.UTF-8"
LC_MESSAGES="ko_KR.UTF-8"
LC_PAPER="ko_KR.UTF-8"
LC_NAME="ko_KR.UTF-8"
LC_ADDRESS="ko_KR.UTF-8"
LC_TELEPHONE="ko_KR.UTF-8"
LC_MEASUREMENT="ko_KR.UTF-8"
LC_IDENTIFICATION="ko_KR.UTF-8"
LC_ALL=ko_KR.UTF-8

 

끝! 

 

쉽죠? ^^

 

 

참고 : http://drparksc.blog.me/220304792251

 

image from humblebundle.com

 

며칠전에 구입한 15불짜리 험블번들(Humble Firaxis Bubdle)의 추가 게임이 공개되었습니다~!!

관련글 : 2016/01/22 - [게임/PC _ 온라인] - 엑스박스 360 게임패드(컨트롤러) 구입 + 험블번들(문명, XCOM) 구입

 

 

해외 게임 커뮤니티에서 예상했던대로 X-COM 구버전들과, 문명5 신과 왕 확장팩이 포함되었네요. ^^

X-COM: Complete Pack

Sid Meier's Civilization V: Scrambled Nations Map Pack

Sid Meier's Civilization V: Scrambled Continents Map Pack

Sid Meier's Civilization V: Gods & Kings

 

위 4개도 아래 그림처럼 하나의 스팀키로 제공이 됩니다. 이미 스팀 라이브러리에 있었다고 해도 상관없이 그냥 없어집니다..

(하지만 저는 아직 안 샀기 때문에 괜찮아요. ^^)

 

image from humblebundle.com

 

이미 구입하신 분들은 얼른 리딤 하시길 바랍니다. ^^

 

 

 

 

2016년 공무원 보수표입니다.

 

2015년 대비 총 보수는 3% 인상되었습니다. (보수표는 3.4% 인상)

 

힘내봅시다!!

 

 

 

참고 : 공무원 보수 규정 http://www.law.go.kr/법령/공무원보수규정/(26877,20160108)

참고 : 2016년 1월 8일 전자관보 http://gwanbo.moi.go.kr/gwanbo/dailyGazetteView.gz?ebookSeq=00000000000000001452133381575000&searchDate=&currPage=2&linePerPage=10#none

 

요새 스팀으로 게임을 많이 사서, 행복한 나날을 보내고 있습니다.

 

며칠전에 구입한 툼레이더 리부트를 하고 있는데, 문득 게임패드(컨트롤러)로 하면 더 재미있을 것 같다는 생각이 들더라고요.

 

image from naver.com

 

 

 

 

그래서 구입!

 

XBOX 360 컨트롤러

 

인터넷에서 구입하니 하루만에 날아오네요. ^^;

 

가격은 배송비 포함 3.5만원... 이지만 일단 조작이 재미있습니다.

 

하려던 툼레이더는 안하고, 전에 사두었던 탈로스 법칙을 잠깐 돌려봤습니다.

 

image from naver.com

 

 

처음에는 약간 어색했는데, 문을 들락달락할때, 점프 뛸때마다 진동도 들어오고 좋습니다. ^^

 

life is strange 등등도 열심히 해봐야겠어요.

 

 

 

 

 

그런 의미에서(?) 험블 번들도 같이 질렀습니다.

 

이번 험블번들은 무려 프랙시스 번들! 입니다.

XCOM, 문명3, 문명3, 문명5, 문명 비욘드어스 가 다 포함된 풀 패키지가 단돈 15불!

 

image from humblebundle.com

 

아직 게임 하나는 공개되지 않았고(다음주 화요일 공개), 문명 비욘드어스 : 라이징 타이드는 포함되지 않았습니다.

 

예전에 게임별 키가 나올때는 가지고 있는 게임은 선물하기가 가능했거든요.

이번 스팀키는 티어별 1개씩 총 3개가 나오고, 이걸 받아서 입력하니까 기존에 있던 게임이고 뭐고 그냥 다 라이브러리로 들어가네요. 그점은 좀 아쉽긴 합니다.

 

 

간만에 XCOM 켜고 패드로 두어판 하고, 비욘드어스를 버버벅이면서 한 4시간 하고 났더니 시간이 어찌 흘렀는지 모르겠습니다. ;;;;

 

 

즐거운 게임라이프!!

 

 

참고 : 험블번들 https://www.humblebundle.com/

 

 

 

며칠전 웹서핑을 하다가 재미있는 글을 봐서 직접 시도해보고, 그 결과를 정리해보았습니다.

I just found an interesting article on the internet, and I tried. 

 

그 내용은, MyBookLive에 세팅된 트랜스미션Transmission에서 토렌트가 다운로드 완료되면 완료메시지를 텔레그램으로 받는 방법입니다.

It is about receiving alarm via telegram when trasmission completes downloading a torrent on your MyBookLive.

 

 

할 일은 크게 2가지 입니다.

1. 텔레그램 봇 설정

2. MyBookLive에서 알람 설정

It is seperated on 2 parts.

1. set up telegram bot

2. set up alarm on MyBookLive

 

 

 

먼저, 텔레그램 봇 설정 방법입니다.

This is how-to set up telegram bot.

 

1. https://telegram.me/botfather 주소를 눌러서 봇파더 BotFather 에게 말을 겁니다.

   PC에서 잘 안되면 텔레그램이 설치된 핸드폰에서 위 주소를 누르면 botfather와의 대화창이 열립니다.

2. /newbot   이라고 입력합니다.

3. 봇의 이름을 적당히 입력합니다. 한글도 가능하고 나중에 바꿀수도 있습니다.

4. 봇의 username을 영어로 입력합니다. 마지막은 반드시 bot으로 끝나야 합니다.

1. press https://telegram.me/botfather . Use cellphone if your computer doesn't work.

2. type /newbot

3. Name your bot

4. choose a username for your bot

위 2~4번의 내용을 대화형태로 표현하면 이렇습니다. "나" 부분의 빨간 글씨가  사용자가 입력해야 하는 부분입니다.

Here's the chat between me and @BotFather. You need to type red characters next to "나". 

 

나: /newbot

BotFather: Alright, a new bot. How are we going to call it? Please choose a name for your bot.

 

나: 토렌트알리미 TorrentAlarm

BotFather: Good. Now let's choose a username for your bot. It must end in `bot`. Like this, for example: TetrisBot or tetris_bot.

 

나: torrent_transmission_alarm_bot

BotFather: Done! Congratulations on your new bot. You will find it at telegram.me/torrent_transmission_alarm_bot. You can now add a description, about section and profile picture for your bot, see /help for a list of commands.

Use this token to access the HTTP API:

123457890:ABCDEFGHIJKLMNOPQRSTUVWXYZABCDE

For a description of the Bot API, see this page: https://core.telegram.org/bots/api

 

 

 파란색으로 칠해진 token 부분을 써먹게 되니 잘 알아두시기 바랍니다. (임의의 문자열로 대체했습니다.)

 Keep the token(in blue color) somewhere like notepad.

 

5. telegram.me/torrent_transmission_alarm_bot 부분을 클릭하면 자신이 만든 봇과의 대화창이 열립니다. (username에 따라 주소가 다릅니다)

6. 적당히 대화를 한두개 보냅니다. 반응이 없는 것이 정상입니다.

7. 이제, 아래 주소를 자신의 token으로 바꾸어서 인터넷 브라우저 주소창에 입력합니다.

   https://api.telegram.org/bot123457890:ABCDEFGHIJKLMNOPQRSTUVWXYZABCDE/getUpdates

8. 그러면 getUpdates.json 파일을 하나 다운받게 되는데, 이 getUpdates.json 파일을 메모장으로 열어봅니다.

5. click telegram.me/torrent_transmission_alarm_bot (depends on your bot username)

6. send your bot some message like "hello"

7. type following text on your browser after replacing blue text with your token from 4

    https://api.telegram.org/bot123457890:ABCDEFGHIJKLMNOPQRSTUVWXYZABCDE/getUpdates

8. your browser will download a file named getUpdates.json. open it with notepad

다음은 getUpdates.json 파일의 내용입니다.

This is the getUpdates.json file. 

 

{"ok":true,"result":[{"update_id":987654321,
"message":{"message_id":1,"from":{"id":12345678,"first_name":"ABCDEFG","last_name":"VWXYZ","username":"USERNAME"},"chat":{"id":12345678,"first_name":"ABCDEFG","last_name":"VWXYZ","username":"USERNAME","type":"private"},"date":1452737400,"text":"\/start"}},{"update_id":987654321,
"message":{"message_id":2,"from":{"id":12345678,"first_name":"ABCDEFG","last_name":"VWXYZ","username":"USERNAME"},"chat":{"id":12345678,"first_name":"ABCDEFG","last_name":"VWXYZ","username":"USERNAME","type":"private"},"date":1452737404,"text":"hello"}}]}

 

 

여기서 id 뒤의 숫자가 중요하니 이것도 잘 알아두시기 바랍니다.

Keep the id number(in blue color) along with your token.

 

9. 텔레그램 봇의 기본적인 설정은 끝입니다.

BotFather에게 /setuserpic 등의 명령어를 주어서 꾸미세요. ^^

9. Now you're done with setting up telegram bot. Tell @BotFather /setuserpic to change the picture.

 

 

 

이제 MyBookLive의 Transmission에서 다운로드 완료시 텔레그램으로 메시지를 보내도록 설정하는 방법입니다.

Transmission 설치방법은 우성군의 NAS 홈페이지 http://www.wsgvet.com/bbs/board.php?bo_table=iomega&wr_id=35 를 참고하시기 바랍니다.

This is how-to set up MyBookLive to send message to telegram bot when transmission finishes downloading a torrent.

The link above is about how-to install transmission on MyBookLive, written in Korean.

If you need to install transmission on your MBL, please google it. sorry. :) 

 

1. putty 등으로 ssh를 통해 MyBookLive에 접속합니다.

2. cd /opt/bin  라고 입력합니다. 커서 앞쪽이 MyBookLive:/opt/bin#로 바뀌는게 보입니다.

3. nano nas_notify.sh  라고 입력합니다. 파일이름은 마음대로 바꾸어도 됩니다.

4. 새 창이 뜨면 아래내용을 복사해서 붙여넣습니다. (putty에서는 마우스 오른쪽 버튼을 누르면 붙여넣기가 됩니다.)

1. connect to MyBookLive with putty, etc.

2. type cd /opt/bin

3. type nano nas_notify.sh

4. copy and paste following text. right click on your mouse for paste on your putty

 

#!/bin/sh

 

# telegram configuration
TOKEN='123457890:ABCDEFGHIJKLMNOPQRSTUVWXYZABCDE'
URL='https://api.telegram.org/bot'$TOKEN
MSG_URL=$URL'/sendMessage?chat_id='
CHAT_ID="12345678"

 

# function setting
function send_message {
res=$(/usr/bin/curl --data-urlencode "text=$TR_TORRENT_NAME download completed" "$MSG_URL"$CHAT_ID"&")
}

 

# telegram notify gogo
send_message

 

 

이때, TOKEN과 CHAT_ID는 위 텔레그램 봇 설정에서 나온 문자열로 바꿔줍니다.

 

그리고 CTRL+O, 엔터, CTRL+X를 차례로 한번씩 누르면 파일이 저장되고 다시 밖으로 나옵니다.

replace TOKEN and CHAT_ID with your token and chat_id, press Ctrl+O, enter, Ctrl+X to save & exit.

 

4. chmod a+x nas_notify.sh  라고 입력합니다. 파일이 실행가능으로 변경됩니다.

5. chmod 777 nas_notify.sh  라고 입력합니다. 트랜스미션에도 실행권한을 줍니다.

6. /opt/etc/init.d/S90transmission stop  라고 입력합니다. 실행중인 트랜스미션을 정지시킵니다.

7. nano /root/.config/transmission-daemon/settings.json  라고 입력합니다. 트랜스미션 설정파일을 수정합니다.

4. type chmod a+x nas_notify.sh  to change the sh file executable

5. type chmod 777 nas_notify.sh  to give permission to be executed

6. type /opt/etc/init.d/S90transmission stop  to stop transmission

7. type nano /root/.config/transmission-daemon/settings.json to alter setting file of transmission

아래 문자열을 찾습니다. 

    "script-torrent-done-enabled": false,
    "script-torrent-done-filename": "",
 

이렇게 수정합니다.

    "script-torrent-done-enabled": true,
    "script-torrent-done-filename": "/opt/bin/nas_notify.sh",

 

 

 

바뀐 부분은 제일 뒷부분만 이지만, 두줄 전체를 바꾸어버려도 됩니다. 

 

그리고 CTRL+O, 엔터, CTRL+X를 차례로 한번씩 누르면 파일이 저장되고 다시 밖으로 나옵니다.

 

find blue text, and replace them to red text.

press Ctrl+O, enter, Ctrl+X to save & exit.

 

8. /opt/etc/init.d/S90transmission start   라고 입력합니다. 트랜스미션을 다시 시작합니다.

8. type /opt/etc/init.d/S90transmission start  to start transmission again.

 

9. 트랜스미션의 설정이 완료되었습니다.

9. now you're done with everything!

 

 

 

 

참고 : 포고플러그에서 트랜스미션 다운로드 완료시 스마트폰으로 알람받기 http://www.clien.net/cs2/bbs/board.php?bo_table=lecture&wr_id=233890

참고 : 트랜스미션, Flexget 다운로드 완료시 텔레그램으로 알람받기 http://www.clien.net/cs2/bbs/board.php?bo_table=lecture&wr_id=303717

참고 : 텔레그램 봇 설정 http://domoticz.com/wiki/Telegram_Bot

참고 : 텔레그램 봇 설정 https://core.telegram.org/bots

참고 : putty 프로그램 다운로드 http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html