Linux2009. 12. 8. 20:05
도대체 달력소스는 왜케 찾기가 힘들지 ㄱ-
일단 분석을 해서 어떻게 그리는지 알아봐야겠다 ㅠ.ㅠ


[링크 : http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/calendar/]
Posted by 구차니
프로그램 사용/VLC2009. 12. 8. 18:13
기본값으로 설치했을 경우
C:\Program Files\VideoLAN\VLC\http\.hosts
라는 파일의 내용은 아래와 같다.

#
# Access-list for VLC HTTP interface
# $Id$
#

# localhost
::1
127.0.0.1

# link-local addresses
#fe80::/64

# private addresses
#fc00::/7
#fec0::/10
#10.0.0.0/8
#172.16.0.0/12
#192.168.0.0/16
#169.254.0.0/16

# The world (uncommenting these 2 lines is not quite safe)
#::/0
#0.0.0.0/0

위의 localhost 부분이 자기 스스로 접속하면 되는데,
외부에서는 접속해도 forbidden 이라면서 접속하지 못하도록 하는 부분이다.

만약에 C Class를 허가하고 싶다면 ip/24로 적어주면된다.
(예를 들어 192.168.0.1~255를 허가하고 싶다면
192.168.0.1/24로 하면 된다.)


참고 : 굳이 VLC 죽였다 하지 않아도 자동으로 갱신되는 듯 하다.
Posted by 구차니
Linux2009. 12. 8. 17:53
How redirect stderr to /dev/null in c program(language) on linux

if (replace_stderr && freopen("/dev/null", "w", stderr) == NULL) {
    ap_log_error(APLOG_MARK, APLOG_CRIT, errno, s_main,
        "unable to replace stderr with /dev/null");
}

[링크 : http://www.codase.com/search/call?name=freopen]

#include <stdio.h>

FILE *fopen(const char *path, const char *mode);
FILE *fdopen(int fildes, const char *mode);
FILE *freopen(const char *path, const char *mode, FILE *stream);

[링크 : http://linux.die.net/man/3/freopen]

freopen 은 파일 디스크립터를 다시 열어주는 역활을 한다.
위의 예제대로
freopen("/dev/null", "w", stderr);
를 실행하면 /dev/null 을 stderr로 열어주므로, 모든 stderr 메시지가 사라진다.

$ cat redirection.c
#include <stdio.h>
#include <unistd.h>

void main()
{
        fprintf(stdout,"test output message\n");
        fprintf(stderr,"test error message\n");
}

$ gcc -o a.out redirection.c

$ ./a.out
test output message
test error message
$ ./a.out > /dev/null
test error message
$ ./a.out 2> /dev/null
test output message

$ cat redirection_2.c
#include <stdio.h>
#include <unistd.h>

void main()
{
        freopen("/dev/null", "w", stderr);

        fprintf(stdout,"test output message\n");
        fprintf(stderr,"test error message\n");
}

$ gcc -o b.out redirection_2.c

$ ./b.out
test error message
$ ./b.out > /dev/null
$ ./b.out 2> /dev/null
test output message

위의 예제 두개를 비교해보면 알 수 있겠지만,
freopen 으로 인해 아래의 예제는 stderr이 출력되지 않는다.
Posted by 구차니
분류가 모호한 글2009. 12. 8. 13:59
Up Close And Personal
밀착취재를 뜻하는 미국의 속어입니다.

[링크 : http://kin.naver.com/qna/detail.nhn?d1id=3&dirId=30301&docId=50703532&qb=7JeFIO2BtOuhnOymiCDslaQg7Y287Iqk64SQ&enc=utf8&section=kin&rank=2&sort=0&spq=0&pid=fx3N8woi5TGssZ6SCBRsss--287325&sid=Sx3bmejCHUsAAE@4P7E]



영화가 유명해서 단어가 검색이 안된다 ㅠ.ㅠ

'분류가 모호한 글' 카테고리의 다른 글

과냉각 / 유리  (0) 2010.01.03
아랍의 공휴일(일요일)  (6) 2009.12.11
기믹(Gimmick)  (0) 2009.11.24
코드러너 - 웹에서 프로그래밍을!  (0) 2009.11.20
콜론, 콤마, 세미콜론 등등등  (0) 2009.11.17
Posted by 구차니
개소리 왈왈/독서2009. 12. 8. 11:18


얇고, 부담되지 않는 내용에 만원이라는 가격을 생각하면 비싸다고 생각할수도 있겠지만,
가슴이 훈훈해지고 당연한걸 잊고 살았던 자신을 돌아보게 하는 책의 값어치를 생각하면
충분하다고 생각이 된다. 그래도.. 선물하기 좋게 한 5000원이었으면 좋겠다 ㅋ


어쩌면 당연하면서도 잊고 살아왔던 당연한 진리
"나 자신이 타인에게 얻은 은혜만큼 타인에게 베풀라"
"인생(지식)을 잡지말고 타인에게 흘려라"
라는 이러한 단순한 진리는 지금의 경쟁위주의 사회에서는
어릴때 부터 아무런 가치도 없고 의미도 없는 일이라고 되뇌이게 하고있다.

하지만 고인물이 썩고, 쌓아놓은 곡식도 썩듯
자신이 타인에게 받은 지식은 타인에게 덧붙여 베풀고
나의 배움을 타인에게 흘려 다음 세대를 이롭게 하는 것이
현 시대를 살아가는 인간이 다음 세대에게 할 수 있는
최고의 일이자, 먼저 살아가는 사람으로서의 책임이 아닐까 생각이 된다.


책에서 말한것과 비슷하게
"배워서 남주자" 라는 마음을 다시 한번 되새겨 봐야 하지 않을까?


[링크 : http://book.daum.net/detail/book.do?bookid=KOR9788989313977]




Posted by 구차니
Microsoft/Windows2009. 12. 8. 11:11
이녀석이 먼가해서 검색해봤더니
디스크가 동적 디스크가 되서 제대로 인식못해 생기는 거라는데
AHCI(SATA)와 연관이 된건가 해서 일단은 드라이버를 설치했는데 잘될지는 모르겠다 ㅠ.ㅠ

[링크 : http://blog.naver.com/quriquri2/150036739681] >> SESSION3_INITIALIZATION_FAILED
[링크 : http://nicebug.egloos.com/1525609] >> AHCI on XP



2009.12.9 추가
ACHI 설치후 부팅이 잘 안되는 문제는 해결되었으나,
그래픽 카드가 제대로 설치되었음에도 해상도/색상이 이상하게 설정되는 문제가 발생했다.
Posted by 구차니
Linux2009. 12. 7. 18:04

# mount
rootfs on / type rootfs (rw)
/dev/root on / type cramfs (ro,noatime)
proc on /proc type proc (rw)
usbfs on /proc/bus/usb type usbfs (rw)
sysfs on /sys type sysfs (rw)
/dev/mtdblock3 on /root/apps type cramfs (ro)
/dev/mtdblock4 on /root/apps/data type jffs2 (rw)
/dev/sda1 on /root/sda1 type vfat (rw,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1)

...
FAT: Filesystem panic (dev sda1)
    fat_get_cluster: invalid cluster chain (i_pos 125316)
    File system has been set read-only
...

# mount
rootfs on / type rootfs (rw)
/dev/root on / type cramfs (ro,noatime)
proc on /proc type proc (rw)
usbfs on /proc/bus/usb type usbfs (rw)
sysfs on /sys type sysfs (rw)
/dev/mtdblock3 on /root/apps type cramfs (ro)
/dev/mtdblock4 on /root/apps/data type jffs2 (rw)
/dev/sda1 on /root/sda1 type vfat (ro,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1)




fsck 그것은 진리인가?

fsck.msdos with -a

[링크 : http://southerns.wordpress.com/2007/06/22/fat-filesystem-panic-dev-xxx/]

Posted by 구차니
Linux2009. 12. 7. 17:17

umount: cannot umount [mount poiunt] "Device or resource busy"

요런 에러를 발생해서 상콤하게 검색 고고싱,

-f
    Force unmount (in case of an unreachable NFS system). (Requires kernel 2.1.116 or later.)
-l
    Lazy unmount. Detach the filesystem from the filesystem hierarchy now, and cleanup all references to the filesystem as soon as it is not busy anymore. (Requires kernel 2.4.11 or later.)

[링크 : http://linux.die.net/man/8/umount] - umount

Linux 2.1.116 added the umount2() system call, which, like umount(), unmounts a target, but allows additional flags controlling the behaviour of the operation:

MNT_FORCE
(since Linux 2.1.116)
    Force unmount even if busy. (Only for NFS mounts.)

MNT_DETACH (since Linux 2.4.11)
    Perform a lazy unmount: make the mount point unavailable for new accesses, and actually perform the unmount when the mount point ceases to be busy.

MNT_EXPIRE (since Linux 2.6.8)
    Mark the mount point as expired. If a mount point is not currently in use, then an initial call to umount2() with this flag fails with the error EAGAIN, but marks the mount point as expi2red. The mount point remains expired as long as it isn't accessed by any process. A second umount2() call specifying MNT_EXPIRE unmounts an expired mount point. This flag cannot be specified with either MNT_FORCE or MNT_DETACH.

[링크 : http://linux.die.net/man/2/umount] - umount()

원인이야, 이미 열린 파일이 있을 경우이지만,
커널 2.4.11 이후부터는 lazy umount를 지원해서 깔끔하게 에러없이 마운트를 해제할 수 있다.
(어떤 문제점이 부가적으로 생길지는..)

2010.02.05 추가
# umount -fl 로 실행하면 묻지도 따지지도 않고 언마운트시킨다.


2014.09.03 추가
ssh로 로그인 중이었는데 fuser로 하니 사용자가 튕기면서 unmount가 된다 ㄷㄷ
그 이후에 많이 엉기니 사용시 주의가 필요한듯

# fuser -km /mountpoint
[링크 : http://www.cyberciti.biz/tips/how-do-i-forcefully-unmount-a-disk-partition.html]


Posted by 구차니
Linux2009. 12. 7. 17:07
# /usr/sbin/lsof
COMMAND     PID      USER   FD      TYPE     DEVICE     SIZE       NODE NAME
init          1      root  cwd       DIR      253,0     4096          2 /
init          1      root  rtd       DIR      253,0     4096          2 /
init          1      root  txt       REG      253,0    38620   10322027 /sbin/init
init          1      root  mem       REG      253,0    89408    6882935 /lib/libselinux.so.1
init          1      root  mem       REG      253,0   121652    6882916 /lib/ld-2.5.so
init          1      root  mem       REG      253,0  1589336    6882917 /lib/i686/nosegneg/libc-2.5.so
init          1      root  mem       REG      253,0    16528    6882918 /lib/libdl-2.5.so
init          1      root  mem       REG      253,0   245376    6882934 /lib/libsepol.so.1
init          1      root   10u     FIFO       0,15                 996 /dev/initctl

lsof는 열린파일의 목록을 보여준다.
umount 실패를 찾다가 나온 유틸리티이다.

음.. 일단 /proc 에서 프로세스 별로 fd를 확인해도 되겠지만 노가다이니 이런 착한 프로그램을 이용해 주어야한다!

[링크 : http://linux.die.net/man/8/lsof]


certcc 문서의 본래 링크를 못찾아서 대체링크
[링크 : http://unix.co.kr/bbs/board.php?bo_table=02_06&wr_id=6]

'Linux' 카테고리의 다른 글

USB가 읽기전용이 되었어요! (FAT rw -> ro)  (6) 2009.12.07
umount(), umount  (0) 2009.12.07
filesystem - msdos, vfat, umsdos  (0) 2009.12.06
/proc/net/route 파싱  (0) 2009.11.30
좀비 프로세스 생성하기(!)  (0) 2009.11.20
Posted by 구차니
Linux API/network2009. 12. 7. 13:42
0.0.0.0 은 간단하게 all allow의 의미라고 한다.







MS 넘들은 뻑하면 "의도된 설계입니다"
이 한마디로 구렁이 담 넘어 가듯 넘어간단 말이야 ㄱ-

The Winsock application that is listening on the designated port was written so that it binds to any local IP address by using INADDR_ANY. This means that the application will listen to all local interfaces and you can connect to the port of any of them. This is why netstat -an shows IP address 0.0.0.0 listening on the port.

[링크 : http://support.microsoft.com/?scid=kb%3Ben-us%3B175952&x=6&y=11]



-------------
$ netstat -an | more
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 0.0.0.0:2049                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:674                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:139                 0.0.0.0:*                   LISTEN

$ netstat -a | more
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 *:nfs                       *:*                         LISTEN
tcp        0      0 *:acap                      *:*                         LISTEN
tcp        0      0 *:netbios-ssn               *:*                         LISTEN

리눅스 상에서는 0.0.0.0 은 *로 표시 되기도 한다.
(-n 옵션은 numeric하게 출력할지 아니면 /etc/services 의 문자열로 출력할지를 결정하는 옵션이다)

'Linux API > network' 카테고리의 다른 글

INADDR_ANY/INADDR_BROADCAST/INADDR_NONE 매크로  (0) 2011.09.29
hton(), ntoh()  (0) 2011.09.26
ioctl을 이용한 정보수집  (0) 2009.11.30
termios 구조체를 이용한 자국반향(echo) 제어  (0) 2009.08.27
canonical / non-canonical  (0) 2009.08.27
Posted by 구차니