tftpd32를 이용하여 간단하게 하는 방법을 따라해 보았다.
[링크 : http://blog.cuwoom.net/117]


나의 경우에는, 192.168.0.1 이 공유기이다.
공유기가 있어서 DHCP 충돌나지는 않을까 bootp에 문제가 없을까 걱정했는데
아무런 문제없이, tftpd32에서 제대로 받아갔다.

차이점.
1. pxelinux.0 파일은 링크와는 다르게!!
   ftp://archive.ubuntu.com/ubuntu/dists/karmic/main/installer-i386/current/images/netboot/netboot.targ.z
   을 받아, ./ubuntu_installer/i386/ 디렉토리를 추출하여 사용했다.
   그냥 압축을 풀어보면 용량이 0로 나오고, 부팅을 진행하면 install을 눌러도 넘어가지 않는다.
   0바이트 파일은 sybmolic link라서 윈도우에서는 제대로 연결을 해주지 못하는 것으로 생각이 된다.
 
. 에 존재하는 파일은 용량이 0 이다.
i386의 내용중 pxelinux.cfg와 pxelinux.0를 tftpd32 루트로 옮겨준다.

이런식으로 옮겨주면 된다.

PXE 부팅 설정으로 들어가려면 Shift-F10을 누르라고 하는데
들어가도 설정한건 없어서 그냥 나왔으니 패스 -ㅁ-!

꼼지락 대면서 BOOTP를 통해 ip와 pxelinux.0를 받으려고 한다.

받아온 아이피는 192.168.0.200 그리고 DHCP 서버는 tftpd32가 설치된 0.100 이다.
tftp를 통해 pxelinux.cfg 파일을 읽고 내용을 받아와서 부팅이 된다.


'프로그램 사용 > PXE(네트워크 부트)' 카테고리의 다른 글

pxe boot  (0) 2023.06.21
DHCP hostname  (0) 2020.10.14
DHCP / BOOTP / TFTP  (4) 2010.04.27
PXE를 통한 우분투/XP 설치  (0) 2009.12.09
Posted by 구차니
예전글에서 프로젝트 리비전을 분할관리 해야할 것 같아서 다시 한번 시도를 해봤는데 아래와 같은 내용이 있었다.

USAGE:
cvs2svn [OPTIONS]... [-s SVN-REPOS-PATH|--dumpfile=PATH|--dry-run] CVS-REPOS-PATH
cvs2svn [OPTIONS]... --options=PATH
CVS-REPOS-PATH The filesystem path of the part of the CVS repository that you want to convert. It is not possible to convert a CVS repository to which you only have remote access; see the FAQ for details. This doesn't have to be the top level directory of a CVS repository; it can point at a project within a repository, in which case only that project will be converted. This path or one of its parent directories has to contain a subdirectory called CVSROOT (though the CVSROOT directory can be empty).
Configuration via options file
--options=PATH Read the conversion options from the specified file. See section options file method for more information.
Output options
-s PATH
--svnrepos PATH
Write the output of the conversion into a Subversion repository located at PATH. This option causes a new Subversion repository to be created at PATH unless the --existing-svnrepos option is also used.

[링크 : http://cvs2svn.tigris.org/cvs2svn.html]



예를들어
/home/cvs
|-- CVSROOT
|-- Project1
|-- Project2
`-- Project3
이런구조의 cvs repository라면,

$ cvs2svn --svnrepos /home/svn/ --encoding=cp949 /home/cvs/
으로 할경우, 리비전이 전부 하나로 묶이고, 프로젝트가 분리되지 않는다.

$ cvs2svn --svnrepos /home/svn/Project1 --encoding=cp949 /home/cvs/Project1
$ cvs2svn --svnrepos /home/svn/Project2 --encoding=cp949 /home/cvs/Project2
$ cvs2svn --svnrepos /home/svn/Project3 --encoding=cp949 /home/cvs/Project3
이렇게 하면 개별 프로젝트로 repository가 생성이 된다.
(부가적으로 revision이 단순해져서 변환도 상대적으로 빨라지는 듯하다)

2009/05/10 - [프로그램 사용/CVS / SVN / GIT] - cvs2svn 사용방법

'프로그램 사용 > Version Control' 카테고리의 다른 글

visualSVN  (0) 2010.09.09
TortoiseSVN tag/branch = copy  (2) 2010.04.30
svn / svnadmin 도움말  (0) 2010.04.23
CVS / SVN 장단점, 차이점 비교  (6) 2010.04.07
GIT는 리눅스에서 받으시는걸 추천합니다.  (0) 2010.03.18
Posted by 구차니
자세히 보면 티가 나지만, 어떤녀석은 URL 이고 어떤 녀석은 PATH이다.
일단 URL에서 파일 경로일 경우에는 file:/// 이라고 / 개 3개가 들어가야 한다.

$ svnadmin create [repository direcotry name]
$ svn checkout file:///[absolute path] [name of repository which will create]

머.. 일단 콘솔에서는 이렇게 초기화 하고 만들면 될 듯.

$ svnadmin help
general usage: svnadmin SUBCOMMAND REPOS_PATH  [ARGS & OPTIONS ...]
Type 'svnadmin help <subcommand>' for help on a specific subcommand.

Available subcommands:
   crashtest
   create
   deltify
   dump
   help (?, h)
   hotcopy
   list-dblogs
   list-unused-dblogs
   load
   lslocks
   lstxns
   recover
   rmlocks
   rmtxns
   setlog
   verify

$ svnadmin help create
create: usage: svnadmin create REPOS_PATH

Create a new, empty repository at REPOS_PATH.

Valid options:
  --bdb-txn-nosync         : disable fsync at transaction commit [Berkeley DB]
  --bdb-log-keep           : disable automatic log file removal [Berkeley DB]
  --config-dir arg         : read user configuration files from directory ARG
  --fs-type arg            : type of repository: 'fsfs' (default) or 'bdb'

$ svn help
usage: svn <subcommand> [options] [args]
Subversion command-line client, version 1.3.2.
Type 'svn help <subcommand>' for help on a specific subcommand.

Most subcommands take file and/or directory arguments, recursing
on the directories.  If no arguments are supplied to such a
command, it recurses on the current directory (inclusive) by default.

Available subcommands:
   add
   blame (praise, annotate, ann)
   cat
   checkout (co)
   cleanup
   commit (ci)
   copy (cp)
   delete (del, remove, rm)
   diff (di)
   export
   help (?, h)
   import
   info
   list (ls)
   lock
   log
   merge
   mkdir
   move (mv, rename, ren)
   propdel (pdel, pd)
   propedit (pedit, pe)
   propget (pget, pg)
   proplist (plist, pl)
   propset (pset, ps)
   resolved
   revert
   status (stat, st)
   switch (sw)
   unlock
   update (up)

Subversion is a tool for version control.
For additional information, see http://subversion.tigris.org/

$ svn help list
list (ls): List directory entries in the repository.
usage: list [TARGET[@REV]...]

  List each TARGET file and the contents of each TARGET directory as
  they exist in the repository.  If TARGET is a working copy path, the
  corresponding repository URL will be used. If specified, REV determines
  in which revision the target is first looked up.

  The default TARGET is '.', meaning the repository URL of the current
  working directory.

  With --verbose, the following fields will be shown for each item:

    Revision number of the last commit
    Author of the last commit
    If locked, the letter 'O'.  (Use 'svn info URL' to see details)
    Size (in bytes)
    Date and time of the last commit

Valid options:
  -r [--revision] arg      : ARG (some commands also take ARG1:ARG2 range)
                             A revision argument can be one of:
                                NUMBER       revision number
                                "{" DATE "}" revision at start of the date
                                "HEAD"       latest in repository
                                "BASE"       base rev of item's working copy
                                "COMMITTED"  last commit at or before BASE
                                "PREV"       revision just before COMMITTED
  -v [--verbose]           : print extra information
  -R [--recursive]         : descend recursively
  --incremental            : give output suitable for concatenation
  --xml                    : output in XML
  --username arg           : specify a username ARG
  --password arg           : specify a password ARG
  --no-auth-cache          : do not cache authentication tokens
  --non-interactive        : do no interactive prompting
  --config-dir arg         : read user configuration files from directory ARG

$ svn help checkout
checkout (co): Check out a working copy from a repository.
usage: checkout URL[@REV]... [PATH]

  If specified, REV determines in which revision the URL is first
  looked up.

  If PATH is omitted, the basename of the URL will be used as
  the destination. If multiple URLs are given each will be checked
  out into a sub-directory of PATH, with the name of the sub-directory
  being the basename of the URL.

Valid options:
  -r [--revision] arg      : ARG (some commands also take ARG1:ARG2 range)
                             A revision argument can be one of:
                                NUMBER       revision number
                                "{" DATE "}" revision at start of the date
                                "HEAD"       latest in repository
                                "BASE"       base rev of item's working copy
                                "COMMITTED"  last commit at or before BASE
                                "PREV"       revision just before COMMITTED
  -q [--quiet]             : print as little as possible
  -N [--non-recursive]     : operate on single directory only
  --username arg           : specify a username ARG
  --password arg           : specify a password ARG
  --no-auth-cache          : do not cache authentication tokens
  --non-interactive        : do no interactive prompting
  --config-dir arg         : read user configuration files from directory ARG
  --ignore-externals       : ignore externals definitions


'프로그램 사용 > Version Control' 카테고리의 다른 글

TortoiseSVN tag/branch = copy  (2) 2010.04.30
cvs2svn 사용방법 2  (0) 2010.04.23
CVS / SVN 장단점, 차이점 비교  (6) 2010.04.07
GIT는 리눅스에서 받으시는걸 추천합니다.  (0) 2010.03.18
TortoiseGIT  (0) 2010.03.18
Posted by 구차니
expat도 SAX의 일종이라고 할 수 있을지는 모르겠지만,
방식측면에서는 event-driven 이니 SAX는 맞는것 같다.

아무튼, DOM 구조가 없으니 navigation은 힘든편.

SAX (Simple API for XML) is a serial access parser API for XML. SAX provides a mechanism for reading data from an XML document. It is a popular alternative to the Document Object Model (DOM).

[링크 : http://en.wikipedia.org/wiki/Simple_API_for_XML]

DOM vs SAX 파서

두 가지 유형의 XML 문서 파서가 있다. 이들은 XML 문서에 액세스하는 방식부터 다르다:

  • Document Object Model (DOM). XML 문서로의 랜덤 액세스(random access)에 사용된다. DOM의 장점은 메모리 안에 문서의 전체 모델을 갖고 있다는 점이다. 이는 모든 XML 엘리먼트에 어떤 순서로든지 액세스가 가능하다는 것을 의미한다. 하지만 큰 문서의 경우 둔해 질 수 있다. 메모리에서 실행시키지 않으면 시스템이 한계에 다다를 때 퍼포먼스가 느려진다.
  • Simple API for XML (SAX). 순차적 액세스(sequential access)에 사용된다. SAX의 장점은 문서의 한 부분이 메모리에서 사용될 수 있기 때문에 보다 큰 문서를 핸들할 수 있다는 점이다. SAX의 단점은 엘리먼트를 순서대로 처리해야 하며 한번에 볼 수 있는 문서 부분도 작다. SAX를 이용하여 문서를 파싱할 때 XML 부분을 저장할 수 있다.

[링크 : http://www.ibm.com/developerworks/kr/library/j-xmljava/]

Simple API for XML (SAX) 이벤트 중심 API이다. XML 마크업의 다른 부분들(시작과 끝 태그, 텍스트, 엔터티)에서 실행된 특정 이벤트용 핸들러 코드를 등록한다. 이 파서는 인풋 XML에 기반하여 이러한 이벤트들의 스트림을 보내면, 핸들러 코드는 이를 처리한다.

[링크 : http://www.ibm.com/developerworks/kr/xml/standards/x-saxspec.html]

SAX is the Simple API for XML, originally a Java-only API. SAX was the first widely adopted API for XML in Java, and is a “de facto” standard.

[링크 : http://www.saxproject.org/] SAX 공식


Posted by 구차니
iconv() 함수에서
변환결과로 나와야 하는 방법이 unicode일 경우에는 (일단 다른건 안해봤으니 -ㅁ-?)
(strlen(inbuf) + 2) * 2 가 된다.

size_t iconv(iconv_t cd,
                     char **inbuf, size_t *inbytesleft,
                     char **outbuf, size_t *outbytesleft);

예를 들어 UTF-8을 UNICODE로 변환시에는
UTF-8 문자열 특성상, stelen(utf8str) == 100 일 경우
유니코드(2바이트) 스트링은 최소 25에서 최대 100 까지 변환이 된다.

그리고 iconv 특성상 처음에 2바이트 BOM(Byte Order Mark)을 붙이므로
실질적으로 변환을 위해 필요로 하는 outbuf의 길이는
(strlen(inbuf) + 2) * 2 가 된다.

원래대로라면
(strlen(inbuf) + 1) * 2 + 2 이고
+1 은 '\0'
+2 는 Unicode BOM(0xFEFF in big endian)이다.

[링크 : http://mwultong.blogspot.com/2006/05/qna-unicode-bom-byte-order-mark.html]


덧 : UTF-8로 인코딩된 아랍어의 경우, 조합은 별도로 해주어야 한다.
iconv()가 UNICODE로 변환은 해주지만, 그렇다고 해서 조합까지 해주지는 않는다.
Posted by 구차니
프로그램 사용/VLC2010. 4. 22. 11:06
http://192.168.10.94:8080/?control=pause

현재 사용중인 PC의 ip가 192.168.10.94 이고, VLC 에서 웹 인터페이스를 켜놨을 경우
위와 같이 URL을 입력하면 플레이 중인 동영상이 일시정지 된다.
pause는 토글 방식으로, 한번 보내면 멈추고, 다시 보내면 재생된다.

위는 dreambox에서 PC의 VLC로 원격명령을 날리는 부분을, wireshark로 캡쳐한 화면

2010/04/21 - [프로그램 사용/VLC] - VLC를 웹 쿼리로 제어하기 - VLC web control

'프로그램 사용 > VLC' 카테고리의 다른 글

VLC - V4L2 modules  (0) 2010.07.03
VLC 1.1.0 Luggage  (0) 2010.07.03
VLC를 웹 쿼리로 제어하기 - VLC web control  (0) 2010.04.21
x264 와 h264의 관계?  (0) 2010.04.15
VLC nightly build  (0) 2010.04.13
Posted by 구차니
프로그램 사용/VLC2010. 4. 21. 15:08
VLC 에는 web interface 라는 넘이 있는데,
이녀석을 원격지에서 http query를 통해 제어가 가능하다.

윈도우에서 기본설치시
C:\Program Files\VideoLAN\VLC\http\requests 경로에 존재하는 파일을 읽어보면 될 듯 하다.

웹에서 접속시에는
http://localhost:8080/requests/filename.xml?query
식으로 하면된다.

아래는 readme.txt 파일
$Id$

This file describes commands available through the requests/ file:

Lines starting with < describe what the page sends back
Lines starting with > describe what you can send to the page

All parameters need to be URL encoded.
Examples:
 # -> %23
 % -> %25
 + -> %2B
 space -> +
 ...

status.xml:
===========
< Get VLC status information, current item info and meta.

> add <mrl> to playlist and start playback:
  ?command=in_play&input=<mrl>

> add <mrl> to playlist:
  ?command=in_enqueue&input=<mrl>

> play playlist item <id>:
  ?command=pl_play&id=<id>

> toggle pause. If current state was 'stop', play item <id>:
  ?command=pl_pause&id=<id>

> stop playback:
  ?command=pl_stop

> jump to next item:
  ?command=pl_next

> jump to previous item:
  ?command=pl_previous

> delete item <id> from playlist:
  ?command=pl_delete&id=<id>

> empty playlist:
  ?command=pl_empty

> sort playlist using sort mode <val> and order <id>:
  ?command=pl_sort&id=<id>&val=<val>
  If id=0 then items will be sorted in normal order, if id=1 they will be
  sorted in reverse order
  A non exhaustive list of sort modes:
    0 Id
    1 Name
    3 Author
    5 Random
    7 Track number

> toggle random playback:
  ?command=pl_random

> toggle loop:
  ?command=pl_loop

> toggle repeat:
  ?command=pl_repeat

> toggle enable service discovery module <val>:
  ?command=pl_sd&val=<val>
  Typical values are:
    sap
    shoutcast
    podcast
    hal

> toggle fullscreen:
  ?command=fullscreen

> set volume level to <val> (can be absolute integer, percent or +/- relative value):
  ?command=volume&val=<val>
  Allowed values are of the form:
    +<int>, -<int>, <int> or <int>%

> seek to <val>:
  ?command=seek&val=<val>
  Allowed values are of the form:
    [+ or -][<int><H or h>:][<int><M or m or '>:][<int><nothing or S or s or ">]
    or [+ or -]<int>%
    (value between [ ] are optional, value between < > are mandatory)
  examples:
    1000 -> seek to the 1000th second
    +1H:2M -> seek 1 hour and 2 minutes forward
    -10% -> seek 10% back

playlist.xml:
=============
< get the full playlist tree

browse.xml:
===========
< ?dir=<dir>
> get <dir>'s filelist

vlm.xml:
========
< get the full list of VLM elements

vlm_cmd.xml:
============
< execute VLM command <cmd>
  ?command=<cmd>
> get the error message from <cmd>



[링크 : http://forum.videolan.org/viewtopic.php?f=16&t=45842]

2009/12/08 - [프로그램 사용/VLC] - VLC 웹 인터페이스 원격지에서 안될경우
2009/11/24 - [프로그램 사용/VLC] - VLC web interface(웹 인터페이스)
Posted by 구차니
프로그램 사용/busybox2010. 4. 20. 20:08
원인은 못찾았지만, 커널 옵션에서 quiet 주어도 나오길래, 최소한 커널 오류는 아닌것으로 판단
busybox에서 찾아보니

./shell/ash.c:4849:     ash_msg_and_raise_error("cannot open %s: %s", fname, errmsg(errno, "no such file"));

한녀석이 걸려 나온다.

특이한건, 이 소스가 있는 부분은 openredirect라는 함수.
음.. 머하는 녀석일려나?

static int
openredirect(union node *redir)
{
    char *fname;
    int f;

    switch (redir->nfile.type) {
    case NFROM:
        fname = redir->nfile.expfname;
        f = open(fname, O_RDONLY);
        if (f < 0)
            goto eopen;
        break;
    case NFROMTO:
        fname = redir->nfile.expfname;
        f = open(fname, O_RDWR|O_CREAT|O_TRUNC, 0666);
        if (f < 0)
            goto ecreate;
        break;
    case NTO:
        /* Take care of noclobber mode. */
        if (Cflag) {
            fname = redir->nfile.expfname;
            f = noclobberopen(fname);
            if (f < 0)
                goto ecreate;
            break;
        }
        /* FALLTHROUGH */
    case NCLOBBER:
        fname = redir->nfile.expfname;
        f = open(fname, O_WRONLY|O_CREAT|O_TRUNC, 0666);
        if (f < 0)
            goto ecreate;
        break;
    case NAPPEND:
        fname = redir->nfile.expfname;
        f = open(fname, O_WRONLY|O_CREAT|O_APPEND, 0666);
        if (f < 0)
            goto ecreate;
        break;
    default:
#if DEBUG
        abort();
#endif
        /* Fall through to eliminate warning. */
    case NTOFD:
    case NFROMFD:
        f = -1;
        break;
    case NHERE:
    case NXHERE:
        f = openhere(redir);
        break;
    }

    return f;
 ecreate:
    ash_msg_and_raise_error("cannot create %s: %s", fname, errmsg(errno, "nonexistent directory"));
 eopen:
    ash_msg_and_raise_error("cannot open %s: %s", fname, errmsg(errno, "no such file"));
}


2010.04.21 추가
inittab에 ttyAS1을 초기화 하는 부분이 있었는데, 커널에서(?) 사용하지 않도록 해놔서 계속 에러가 난 모양이다.
아무튼, /bin/sh에 ttyAS1을 열도록 해놓았기 때문에, busybox에서 ash이 sh을 대체하고,
그러다 보니 ash에서 에러발생. 머.. 문제 해결 끝!

$ cat target/etc/inittab
# Example Busybox inittab
::sysinit:/etc/init.d/rcS
ttyAS0::askfirst:/bin/sh
ttyAS1::askfirst:/bin/sh
::ctrlaltdel:/sbin/reboot
::shutdown:/sbin/swapoff -a
::shutdown:/bin/umount -a -r
::restart:/sbin/init

'프로그램 사용 > busybox' 카테고리의 다른 글

busybox tftp  (0) 2013.06.18
busybox - setconsole  (0) 2011.10.21
busybox ps는 BSD 스타일?  (0) 2010.01.12
ifup / ifdown 을 통한 static <-> dhcp 변환  (0) 2009.12.29
udhcpd 용 interface 예제  (0) 2009.12.23
Posted by 구차니
iconv_open() 함수는 dest, source 형식으로 인자를 받고
iconv() 함수는 2중 포인터를 사용한다.

#include <iconv.h>

iconv_t iconv_open(const char *tocode, const char *fromcode);
size_t iconv(iconv_t cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);

iconv_open(TO, FROM);
이므로 반대로 넣으면 이상하게 나온다. 주의요망!

그리고 iconv() 함수는
문자열 변수들은 2중 포인터로 넘겨주고(왜?)
inbytesleft는 strlen(*inbuf) 의 값을
outbytesleft는 strlen(*outbuf) 의 값을 넣어주면된다.

물론 변환에 따라서, 길이가 가변적으로 달라질수 있기 때문에 주의해야 한다.

만약, 변환중 메모리가 넘치게 되면 EILSEQ 에러가 발생하게 되며, (물론 넘치기 전에 데이터는 빼낼수 있다.)
변수의 포인터가 2중 포인터가 아니면
"__gconv: Assertion `outbuf != ((void *)0) && *outbuf != ((void *)0)' failed."
이런 에러를 만나게 될 것이다.


#include "stdio.h"
#include "string.h"
#include "iconv.h"
#include "errno.h"

#define BUFF_SIZE 64

int main()
{
        iconv_t cd = iconv_open("UNICODE", "UTF-8");
        if (cd == (iconv_t)(-1))
        {
                perror("iconv_open");
                return 0;
        }

        char inBuf[BUFF_SIZE] = "Hello world";
        int inBufSize = sizeof(inBuf);

        char outBuf[BUFF_SIZE];
        int outBufSize = sizeof(outBuf);
        memset(outBuf, 0, outBufSize);

        // convert
        size_t readBytes = strlen(inBuf);
        size_t writeBytes = sizeof(outBuf);
        char* in = inBuf;
        char* out = outBuf;

        printf("readBytes:%d writeBytes:%d\n",readBytes,writeBytes);

        if (iconv(cd, &in, &readBytes, &out, &writeBytes) == -1)
        {
                printf("failed to iconv errno:%d EILSEQ:%d\n", errno, EILSEQ);
        }
        else
        {
                int idx;
                printf("in:%x out:%x\n",in,out);
                printf("readBytes:%d writeBytes:%d\n",readBytes,writeBytes);
                for(idx = 0; idx < BUFF_SIZE; idx++)
                {
                        printf("%03d %c %x\t\t", idx, inBuf[idx], inBuf[idx]);
                        printf("%03d %c %x\n", idx, outBuf[idx], outBuf[idx]);
                }
                outBuf[writeBytes] = '\0';
        }

        iconv_close(cd);
        return 0;
}


2010/04/20 - [Linux] - linux iconv 테스트
2010/04/19 - [Linux] - iconv

Posted by 구차니
iconv 유틸리티를 이용해서 일단 변환 테스트.
-f=UTF-8        (UTF-8 문서를)
-t=UNICODE   (유니코드로 변환)
-o result.txt    (result.txt로 출력)

$ cat test.str
Hello world
$ vi test.str
  1 Hello world

$ iconv -f=UTF8 -t=UNICODE test.str -o result.txt

$ cat result.txt
▒▒Hello world
$ vi result.txt
  1 ÿþH^@e^@l^@l^@o^@ ^@w^@o^@r^@l^@d^@
  2 ^@




Posted by 구차니