2019-02-19
[firefox] 링크 새탭으로 열기
firefox사용시 링크 누르면 현재 탭이 새창으로 변경되는 불편함이 있어서 링크를 새탭으로 여는 설정을 작성한다.
firefox 주소창에 about:config를 입력한다.
browser.search.openintab 의 값을 찾아서 true로 변경한다.
firefox를 재시작한다.
2017-09-15
[FFMPEG] linux mint에서 ffmpeg 빌드 하기
ffmpeg을 직접 빌드해야하는 이슈가 발생하여 linuxmint-18.2-mate-64bit 에서 빌드한 내용을 남긴다.
아래 링크를 참조하여 작업하였다.
https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
1. 종속성 라이브러리 설치
$ sudo apt-get update
$ sudo apt-get -y install autoconf automake build-essential libass-dev libfreetype6-dev libsdl2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev pkg-config texinfo wget zlib1g-dev
2. 설치시 사용할 디렉토리 생성
$ mkdir ~/ffmpeg_sources ~/ffmpeg_build ~/bin
3. yasm 설치
$ sudo apt-get install yasm
4. nasm 설치
$ cd ~/ffmpeg_sources
$ wget http://www.nasm.us/pub/nasm/releasebuilds/2.13.01/nasm-2.13.01.tar.bz2
$ tar xjvf nasm-2.13.01.tar.bz2
$ cd nasm-2.13.01
$ ./autogen.sh
$ PATH="$HOME/bin:$PATH" ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"
$ PATH="$HOME/bin:$PATH" make
$ make install
5. libx264 설치
$ sudo apt-get install libx264-dev
6. libx265 설치
$ sudo apt-get install libx265-dev
7. libfdk-aac 설치
$ sudo apt-get install libfdk-aac-dev
8. libfdk-aac 설치
$ sudo apt-get install libmp3lame-dev
9. libfdk-aac 설치
$ sudo apt-get install libopus-dev
10. libfdk-aac 설치
$ sudo apt-get install libvpx-dev
11. ffmpeg 빌드 및 설치
$ cd ~/ffmpeg_sources
$ wget http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
$ tar xjvf ffmpeg-snapshot.tar.bz2
$ cd ffmpeg
$ PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" $ ./configure --prefix="$HOME/ffmpeg_build" --pkg-config-flags="--static" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="$HOME/bin" --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
$ PATH="$HOME/bin:$PATH" make
$ make install
12. ffmpeg 동작 확인
$ ./ffmpeg -version
ffmpeg version N-87286-g6ce4a63 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
configuration: --prefix=/home/sharpis/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/sharpis/ffmpeg_build/include --extra-ldflags=-L/home/sharpis/ffmpeg_build/lib --bindir=/home/sharpis/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
libavutil 55. 74.100 / 55. 74.100
libavcodec 57.105.100 / 57.105.100
libavformat 57. 82.100 / 57. 82.100
libavdevice 57. 8.100 / 57. 8.100
libavfilter 6.105.100 / 6.105.100
libswscale 4. 7.103 / 4. 7.103
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
13. troubleshoot
A. 11에 configure 에서 "ERROR: x265 not found using pkg-config" 오류 발생 시 libx265을 아래와 같이 소스 설치 후 다시 시도 한다.
$ sudo apt-get install cmake mercurial
$ cd ~/ffmpeg_sources
$ hg clone https://bitbucket.org/multicoreware/x265
$ cd ~/ffmpeg_sources/x265/build/linux
$ PATH="$HOME/bin:$PATH" cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED:bool=off ../../source
$ make
$ make install
2017-03-04
[MINGW/MSYS] beep음 off 하는 방법
windows에서 msys를 사용하던 중 beep음이 많이 신경이 쓰여서 beep음을 없애야했다.
노가다로 msys 설정 파일들을 확인하면서 찾아낸 방법을 기록해둔다.
msys 창에서 inputrc파일을 연다.
1. inputrc파일 을 연다.
$ vim ~/.inputrc
2. "set bell-style" 이 포함된 라인을 찾아서 다음과 같이 수정한다.
# none, visible or audible
#set bell-style audible
set bell-style none
3. msys 창을 종료 후 다시 실행하면 더이상 beep음이 발생하지 않는다.
4. vimrc 파일을 연다.
$ vim ~/.vimrc
5. 아래 라인을 추가한다.
set noerrorbells
set vb t_vb=
6. vim 을 다시 실행하면 vim beep음도 더 이상 발생하지 않는다.
2015-11-20
[JAVA] JNI용 C header file 생성 (javah)
오랜만에 JNI를 사용하여 라이브러리를 작성할 일이 생겼다.
JNI를 사용할 때 c 함수 형태를 java code에서 호출할 수 있게 생성해야한다.
이를 쉽게 해주는 tool이 javah인데, 너무 오랜만에 사용했더니 사용법잘생각이 안났다.
나중에 다시 찾을때를 위해 간단히 기록해둔다.
javah help 페이지는 아래와 같다.
> javah --help
Usage:
javah [options] <classes>
where [options] include:
-o <file> Output file (only one of -d or -o may be used)
-d <dir> Output directory
-v -verbose Enable verbose output
-h --help -? Print this message
-version Print version information
-jni Generate JNI-style header file (default)
-force Always write output files
-classpath <path> Path from which to load classes
-cp <path> Path from which to load classes
-bootclasspath <path> Path from which to load bootstrap classes
<classes> are specified with their fully qualified names
(for example, java.lang.Object).
example)
> javah -classpath E:\workspace\android\testpackage\src\main\java>javah -classpath C:\Android\sdk\platforms\android-23\andro
id.jar; testpackage.TestClass
JNI를 사용할 때 c 함수 형태를 java code에서 호출할 수 있게 생성해야한다.
이를 쉽게 해주는 tool이 javah인데, 너무 오랜만에 사용했더니 사용법잘생각이 안났다.
나중에 다시 찾을때를 위해 간단히 기록해둔다.
javah help 페이지는 아래와 같다.
> javah --help
Usage:
javah [options] <classes>
where [options] include:
-o <file> Output file (only one of -d or -o may be used)
-d <dir> Output directory
-v -verbose Enable verbose output
-h --help -? Print this message
-version Print version information
-jni Generate JNI-style header file (default)
-force Always write output files
-classpath <path> Path from which to load classes
-cp <path> Path from which to load classes
-bootclasspath <path> Path from which to load bootstrap classes
<classes> are specified with their fully qualified names
(for example, java.lang.Object).
example)
> javah -classpath E:\workspace\android\testpackage\src\main\java>javah -classpath C:\Android\sdk\platforms\android-23\andro
id.jar; testpackage.TestClass
2015-08-30
[debian] apache2 web server 간단한 설정
집에서 사용하는 개인용 Debian에서 apache2로 web server를 설정하는 방법을 기록한다.
1. 준비
Debian 설치시 옵션으로 web server를 사용하겠다고 선택했더니 이미 apache2가 설치되어 있었다. 방화벽도 열려 있었다.
기본 설정 파일 내용은 변경을 거의 안할것다. 일부 보안 관련 설정만 작업 할 것이다.
web root : /var/www/html (기본 설정)
2. security.conf 수정
# vi /etc/apache2/conf-available/security.conf
<Directory />
AllowOverride None
Order Deny,Allow
Deny from all
</Directory>
<Directory /var/www/html>
AllowOverride None
Order Deny,Allow
Allow from all
</Directory>
ServerTokens Prod
ServerSignature Off
TraceEnable On
3. user 추가
# htpasswd -c /etc/apache2/passwd userid
4. 디렉토리 설정
# vi /etc/apache2/conf-available/video.conf
<Directory /var/www/html/video>
Order Deny,Allow
AuthType Basic
AuthName "testauthname"
AuthUserFile /etc/apache2/passwd
Require valid-user
</Directory>
5. 설정 파일 link
# ln -s /etc/apache2/conf-available/video.conf /etc/apache2/conf-enabled/video.conf
6. 재시작
# service apache2 restart
웹 브라우저에 video 디렉 토리 접근시 3번 과정에서 추가한 userid와 password를 요구한다.
1. 준비
Debian 설치시 옵션으로 web server를 사용하겠다고 선택했더니 이미 apache2가 설치되어 있었다. 방화벽도 열려 있었다.
기본 설정 파일 내용은 변경을 거의 안할것다. 일부 보안 관련 설정만 작업 할 것이다.
web root : /var/www/html (기본 설정)
2. security.conf 수정
# vi /etc/apache2/conf-available/security.conf
<Directory />
AllowOverride None
Order Deny,Allow
Deny from all
</Directory>
<Directory /var/www/html>
AllowOverride None
Order Deny,Allow
Allow from all
</Directory>
ServerSignature Off
TraceEnable On
3. user 추가
# htpasswd -c /etc/apache2/passwd userid
4. 디렉토리 설정
# vi /etc/apache2/conf-available/video.conf
<Directory /var/www/html/video>
Order Deny,Allow
AuthType Basic
AuthName "testauthname"
AuthUserFile /etc/apache2/passwd
Require valid-user
</Directory>
# ln -s /etc/apache2/conf-available/video.conf /etc/apache2/conf-enabled/video.conf
6. 재시작
# service apache2 restart
웹 브라우저에 video 디렉 토리 접근시 3번 과정에서 추가한 userid와 password를 요구한다.
2015-08-22
[debian] torrent 설정
debian linux에서 torrent daemon(transmission-daemon) 을 설정한다.
1. 준비
torrent 자동 추가 디렉토리 : "/mnt/exhdd/seagate_hdd/torrent/input"
torrent 임시 디렉토리 : "/mnt/exhdd/seagate_hdd/torrent/tmp"
torrent 다운로드 디렉토리 : "/mnt/exhdd/seagate_hdd/torrent/down"
2. 설치
# apt-get install transmission-daemon
3. 서비스 종료 (안하면, 설정이 수정안됨)
# service transmission-daemon stop
4. 설정
# vi /etc/transmission-daemon/settings.json
아래 url에서 설정관련 추가 정보를 얻을수 있다.
https://trac.transmissionbt.com/wiki/EditConfigFiles
{
"alt-speed-down": 50,
"alt-speed-enabled": false,
"alt-speed-time-begin": 540,
"alt-speed-time-day": 127,
"alt-speed-time-enabled": false,
"alt-speed-time-end": 1020,
"alt-speed-up": 50,
"bind-address-ipv4": "0.0.0.0",
"bind-address-ipv6": "::",
"blocklist-enabled": false,
"blocklist-url": "http://www.example.com/blocklist",
"cache-size-mb": 4,
"dht-enabled": true,
"download-dir": "/mnt/exhdd/seagate_hdd/torrent/down",
"download-limit": 100,
"download-limit-enabled": 0,
"download-queue-enabled": true,
"download-queue-size": 5,
"encryption": 1,
"idle-seeding-limit": 30,
"idle-seeding-limit-enabled": false,
"incomplete-dir": "/mnt/exhdd/seagate_hdd/torrent/tmp",
"incomplete-dir-enabled": true,
"lpd-enabled": false,
"max-peers-global": 200,
"message-level": 1,
"peer-congestion-algorithm": "",
"peer-id-ttl-hours": 6,
"peer-limit-global": 200,
"peer-limit-per-torrent": 50,
"peer-port": 51413,
"peer-port-random-high": 65535,
"peer-port-random-low": 49152,
"peer-port-random-on-start": false,
"peer-socket-tos": "default",
"pex-enabled": true,
"port-forwarding-enabled": false,
"preallocation": 1,
"prefetch-enabled": 1,
"queue-stalled-enabled": true,
"queue-stalled-minutes": 30,
"ratio-limit": 2,
"ratio-limit-enabled": false,
"rename-partial-files": true,
"rpc-authentication-required": true,
"rpc-bind-address": "0.0.0.0",
"rpc-enabled": true,
"rpc-password": "torrent_password",
"rpc-port": 9091,
"rpc-url": "/transmission/",
"rpc-username": "torrent_id",
"rpc-whitelist": "192.168.0.2",
"rpc-whitelist-enabled": true,
"scrape-paused-torrents-enabled": true,
"script-torrent-done-enabled": false,
"script-torrent-done-filename": "",
"seed-queue-enabled": false,
"seed-queue-size": 10,
"speed-limit-down": 100,
"speed-limit-down-enabled": false,
"speed-limit-up": 100,
"speed-limit-up-enabled": false,
"start-added-torrents": true,
"trash-original-torrent-files": false,
"umask": 18,
"upload-limit": 100,
"upload-limit-enabled": 0,
"upload-slots-per-torrent": 14,
"utp-enabled": true,
"watch-dir": "/mnt/exhdd/seagate_hdd/torrent/input",
"watch-dir-enabled": true,
"trash-original-torrent_files": true
}
5. 재시작
# service transmission-daemon restart
6. web browser로 동작 확인
web browser에서 http://192.168.0.3:9091/transmission/
id : torrent_id
password : torrent_password
1. 준비
torrent 자동 추가 디렉토리 : "/mnt/exhdd/seagate_hdd/torrent/input"
torrent 임시 디렉토리 : "/mnt/exhdd/seagate_hdd/torrent/tmp"
torrent 다운로드 디렉토리 : "/mnt/exhdd/seagate_hdd/torrent/down"
2. 설치
# apt-get install transmission-daemon
3. 서비스 종료 (안하면, 설정이 수정안됨)
# service transmission-daemon stop
4. 설정
# vi /etc/transmission-daemon/settings.json
아래 url에서 설정관련 추가 정보를 얻을수 있다.
https://trac.transmissionbt.com/wiki/EditConfigFiles
"alt-speed-down": 50,
"alt-speed-enabled": false,
"alt-speed-time-begin": 540,
"alt-speed-time-day": 127,
"alt-speed-time-enabled": false,
"alt-speed-time-end": 1020,
"alt-speed-up": 50,
"bind-address-ipv4": "0.0.0.0",
"bind-address-ipv6": "::",
"blocklist-enabled": false,
"blocklist-url": "http://www.example.com/blocklist",
"cache-size-mb": 4,
"dht-enabled": true,
"download-dir": "/mnt/exhdd/seagate_hdd/torrent/down",
"download-limit": 100,
"download-limit-enabled": 0,
"download-queue-enabled": true,
"download-queue-size": 5,
"encryption": 1,
"idle-seeding-limit": 30,
"idle-seeding-limit-enabled": false,
"incomplete-dir": "/mnt/exhdd/seagate_hdd/torrent/tmp",
"incomplete-dir-enabled": true,
"lpd-enabled": false,
"max-peers-global": 200,
"message-level": 1,
"peer-congestion-algorithm": "",
"peer-id-ttl-hours": 6,
"peer-limit-global": 200,
"peer-limit-per-torrent": 50,
"peer-port": 51413,
"peer-port-random-high": 65535,
"peer-port-random-low": 49152,
"peer-port-random-on-start": false,
"peer-socket-tos": "default",
"pex-enabled": true,
"port-forwarding-enabled": false,
"preallocation": 1,
"prefetch-enabled": 1,
"queue-stalled-enabled": true,
"queue-stalled-minutes": 30,
"ratio-limit": 2,
"ratio-limit-enabled": false,
"rename-partial-files": true,
"rpc-authentication-required": true,
"rpc-bind-address": "0.0.0.0",
"rpc-enabled": true,
"rpc-password": "torrent_password",
"rpc-port": 9091,
"rpc-url": "/transmission/",
"rpc-username": "torrent_id",
"rpc-whitelist": "192.168.0.2",
"rpc-whitelist-enabled": true,
"scrape-paused-torrents-enabled": true,
"script-torrent-done-enabled": false,
"script-torrent-done-filename": "",
"seed-queue-enabled": false,
"seed-queue-size": 10,
"speed-limit-down": 100,
"speed-limit-down-enabled": false,
"speed-limit-up": 100,
"speed-limit-up-enabled": false,
"start-added-torrents": true,
"trash-original-torrent-files": false,
"umask": 18,
"upload-limit": 100,
"upload-limit-enabled": 0,
"upload-slots-per-torrent": 14,
"utp-enabled": true,
"watch-dir": "/mnt/exhdd/seagate_hdd/torrent/input",
"watch-dir-enabled": true,
"trash-original-torrent_files": true
}
5. 재시작
# service transmission-daemon restart
6. web browser로 동작 확인
web browser에서 http://192.168.0.3:9091/transmission/
id : torrent_id
password : torrent_password
2015-08-20
[debian] samba 설치
debian linux에서 samba를 설치 및 설정 하여 windows와 디렉토리를 공유한다.
1. 준비
공유 할 디렉토리는 /mnt/exhdd 이다.
공유 시 사용할 계정은 userid이다.
2. samba 설치
# apt-get install samba
3. samba 설정, 아래 구문 추가
# vi /etc/samba/smb.conf
[exhdd]
path = /mnt/exhdd
valid users = userid
writeable = yes
browseable = yes
1. 준비
공유 할 디렉토리는 /mnt/exhdd 이다.
공유 시 사용할 계정은 userid이다.
2. samba 설치
# apt-get install samba
3. samba 설정, 아래 구문 추가
# vi /etc/samba/smb.conf
[exhdd]
path = /mnt/exhdd
valid users = userid
writeable = yes
browseable = yes
4. samba 계정 등록
# smbpasswd -a userid
New SMB password:
Retype new SMB password:
Added user sharpis.
5. samba 설정 적용
# service samba reload
6. 탐색기에서 "\\IP주소" 형태로 접속한다.
ex) \\192.168.0.2
피드 구독하기:
글 (Atom)