리눅스에서 FTP 사용하기

from Info/Tools 2008/12/30 15:34 view 29608

원문 : http://danggi.tistory.com/entry/리눅스-ftp-사용하기

* 실행 환경 페도라. (우분투도 크게 다르지 않음)

1. ftp 다운로드 하기

]# yum install vsftpd

 -> vsftp는 ftp 이름이다. profrp 도 있다. 원하는 대로 하면 됨.

2. ftp 환경설정

]# vi /etc/vsftp/vsftp.conf

=========== vsftp.conf ================

#임의의 사용자에게 공개할 것인지를 뜻하는 부분 공개 ftp가 아니라면 주석처리 해준다.

# anonymous_enable=YES


# 접속한 사용자가 상위 폴더를 이용하지 못하도록 하는 부분.
# ftp 프로그램 (알 ftp같은 것) 을 이용한다면 상위폴더에 접근 가능하므로 이것을 막아준다.
# 아래 부분의 주석처리를 해지해 준다.
# chroot_list는 어떤 conf 파일에서는 /etc/vsftpd.chroot_list로 되어있는 경우가 있다.
# 상관없으니 그냥 되어 있는대로 하면 됨.

chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list


# 저장
================================================

이제 어떤 ID를 상위폴더에 접근하지 못하게 할 것인지를 설정한다.
vsftpd.conf 파일에서 지정해준 chroot_list 위치대로 파일을 연다. (없을때는 그냥 생성 됨)

]# vi /etc/vsftpd/chroot_list

접근을 막을 ID를 써준다. (한줄에 하나씩)

3. ftp 실행

vsftp 데몬을 재시작.

]# /etc/init.d/vsftpd restart

=====================================================

ffp는 리눅스의 일반계정에 등록되어 있는 계정을 쓰면 된다.

Tag | ,

리눅스(Fedora, Ubuntu)에서 QT설치하기

from Study/QT 2008/12/30 15:32 view 66463
원문 : http://danggi.tistory.com/entry/리눅스-QT-설치

Fedora에서의 QT 설치는 매우매우 쉽다. ㄱ-
Ubuntu에서는 가끔 안되기도 한다. -_-;;

1. qt-x11을 다운 받는다.
   ftp://ftp.trolltech.com/pt/source


여기에서 가장 최신 버전을 찾아 받은후 압축을 풀어준다.

[bbonya@localhost qt]$ tar -xvzf qt-x11-3.3.8.tar.gz


2. 디렉토리 명을 간단하게 수정해 준다.
[bbonya@localhost qt]$ mv qt-x11-3.3.8 ./qt-x11

3. 환경변수를 등록해준다.
[bbonya@localhost qt]$ vi ~/.bash_profile

QTDIR=$HOME/qt/qt-x11
PATH=$PATH:$QTDIR/bin
MAN_PATH=$MANPATH:$QTDIR/doc/man
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$QTDIR/lib
export QTDIR PATH MAN_PATH LD_LIBRARY_PATH

[bbonya@localhost qt]$ source ~/.bash_profile

4. configur
[bbonya@localhost qt-x11]$ ./configure -no-xft -release -shared

   >> ./configure뒤에 붙은 아이들은 옵션이다. no가 붙은건 쓰지 않겠다는 뜻.
   >> license 동의 여부를 물으면 yes 라고 답해준다.
   >> configure --help 하면 더 많은 옵션들을 볼 수 있다.

5. make
[bbonya@localhost qt-x11]$ vi Makefile

all: symlinks src-qmake src-moc sub-src sub-tools # sub-tutorial sub-examples
 @echo

   >> sub-tutorial 앞에 #을 붙여서 주석처리 해준다. (make 시간 단축)

[bbonya@localhost qt-x11]$ make

   >> make 하는 시간이 쏘 오래 걸리니... 산책이라도 해주는 센스.

6. Tip in Ubuntu...
Ubuntu에서는 버전이 낮을시에 가끔 make에서 에러가 나기도 한다.
그럴때는 apt-get install을 이용하여 이것저것 받아줘야 하는데..
한꺼번에 너무 많은걸 받아서 정확히 뭐가 make를 제대로 하게 했는지 알 수가 없다 ㅠㅠ
(다른 사람 컴퓨터에서 test 해보려 했더니 한번에 돌아가더라는... ㅡ_-);;

qt를 apt-get을 통해 받을때 그 패키지의 종류는 대략.
qt3-qtconfig, qt3-linguist, qt3-dev-tools-embedded, qt3-dev-tools-compat
qt3-assistant, qt3-dev-tools, qt3-designer, qt3-apps-dev, libqt3-mt

이아이들이다. 내가 생각하기에 libpt3-mt, qt3-apps-dev, qt3-dev-tools 가 좀 유력한 후보이다.
designer라는건 어차피 make하고나면 생기는 아이이니까.... ㅡ_-);;
가만 생각해보면 이아이들을 골고루 받으면 굳이 다운로드 받지 않고도
QT프로그래밍을 할 수있을 것이다. (designer는 비쥬얼 스튜디오 같은 아이니까;; )
그러나... 역시 사용법을 모른다는거~ ㅠ.ㅠ
아놔, install 패키지 이름들을 알아낸게 너무 기뻐서 줄줄이 받은게 화근. ㄱ- (머리나쁘면 평생 고생)
Tag | ,
오류
/usr/bin/ld: cannot find -lsocket
collect2: ld returned 1 exit status
make: *** [opbroker] 오류 1

해결책
소켓 함수를 컴파일 하기 위헤 필요한 라이브러리 이름은 아직 표준화 되지 않았다.
Sun Solaris 에서는 -lsocket -lnsl 라이브러리 옵션을 필요로 한다.
Linux 의 경우는 단순히 -lnsl 옵션을 필요로 하고, Mac OS X의 경우 외부 라이브러리를 필요로 하지 않는다.
메뉴얼 페이지에서 사용해야할 라이브러리 이름을 확인하자..!!!

네이버!!!
ld는 링커입니다. 일단 메시지로 봐서는 ld가 동작은 했습니다.

문제는 -lsocket인데... 컴파일이나 링크시에 -L 옵션을 사용하지 않으셨으면..

/usr/lib 디렉토리의 라이브러리를 찾게 됩니다.

-l 옵션은 뒤의 라이브러리를 찾는데 libsocket.(라이브러리 확장자) 의 파일을 찾습니다. 확장자로는 a, la, so, sl 등이 사용됩니다.

그래서 -lsocket은 /usr/lib/libsocket.(라이브러리 확장자)를, -lnsl은 /usr/lib/libnsl.(라이브러리 확장자)를 가리킵니다. 만약 -L 옵션을 사용했으면 다른 디렉토리도 뒤집니다. 예를 들어 -L/usr/local/lib을 쓰셨다면 앞에서 언급한 패스 이외에 /usr/local/lib/libsocket.(라이브러리 확장자) 와 /usr/local/lib/libnsl.(라이브러리 확장자) 를 찾게 됩니다.

-lsocket과 -lnsl을 쓰신 것으로 봐서는 솔라리스에서 컴파일을 하시는 듯 한데 솔라리스가 아닌 다른 OS에서 컴파일을 하신다면 옵션을 빼주시면 됩니다.
Tag |

GDI+ 사용 스레드.

from Study/API 2008/12/22 16:28 view 45736
1. GDI+ 기본정의

#pragma comment (lib, "gdiplus.lib")

#include <gdiplus.h>
using namespace Gdiplus;

 ULONG_PTR gpToken;
 GdiplusStartupInput gpsi;
VERIFY(GdiplusStartup( &gpToken, &gpsi, NULL ) == Ok );
//////////////////////////////////////////////////////////////////////
// Grahpics g;
////////////////////////////////////////////////////////////////////

GdiplusShutdown(gpToken);


2. MFC 에서 GDI+를 사용하기 위한 정의
 PRB: Microsoft Foundation Classes DEBUG_NEW Does Not Work with GDI+
" error C2660: 'Gdiplus::GdiplusBase::operator new' : 함수는 3개의 매개 변수를 사용하지 않습니다. "

#define ULONG_PTR DWORD
//// Ensure that GdiPlus header files work properly with MFC DEBUG_NEW and STL header files.
#define iterator _iterator

#ifdef _DEBUG

namespace Gdiplus
{
    namespace DllExports
    {
#include "GdiplusMem.h"
    };
#ifndef _GDIPLUSBASE_H
#define _GDIPLUSBASE_H
    class GdiplusBase
    {
    public:
        void (operator delete)(void* in_pVoid)
        {
            DllExports::GdipFree(in_pVoid);
        }
        void* (operator new)(size_t in_size)
        {
            return DllExports::GdipAlloc(in_size);
        }
       
        void (operator delete[])(void* in_pVoid) { DllExports::GdipFree(in_pVoid); } void* (operator new[])(size_t in_size)
        {
            return DllExports::GdipAlloc(in_size);
        }
       
        void * (operator new)(size_t nSize, LPCSTR lpszFileName, int nLine)
        {
            return DllExports::GdipAlloc(nSize);
        }
       
        void operator delete(void* p, LPCSTR lpszFileName, int nLine)
        {
            DllExports::GdipFree(p);
        }
       
    };
#endif // #ifndef _GDIPLUSBASE_H
}
#endif // #ifdef _DEBUG

#include "GdiPlus.h"
using namespace Gdiplus;
#undef iterator
    //// Ensure that Gdiplus.lib is linked.
#pragma comment(lib, "gdiplus.lib")


3. 알수 없는 에러가 쭉 나오는 현상..
//MFC를 사용하지 않는 경우에 컴파일 시간을 줄이기 위해 정의한다.(GDI+ 에러남.)
#define WIN32_LEAN_AND_MEAN  // 원흉의 매크로~주석처리~



4. 유용한 사이트
  1) winapi.co.kr/gdi+
Tag |
밑에 링크들 따라하면 됨. Audio = > XP3 는 서비스팩 3 깔아야함-_ㅡ...

참고사이트
1. IBM 노트북 VISTA->XP 다운그레이드 http://forum.notebookreview.com/showthread.php?t=188992
2. IBM X 씨리즈 포럼 : http://forums.lenovo.com/lnv/board?board.id=X_Series_Thinkpads
3. 노트북 시스템 업데이트(자동업데이트!!!) : /사이트가기...꼭 깔자!!

1. 레노버 메뉴얼

more..



2. IBM 매니아(상우님 글)

more..


3. x200 드라이버 다운하기
http://www-307.ibm.com/pc/support/site.wss/document.do?sitestyle=lenovo&lndocid=MIGR-70476

ORCALE 정보

from Study/DB 2008/12/03 17:37 view 25710
오라클 포럼 가기 : http://kr.forums.oracle.com/forums/forum.jspa?forumID=82&start=0


명령어 모음
- 화면 지우기 : clear screen (약어:cl scr)

- 데이터베이스 이름 보기 : mysql-show database
 SELECT NAME FROM v$database;

- 테이블 이름 보기 : mysql-show table
  select table_name from user_tables ; //자신의 테이블을 볼 때 :
  select table_name from all_tables ;    //접근할 수 있는 모든 테이블을 볼 때 :
  select table_name from dba_tables ; //이 데이터베이스 안에 있는 모든 테이블을 볼 때
 
- 사이즈 맞추기
 set linesize 150
 COL[UMN] [{column | expr} [option ...] ]   ex) col dname format a10





Tag | ,

SQL 연습하기

from Study/DB 2008/12/03 17:25 view 25294

ORACLE

1. 기본예제 실습





more..

Tag | ,

VS2005엔 _GetBaseMessageMap 이게 없는듯 하다. -_-.. 그래서 새로 정의해서 해결해야 한다. 아나..
error C2065: 'GetThisMessageMap' : 선언되지 않은 식별자입니다.
error C2653: 'TheBaseClass' : 클래스 또는 네임스페이스 이름이 아닙니다.
error C2039: 'messageMap' : 'TTaskbarContainer<T>'의 멤버가 아닙니다.
error C2039: '_GetBaseMessageMap' : 'TTaskbarContainer<T>'의 멤버가 아닙니다.

#ifndef __AFXWIN_H__
#include "afxwin.h"
#endif

#if ( _MSC_VER >= 1400) // VC++ 8.0 (.net)

//#ifdef _AFXDLL
#define BEGIN_TEMPLATE_MESSAGE_MAP(theTemplate, theClass, baseClass) \
    PTM_WARNING_DISABLE \
    template <theTemplate>\
    const AFX_MSGMAP* theClass::GetMessageMap() const \
{ return GetThisMessageMap(); } \
    template <theTemplate>\
    const AFX_MSGMAP* PASCAL theClass::GetThisMessageMap() \
{ \
    typedef theClass ThisClass; \
    typedef baseClass TheBaseClass; \
    static const AFX_MSGMAP_ENTRY _messageEntries[] = \
{\

#endif

#else    // VC++6.0

#ifdef _AFXDLL
#define BEGIN_TEMPLATE_MESSAGE_MAP(theTemplate, theClass, baseClass) \
    template <theTemplate> const AFX_MSGMAP* PASCAL theClass::_GetBaseMessageMap() \
        { return &baseClass::messageMap; } \
        template <theTemplate> const AFX_MSGMAP* theClass::GetMessageMap() const \
        { return &theClass::messageMap; } \
        template <theTemplate> AFX_DATADEF const AFX_MSGMAP theClass::messageMap = \
    { &theClass::_GetBaseMessageMap, &theClass::_messageEntries[0] }; \
    template <theTemplate> const AFX_MSGMAP_ENTRY theClass::_messageEntries[] = \
    { \

#else

#define BEGIN_TEMPLATE_MESSAGE_MAP(theTemplate, theClass, baseClass) \
    template <theTemplate> const AFX_MSGMAP* theClass::GetMessageMap() const \
        { return &theClass::messageMap; } \
        template <theTemplate> AFX_DATADEF const AFX_MSGMAP theClass::messageMap = \
    { &baseClass::messageMap, &theClass::_messageEntries[0] }; \
    template theTemplate const AFX_MSGMAP_ENTRY theClass::_messageEntries[] = \
    { \
#endif

#endif
Tag |

3개월간의 짧고도 긴 시간...

from 잡담 2008/03/11 11:23 view 24819

12월부터 시작한 프로젝트가 다 끝났다.. 하나는 결과가 별로였고 다른 하나는 나름 성공적으로 릴리즈 되어서 내 손을 떠났다. 문제될 소지가 있긴 하지만 나름 안정된 구조로 짜놓았는데.. 불안하긴 하다. 학교생활 열심히 하고 졸업하자!!

로그클래스

from Study/C++ 2007/12/14 18:23 view 33357

1. Log.h ( 로그파일, 출력을 도와주는 클래스 )

/** \file Log.h
**    \date  2007/12/10
**    \author kimjunju@hotmail.com
**/


#pragma once 

/**    \class    CLog
    \brief    시간을 기준으로 로그를 남긴다.
    \remark    static 멤버함수로 선언하여 객체없이 함수를 이용가능하다.
*/


/** \ingroup UTIL */

class CLog
{
public:
    static BOOL    WriteLog(LPTSTR data, ...)
    {
        _wsetlocale(LC_ALL, _T("korean"));  // 한글을 출력하기 위한 설정.

        SYSTEMTIME    SystemTime;
        TCHAR        CurrentDate[32]                    = {0,};
        TCHAR CurrentFileName[MAX_PATH] = {0,};
        FILE* FilePtr = NULL;
        TCHAR        DebugLog[MAX_BUFFER_LENGTH]        = {0,};

        va_list        ap;
        TCHAR        Log[MAX_BUFFER_LENGTH]    = {0,};

        va_start(ap, data);
        _vstprintf(Log, data, ap);
        va_end(ap);

        GetLocalTime(&SystemTime);
        _sntprintf(CurrentDate, 32, _T("%d-%d-%d %d:%d:%d"),
            SystemTime.wYear,
            SystemTime.wMonth,
            SystemTime.wDay,
            SystemTime.wHour,
            SystemTime.wMinute,
            SystemTime.wSecond);

        _sntprintf(CurrentFileName, MAX_PATH, _T("LOG_%d-%d-%d %d.log"),
            SystemTime.wYear,
            SystemTime.wMonth,
            SystemTime.wDay,
            SystemTime.wHour);

        FilePtr = _tfopen(CurrentFileName, _T("a"));
        if (!FilePtr)
            return FALSE;

        _ftprintf(FilePtr, _T("[%s] %s\n"), CurrentDate, Log);
        _sntprintf(DebugLog, MAX_BUFFER_LENGTH, _T("[%s] %s\n"), CurrentDate, Log);

        fflush(FilePtr);
        fclose(FilePtr);

        OutputDebugString(DebugLog);
        _tprintf(_T("%s"), DebugLog);

        return TRUE;
    }

    static BOOL    WriteLogNoDate(LPTSTR data, ...)
    {
        _wsetlocale(LC_ALL, _T("korean"));

        SYSTEMTIME    SystemTime;
        TCHAR        CurrentDate[32]                    = {0,};
        TCHAR        CurrentFileName[MAX_PATH]        = {0,};
        FILE*        FilePtr                            = NULL;
        TCHAR        DebugLog[MAX_BUFFER_LENGTH]        = {0,};

        va_list        ap;
        TCHAR        Log[MAX_BUFFER_LENGTH]    = {0,};

        va_start(ap, data);
        _vstprintf(Log, data, ap);
        va_end(ap);

        GetLocalTime(&SystemTime);
        _sntprintf(CurrentDate, 32, _T("%d-%d-%d %d:%d:%d"),
            SystemTime.wYear,
            SystemTime.wMonth,
            SystemTime.wDay,
            SystemTime.wHour,
            SystemTime.wMinute,
            SystemTime.wSecond);

        _sntprintf(CurrentFileName, MAX_PATH, _T("LOG_%d-%d-%d %d.log"),
            SystemTime.wYear,
            SystemTime.wMonth,
            SystemTime.wDay,
            SystemTime.wHour);

        FilePtr = _tfopen(CurrentFileName, _T("a"));
        if (!FilePtr)
            return FALSE;

        _ftprintf(FilePtr, _T("%s"), Log);
        _sntprintf(DebugLog, MAX_BUFFER_LENGTH, _T("%s"), Log);

        fflush(FilePtr);

        fclose(FilePtr);

        OutputDebugString(DebugLog);
        _tprintf(_T("%s"), DebugLog);

        return TRUE;
    }
};
Tag |