프로그램 사용/busybox2009. 7. 29. 15:13
$ ls /bin/udhcpc*
lrwxrwxrwx 1 root     root 7 Jul 29 14:49 udhcpc -> busybox
lrwxrwxrwx 1 root     root 7 Jul 29 14:49 udhcpd -> busybox

요즘 busybox는 udhcp 라는 dhcp 서버/클라이언트가 내장되어있다.
물론 기본값으로 busybox에 포함되긴 하지만, 확인 후 사용해야 한다.

아무튼, 옵션은 설정되어 있었음에도 불구하고
심볼릭 링크와, 스크립트가 생성되어 있지 않았다.


/sbin/udhcpc - udhcp Client
/sbin/udhcpd - udhcp Daemon
/usr/share/udhcpc/default.script - 기본 dhcp 스크립트




Posted by 구차니
sftp는 ssh를 이용한 ftp이다.
별다르게 설정하지 않았다면, 기본값으로 ssh를 통해 sftp로 전송이 가능하다.

SYNOPSIS
     sftp [-1Cv] [-B buffer_size] [-b batchfile] [-F ssh_config]
          [-o ssh_option] [-P sftp_server_path] [-R num_requests] [-S program]
          [-s subsystem | sftp_server] host
     sftp [[user@]host[:file [file]]]
     sftp [[user@]host[:dir[/]]]
     sftp -b batchfile [user@]host

사용방법은 위와 같은데 간단하게 예를 들자면,

# sftp root@192.168.10.10:/home.tar home.tar
Connecting to 192.168.10.10...
root@192.168.10.10's password:
Fetching /home.tar to home.tar
/home.tar                                       8% 1811MB   6.3MB/s   49:58 ETA

처럼 사용하면 된다. 머랄까.. 저 형식은 cvs나 svn 포맷같기도 하고..
Posted by 구차니
프로그램 사용/busybox2009. 7. 23. 14:45
busy 박스의 문제라기 보다는 라이브러리의 문제인 듯 하다.

ld-linux.so.2
libc.so.6
libdl.so.2
libnss_dns.so.2
libnss_files.so.2
libpthread.so.0
libresolv.so.2

이번 경우에는 libresolv.so 가 없어서 dns resolv가 되지 않았었다.

[링크 : http://kelp.or.kr/korweblog/stories.php?story=05/04/03/4168817]
Posted by 구차니
프로그램 사용/VNC2009. 7. 22. 14:42
서버설정은 크게 6단계로 나뉜다.

1. rpm이나 소스로 vnc를 설치한다.(자세한 내용은 생략)
2. /etc/sysconfig/vncserver의 내용을 수정한다.
# The VNCSERVERS variable is a list of display:user pairs.
 #
 # Uncomment the lines below to start a VNC server on display :2
 # as my 'myusername' (adjust this to your own).  You will also
 # need to set a VNC password; run 'man vncpasswd' to see how
 # to do that.
 #
 # DO NOT RUN THIS SERVICE if your local area network is
 # untrusted!  For a secure way of using VNC, see
 # <URL:http://www.uk.research.att.com/archive/vnc/sshvnc.html>.
 
 # Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
 
 # Use "-nohttpd" to prevent web-based VNC clients connecting.
 
 # Use "-localhost" to prevent remote VNC clients connecting except when
 # doing so through a secure tunnel.  See the "-via" option in the
 # `man vncviewer' manual page.
 
 # VNCSERVERS="2:myusername"
 # VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"

FC6에서는 localhost:0.0 은 gdm에서 사용하고 있으므로, 1번 이후로 설정을 해준다.
예를들어 testuser 라는 아이디로 1번 디스플레이 1024x768 해상도로 접속을 하도록 하려면 아래와 같이 추가를 해준다.
VNCSERVERS="1:testuser"
VNCSERVERARGS[1]="-geometry 1024x768 -nohttpd"

3. vncpasswd로 사용자 비밀번호를 설정한다. 물론 확인을 위해 두번 입력 해야 한다.
   이 부분을 하지 않고 vncserver를 구동시키면, 아무런 에러 없이 FAILED 만 출력된다.
$ vncpasswd
Password:
Verify:

4. 기본으로 설정되는 윈도우 매니저는 twm으로, gdm에 익숙해진 일반유저로서는 교체해주는 것이 좋다.
   위의 설정에 해준 아이디의 홈디렉토리에서 .vnc/ 디렉토리에 xstartup이라는 스크립트를 교체 해준다.
   xstatup 파일은 /etc/X11/xinit/xinitrc을 xstartup으로 이름 바꾸어 복사해주면 된다.


# more xstartup
#!/bin/sh
# Copyright (C) 1999 - 2005 Red Hat, Inc. All rights reserved. This
# copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the
# GNU General Public License version 2.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Authors:
#       Mike A. Harris <mharris@redhat.com>

# Mandatorily source xinitrc-common, which is common code shared between the
# Xsession and xinitrc scripts which has been factored out to avoid duplication
. /etc/X11/xinit/xinitrc-common

# The user may have their own clients they want to run.  If they don't,
# fall back to system defaults.
if [ -f $HOME/.Xclients ]; then
    exec $SSH_AGENT $DBUS_LAUNCH $HOME/.Xclients || \
    exec $SSH_AGENT $HOME/.Xclients
elif [ -f /etc/X11/xinit/Xclients ]; then
    exec $SSH_AGENT $DBUS_LAUNCH /etc/X11/xinit/Xclients || \
    exec $SSH_AGENT /etc/X11/xinit/Xclients
else
    # Failsafe settings.  Although we should never get here
    # (we provide fallbacks in Xclients as well) it can't hurt.
    [ -x /usr/bin/xsetroot ] && /usr/bin/xsetroot -solid '#222E45'
    [ -x /usr/bin/xclock ] && /usr/bin/xclock -geometry 100x100-5+5 &
    [ -x /usr/bin/xterm ] && xterm -geometry 80x50-50+150 &
    [ -x /usr/bin/twm ] && /usr/bin/twm
fi

5. 방화벽을 해제하거나, 포트를 풀어준다.(자세한 내용은 생략)
    포트는 5900번이 기본으로 디스플레이 포트를 더해준다.
    예를들어 3번 display 번호를 사용하면 5900 + 3 = 5903 번의 포트를 열어주어야 한다.

6. vnc 서버를 구동한다.(자세한 내용은 생략)
    service vncserver start
    service vncserver restart

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

tsclient에 VNC 추가하기  (0) 2011.12.31
UVNC - Ultra VNC  (2) 2010.11.26
우분투 9.10 원격설정하기(vino server on Ubuntu 9.10)  (0) 2009.12.30
tightVNC 서버사용기  (0) 2009.04.02
tightVNC / realVNC  (0) 2009.03.13
Posted by 구차니
프로그램 사용/vi2009. 7. 21. 13:06
ctags는 c언어를 파싱하여 token 별로 추출해주는 녀석이다.
아무튼 vi에서 사용하기 위해서는
가장 간단한 방법으로


/src/ctags -R 을 실행후
/src/vi src.c 를 실행한다.

네비게이션은
ctrl - ] 는 추적하기(여러개 있을 경우 숫자로 선택)
ctrl - t 는 이전 위치로 돌아오기이다.
:tag tagname 은 그 태그로 이동하기 이다.(함수 이름, 변수 전부 이동가능)

[링크 : http://www.buggymind.com/90]
[링크 : http://www.joinc.co.kr/modules/moniwiki/wiki.php/article/ctags]

문서불러오기
:e [파일명]
새 문서(새 창열기)
:new
새 문서(이름으로)
:new [파일명]
[링크 : http://mwultong.blogspot.com/2006/06/vim-gvim.html]


ctrl+w f 하면 #include "" 나 #include <>의 파일 따라가기
[링크 : http://kldp.org/node/72478]


2010.01.28 추가
[링크 : http://www.viper.pe.kr/cgi-bin/moin.cgi/ctags_와_vi_사용하기]
Posted by 구차니
프로그램 사용/u-boot2009. 7. 18. 13:09
u-boot/tools/env 에 있는 README 파일 번역입니다.

이것은 U-boot의 환경 변수를 읽어오는 리눅스 명령행 프로그램의 적용예제 입니다.

run-time 유틸리티 설정을 위해서 다음의 줄을 주석처리 합니다.
fw_env.h 파일의
    #define CONFIG_FILE  "/etc/fw_env.config"

특정 타겟 보드를 위한 define들은 fw_env.confg 파일의 주석을  보시기 바랍니다.

화경설정은 fw_env.h 파일의 #define들을 통해 할 수 있습니다.
아래의 내용을 수정하시면 됩니다.

    #define HAVE_REDUND     /* 환경변수 영역이 2개일 경우 */
    #define DEVICE1_NAME    "/dev/mtd1"
    #define DEVICE2_NAME    "/dev/mtd2"
    #define DEVICE1_OFFSET    0x0000
    #define ENV1_SIZE         0x4000
    #define DEVICE1_ESIZE     0x4000
    #define DEVICE2_OFFSET    0x0000
    #define ENV2_SIZE         0x4000
    #define DEVICE2_ESIZE     0x4000

현재의 설정은 TRAB 보드에 맞추어져 있습니다.

백업용 환경변수 영역을 사용하지 않는다면 HAVE_REFUND를 주석처리합니다.
HAVE_REDUND 가 주석처리 되면 DEVICE2_NAME, ENV2_SIZE, DEVICE2_ESIZE 를 무시합니다.

DEVICEx_NAME 에는 환경변수가 저장되어 있는 MTD 캐릭터 디바이스를 지정합니다.
DEVICEx_OFFSET 에는 MTD 캐릭터 디바이스 범위 안의 환경변수의 offset을 지정합니다.
ENVx_SIZE 에는 (만약에 환경변수가 하나의 섹터크기 보다 적다면 플래시 섹터보다 작은 값을 지닐) 환경변수에 의해 사용되는 크기를 지정합니다.
DEVICEx_ESIZE 환경변수가 위치하는 플래시 파티션의 첫 섹터의 크기를 지정합니다.


Posted by 구차니
프로그램 사용/Putty2009. 7. 18. 09:35

언제부터 있는 기능인지는 모르겠지만
Connection - Data 에
Login detailsAuto-login username 이라는 항목이 존재한다.
이 항목에 어쩌다가 id가 들어가게 되었는지는 모르겠지만..
SSH / Telnet 에서는 자동 로그인이 지원된다. (테스트 서버 버전 : Fedora Core 6)


Posted by 구차니
프로그램 사용2009. 7. 15. 20:31
트위터는 불편하다.
일각에서는 30세 이상을 위한 서비스라는 소문이 있을 정도로
젊은(!) 나로서는 쓰기가 매우 버겁다.

아무튼 pbtweet라는것을 써보려다가 GG 치다가 한번 용기를 내서 해보았다.


Step 1. 파이어폭스의 부가기능에 Greasemonkey를 검색하여 설치

Step 2. pbtweet 에서 Firefox greasemonkey용을 클릭하여 설치한다.
v1.4.8 for Firefox
pbtweet.user.js for Firefox 3.0 (for GreaseMonkey script)
Firefox version does not run animation. and some layout is broken. I strongly recommend to use pbtweet on Safari or Google Chrome.


Step 3. 트위터를 사용한다.

Step 4. 위의 방법이 불편하여 사용하기 싫으면 아래의 원숭이를 클릭한다.


[pbtweet : http://web.me.com/t_trace/pbtweet.html#install]
[Greasemonkey : https://addons.mozilla.org/ko/firefox/addon/748]
Posted by 구차니
프로그램 사용/libjpeg2009. 7. 14. 17:34
jpeg는 grayscale일 경우에는 무조건 흑백인 듯 하다.
(조금 더 확실하게 검색필요)

그런 이유로, 8bit color일 경우에는 팔레트가 NULL인지 아닌지 확인하고
NULL일 경우에는 팔레트를 만들어주면 된다.

wrbmp.c 파일을 참고 하자면
LOCAL(void)
write_colormap (j_decompress_ptr cinfo, bmp_dest_ptr dest,
		int map_colors, int map_entry_size)
{
  JSAMPARRAY colormap = cinfo->colormap;
  int num_colors = cinfo->actual_number_of_colors;
  FILE * outfile = dest->pub.output_file;
  int i;

  if (colormap != NULL) {
    if (cinfo->out_color_components == 3) {
      /* Normal case with RGB colormap */
      for (i = 0; i < num_colors; i++) {
	putc(GETJSAMPLE(colormap[2][i]), outfile);
	putc(GETJSAMPLE(colormap[1][i]), outfile);
	putc(GETJSAMPLE(colormap[0][i]), outfile);
	if (map_entry_size == 4)
	  putc(0, outfile);
      }
    } else {
      /* Grayscale colormap (only happens with grayscale quantization) */
      for (i = 0; i < num_colors; i++) {
	putc(GETJSAMPLE(colormap[0][i]), outfile);
	putc(GETJSAMPLE(colormap[0][i]), outfile);
	putc(GETJSAMPLE(colormap[0][i]), outfile);
	if (map_entry_size == 4)
	  putc(0, outfile);
      }
    }
  } else {
    /* If no colormap, must be grayscale data.  Generate a linear "map". */
    for (i = 0; i < 256; i++) {
      putc(i, outfile);
      putc(i, outfile);
      putc(i, outfile);
      if (map_entry_size == 4)
	putc(0, outfile);
    }
  }
  /* Pad colormap with zeros to ensure specified number of colormap entries */ 
  if (i > map_colors)
    ERREXIT1(cinfo, JERR_TOO_MANY_COLORS, i);
for (; i < map_colors; i++) { putc(0, outfile); putc(0, outfile); putc(0, outfile); if (map_entry_size == 4) putc(0, outfile);
}
}

이런식으로 0에서 255 까지 팔레트를 생성하면 되고,
256color(=8bit) 일 경우에는 팔레트는 RGBQUAD 로 4바이트 구조이므로,
마지막 바이트는 reserve(혹은 alpha) 값으로 0x00(stfae에서는0x80) 을 해주면 된다.
Posted by 구차니
혹시나 하는 마음에
Eclipse IDE for C/C++ Developers (79 MB)
를 받고 실행했는데, 역시나 eclipse는 JRE나 JDK가 있어야 실행이 된다.

그래서 봤더니.. 자바 버전이 JDK6 update 14까지 나왔다 -ㅁ-!
아무튼 사랑하는 netbeans 포함 버전을 선택(그러고 보니.. JRE 외에는 전부 통합버전이다)
다운로드를 받고 설치 하려니 요구용량이 500M에 근접한다. ㄱ-

그리고 나서 실행했는데 이 먼가 허전한 느낌..
c와 c++ 프로젝트는 생성이 되는데, MFC 라던가 이런건 아무래도 무리인 듯..

그래서 검색을 해봤더니, class wizard나 project wizard 없이 사용하는건 실질적으로 불가능하다는 이야기가 나왔다.
[링크 : http://dev.eclipse.org/newslists/news.eclipse.tools.cdt/msg01844.html]

Migrate Visual Studio C and C++ projects to Eclipse CDT
[링크 : http://www.ibm.com/developerworks/library/os-ecl-vscdt/]


솔찍히.. wizard없이 손으로 일일이 직접 mfc 코드들을 작성하기란 쉬운일은 아니다.
머.. 그래서 잠시 Visual studio express버전을 검색했는데..

일단 VB와 VC++은 존재한다.
마음에 걸리는건.. 2008 버전! ㄱ-
혹시.. .net을 강요하는건 아니겠지? 나중에 다른 pc에 설치나 해봐야겠다 쩝...

'프로그램 사용 > eclipse CDT & minGW' 카테고리의 다른 글

eclipse CDT plugin 설치하기  (2) 2012.01.29
eclipse에서 archive (*.a) 링크하기  (0) 2012.01.18
eclipse CDT 에서 include 경로 추가하기  (0) 2012.01.17
MinGW  (0) 2010.09.07
Eclipse IDE for C/C++ Developers  (0) 2009.07.06
Posted by 구차니