Linux/Ubuntu2009. 12. 26. 00:01
build-essential 을 설치해야지 gcc 및 각종 include 파일들이 설치된다.

추가적으로 추천하는 패키지는
meld
codeblocks
cvs/subversion

정도면 충분?!

[링크 : http://mwultong.blogspot.com/2006/10/gcc-c-ubuntu-linux-gcc-install.html]
Posted by 구차니
Linux2009. 12. 23. 11:11
스왑이 부족한데, 파티션 조정은 힘드니 파일로 스왑을 하는 방법이 있다고 한다.
dd if=/dev/zero of=/swapfile bs=1024 count=1000
mkswap /swapfile
swapon /swapfile
dd 로 생성할때는 bs는 Blocksize로 byte 단위이다.

[링크 : http://ask.nate.com/qna/view.html?n=8735836]
[링크 : http://linux.die.net/man/8/swapon]


스왑파일은 어디서 생성하던 상관은 없지만,
NFS Client 일 경우에는, 외부 디스크에만 스왑이 되는 듯한 현상이 발생했다.

# swapon swapfile
swapon: swapfile has holes
swapon: swapfile: Invalid argument
안될때는 이렇게 나오고(NFS 상의 디렉토리에서 수행)

# swapon swapfile
Adding 992k swap on swapfile.  Priority:-1 extents:1 across:992k
되면 이렇게 곱게 나와주신다. (USB 로 파일 이전후 시도)


swap filesystem을 지원하지 않아서 그런것 같다는 말도 있긴 하지만,
단순하게 디스크를 옮김으로서 해결이 된것봐서는, swapfile의 위치 제약이 존재하는 듯 하다.
[링크 : http://www.0x61.com/forum/busybox-linux-f110/filesystem-v1-10-0-swapon-swapfile-has-holes-blocksize-t50097.html]

+
2021.01.18
swapon 으로 상황을 볼 수 있다.

[링크 : https://www.snoopybox.co.kr/1964]

'Linux' 카테고리의 다른 글

ntfs-3g at Tuxera  (0) 2010.01.06
웹캠 VLC에서 테스트(Ubuntu 9.10)  (0) 2009.12.29
DNS / Host Lookup 관련 파일  (0) 2009.12.22
OOM - Out of Memory  (2) 2009.12.15
Linux 에서 malloc 으로 할당된 memory 크기를 알 수 있는 방법  (2) 2009.12.14
Posted by 구차니
Linux2009. 12. 22. 17:49
resolv.conf 는 DNS 서버의 아이피가 들어감
nsswitch.conf 는 호스트 이름을 resolve할 순서를 정의함
hosts 는 static 한 resolve 이름을 정의한다. (예를 들어 리눅스 로컬 서버들끼리의 alias)

삼바에서는
lmhossts 파일을 통해 할 수 있고,
smb.conf 에서 resolve할 순서를 정의할 수 있다.

[링크 : http://linux.die.net/man/5/resolv.conf]
[링크 : http://linux.die.net/man/5/nsswitch.conf]
[링크 : http://linux.die.net/man/5/hosts]
[링크 : http://linux.die.net/man/5/hosts.allow]
[링크 : http://linux.die.net/man/5/hosts.deny]

[링크 : http://linux.die.net/man/7/samba]
[링크 : http://linux.die.net/man/5/smb.conf]
[링크 : http://linux.die.net/man/5/lmhosts]
Posted by 구차니
Linux2009. 12. 15. 18:13
OOM Logo

삼바가 죽는다. 이유는 모르겠다.
아무튼, oom-killer 라길래 검색해 보니 out of memory의 약자인데,
문제는.. 메모리 부족시에는 랜덤하게 process를 kill한다고 한다.(random이 이렇게 무섭게 느껴지다니)

oom-killer: gfp_mask=0x201d0, order=0

Call trace:
[<846467ae>] out_of_memory+0x14e/0x200
[<84648cc6>] __alloc_pages+0x306/0x340
[<846449f8>] read_cache_page+0x98/0x260
[<84641660>] find_get_page+0x0/0xe0
[<84641d00>] add_to_page_cache_lru+0x0/0x40
[<84673aa0>] blkdev_readpage+0x0/0x20
[<846da4ca>] cramfs_read+0x14a/0x260
[<84789eb8>] radix_tree_preload+0x18/0x100
[<846dabd4>] cramfs_readpage+0x154/0x1a0
[<848c78c0>] mutex_unlock+0x0/0x60
[<8464af2a>] __do_page_cache_readahead+0x20a/0x380
[<84641b80>] add_to_page_cache+0x0/0x180
[<846452ec>] filemap_nopage+0x10c/0x4c0
[<84652306>] __handle_mm_fault+0xc6/0xa40
[<847b7326>] asc_transmit_chars+0x186/0x1e0
[<84613842>] do_page_fault+0x102/0x3e0
[<84616760>] default_wake_function+0x0/0x20
[<84799f5c>] tty_write+0x13c/0x280
[<8479778c>] tty_ldisc_deref+0x4c/0xe0
[<84799ec6>] tty_write+0xa6/0x280
[<8468167c>] do_ioctl+0x5c/0x80
[<848c82c2>] unlock_kernel+0x22/0x80
[<84681682>] do_ioctl+0x62/0x80
[<846816f2>] vfs_ioctl+0x52/0x3e0
[<8466a496>] fget_light+0x96/0xe0
[<84681aae>] sys_ioctl+0x2e/0x80
[<84605068>] ret_from_exception+0x0/0x8
[<84605000>] tlb_miss_load+0x0/0x4

Mem-info:
DMA per-cpu:
cpu 0 hot: high 18, batch 3 used:2
cpu 0 cold: high 6, batch 1 used:0
DMA32 per-cpu: empty
Normal per-cpu: empty
HighMem per-cpu: empty
Free pages:        1212kB (0kB HighMem)
Active:1514 inactive:6105 dirty:4417 writeback:1689 unstable:0 free:303 slab:2039 mapped:1513 pagetables:81
DMA free:1212kB min:972kB low:1212kB high:1456kB active:6056kB inactive:24420kB present:59392kB pages_scanned:7433 all_unreclaimable
? no
lowmem_reserve[]: 0 0 0 0
DMA32 free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0 0
Normal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0 0
HighMem free:0kB min:128kB low:128kB high:128kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0 0
DMA: 33*4kB 35*8kB 6*16kB 0*32kB 1*64kB 1*128kB 0*256kB 1*512kB 0*1024kB 0*2048kB 0*4096kB = 1212kB
DMA32: empty
Normal: empty
HighMem: empty
Swap cache: add 0, delete 0, find 0/0, race 0+0
Free swap  = 0kB
Total swap = 0kB
Free swap:            0kB
14848 pages of RAM
3075 reserved pages
6389 pages shared
0 pages swap cached



[링크 : http://linux-mm.org/OOM_Killer]
[링크 : http://linux-mm.org/OOM]
Posted by 구차니
Linux2009. 12. 14. 23:53
최초 의도한 내용은,
malloc() 으로 할당받은 포인터가 있고,
이 포인터 만을 가지고, 얼마나 큰 용량을 할당 받았는지 알아내는 방법에 대한 것이었는데
일단 malloc()으로 할당된 총 메모리 용량이라도 링크...

#include <malloc.h>
#include <stdio.h>

#define mm() do{s_m = mallinfo(); fprintf(stdout, "%d/%d --\n", s_m.arena, s_m.uordblks);}while(0)

int main(int s_argc, char **s_argv)
{
        struct mallinfo s_m;
        void *s_p;

        mm();

        s_p = malloc(100);
        mm();

        free(s_p);
        mm();

        s_p = malloc(10000);
        mm();

        free(s_p);
        mm();

        return(0);
}

% ./a.out
0/0 --
135168/104 --
135168/0 --
135168/10008 --
135168/0 --

[링크 : http://webdizen.new21.net/blog/3041]


 struct mallinfo {
   int arena;
   int ordblks;
   int smblks;
   int hblks;
   int hblkhd;
   int usmblks;
   int fsmblks;
   int uordblks;
   int fordblks;
   int keepcost;
 };

[링크 : http://www.delorie.com/djgpp/doc/libc/libc_550.html]


[링크 : http://www.ibm.com/developerworks/linux/library/l-memory/] 영문
[링크 : http://www.ibm.com/developerworks/kr/library/l-memory/] 한글

[링크 : http://www.gnugeneration.com/books/linux/2.6.20/kernel-api/ch05.html]

[링크 : http://weezzle.net/1660]

'Linux' 카테고리의 다른 글

DNS / Host Lookup 관련 파일  (0) 2009.12.22
OOM - Out of Memory  (2) 2009.12.15
시간관련 함수/구조체 - time API on linux  (0) 2009.12.09
compiz / beryl  (0) 2009.12.09
LiveUSB의 Persistence file 용량 증설하기  (0) 2009.12.09
Posted by 구차니
Linux/Ubuntu2009. 12. 10. 11:12
how to install ubuntu in TC-100 tablet

귀찮으니 (눈에 안들어 오는 -ㅁ-) 일단 링크 정리


[링크 : https://help.ubuntu.com/community/Wacom]
[링크 : http://alexmac.cc/tablet-apps/]
[링크 : http://wiki.linuxquestions.org/wiki/Tc1100]
[링크 : http://ubuntuforums.org/showthread.php?t=563736&page=32]
[링크 : http://ubuntuforums.org/showpost.php?p=7234134&postcount=176]

'Linux > Ubuntu' 카테고리의 다른 글

콘솔 터미널 탭사용하기  (0) 2010.01.13
우분투 개발관련 패키지  (0) 2009.12.26
Xournal + CellWriter  (4) 2009.12.10
Ubuntu 9.10 에서 프로그램 설치가 안될경우  (0) 2009.12.09
Ubuntu 9.10 만세  (4) 2009.12.09
Posted by 구차니
Linux/Ubuntu2009. 12. 10. 09:47


천백이 카페의 의기천추님의 조언으로 Xournal을 설치하면서
몇가지 검색을 해보니 CellWriter라는 녀석이 있습니다.

네네~ 이녀석은 말그대로 윈도우 XP Tablet Edition의 필기체 인식을 하는 녀석이죠~
근데.. 아쉽게도 한글인식은 못합니다

아무튼, Xournal은 윈도우 필기장 보다는 부드럽게 써지는 느낌이지만
윈도우 필기장과 호환안되는 점은 아쉽습니다만.. 머 윈도우 필기장도 전용 포맷이니 ㅋㅋㅋ



2009.12.28 추가
PDF annotator 처럼 Xournal에서 PDF를 열어 필기가 가능하다고 한다.
[링크 : http://brucekim.egloos.com/2455400]

Posted by 구차니
Linux2009. 12. 9. 17:15

#include <time.h>

time_t time(time_t *t);
size_t strftime(char *s, size_t max, const char *format, const struct tm *tm);

char *asctime(const struct tm *tm);
char *asctime_r(const struct tm *tm, char *buf);
char *ctime(const time_t *timep);
char *ctime_r(const time_t *timep, char *buf);
struct tm *gmtime(const time_t *timep);
struct tm *gmtime_r(const time_t *timep, struct tm *result);
struct tm *localtime(const time_t *timep);
struct tm *localtime_r(const time_t *timep, struct tm *result);
time_t mktime(struct tm *tm);

struct tm
{
    int tm_hour;//     hour (0 - 23)
    int tm_isdst;//     Daylight saving time enabled (> 0), disabled (= 0), or unknown (< 0)
    int tm_mday;//     day of the month (1 - 31)
    int tm_min;//     minutes (0 - 59)
    int tm_mon;//     month (0 - 11, 0 = January)
    int tm_sec;//     seconds (0 - 59)
    int tm_wday;//     day of the week (0 - 6, 0 = Sunday)
    int tm_yday;//     day of the year (0 - 365)
    int tm_year;//     year since 1900
}

[링크 : http://en.wikipedia.org/wiki/Time.h] Time_t 구조체 내용
[링크 : http://en.wikipedia.org/wiki/Time_t]  Time_t 구조체 사용방법

[링크 : http://linux.die.net/man/3/strftime]
[링크 : http://linux.die.net/man/3/localtime]
[링크 : http://linux.die.net/man/3/mktime]

struct tm과 time_t 라는 타입은 시간에 사용된다.
mktime() 은 struct tm의 값으로 timt_t 형의 시간을 만들어 주고, time()은 현재의 시간을 반환해준다.(time_t *t = NULL)
localtime() 으로 time_t 형의 값으로 변환해준다.
strftime()은 sprintf와 비슷하게 time_t 형의 값을 받아 문자열로 시간을 나타내준다.

복잡하게 보이지만, 간단하게 예를 들자면,
int main(void)
{
    time_t     now;
    struct tm  tmtm;
    struct tm  *ts;
    char       buf[80];

    /* Get the current time */
    //now = time(NULL);
    tmtm.tm_year = 102;
    tmtm.tm_mon = 1;
    tmtm.tm_mday = 23;
    tmtm.tm_hour = 10;
    tmtm.tm_min = 12;
    tmtm.tm_sec = 51;
    now = mktime(&tmtm);

    /* Format and print the time, "ddd yyyy-mm-dd hh:mm:ss zzz" */
    ts = localtime(&now);
    strftime(buf, sizeof(buf), "%a %Y-%m-%d %H:%M:%S %Z", ts);
    printf("%s\n", buf);

    return 0;
}
결과는 아래와 같다.
 Sat 2002-02-23 10:12:51 KST
mktime()으로 원하는 시간과 날자를 넣고, (만약 주석된 time()을 풀면 현재 시간이 나온다)
localtime()을 통해서 time_t 형으로 변환하고
strftime()을 통해서 문자열로 출력을 한다.
만약에 요일이 궁금하다면 날자를 넣고, localtime() 한뒤 리턴되는 struct tm 의 값중 tm_wday 을 읽으면 된다.

[링크 : http://www.joinc.co.kr/modules/moniwiki/wiki.php/man/3/mktime]
Posted by 구차니
Linux2009. 12. 9. 16:11
이름은 모르겠지만, 위와 같이 사용하려면 아래의 항목을 Enable 해주면 된다.

모든 작업공간상의 프로그램을 순환하려면 Alt-win-Tab 으로 하면된다.
(기본값임)
Posted by 구차니
Linux/Ubuntu2009. 12. 9. 14:50
apt-get 서버의 목록중 캐노니컬 관리 / 커뮤니티 관리 이런식으로 분리를 해놓는 바람에
많은 프로그램들이 기본 설치목록에 빠져있기 때문이다.

System - Administration - Software Sources 를 선택한다.

Communitu-maintained Open Source software (universe)
항목을 선택하고 Close 한뒤, refresh 해주면 서버에서 프로그램 목록을 가져온다.

compiz 모드에서 찍은 스샷이라.. 제목표시줄이 가출.. (먼산)
아무튼 위의 항목을 선택 해주지 않으면, 위와 같이 캐노니컬에서 한게 아니라 Install 버튼이 생기지 않는다

하지만 항목을 선택하고 나면 위와 같이 캐노니컬에서 하지 않지만 Install 버튼이 생긴다.

'Linux > Ubuntu' 카테고리의 다른 글

TC1100에 우분투 설치 관련 문서  (6) 2009.12.10
Xournal + CellWriter  (4) 2009.12.10
Ubuntu 9.10 만세  (4) 2009.12.09
9.10 kalmic 업그레이드 / 맛배기  (0) 2009.11.02
gnome panel에 온도 정보 넣기  (0) 2009.11.02
Posted by 구차니