manywaypark's Blog
개발, 검색, 함수

문제:
lyx에서 문서를 랜더링할때 다음과 같은 에러를 내면서 안되는 경우가 있다.
Warning: Document class not available
----------------------------------------
The layout file requested by this document,
IEEEtran.layout,
is not usable. This is probably because a LaTeX
class or style file required by it is not
available. See the Customization documentation
for more information.
LyX will not be able to produce output.
Error: Couldn't export file
----------------------------------------

해결: package 하나만 설치하면 된다.
sudo apt-get install texlive-publishers
lyx에서 tools > reconfigure 하는 것도 잊지 말자.
예전에 한번 문제가 되어서 해결했던 것인데, 다시 다른 박스의 ubuntu에서 예전에 작성했던 문서 소스를 rendering하려니 make 에러가 났다. 1시간 가량 삽질. Orz

happy hackin'
djbdns를 설치하려했는데, 의존성이 걸린 daemontools-run이 제대로 설치 되지 않는 문제가 발생했다.
환경: ubuntu intrepid

에러 메시지:

[...]
Adding SV inittab entry...
cp: cannot stat `/etc/inittab': No such file or directory

dpkg: error processing daemontools-run (--install):
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 daemontools-run

해결:

다음을 /etc/apt/sources.list에 추가해서 patch된 버전을 인스톨(apt-get update후 apt-get install)한다.
deb http://ppa.launchpad.net/amoog/amoog-devel/ubuntu jaunty main
deb-src http://ppa.launchpad.net/amoog/amoog-devel/ubuntu jaunty main

인증 관련해서 apt-get update가 실패하면
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com E6090F843576F6EDB9FB63DE24BDD6095AFE82CE

참고:

happy hackin'
에러:
$ sudo apt-get install djbdns
......
Setting up daemontools (1:0.76-3) ...
Setting up daemontools-run (1:0.76-3) ...
grep: /etc/inittab: No such file or directory
grep: /etc/inittab: No such file or directory
grep: /etc/inittab: No such file or directory
grep: /etc/inittab: No such file or directory
grep: /etc/inittab: No such file or directory
Adding SV inittab entry...
cp: cannot stat `/etc/inittab': No such file or directory
dpkg: error processing daemontools-run (--configure):
 subprocess post-installation script returned error exit status 1
Setting up djbdns (1:1.05-2) ...
Setting up ucspi-tcp (1:0.88-2) ...
Errors were encountered while processing:
 daemontools-run
E: Sub-process /usr/bin/dpkg returned an error code (1)

해결:
$ sudo apt-get remove daemontools-run --purge

참고:

happy hackin'
문제
다음과 같은 오류메시지가 로그에 쌓이면서 제대로 동작하지 않는 경우가 있다.
IOError: [Errno 95] Operation not supported: '/var/spool/caldavd'

해결
/var/spool/caldavd 디렉토리가 포함된 파티션의 파일시스템이 ext2나 ext3라면, /etc/fstab 에서 마운트옵션에 user_xattr를 추가해주면 된다.

참고
패키지에 포함된 README.Debian
happy hackin'
OpenOffice에서 다음과 같은 에러를 내며 기능이 실행되지 않았다.
javaldx: Could not find a Java Runtime Environment!

Tools > Options > Java 에서 설정하라는 말은 헛소리인듯하고,

그냥,
$ sudo apt-get install openoffice.org-java-common

해결되었다.

참고: http://ubuntuforums.org/showthread.php?t=627559

happy hackin'

[UTIL] scponly - 설치

tips & tricks/Linux/Unix 2008. 9. 21. 23:44 by manywaypark
환경 : ubuntu(64bit), x86-84
ssh 프로토콜만을 사용해서 sftp만 독립적(?)으로 실행하는, 안전한 scponly를 설치하는 방법을 설명한다.[각주:1]
ubuntu package를 설치하는 것만으로는 좀 미진한 부분이 있어 추가 설정에 관해서 알아본다. 
  1. root 권한으로 로그인후에,
  2. scponly package를 설치한다
    # apt-get install scponly
  3. 설정 스크립트 압축 풀기
    # cd /usr/share/doc/scponly/setup_chroot/
    # gzip -d setup_chroot.sh.gz
  4. 설정 스크립트(setup_chroot.sh) 편집 (64bit 시스템만 해당)
    다음과 비슷한 라인을 찾아서,
    LDSO_LIST="/lib/ld.so /libexec/ld-elf.so /libexec/ld-elf.so.1 /usr/libexec/ld.so /lib/ld-linux.so.2 /usr/libexec/ld-elf.so.1"
    다음과 같이 변경(ld-linux-x86-64.so.2 추가)
    LDSO_LIST="/lib/ld.so /libexec/ld-elf.so /libexec/ld-elf.so.1 /usr/libexec/ld.so /lib64/ld-linux-x86-64.so.2 /lib/ld-linux.so.2 /usr/libexec/ld-elf.so.1"
  5. 설정 스크립트 실행
    # sh ./setup_chroot.sh
    username, user_home_dir,  user_working_dir(요건 user_home_dir 밑에 위치하게 설정) 입력.
  6. /etc/shells에 scponlyc 추가
    which scponlyc >> /etc/shells
  7. SUID-Bit 설정
    chmod u+s `which scponlyc`
  8. dev 만들기
    # cd /home/username
    # mkdir dev
    # cd dev
    # mknod -m 666 null c 1 3
  9. sftp로 접속해서 파일 upload, download 테스트하기. 잘 안되면 다음 명령어로 debug message 확인해보기
    echo 2 /etc/scponly/debuglevel

참고: 

happy hackin'
  1. 참고 사이트 정리에 불과하다. :) 우분투 x86-64에 설치할 때를 기준으로 좀 편리하게 정리했다. [본문으로]
파일이 삼천만개면 너무 많은 건가? --;

파일들의 개수가 많아지면, 참기 힘들 정도로 속도가 저하된다.
apt-get 등으로 정상적인 시스템 관리(package update 등)하기도 너무 느려서 짜증날 정도다.

관리의 편의를 위해 많은 삽질 끝에 자동으로 대량의 데이터 파일들을 .deb 파일로 만들어서 간편하게 설치하는 방식을 현재 진행중인 프로젝트에 적용했으나, 속도 문제로 다른 방법을 찾아야할 듯하다.

예:
# dpkg -r some-pkg
(Reading database ... 36070717 files and directories currently installed.)
Removing some-pkg ...

위에 보이는 패키지 하나 삭제하는 데에 몇십분은 걸리는 듯하다. Orz.

happy hackin'




[TIP] 내지는 잡담

tips & tricks/Linux/Unix 2008. 6. 21. 04:23 by manywaypark
집에서 좀 볼일이 있어서 회사 서버로 접속을 했다가 Ubuntu 서버들을 간만에 upgrade하려했더니 업데이트 서버에서 파일이 없다는 식의 에러가 나면서 안됐다.
살펴보니 edgy였다. http://(kr|us).archive.ubuntu.com/ubuntu/dists/ 에 직접 브라우저로 들어가서 살펴보니 egdy는 아예 디렉토리도 없다. Orz.
가만히 생각해보니 모든 서버를 Dapper (LTS)로 했다가, 한놈만 갑자기 죽는 현상이 있어서 egdy로 올렸던 것이 떠올랐다.

표준적인(?) 방법으로,
/etc/apt/sources.list에서 edgy를 몽땅 feisty로 바꾸고
apt-get update
apt-get upgrade
apt-get dist-upgrade
를 했는데,

다음과 같은 무시무시한 경고 메시지가 나왔다.
W: mdadm: unchecked configuration file: /etc/mdadm/mdadm.conf
W: mdadm: please read /usr/share/doc/mdadm/README.upgrading-2.5.3.gz .
W: mdadm: no arrays defined in configuration file.
W: mdadm: falling back to emergency procedure in initramfs.

'이거 잘못되면 주말에 회사 나가게 생겼구나. 3T짜리 레이드가 인식이 안될 수도 있겠다'

구글링을 해서 자료를 찾고, reboot을 하는 중에 계속 ping을 날리는데 ping
"Destination Host Unreachable"에서 "64 bytes from boxname (xxx.xxx.xxx.xxx)"으로 바뀔때 어찌나 기쁘던지...

해결법(google and copy and paste):
sudo apt-get remove mdadm
sudo apt-get install sysv-rc-conf
sudo sysv-rc-conf # Press space to "uncheck" each item on the mdadm and mdadm-radi lines)
sudo apt-get remove grub
sudo apt-get install grub
sudo update-grub
sudo dpkg --configure -a

참고:https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/98911
업무중 간단히 쓸 일이 있어 만든 것인데 기억을 위해 글을 남긴다.
파일을 찾고, 경로에서 문자열을 추출하고 여러줄을 한줄로 만드는 일을 하는 것인데, 나말고는 별로 쓸 사람이 없을 것같기도 하다.
  1. 숫자와 dash로 된 txt 파일들을 찾고(find) 경로 중의 임의의 문자(A or B)를 추출(grep)한다.
    $ find . -name '*.txt' | egrep -o 'A|B|[0-9-]*.txt$'
    (다 좋은데, 하나의 match가 한 줄에 표시되어서 여러줄로 나온다.)
  2. 한줄에 표시하고 싶다 (sed).
    $ find . -name '*.txt' | egrep -o 'A|B|[0-9-]*.txt$' | sed '{
    N
    s/\n//
    }'
난 아직 sed에는 익숙치 않은 듯하다. sed 때문에 검색 + 삽질했다.

sed 예제 많은 페이지: http://www.grymoire.com/Unix/Sed.html

happy hackin'
"apt-get install devscripts build-essential fakeroot" 으로 대충 build에 필요한 기본 패키지들을 깔고,
만약 less를 빌드한다면 다음과 같이 해서 소스 받고 build에 필요한(의존성이 있는) 패키지들을 깔고

~$ apt-get source less
~$ apt-get build-dep less
빌드한다.
~$ cd less-###/
~$ fakeroot ./debian/rules binary

"../less_###_XXX.deb"가 생성된다.

"dpkg -i less_###_XXX.deb" 로 시스템에 설치할 수 있다.

"dpkg-deb -c less_###_XXX.deb" 로 .deb 파일의 내용을 확인할 수도 있다 (다른 사람이 만들어 놓은 .deb 파일을 구했을 때는 한번 해보는 것이 좋을 듯).

참고: http://www.debian-administration.org/articles/20 (약간 오래된 글이라 ./debian/rules를 사용하지 않는 듯하다.)

happy hackin'
1 2 3 4 5 6 
분류 전체보기 (306)
잡담 (20)
함수형 언어 (65)
emacs (16)
java (18)
tips & tricks (154)
Linux/Unix (57)
Win (19)
Qt (11)
Xcode (1)
Mac (8)
사랑 (1)
가사 (0)
독서 (4)
mobile (6)
비함수형 언어 (2)

공지사항

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

04-28 02:33