폐기처리할 HDD의 자료를 안전하게 지우는 방법으로  shred 명영을 사용한다.

# shred -vzn 0 /dev/sdX

erases whole partitions by overwriting everything with 0s in a single iteration

(기본 옵션은 random 3회 이다.)

http://askubuntu.com/questions/57572/how-to-delete-files-in-secure-manner

안드로이드 5.0 Lolipop에서 SELinux enforce mode가 적용된다.

http://www.android.com/versions/lollipop-5-0/


SE for Android 관련 정보는 The SELinux Notebook 최신판 (4th edition)에 업데이트 되어 있다.

http://freecomputerbooks.com/The-SELinux-Notebook-The-Foundations.html


참고로, 현재 http://selinuxproject.org/page/NewUsers 에는 3rd edition이 링크되어 있다.

(2014/12/4일자로 4th Edition으로 업데이트됨)


The_SELinux_Notebook-4th_Edition.pdf


notebook-source-4.0.tar.gz


grub의 graphical terminal이 tty와 충돌이 발생하는 경우 login화면이 보이지 않는다.

프로세스 상으로는 정상동작하고, id/passwd 입력을 하면, bash 또한 fork된 것을 확인할 수도 있다.

$ ps -ax | grep tty

 1374 tty4     Ss+    0:00 /sbin/getty -8 38400 tty4

 1380 tty5     Ss+    0:00 /sbin/getty -8 38400 tty5

 1388 tty2     Ss+    0:00 /sbin/getty -8 38400 tty2

 1389 tty3     Ss+    0:00 /sbin/getty -8 38400 tty3

 1391 tty6     Ss+    0:00 /sbin/getty -8 38400 tty6

 1492 tty7     Ss+    0:09 /usr/bin/X :0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch -background none

 2166 tty1     Ss+    0:00 /sbin/getty -8 38400 tty1


이때 /etc/default/grub 파일에 GRUB_TERMINAL 주석을 지우고,  update-grub를 하면 이 문제를 해결할 수 있다.

# Uncomment to disable graphical terminal (grub-pc only)

GRUB_TERMINAL=console


출처 :

http://askubuntu.com/questions/162535/why-does-switching-to-the-tty-give-me-a-blank-screen


http://www.theverge.com/2014/9/24/6840697/worse-than-heartbleed-todays-bash-bug-could-be-breaking-security-for

Bash 에 command Injection 보안 이슈가 있다고 공개후 보안 업데이트가 릴리즈되었다.


command injection 보안 이슈에 대한 설명 및 예제 명령인데, 보안 업데이트 후에는 아래 사진처럼 보안 문제가 해결되었다.

https://access.redhat.com/articles/1200223




아래는 유사한 code injection 보안이슈 사례들이다.

http://cwe.mitre.org/data/definitions/78.html

만약 ";rm -rf /" 명령 같은게 injection 된다면... 섬찟 -_-;;;;


2014/09/26 현재까지 Bash shell 추가 패치가 계속 업데이트 되고 있다.

CVE-2014-7169
CVE-2014-7186
CVE-2014-7187


Ubuntu 12.04 버전에서 Nvidia GTX750 등의 최신 그래픽 카드를 드라이버가 지원하지 못하는 문제로 

아래 화면과 같이 IRQ storm이 발생하면서 부팅이 안되는 문제가 있다.


http://forum.siduction.org/index.php?topic=4496.0

위 링크의 해결책은 "nouveau.modeset=0 xmodule=vesa"를 커널 부트 커멘드로 추가하면 부팅 가능.

이후 최신 nvidia driver를 설치하면 된다.


dd 명령은 진행 상태를 확인하기 어렵다. 이 경우 pv 명령이 진행 상황을 확인 할수 있는 기능을 제공한다.


install :

sudo apt-get install pv


usage :

dd if=/dev/sdX bs=1M | pv | dd of=/dev/sdY


output:

3.95GB 0:05:02 [4.66MB/s] [ <=>                                                ]


윈도우즈에서 다음 꼬마사전을 애용하고 있는데, 리눅스에서 동일하게 사용할 수 있을까 알아보다가,

GoldenDict의 웹사이트 쿼리 기능을 이용하는 방법을 찾음.


1) GoldenDict 설치 & 실행

2) Edit - Dictionaries에서 Daum Dic 추가하고 활성화.

http://small.dic.daum.net/search.do?dic=eng&q=%GDWORD%

3) GoldenDict에서 "Scan Popup" 기능 활성화


아래처럼, 단어 선택시 단어사전창이 팝업된다.


20015.06.09 추가 사항 : 

TTS 기능을 지원하는데, TTS 어플(espeak)을 이용하는 방법과 online으로 구글번역기의 TTS를 이용하는 방법이 아래 링크에 있다.

http://askubuntu.com/questions/458584/how-can-i-add-text-to-speech-to-goldendict


1. Edit -> Dictionaries -> Programs.

2. click on Add and choose "Audio" in type field .

3. in "Command Line" field copy and paste this command:

bash -c "p=$(echo "%GDWORD%" |sed 's/ /+/g');wget -U Mozilla -q -O - "$@" translate.google.com/translate_tts?tl=en\&q=$p|mpg123 -"

4. click ok


준비 사항 : Java 1.6, Tomcat 7, opengrok 0.11, exuberant ctags.

1. Tomcat 설치

$ sudo apt-get install tomcat7

2. Tomcat 서비스 시작

$ sudo service tomcat7 start

3. OpenGrok deploy

$ sudo OPENGROK_TOMCAT_BASE=/var/lib/tomcat7 ./OpenGrok deploy


4. 소스 인덱싱

$ OPENGROK_INSTANCE_BASE=/home2/opengrok/var ./OpenGrok index /home2/work/kernel


5. /var/opengrok/etc/configuration.xml

sudo ln -s /home2/opengrok/var/etc/configuration.xml  configuration.xml


커널 안에서 정의된 여러 구조체들을 보는 중에 구조체내의 멤버의 옵셋 값을 쉽게 알 수 있는 방법이 있지 않을까해서

구글 검색을 해보니 pahole이라는 명령어가 있다. dwarves 패키지에 포함된 프로그램이다.


설치 :

$ sudo apt-get install dwarves

사용 예 :

$ pahole vmlinux // 커널에 정의된 type들을 보여주는데도 시간이 무지 걸린다.

$ pahole -E vmlinux > type_list.txt // -E : 내부 멤버에 대해서도 전개.


최근 빌드된 vmlinux 에서 아래와 같이 인식하지 못하는 TAG로 비정상 종료되는 문제가 있다.

 (Ubuntu 12.04 의  pahole 서 발생)

die__process_function: DW_TAG_INVALID (0x4109) @ <0x187b8> not handled!


최신 버전에 수정이 된 듯 하여 최신 버전을 받아서 빌드하기로 결정.

최신 버전을 아래와 같이 받을 수 있다.

$ git clone https://git.kernel.org/cgit/devel/pahole/pahole.git/


빌드 설명을 README 파일을 참고 (cmake가 필요하다)

1. install cmake ($ sudo apt-get install cmake)

2. mkdir build

3. cd build

4. cmake -D__LIB=lib ..

5. make install



빌드를 하려니 패키지가 없다고 불평이다.
$ cmake -D__LIB=lib ..
-- The C compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Checking availability of DWARF and ELF development libraries
-- Could NOT find dwarf include dir
-- Could NOT find libdw include dir
-- Could NOT find libebl library
-- Could NOT find libdw library
-- Could NOT find libelf library

libdw-dev libelf-dev 를 설치했지만, libebl은 ubuntu 패키지로 존재하지 않는다.

일부 수정이 필요하다. (libdw 로 단순히 이름 바꾸기)

diff --git a/cmake/modules/FindDWARF.cmake b/cmake/modules/FindDWARF.cmake
index f4feec4..d3bb17a 100644
--- a/cmake/modules/FindDWARF.cmake
+++ b/cmake/modules/FindDWARF.cmake
@@ -38,7 +38,7 @@ find_library(ELF_LIBRARY
 )
 
 find_library(EBL_LIBRARY
-       NAMES ebl
+       NAMES dw
        PATHS /usr/lib /usr/local/lib /usr/lib64 /usr/local/lib64 ~/usr/local/lib ~/usr/local/lib64
 )

설치 후 만약 shared library path를 못찾는다면, sudo ldconfig 로 갱신.

Linux에서 iTunes media server 기능을 제공하는 패키지로,

mt-daapd (Firefly media server)와 forked-daapd가 있다.

최신 우분투 배포판에는 forked-daapd를 패키지로 제공한다.


ODROID-X에 forked-daapd를 설치해보자.

ODROID-X는 armhf 빌드 패키지를 사용한다.

우분투 repository 에 armhf용 빌드 패키지는 검색이 안된다.

(http://packages.ubuntu.com/precise/forked-daapd)

launchpad.net에서 패키지를 구함.

(https://launchpad.net/ubuntu/precise/armhf/forked-daapd/0.19-1ubuntu1)

링크에 필요한 패키지들이 나열되어 있다.


필요한 패키지들을 설치하지 않으면, 설치시 의존성 에러가 발생한다. (내 ODROID-X 경우...)

$ sudo dpkg -i forked-daapd_0.19-1ubuntu1_armhf.deb

Selecting previously unselected package forked-daapd.

(Reading database ... 180188 files and directories currently installed.)

Unpacking forked-daapd (from forked-daapd_0.19-1ubuntu1_armhf.deb) ...

dpkg: dependency problems prevent configuration of forked-daapd:

forked-daapd depends on libantlr3c-3.2-0 | libantlr3c-antlrdbg-3.2-0; however:

  Package libantlr3c-3.2-0 is not installed.

  Package libantlr3c-antlrdbg-3.2-0 is not installed.

forked-daapd depends on libavl1; however:

  Package libavl1 is not installed.

forked-daapd depends on libconfuse0 (>= 2.5); however:

  Package libconfuse0 is not installed.

forked-daapd depends on libevent-core-1.4-2 (>= 1.4.14b-stable); however:

  Package libevent-core-1.4-2 is not installed.

forked-daapd depends on libmxml1; however:

  Package libmxml1 is not installed.

forked-daapd depends on libtagc0 (>= 1.5); however:

  Package libtagc0 is not installed.

forked-daapd depends on libunistring0; however:

  Package libunistring0 is not installed.

dpkg: error processing forked-daapd (--install):

dependency problems - leaving unconfigured

Processing triggers for ureadahead ...

Processing triggers for man-db ...

locale: Cannot set LC_ALL to default locale: No such file or directory

Errors were encountered while processing:

forked-daapd


설치 안된 패키지는 apt-get install로 설치...

$ sudo apt-get install libantlr3c-3.2-0 libavl1 libconfuse0 libevent-core-1.4-2 libmxml1 libtagc0 libunistring0


/etc/forked-daapd.conf 설정파일을 수정.
-- 생략 --
library {
        # Name of the library as displayed by the clients
        # %h: hostname, %v: version
        name = "My Music on %h"
        # TCP port to listen on. Default port is 3689 (daap)
        port = 3689
        # Password for the library. Optional.
        password = "XXXX" # 패스워드 설정

        # Directories to index
        directories = { "/home/data/mp3" } # 미디어 위치
-- 생략 --

안드로이드 DAAP 어플로 동작 확인



+ Recent posts