Toys

OSMC kodi

Posted on

Install Korean language Install Korean Nanum font sudo apt-get install fonts-nanum Download Noto-CJK fonts from here cd ~osmc unzip NotoSansCJKtc_ttf.zip Copy fonts to skin directory sudo cp /usr/share/fonts/truetype/nanum/NanumGothic.ttf /usr/share/kodi/media/Fonts/ sudo cp /usr/share/fonts/truetype/nanum/NanumGothic.ttf /usr/share/kodi/addons/skin.osmc/fonts/ sudo cp ~osmc/NotoSansCJKtc-Thin.ttf /usr/share/kodi/media/Fonts/ sudo cp ~osmc/NotoSansCJKtc-Thin.ttf /usr/share/kodi/addons/skin.osmc/fonts/ Change font in skins (example for osmc default skin) sudo cp /usr/share/kodi/addons/skin.osmc/16×9/Font.xml /usr/share/kodi/addons/skin.osmc/16×9/Font.xml.otg sudo […]

System Engineering

Install SRSd with Postfix on OpenSUSE

Posted on

Postfix Sender Rewriting Scheme(SRS) daemon zypper install postsrsd vi /etc/default/postsrsd SRS_DOMAIN=xxx.com vi /etc/postfix/main.cf inet_interfaces = all inet_protocols = ipv4 myhostname = smtp.xxx.com mynetworks_style = subnet mynetworks = 10.3.0.0/16, 192.168.1.0/24 relay_domains = $mydestination, hash:/etc/postfix/relay virtual_alias_domains = hash:/etc/postfix/virtual virtual_alias_maps = hash:/etc/postfix/virtual # Aiden: PostSRSd settings. sender_canonical_maps = tcp:localhost:10001 sender_canonical_classes = envelope_sender recipient_canonical_maps = tcp:localhost:10002 recipient_canonical_classes= envelope_recipient,header_recipient # […]

System Engineering

자체적으로 rotate되는 로그파일에 logrotate 적용하기

Posted on
log rotate

tomcat 기본설정 처럼 로그파일 이름이 자체적으로 rotate되어 버리는 경우, logrotate 로의  통합이 어렵다. 네이밍은 자체룰을 이용하고 압축을 하는 등 후작업을 logrotate에 넣는 방식으로 통합하는 방법이다. vi /etc/logrotate.d/tomcat /var/log/tomcat-access-log-dummy { su root root rotate 0 create 664 tomcat root daily ifempty lastaction /usr/bin/find /home/www/*/logs/*.txt -mtime +30 -delete /usr/bin/find /home/www/*/logs/*.txt -mtime +1 -exec gzip -q {} \; endscript […]

Developments

MySQL Stored Procedure for CRUD Dynamic Queries

Posted on

The new MySQL 5.7 version has some great features. One of them is the ‘JSON data’ type. We can use it for column of table like ‘Virtual Colunm’ with Indexing. But, ‘JSON data’ is also useful for stored procedure. Because we can compact parameters and the procedure could be more flexible.I made the procedures for […]

Others

AWS Solutions Architect Associate

Posted on
AWS Solutions Architect Associate

I Passed the AWS Solutions Architect Associate Exam. The test is a quite difficult if you do not know exactly about the overall AWS. I’ll think about challenging professional qualifications the next step, if  this certification useful.

System Engineering

Mysql Backup Script

Posted on
MySQL

Features Full Backup (Mysqldump) Incremental Backup (Bin-log) Local Backup & Remote(AWS S3) Upload Sample Environments MySQL bin log prefix : mysql-bin BINLOG_PATH=/home/mysql/data BACKUP_ROOT=/home/backup/mysql S3_PATH=s3://system-backup/{SyatemName}/mysql #!/bin/bash #—————————————- # MySQL Backup Script # Revision 20160531 # Copyright (c) Aiden Kim # http://www.daemon.pe.kr #—————————————- ARCHIVE_PERIOD=60 BINLOG_PATH=/home/mysql/data BASE_PATH=/home/backup/mysql SYSNAME=$(echo $HOSTNAME | tr “[:lower:]” “[:upper:]”) S3_PATH=s3://system-backup/${SYSNAME}/mysql STATUS_PATH=${BASE_PATH}/mysql-backup-status ## prepare path if ! […]

System Engineering

Subversion Repogitories Backup Script

Posted on
Subversion

Features Full Backup (Dump) Incremental Backup (Dump) Local Backup & Remote(AWS S3) Upload Sample Environments REPOS_ROOT=/home/svn/repos BACKUP_ROOT=/home/backup/svn S3_PATH=s3://svn-backup/svn #!/bin/bash #—————————————- # Subversion Repogitories Backup Script # Revision 20160531 # Copyright (c) Aiden Kim # http://www.daemon.pe.kr #—————————————- DSTR=$(date +”%Y%m%d”) ARCHIVE_PERIOD=30 REPOS_ROOT=/home/svn/repos BACKUP_ROOT=/home/backup/svn S3_PATH=s3://svn-backup/svn # Each repogitories REPOS_DIRS=`ls -t ${REPOS_ROOT} 2>/dev/null` for DIR in ${REPOS_DIRS}; do # Create directory BACKUP_PATH=${BACKUP_ROOT}/repo-${DIR} […]

Developments

Don’t use utf8 encoding in MySQL (>= 5.5.3)

Posted on
MySQL

오늘날 한국어/중국어/일본어등 2바이트 문자권에서의 SW개발 및 다국어를 대비한 문자열 인코딩은 거의 UTF-8로 통일화 되고 있다. 그런데, MySQL의 문자인코딩 중 utf8인코딩은 ‘진짜 UTF-8’이 아니다 ! 원래 UTF-8은 규약상 한 문자가 4바이트까지 사용하는데 MySQL의 utf8인코딩은 3바이트까지만 입력이 가능하기 때문이다. 대부분의 한중일 문자는 3바이트 코드로  표현이 가능한데, 특히 특수문자나 한자를 많이 사용하는 일본어 등에서는 심심치 않게 4바이트 문자에 의한 […]

System Engineering

When Nagios send alert mails with attachement…

Posted on

When Nagios send alert mails with attachement… Perhaps this problem is that if a device name or warning message include non-Latin characters.   1. Add new command to nagios configuration Original commands # ‘notify-host-by-email’ command definition define command{ command_name notify-host-by-email command_line /usr/bin/printf “%b” “***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n” | /usr/bin/mail -s “** $NOTIFICATIONTYPE$ Host […]