using System.Net;
using System.IO;
using mshtml;

.....

HttpWebRequest req = (HttpWebRequest)WebRequest.Create(http://www.google.com);
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
Stream strm = resp.GetResponseStream();
StreamReader sr = new StreamReader(strm);
String htmltxt = sr.ReadToEnd();

IHTMLDocument2 doc = (IHTMLDocument2)new HTMLDocument();
doc.clear();
doc.write(htmltxt);
doc.close();

IHTMLElementCollection hc = doc.all;
foreach (IHTMLElement he in hc)
{
    //do something
}

Posted by
Visual Studio가 실행되기는 하지만

프로젝트를 열거나 새로운 프로젝트를 만들려 할때

아무런 오류 메시지 없이 VS가 종료되는 현상이 발생한다면

시스템에 VMWare workstation 6.5가 설치되어있는지 확인해본다.

VMWare workstation의 Visual Studio Integrated Debugger가 문제일 수 있음.
(설치할꺼냐고 물어보지도 않고 이런걸 깔아놓다니 --;; )

해결방법은 VS 실행 후 [Tools] -> [Add-in managemr] -> [VMDebugger 해제] 한 다음

프로젝트 열기 또는 생성하여 사용 (프로젝트 열때마다 해줘야함)

VMware Integrated debugger add-in을 앞으로 영원히 사용할 계획이 없다면

C:\Program Files\VMware\VMware Workstation\Visual Studio Integrated Debugger 의

dcl.dll을 지우거나 이름을 바꿔둠. (한번만 해두면 됨)

이문제로 운영체제를 세번 갈아엎고

Visual Studio를 버전별로 세네번씩 깔았다 지웠다 하는 수고를 할

잠재적인 Visual Studio와 VMware 사용자께 도움이 되길.
Posted by
http://blog.naver.com/masaruchi/110032986740

순간 20년은 받고 60년은 빼앗기는
불합리한 세벳돈의 논리에 공감하는 나를 발견하며...

할아버지 - 아버지 - 나 - 아들 - 손자

의 세대 체인에서 한 세대를 30년으로 보고
자식의 수는 한명이라고 가정할 때
아래와 같은 결과를 얻을 수 있다.

내 나이 누적 세벳돈 수입 누적 세벳돈 지출 이벤트
0 세 0 만원 0 만원 태어남
10 세 20 만원 0 만원
20 세 40 만원 0 만원 수입에서 지출로 전환
30 세 40 만원 0 만원 아들 태어남
40 세 40 만원 10 만원
50 세 40 만원 20 만원 아들에게 지출 않음
60 세 40 만원 20 만원 손자 태어남
70 세 40 만원 30 만원
80 세 40 만원 40 만원 사망

여기서 얻을 수 있는 중요한 결론!!!

단지 설날이 있는 나라에 태어났단 이유만으로
불행속에 몸부림치며 살아가지 않으려면

"자식은 하나만 낳아야 한다"


P.S.
"그렇다면 도대체 무엇이 우리를 이 가난한 나라보다 불행한 삶을 살도록 하는 것일까 ?"
"그 나라들엔 없고 우리 나라엔 있는 것이 뭔지..."
에서 2MB가 생각나는 건 나뿐인걸까
Posted by
Windows XP sp3와 함께
V3 IS 의 개인 방화벽을 사용하고 있을 경우
개인 방화벽에 RDP의 대기 포트인 3389를 추가해줘야 한다.

사용자 삽입 이미지

[해킹 차단]

사용자 삽입 이미지

[개인 방화벽]

사용자 삽입 이미지

[네트워크 규칙]

사용자 삽입 이미지

[추가]

사용자 삽입 이미지

[다음]

사용자 삽입 이미지

[모든IP주소 -> 다음]

사용자 삽입 이미지

[TCP만 선택 -> 다음]

사용자 삽입 이미지

[특정 포트 -> 추가]

사용자 삽입 이미지

[로컬 포트 -> 단일 포트 -> 3389 -> 확인]

사용자 삽입 이미지

[다음]

사용자 삽입 이미지

[들어오기/나가기 허용 -> 다음]

사용자 삽입 이미지

[규칙이름 -> 다음]

사용자 삽입 이미지

[마침]

사용자 삽입 이미지

[닫기 -> 끝]

Posted by
MaNGOSx 1.4 다운로드

MaNGOSx -> Application 폴더로 이동

MaNGOSx 실행

MaNGOS Server 다운로드

===> MaNGOS Server가 활성화 되지 않는 문제 발생

MaNGOS Server 다운로드 중

Finder로 / 폴더를 보면 다운로드 중인 mangos.rar 파일이 보임

다운로드가 완료되기 전에 mangos.rar 파일 [정보보기]

[잠김] 속성 설정

다운로드 완료 후 MaNGOSx에서 rar 압축 해제 실패하더라도 삭제 되지 않고 남아있음.

수동으로 설치 필요. MaNGOSx 종료

1. unrar을 /usr/bin으로 복사 (PATH 걸려있는 곳으로)
sudo cp /Application/MaNGOSx.app/unrar /usr/bin

2. /에서 mangos.rar 압축 해제
sudo unrar x mangos.rar
/opt/mangos에 압축 풀림

3. MaNGOSx 다시 실행
MaNGOS Server가 활성화 되었음을 확인

4. DBC, UDB, Maps 다운로드
Posted by

ScriptErrorsSuppressed

삽질 2007/09/27 06:34

C#.Net 에서 웹브라우저 컨트롤을 폼에 삽입하여
웹브라우저 호스팅할 때 자바 스트립트 에러가 발생하여
디버깅할지 예/아니오를 선택하라고 한다면
webBrowser.ScriptErrorsSuppressed 속성을 true로
설정하여 다이얼로그를 보이지 않도록 할 수 있다.

단, 웹브라우저의 도구 -> 인터넷 옵션 -> 고급 설정의
검색 항목에서 "스크립트 디버깅 사용안함(기타)"에 체크한다.
(Internet Explorer 7.0의 경우)

webBrowser.ScriptErrorsSuppressed 속성이 true인 경우
자바 스크립트 오류 뿐만 아니라 ActiveX 컨트롤에서 발생한
다이얼로그까지 나타내지 않는 문제가 있을 수 있다.

이런 경우 아래와 HtmlWindow.Error 이벤트 핸들러를 추가하여
자바 스크립트 오류만 suppress 시킬 수 있다.

private void SuppressScriptErrorsOnly(WebBrowser browser)
{
    browser.ScriptErrorsSuppressed = false;

    browser.DocumentCompleted +=
        new WebBrowserDocumentCompletedEventHandler(
            browser_DocumentCompleted);
}

private void browser_DocumentCompleted(object sender,
    WebBrowserDocumentCompletedEventArgs e)
{
    ((WebBrowser)sender).Document.Window.Error +=
        new HtmlElementErrorEventHandler(Window_Error);
}

private void Window_Error(object sender, HtmlElementErrorEventArgs e)
{
    e.Handled = true;
}

자료 출처
http://msdn2.microsoft.com/en-us/library/system.windows.forms.webbrowser.scripterrorssuppressed.aspx

http://www.cfdan.com/posts/Visual_Basic_6_And_Internet_Explorer_7.cfm


Posted by

경고! 모든 중요한 자료를 백업해 두시오.

주의! Atheros 칩셋을 사용하는 무선 네트워크와 X1600 이상의 Radeon 그래픽 하드웨어는 제대로 동작하지 않을 수 있음.

주의! 본 자료는 Mac OS/X과 Fedora Core 6의 듀얼 부팅을 목적으로 함.

준비할 사항
OS/X 10.4.6 과 최신 업데이트
BootCamp 1.1.2
FedoraCore6 CD 또는 DVD

1. OS/X와 firmware에 대한 업데이트를 수행한다.

2. 부트캠프를 설치하고 OS/X의 HFS+ 파티션을 분할한다.

3. 페도라 CD 또는 DVD를 삽입하고 시스템을 재시작한다.

4. 부팅 시에 C 버튼을 눌러 페도라로 부팅한다.

5. 일반적인 페도라 설치과정을 따른다.

6. GRUB는 MBR이 아닌 /boot에 설치한다.

7. 설치가 완료되면 시스템을 재시작한다.

8. 부팅 시에 Option 버튼을 눌러 부트캠프 메뉴에서 Windows를 선택한다.

9. GRUB화면에서 아무 키도 누르지 않도록 주의한다.

10. 부팅되면 /etc/X11/xorg.conf에서 "i801" 드라이버를 "intel"로 수정한다. (필요시)

원문 출처
===================================
http://fedoraproject.org/wiki/FedoraOnMactel

Posted by

유용한 사이트들

삽질 2006/07/24 09:34
www.kernel.org
리눅스 커널 다운로드

www.netfilter.org
넷필터 소스 다운로드 & HOWTO 문서들

lxr.linux.no
리눅스 소스 크로스 레퍼런스 사이트

www.mobile-ipv6.org
MIPv6, NEMO 구현 (linux)

man.linux.co.kr
한글 man 페이지
Posted by

include/linux/kernel.h

#define NIPQUAD(addr) \
((unsigned char *)&addr)[0], \
((unsigned char *)&addr)[1], \
((unsigned char *)&addr)[2], \
((unsigned char *)&addr)[3]
#define NIPQUAD_FMT "%u.%u.%u.%u"

IPv4 주소를 000.000.000.000 형태로 포맷팅한다.

#define NIP6(addr) \
ntohs((addr).s6_addr16[0]), \
ntohs((addr).s6_addr16[1]), \
ntohs((addr).s6_addr16[2]), \
ntohs((addr).s6_addr16[3]), \
ntohs((addr).s6_addr16[4]), \
ntohs((addr).s6_addr16[5]), \
ntohs((addr).s6_addr16[6]), \
ntohs((addr).s6_addr16[7])
#define NIP6_FMT "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x"
#define NIP6_SEQFMT "%04x%04x%04x%04x%04x%04x%04x%04x"

IPv6 주소를 0000:0000:0000:0000:0000:0000:0000:0000 형태로 포맷팅한다.

include/linux/ipv6.h

struct ipv6hdr {
__u8   version:4,
   priority:4;
__u8   flow_lbl[3];

__u16   payload_len;
__u8   nexthdr;
__u8   hop_limit;

struct in6_addr saddr;
struct in6_addr daddr;
};

IPv6 헤더 구조.
4|24
16|8|8
32x4
32x4

struct ipv6_opt_hdr {
__u8   nexthdr;
__u8   hdrlen;
/*
  * TLV encoded option data follows.
  */
};

IPv6 옵션헤더. hdrlen에 정의된 길이만큼 TLV로 인코딩된 옵션 데이터가 존재한다.

int ipv6_optlen(u8 *nexthdrp)

nexthdrp로 가리키는 옵션헤더의 길이를 알려준다.

int ipv6_skip_exthdr(const struct sk_buff *skb, int start, u8 *nexthdrp)

주어진 skb에서 nexthdrp로 나타내어지는 옵션헤더를 건너뛴다.

static inline void ipv6_addr_copy(struct in6_addr *a1, const struct in6_addr *a2)

a1의 주소를 a2로 복사한다.

static inline void ipv6_addr_set(struct in6_addr *addr, __u32 w1, __u32 w2, __u32 w3, __u32 w4)

addr로 표현되는 IPv6 주소 구조체를 w1,w2,w3,w4의 값으로 설정한다.

static inline int ipv6_addr_equal(const struct in6_addr *a1, const struct in6_addr *a2)

a1과 a2의 주소가 일치하는지 확인한다.


include/linux/ip6_checksum.h

static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr, __u16 len, unsigned short proto, unsigned int csum)

해당 IPv6 패킷의 checksum을 계산한다.


include/linux/skbuff.h

extern void kfree_skb(struct sk_buff *skb);

skb를 위해 할당된 공간을 해제한다.

extern struct sk_buff *__alloc_skb(unsigned int size, gfp_t priority, int fclone);

새로운 skb를 할당한다.

extern struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t priority);
extern struct sk_buff *skb_copy(const struct sk_buff *skb, gfp_t priority);

주어진 skb를 복사한다.

extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, unsigned int headroom);

주어진 skb의 headroom 공간을 주어진 크기로 재조정한다.

static inline struct sk_buff *skb_peek(struct sk_buff_head *list_)

skb 리스트중 첫 아이템을 peek 한다. list에서 삭제하지는 않음.

static inline __u32 skb_queue_len(const struct sk_buff_head *list_)

skb 리스트의 길이를 반환한다.

static inline struct sk_buff *skb_peek_tail(struct sk_buff_head *list_)

skb 리스트중 마지막 아이템을 peek 한다. list에서 삭제하지는 않음.

extern struct sk_buff *skb_dequeue(struct sk_buff_head *list);

skb 리스트중 첫 아이템을 꺼낸다.

extern void skb_insert(struct sk_buff *old, struct sk_buff *newsk, struct sk_buff_head *list);
extern void skb_append(struct sk_buff *old, struct sk_buff *newsk, struct sk_buff_head *list);

list로 주어지는 skb에 새로운 skb를 삽입한다.

static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, int len, void *buffer)

skb에 존재하는 패킷의 헤더 위치를 반환한다.

static inline void skb_get_timestamp(const struct sk_buff *skb, struct timeval *stamp)
static inline void skb_set_timestamp(const struct sk_buff *skb, struct timeval *stamp)

skb에 기록된 timestamp를 반환/설정한다.

static inline unsigned char *skb_put(struct sk_buff *skb, unsigned int len)
static inline unsigned char *skb_push(struct sk_buff *skb, unsigned int len)

skb의 앞/뒤에 len 길이만큼의 공간을 확보한다.

static inline unsigned char *skb_pull(struct sk_buff *skb, unsigned int len)

skb로 부터 len 길이만큼을 읽어온다.

static inline int skb_add_data(struct sk_buff *skb, char __user *from, int copy)

skb에 from으로부터 copy 만큼의 데이터를 복사한다.

Posted by

SK_BUFF Library Funcions

삽질 2006/06/14 11:04

INITIALIZATION

void skb_queue_head_init(struct sk_buff_head *list)

  Initializes the sk_bufff_head structure. Normally, the sk_buff_head is declared as a local variable, which is then initialized to an empty queue by the this function

  sk_buff_head 구조체를 초기화 한다. 일반적으로 sk_buff_head 구조체는 지역변수로 선언되며 이 함수에 의해 비어있는 큐로 초기화 된다.

CREATION

struct sk_buff *alloc_skb(unsigned int size, int priority)

  Allocates kernel memmory to store data of at least the specified size. Note that kernel memory is allocate in powers of two, and so you might get alot more space than you need. The priority indicates whether the memory has to be available right now, or can be paged in. In most cases, it should be GFP_ATOMIC, which means no paging.

  적어도 명시된 크기 만큼의 데이터를 저장할 수 있는 커널 메모리를 할당한다. 커널 메모리는 2의 배수로 할당되므로 필요로 하는 것보다 많은 공간이 할당될 것이다. priority는 메모리 영역이 지금 바로 필요한지 페이징 되어도 되는지를 나타낸다. 대부분의 경우에 GFP_ATOMIC으로 설정하며 이는 페이징하지 않음을 뜻한다.

struct sk_buff *dev_alloc_skb(unsigned int size);

struct sk_buff *skb_clone(struct sk_buff *skb, int priority)
  Make a fake copy of the the specified SKB. The new skb is not owned by a socket, or locked, and will be freed on deletion.

  명시한 skb의 복사본을 만든다. 새로운 skb는 어떤 socket에 소유되지 않으며 잠겨있다. 삭제 될 때 잠김이 풀릴 것이다.

struct sk_buff *skb_copy(struct sk_buff *skb, int priority)
  Make a real (independent) copy of the the specified SKB and the data it points to.

  명시한 skb와 그것이 가르키는 데이터의 복사본을 만든다.

SIMPLE MANIPULATION

void skb_queue_head(struct sk_buff_head *list,struct sk_buff *buf)

  Adds the given SKB to the head of the queue. It will then be the next SKB dequeue.

  주어진 skb를 큐의 head에 추가한다. 추가된 skb는 다음번에 dequeue 된다.

void skb_queue_tail(struct sk_buff_head *list,struct sk_buff *buf)
  Adds the given SKB to the tail (end) of the queue. It will then be the last SKB dequeued.

  주어진 skb를 큐의 tail에 추가한다. 추가된 skb는 마지막에 dequeue 된다.

struct sk_buff * skb_dequeue(struct sk_buff_head *list)
  Removes an SKB from the head of a given queue, if one is available. If not, NULL is returned.

  큐의 head에서 skb 하나를 제거한다. 큐에 skb가 존재하지 않을 경우 NULL을 리턴함.

INFORMATIVE

__u32 skb_queue_len(struct sk_buff_head *list);
  Determines the number of SKBs in a given queue.

  큐에 존재하는 skb의 갯수를 알려준다.

struct sk_buff *skb_peek_copy(struct sk_buff_head *list);
  Takes a peek at the next SKB to be dequeued, BUT DOES NOT REMOVE IT FROM THE LIST. This means that it is possible for another process to run off with it while your back is turned.

  다음번 dequeue될 skb를 peek 한다. 이 때 큐에서 skb를 제거하지는 않는다. 다른 프로세스에서 해당 skb를 가지고 작업 할 수도 있음을 뜻한다.

int skb_headroom(struct sk_buff *skb)
  Determines how many free bytes are available before the actual data starts in the buffer. Often used to see if a header can simplely be prepended to the valid data area, or if a copy into a new buffer is necessary. Usually used as a check right before skb_push() is called.

  버퍼에 실제 data가 나타나기 까지 얼마나 많은 빈 공간(headroom)이 있는지 알려준다. 헤더를 단순히 확장할 수 있는지 새로운 버퍼로 복사해야 하는지를 알아보는데 사용된다.

int skb_tailroom(struct sk_buff *skb)
  Determines how many free bytes are available after the actual data ends in the buffer. Often used to see if a trailer can simplely be appended to the valid data area, or if a copy into a new buffer is necessary. Ussually used as a check right before a call to skb_put().

  버퍼에 실제 data가 끝난 이후로 얼마나 많은 빈 공간(tailroom)이 있는지 알려준다. trailer가 단순히 덧붙을 수 있는지 새로운 버퍼로 복사해야 하는지 알아보는데 사용된다. 일반적으로 skb_put()을 호출하기 전에 크기를 체크하기 위해 사용된다.

int skb_device_locked(struct sk_buff *skb)
  Check to see if the given SKB is locked.

  주어진 skb가 잠김 상태인지를 확인한다.

COMPLEX SKB MANIPULATION

void skb_insert(struct sk_buff *old,struct sk_buff *newsk)
  Inserts the new SKB in front of the old SKB in the list.

  새로운 skb를 old의 앞에 삽입한다.

void skb_append(struct sk_buff *old,struct sk_buff *newsk)
  Inserts the new SKB in back of the old SKB in the list.

  새로운 skb를 old의 뒤에 삽입한다.

void skb_unlink(struct sk_buff *buf)
  Removes the SKB from its list, no matter where it is in that list.

  리스트에서 skb를 제거한다. skb의 위치는 상관없음.

void skb_device_lock(struct sk_buff *skb)
  Places a lock on the given SKB.

  주어진 skb를 잠근다.

void skb_device_unlock(struct sk_buff *skb)
  Removes a lock on a given SKB

  주어진 skb의 잠금을 해제한다.

DATA MANIPULATION

unsigned char * skb_put(struct sk_buff *skb, int len)
  Adds len garbage characters to the end of the PDU, and then returns a pointer to the start of the garbage characters so you can overwrite them. Note that there is no range checking to ensure that space actually exists, so be careful of memory overruns.

  len 길이 만큼의 garbage 문자들을 PDU의 끝에 덧붙이고 garbage character의 시작 위치를 리턴해서 해당 부분을 rewrite할수 있게 한다. 실제로 충분한 공간이 존재하는지를 체크하지 않으므로 메모리 overrun에 주의해야 한다.

unsigned char * skb_push(struct sk_buff *skb, int len)
  "Pushes" len garbage bytes onto the front of the PDU, and returns a pointer to the start of the garbage bytes. Note that there is no range checking to ensure that space actually exists so be careful of memory underruns.

  PDU의 앞쪽에 len 길이 만큼의 garbage 문자들을 삽입하고 garbage 문자의 시작 위치를 리턴한다. 실제로 충분한 공간이 존재하는지를 체크하지 않으므로 메모리 overrun에 주의해야 한다.

unsigned char * skb_pull(struct sk_buff *skb, int len)
  If there are len bytes available, then they are removed from the buffer and a pointer to the start of the removed bytes is returned. Otherwise, a NULL pointer is returned.

  len 길이 만큼의 byte가 사용가능하다면 버퍼에서 그만큼 지우고 지워진 byte의 시작 포인터를 리턴한다. 아니면 NULL 리턴.

void skb_reserve(struct sk_buff *skb, int len)
  Pre-allocates some space for a header that will be added by later protocols. This can save some unnessary copies in lower protocol layers. normally, these headers are then written with skb_push()

  향후 프로토콜들에서 추가될 헤더를 위한 공간을 미리 할당해둠. 하위 프로토콜에서의 불필요한 복사를 줄일 수 있다. 보통 이러한 헤더들은 skb_push() 함수로 skb에 추가된다.

void skb_trim(struct sk_buff *skb, int len)
  Shortens the stored data in the SKB to the desired length. Often used to remove trailiers from PDUs

  skb에 저장된 데이터를 원하는 길이로 짧게 한다. 보통 PDU에서 trailer를 제거하는데 사용됨.

DESTRUCTION

void kfree_skb(struct sk_buff *skb, int rw)
  Frees an SKB for either Reading, Writing, or both.

  skb를 읽기,쓰기 또는 모두 못하도록 해제한다.

void kfree_skbmem(struct sk_buff *skb)
  Frees the memory allocated to an SKB to store data. Not used by newer code

  데이터를 저장하기 위해 할당하였던 메모리를 해제한다. 새로운 코드에서는 사용되지 않음.

void dev_kfree_skb(struct sk_buff *skb, int mode)
  Frees the memory that the SKB structure occupies

  skb 구조체가 점유하는 메모리를 해제함.



원문 출처
---------------------------------
http://www.ittc.ku.edu/Projects/Wireless_ATM/linux/sk-funct.html

Posted by