Egloos | Log-in


[Oracle/Mail]2. Oracle Mail 전송 구문

REM
REM example.sql - A PL/SQL code example to demonstrate how to use the UTL_SMTP
REM package to send emails in ASCII and non-ASCII character sets, emails
REM with text or binary attachments. This example uses the demo_mail helper
REM package that utilizes the UTL_SMTP package to send emails via SMTP.
REM 
REM Note: this example relies on the UTL_ENCODE PL/SQL package in Oracle 9i.
REM For Oracle 8i users, please use example8i instead.

REM Send an email in text to two recipients

BEGIN
  demo_mail.mail(
    sender     => 'Me <
'">me@some-company.com>',
    recipients => 'Someone <
someone@some-company.com>, ' ||
                  '"Another one" <
'">another-one@some-company.com>',
    subject    => 'Test',
    message    => 'Hi! This is a test.');
END;
/

REM Send an email in HTML

DECLARE
  conn utl_smtp.connection;
BEGIN
  conn := demo_mail.begin_mail(
    sender     => 'Me <
'">me@some-company.com>',
    recipients => 'Someone <
'">someone@some-company.com>',
    subject    => 'HTML E-mail Test',
    mime_type  => 'text/html');

  demo_mail.write_text(
    conn    => conn,
    message => '<h1>Hi! This is a <i>test</i>.</h1>');
 
  demo_mail.end_mail( conn => conn );

END;
/

REM Send an email with 2 attachments.

DECLARE
  conn      utl_smtp.connection;
  req       utl_http.req; 
  resp      utl_http.resp;
  data      RAW(200);
BEGIN
  conn := demo_mail.begin_mail(
    sender     => 'Me <
'">me@some-company.com>',
    recipients => 'Someone <
'">someone@some-company.com>',
    subject    => 'Attachment Test',
    mime_type  => demo_mail.MULTIPART_MIME_TYPE);

  demo_mail.attach_text(
    conn      => conn,
    data      => '<h1>Hi! This is a test.</h1>',
    mime_type => 'text/html');
 
  demo_mail.begin_attachment(
    conn         => conn,
    mime_type    => 'image/gif',
    inline       => TRUE,
    filename     => 'image.gif',
    transfer_enc => 'base64');

  -- In writing Base-64 encoded text following the MIME format below,
  -- the MIME format requires that a long piece of data must be splitted
  -- into multiple lines and each line of encoded data cannot exceed
  -- 80 characters, including the new-line characters. Also, when
  -- splitting the original data into pieces, the length of each chunk
  -- of data before encoding must be a multiple of 3, except for the
  -- last chunk. The constant demo_mail.MAX_BASE64_LINE_WIDTH
  -- (76 / 4 * 3 = 57) is the maximum length (in bytes) of each chunk
  -- of data before encoding.

  req := utl_http.begin_request('http://www.some-company.com/image.gif');
  resp := utl_http.get_response(req);

  BEGIN
    LOOP
      utl_http.read_raw(resp, data, demo_mail.MAX_BASE64_LINE_WIDTH);
      demo_mail.write_raw(
        conn    => conn,
        message => utl_encode.base64_encode(data));
    END LOOP;
  EXCEPTION
    WHEN utl_http.end_of_body THEN
      utl_http.end_response(resp);
  END;
  demo_mail.end_attachment( conn => conn );

  demo_mail.attach_text(
    conn      => conn,
    data      => '<h1>This is a HTML report.</h1>',
    mime_type => 'text/html',
    inline    => FALSE,
    filename  => 'report.htm',
    last      => TRUE);
 
  demo_mail.end_mail( conn => conn );

END;
/

REM Send an email in Chinese (big5). This needs to be executed in a database
REM with ZHT16BIG5 character set.

DECLARE
  conn utl_smtp.connection;
BEGIN
  conn := demo_mail.begin_mail(
    sender     => 'Me <
'">me@some-company.com>',
    recipients => 'Someone <
'">someone@some-company.com>',
    subject    => 'Chinese Email Test',
    mime_type  => 'text/plain; charset=big5');

  demo_mail.write_mb_text(
    conn    => conn,
    message => 'Chinese email example - ㄴㅵ퉞쨖턫τⓕ쨖' || utl_tcp.CRLF);

  demo_mail.end_mail( conn => conn );
END;
/

by doaction | 2009/02/01 12:23 | DataBase-Oracle | 트랙백 | 덧글(0)

[Oracle/Mail]1. Oracle Mail 전송 Package

REM
REM maildemo.sql - A PL/SQL package to demonstrate how to use the UTL_SMTP
REM package to send emails in ASCII and non-ASCII character sets, emails
REM with text or binary attachments.
REM
REM Note: this package relies on the UTL_ENCODE PL/SQL package in Oracle 9i.
REM For Oracle 8i users, please use maildemo8i instead.

CREATE OR REPLACE PACKAGE M IS
  
  ----------------------- Customizable Section -----------------------
  
  -- Customize the SMTP host, port and your domain name below.
  smtp_host   VARCHAR2(256) := 'smtp-server.some-company.com';
  smtp_port   PLS_INTEGER   := 25;
  smtp_domain VARCHAR2(256) := 'some-company.com';

  -- Customize the signature that will appear in the email's MIME header.
  -- Useful for versioning.
  MAILER_ID   CONSTANT VARCHAR2(256) := 'Mailer by Oracle UTL_SMTP';
 
  --------------------- End Customizable Section ---------------------

  -- A unique string that demarcates boundaries of parts in a multi-part email
  -- The string should not appear inside the body of any part of the email.
  -- Customize this if needed or generate this randomly dynamically.
  BOUNDARY        CONSTANT VARCHAR2(256) := '-----7D81B75CCC90D2974F7A1CBD';

  FIRST_BOUNDARY  CONSTANT VARCHAR2(256) := '--' || BOUNDARY || utl_tcp.CRLF;
  LAST_BOUNDARY   CONSTANT VARCHAR2(256) := '--' || BOUNDARY || '--' ||
                                              utl_tcp.CRLF;

  -- A MIME type that denotes multi-part email (MIME) messages.
  MULTIPART_MIME_TYPE CONSTANT VARCHAR2(256) := 'multipart/mixed; boundary="'||
                                                  BOUNDARY || '"';
  MAX_BASE64_LINE_WIDTH CONSTANT PLS_INTEGER   := 76 / 4 * 3;

  -- A simple email API for sending email in plain text in a single call.
  -- The format of an email address is one of these:
  --  
someone@some-domain
  --   "Someone at some domain" <someone@some-domain>
  --   Someone at some domain <
someone@some-domain>
  -- The recipients is a list of email addresses  separated by
  -- either a "," or a ";"
  PROCEDURE mail(sender     IN VARCHAR2,
   recipients IN VARCHAR2,
   subject    IN VARCHAR2,
   message    IN VARCHAR2);

  -- Extended email API to send email in HTML or plain text with no size limit.
  -- First, begin the email by begin_mail(). Then, call write_text() repeatedly
  -- to send email in ASCII piece-by-piece. Or, call write_mb_text() to send
  -- email in non-ASCII or multi-byte character set. End the email with
  -- end_mail().
  FUNCTION begin_mail(sender     IN VARCHAR2,
        recipients IN VARCHAR2,
        subject    IN VARCHAR2,
        mime_type  IN VARCHAR2    DEFAULT 'text/plain',
        priority   IN PLS_INTEGER DEFAULT NULL)
        RETURN utl_smtp.connection;

  -- Write email body in ASCII
  PROCEDURE write_text(conn    IN OUT NOCOPY utl_smtp.connection,
         message IN VARCHAR2);

  -- Write email body in non-ASCII (including multi-byte). The email body
  -- will be sent in the database character set.
  PROCEDURE write_mb_text(conn    IN OUT NOCOPY utl_smtp.connection,
     message IN            VARCHAR2);
 
  -- Write email body in binary
  PROCEDURE write_raw(conn    IN OUT NOCOPY utl_smtp.connection,
        message IN RAW);

  -- APIs to send email with attachments. Attachments are sent by sending
  -- emails in "multipart/mixed" MIME format. Specify that MIME format when
  -- beginning an email with begin_mail().
 
  -- Send a single text attachment.
  PROCEDURE attach_text(conn         IN OUT NOCOPY utl_smtp.connection,
   data         IN VARCHAR2,
   mime_type    IN VARCHAR2 DEFAULT 'text/plain',
   inline       IN BOOLEAN  DEFAULT TRUE,
   filename     IN VARCHAR2 DEFAULT NULL,
          last         IN BOOLEAN  DEFAULT FALSE);
 
  -- Send a binary attachment. The attachment will be encoded in Base-64
  -- encoding format.
  PROCEDURE attach_base64(conn         IN OUT NOCOPY utl_smtp.connection,
     data         IN RAW,
     mime_type    IN VARCHAR2 DEFAULT 'application/octet',
     inline       IN BOOLEAN  DEFAULT TRUE,
     filename     IN VARCHAR2 DEFAULT NULL,
     last         IN BOOLEAN  DEFAULT FALSE);
 
  -- Send an attachment with no size limit. First, begin the attachment
  -- with begin_attachment(). Then, call write_text repeatedly to send
  -- the attachment piece-by-piece. If the attachment is text-based but
  -- in non-ASCII or multi-byte character set, use write_mb_text() instead.
  -- To send binary attachment, the binary content should first be
  -- encoded in Base-64 encoding format using the demo package for 8i,
  -- or the native one in 9i. End the attachment with end_attachment.
  PROCEDURE begin_attachment(conn         IN OUT NOCOPY utl_smtp.connection,
        mime_type    IN VARCHAR2 DEFAULT 'text/plain',
        inline       IN BOOLEAN  DEFAULT TRUE,
        filename     IN VARCHAR2 DEFAULT NULL,
        transfer_enc IN VARCHAR2 DEFAULT NULL);
 
  -- End the attachment.
  PROCEDURE end_attachment(conn IN OUT NOCOPY utl_smtp.connection,
      last IN BOOLEAN DEFAULT FALSE);
 
  -- End the email.
  PROCEDURE end_mail(conn IN OUT NOCOPY utl_smtp.connection);

  -- Extended email API to send multiple emails in a session for better
  -- performance. First, begin an email session with begin_session.
  -- Then, begin each email with a session by calling begin_mail_in_session
  -- instead of begin_mail. End the email with end_mail_in_session instead
  -- of end_mail. End the email session by end_session.
  FUNCTION begin_session RETURN utl_smtp.connection;
 
  -- Begin an email in a session.
  PROCEDURE begin_mail_in_session(conn       IN OUT NOCOPY utl_smtp.connection,
      sender     IN VARCHAR2,
      recipients IN VARCHAR2,
      subject    IN VARCHAR2,
      mime_type  IN VARCHAR2  DEFAULT 'text/plain',
      priority   IN PLS_INTEGER DEFAULT NULL);
 
  -- End an email in a session.
  PROCEDURE end_mail_in_session(conn IN OUT NOCOPY utl_smtp.connection);
 
  -- End an email session.
  PROCEDURE end_session(conn IN OUT NOCOPY utl_smtp.connection);

END;
/

CREATE OR REPLACE PACKAGE BODY demo_mail IS
  
  -- Return the next email address in the list of email addresses, separated
  -- by either a "," or a ";".  The format of mailbox may be in one of these:
  --  
someone@some-domain
  --   "Someone at some domain" <someone@some-domain>
  --   Someone at some domain <
someone@some-domain>
  FUNCTION get_address(addr_list IN OUT VARCHAR2) RETURN VARCHAR2 IS

    addr VARCHAR2(256);
    i    pls_integer;

    FUNCTION lookup_unquoted_char(str  IN VARCHAR2,
      chrs IN VARCHAR2) RETURN pls_integer AS
      c            VARCHAR2(5);
      i            pls_integer;
      len          pls_integer;
      inside_quote BOOLEAN;
    BEGIN
       inside_quote := false;
       i := 1;
       len := length(str);
       WHILE (i <= len) LOOP

  c := substr(str, i, 1);

  IF (inside_quote) THEN
    IF (c = '"') THEN
      inside_quote := false;
    ELSIF (c = '\') THEN
      i := i + 1; -- Skip the quote character
    END IF;
    GOTO next_char;
  END IF;
 
  IF (c = '"') THEN
    inside_quote := true;
    GOTO next_char;
  END IF;
     
  IF (instr(chrs, c) >= 1) THEN
     RETURN i;
  END IF;
     
  <<next_char>>
  i := i + 1;

       END LOOP;
   
       RETURN 0;
   
    END;

  BEGIN

    addr_list := ltrim(addr_list);
    i := lookup_unquoted_char(addr_list, ',;');
    IF (i >= 1) THEN
      addr      := substr(addr_list, 1, i - 1);
      addr_list := substr(addr_list, i + 1);
    ELSE
      addr := addr_list;
      addr_list := '';
    END IF;
  
    i := lookup_unquoted_char(addr, '<');
    IF (i >= 1) THEN
      addr := substr(addr, i + 1);
      i := instr(addr, '>');
      IF (i >= 1) THEN
 addr := substr(addr, 1, i - 1);
      END IF;
    END IF;

    RETURN addr;
  END;

  -- Write a MIME header
  PROCEDURE write_mime_header(conn  IN OUT NOCOPY utl_smtp.connection,
         name  IN VARCHAR2,
         value IN VARCHAR2) IS
  BEGIN
    utl_smtp.write_data(conn, name || ': ' || value || utl_tcp.CRLF);
  END;

  -- Mark a message-part boundary.  Set <last> to TRUE for the last boundary.
  PROCEDURE write_boundary(conn  IN OUT NOCOPY utl_smtp.connection,
      last  IN            BOOLEAN DEFAULT FALSE) AS
  BEGIN
    IF (last) THEN
      utl_smtp.write_data(conn, LAST_BOUNDARY);
    ELSE
      utl_smtp.write_data(conn, FIRST_BOUNDARY);
    END IF;
  END;

  ------------------------------------------------------------------------
  PROCEDURE mail(sender     IN VARCHAR2,
   recipients IN VARCHAR2,
   subject    IN VARCHAR2,
   message    IN VARCHAR2) IS
    conn utl_smtp.connection;
  BEGIN
    conn := begin_mail(sender, recipients, subject);
    write_text(conn, message);
    end_mail(conn);
  END;

  ------------------------------------------------------------------------
  FUNCTION begin_mail(sender     IN VARCHAR2,
        recipients IN VARCHAR2,
        subject    IN VARCHAR2,
        mime_type  IN VARCHAR2    DEFAULT 'text/plain',
        priority   IN PLS_INTEGER DEFAULT NULL)
        RETURN utl_smtp.connection IS
    conn utl_smtp.connection;
  BEGIN
    conn := begin_session;
    begin_mail_in_session(conn, sender, recipients, subject, mime_type,
      priority);
    RETURN conn;
  END;

  ------------------------------------------------------------------------
  PROCEDURE write_text(conn    IN OUT NOCOPY utl_smtp.connection,
         message IN VARCHAR2) IS
  BEGIN
    utl_smtp.write_data(conn, message);
  END;

  ------------------------------------------------------------------------
  PROCEDURE write_mb_text(conn    IN OUT NOCOPY utl_smtp.connection,
     message IN            VARCHAR2) IS
  BEGIN
    utl_smtp.write_raw_data(conn, utl_raw.cast_to_raw(message));
  END;

  ------------------------------------------------------------------------
  PROCEDURE write_raw(conn    IN OUT NOCOPY utl_smtp.connection,
        message IN RAW) IS
  BEGIN
    utl_smtp.write_raw_data(conn, message);
  END;

  ------------------------------------------------------------------------
  PROCEDURE attach_text(conn         IN OUT NOCOPY utl_smtp.connection,
   data         IN VARCHAR2,
   mime_type    IN VARCHAR2 DEFAULT 'text/plain',
   inline       IN BOOLEAN  DEFAULT TRUE,
   filename     IN VARCHAR2 DEFAULT NULL,
          last         IN BOOLEAN  DEFAULT FALSE) IS
  BEGIN
    begin_attachment(conn, mime_type, inline, filename);
    write_text(conn, data);
    end_attachment(conn, last);
  END;

  ------------------------------------------------------------------------
  PROCEDURE attach_base64(conn         IN OUT NOCOPY utl_smtp.connection,
     data         IN RAW,
     mime_type    IN VARCHAR2 DEFAULT 'application/octet',
     inline       IN BOOLEAN  DEFAULT TRUE,
     filename     IN VARCHAR2 DEFAULT NULL,
     last         IN BOOLEAN  DEFAULT FALSE) IS
    i   PLS_INTEGER;
    len PLS_INTEGER;
  BEGIN
   
    begin_attachment(conn, mime_type, inline, filename, 'base64');

    -- Split the Base64-encoded attachment into multiple lines
    i   := 1;
    len := utl_raw.length(data);
    WHILE (i < len) LOOP
       IF (i + MAX_BASE64_LINE_WIDTH < len) THEN
  utl_smtp.write_raw_data(conn,
     utl_encode.base64_encode(utl_raw.substr(data, i,
     MAX_BASE64_LINE_WIDTH)));
       ELSE
  utl_smtp.write_raw_data(conn,
    utl_encode.base64_encode(utl_raw.substr(data, i)));
       END IF;
       utl_smtp.write_data(conn, utl_tcp.CRLF);
       i := i + MAX_BASE64_LINE_WIDTH;
    END LOOP;
   
    end_attachment(conn, last);

  END;

  ------------------------------------------------------------------------
  PROCEDURE begin_attachment(conn         IN OUT NOCOPY utl_smtp.connection,
        mime_type    IN VARCHAR2 DEFAULT 'text/plain',
        inline       IN BOOLEAN  DEFAULT TRUE,
        filename     IN VARCHAR2 DEFAULT NULL,
        transfer_enc IN VARCHAR2 DEFAULT NULL) IS
  BEGIN
    write_boundary(conn);
    write_mime_header(conn, 'Content-Type', mime_type);

    IF (filename IS NOT NULL) THEN
       IF (inline) THEN
   write_mime_header(conn, 'Content-Disposition',
     'inline; filename="'||filename||'"');
       ELSE
   write_mime_header(conn, 'Content-Disposition',
     'attachment; filename="'||filename||'"');
       END IF;
    END IF;

    IF (transfer_enc IS NOT NULL) THEN
      write_mime_header(conn, 'Content-Transfer-Encoding', transfer_enc);
    END IF;
   
    utl_smtp.write_data(conn, utl_tcp.CRLF);
  END;

  ------------------------------------------------------------------------
  PROCEDURE end_attachment(conn IN OUT NOCOPY utl_smtp.connection,
      last IN BOOLEAN DEFAULT FALSE) IS
  BEGIN
    utl_smtp.write_data(conn, utl_tcp.CRLF);
    IF (last) THEN
      write_boundary(conn, last);
    END IF;
  END;

  ------------------------------------------------------------------------
  PROCEDURE end_mail(conn IN OUT NOCOPY utl_smtp.connection) IS
  BEGIN
    end_mail_in_session(conn);
    end_session(conn);
  END;

  ------------------------------------------------------------------------
  FUNCTION begin_session RETURN utl_smtp.connection IS
    conn utl_smtp.connection;
  BEGIN
    -- open SMTP connection
    conn := utl_smtp.open_connection(smtp_host, smtp_port);
    utl_smtp.helo(conn, smtp_domain);
    RETURN conn;
  END;

  ------------------------------------------------------------------------
  PROCEDURE begin_mail_in_session(conn       IN OUT NOCOPY utl_smtp.connection,
      sender     IN VARCHAR2,
      recipients IN VARCHAR2,
      subject    IN VARCHAR2,
      mime_type  IN VARCHAR2  DEFAULT 'text/plain',
      priority   IN PLS_INTEGER DEFAULT NULL) IS
    my_recipients VARCHAR2(32767) := recipients;
    my_sender     VARCHAR2(32767) := sender;
  BEGIN

    -- Specify sender's address (our server allows bogus address
    -- as long as it is a full email address (
xxx@yyy.com).
    utl_smtp.mail(conn, get_address(my_sender));

    -- Specify recipient(s) of the email.
    WHILE (my_recipients IS NOT NULL) LOOP
      utl_smtp.rcpt(conn, get_address(my_recipients));
    END LOOP;

    -- Start body of email
    utl_smtp.open_data(conn);

    -- Set "From" MIME header
    write_mime_header(conn, 'From', sender);

    -- Set "To" MIME header
    write_mime_header(conn, 'To', recipients);

    -- Set "Subject" MIME header
    write_mime_header(conn, 'Subject', subject);

    -- Set "Content-Type" MIME header
    write_mime_header(conn, 'Content-Type', mime_type);

    -- Set "X-Mailer" MIME header
    write_mime_header(conn, 'X-Mailer', MAILER_ID);

    -- Set priority:
    --   High      Normal       Low
    --   1     2     3     4     5
    IF (priority IS NOT NULL) THEN
      write_mime_header(conn, 'X-Priority', priority);
    END IF;

    -- Send an empty line to denotes end of MIME headers and
    -- beginning of message body.
    utl_smtp.write_data(conn, utl_tcp.CRLF);

    IF (mime_type LIKE 'multipart/mixed%') THEN
      write_text(conn, 'This is a multi-part message in MIME format.' ||
 utl_tcp.crlf);
    END IF;

  END;

  ------------------------------------------------------------------------
  PROCEDURE end_mail_in_session(conn IN OUT NOCOPY utl_smtp.connection) IS
  BEGIN
    utl_smtp.close_data(conn);
  END;
   
  ------------------------------------------------------------------------
  PROCEDURE end_session(conn IN OUT NOCOPY utl_smtp.connection) IS
  BEGIN
    utl_smtp.quit(conn);
  END;

END;
/

by doaction | 2009/02/01 12:21 | DataBase-Oracle | 트랙백 | 덧글(0)

The Ethics of Hacking

The Ethics of Hacking


I went up to a college this summer to look around, see if it was where I wanted to go and what not. The guide asked me about my interests, and when I said computers, he started asking me about what systems I had, etc. And when all that was done, the first thing he asked me was "Are you a hacker?"
Well, that question has been bugging me ever since. Just what exactly is a hacker? A REAL hacker?
For those who don't know better, the news media (and even comic strips) have blown it way out of proportion; A hacker, by wrong definition, can be anything from a computer user to someone who destroys everything they can get their evil terminals into.
And the idiotic schmucks of the world who get a Commodore Vic-20 and a 300 baud modem (heh, and a tape drive!) for Christmas haven't helped hackers' reputations a damn bit. They somehow get access to a really cool system and find some files on hacking...Or maybe a friendly but not too cautious hacker helps the loser out, gives him a few numbers, etc. The schmuck gets onto a system somewhere, lucks up and gets in to some really cool information or programs, and deletes them. Or some of the more greedy ones capture it, delete it, and try to sell it to Libya or something. Who gets the blame?
The true hackers...that's who. So what is a true hacker?
Firstly, some people may not think I am entirely qualified to say, mainly because I don't consider myself a hacker yet. I'm still learning the ropes about it, but I think I have a pretty damn good idea of what a true hacker is. If I'm wrong, let one correct me....

True hackers are intelligent, they have to be. Either they do really great in school because they have nothing better to do, or they don't do so well because school is terribly boring. And the ones who are bored aren't that way because they don't give a shit about learning anything. A true hacker wants to know everything. They're bored because schools teach the same dull things over and over and over, nothing new, nothing challenging.
True hackers are curious and patient. If you aren't, how can you work so very hard hacking away at a single system for even one small PEEK at what may be on it?
A true hacker DOESN'T get into the system to kill everything or to sell what he gets to someone else. True hackers want to learn, or want to satisfy their curiosity, that's why they get into the system. To search around inside of a place they've never been, to explore all the little nooks and crannies of a world so unlike the boring cess-pool we live in. Why destroy something and take away the pleasure you had from someone else? Why bring down the whole world on the few true hackers who aren't cruising the phone lines with malicious intent?
True hackers are disgusted at the way things are in this world. All the wonderful technology of the world costs three arms and four legs to get these days. It costs a fortune to call up a board in an adjoining state! So why pay for it? To borrow something from a file I will name later, why pay for what could be "dirt cheap if it wasn't run by profiteering gluttons?" Why be forced, due to lack of the hellacious cash flow it would require to call all the great places, to stay around a bunch of schmuck losers in your home town? Calling out and entering a system you've never seen before are two of the most exhilirating experiences known to man, but it is a pleasure that could not be enjoyed were it not for the ability to phreak.
True hackers are quiet. I don't mean they talk at about .5 dB, I mean they keep their mouths shut and don't brag. The number one killer of those the media would have us call hackers is bragging. You tell a friend, or you run your mouth on a board, and sooner or later people in power will find out what you did, who you are, and you're gone....

I honestly don't know what purpose this file will serve, maybe someone somewhere will read it, and know the truth about hackers. Not the lies that the ignorant spread. To the true hackers out there, I hope I am portraying what you are in this file. If I am not, then I at least am saying what I think a true hacker should be. And to those wanna-be's out there who like the label of "HACKER" being tacked onto them, grow up, would ya?

Oh yeah, the file I quoted from...It has been done (at least) two times. "The Hacker's Manifesto" or "Conscience of a Hacker" are the two names I've seen it given (a file by itself, and part of an issue of Phrack). Either way, it was written by The Mentor, and it is absolutely the best thing ever written on the subject of hackers. Read it, it could change your life.

by doaction | 2009/01/28 16:29 | Story... | 트랙백 | 덧글(0)

jQuery


jQuery: Write Less, Do More.

자바스크립트 프레임워크의 세 줄기가 있습니다. prototype.js,
jQuery, mootools. (일천한 제 경험니다.) 그 중 jQuery가 각광을 받고 있다는 기사들이 조금씩 나오는데, 아마 media play도 잘 하는 것 같이 느껴집니다.

여튼 ibm의 developerWorks에 소개된 jQuery 입문글을 보시고 읽어보시는 것도 좋을 것 같습니다.

 

jQuery로 Ajax 개발을 단순화 하기 (한글)

jQuery로 작업하기, Part 2: 내일 나올 웹 응용을 오늘 구현해보자

JQuery: 내일 나올 웹 응용을 오늘 구현해보자

by doaction | 2009/01/28 16:26 | JavaScript | 트랙백 | 덧글(0)

DWR과 Prototype.js의 Ajax성능 비교

    
Direct Web Remoting인 DWR(http://directwebremoting.org/)과 클라이언트 중심으로 돌아가는 Prototype.js(http://www.prototypejs.org/)는 두 가지 Ajax 동작 방식과 개발 방식은 다릅니다만, 외형상 보여지는 부분은 동일합니다. 그 외형에 대한 서영아빠님의 비교 글입니다.

 

부하가 걸리지 않는 상황에서는 DWR이나 prototype.js의 성능상의 차이는 거의 없습니다. 하지만 부하가 걸리는 상황에서는 prototype.js의 성능이 DWR보다 월등한 성능을 보여주고 있습니다.
 하지만 이는 GET방식과 POST방식으로 인한 차이일 수도 있으며 DWR과 prototype.js의 메모리 사용률도 조금달랐습니다. DWR은 메모리가 일정 수치 이상 올라가면 메모리 사용량이 일정 수치 이상 올라가지 않는 것으로 보아 가비지 컬렉터가 수행되는 것 갔았으며 prototype.js는 메모리 사용률이 계속 올라갔습니다. 이 부분에 대해서는 별도의 테스트가 필요한것 같습니다.
 만약 Ajax 컴포넌트를 선택하는 상황이라면 성능상으로는 prototype.js이 뛰어날 지라도 DWR의 개발시 편의성과 메모리 사용률도 무시하지 못할 부분이라고 생각됩니다.

from: http://westzero.net/24

by doaction | 2009/01/28 16:24 | Tips | 트랙백 | 덧글(0)

나의 어느 여름 황당한 이야기...

한때 모사이트에 글을 올렸다가 대박을 친글이다...

참.......

-------------------------------------------------------------------------------------------------

어라 하루만에 베스트에 올랐군요...ㅋㅋ

머 여러가지 리플이 있지만 그래도 후회는 안합니다. 제가 불손한 뜻이 있었던 것도 아니었고

급하게 가려드리려다 팔이 반팔이라... 어쩔수 없는 상황이니까요

경찰에 고소 ,성추행 어쩌구 하시는 분들이 있는데 뇌속에 뭐가 들었는지 정말 궁금하네요..

법을 얼마나 아시는지?

제가 법률회사에서 2년정도 일해봐서 최소한의 법률상식은 가지고 살거든요?

모르면 가만히 글이나 읽고 쉬세요..^^

그리고 도와주지 않는게 상책이라 지만 남자의 팔자가 어디가나요?

남자로 태어난 이상 욕은 묵을지언정 도와주는게 진리랍니다.

다들 말은 그렇게 하시지만 위급한 상황되시면 다들 도와주시는 멋진분들이란것쯤 다 알고 있구요..어차피 된장녀건 네가지 없는 여자건 위급상황에서 결국엔 우리 남자들이 도와주지 않으면 누가 돕겠습니까.. 그게 남자이고.. 오해로 욕은먹지만 나중에 다들 고마워 하겠죠...

그나저나 여전히 궁금합니다. 그 여자분 아직도 치마는 잘 내리고 다니시는지....

 

더운 오후입니다. 다들 즐거운 하루되시길 바랍니다.

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

 

짧은이야기 입니다. ------------------------------그냥 몇년전에 황당한 이야기가 있어서...

때는 몇년전 여름으로 기억합니다.

회사에서 외근을 나와서 길을 가는데... 어느 보험사 앞을 지나갈때 였습니다.

건물앞에서 어떤 여자분이 나와서 제 앞을 가는데...

첨엔 좀 이상했습니다. 긴 치마를 입으셨는데... 치마 가운데가 폭 페인것처럼 올라간것 이었습니다.

첨엔 이것이 똥습녀인가 싶었는데.. 가만히 자세히 보니...

화장실을 다녀오셨는지 급하게 속옷을 올리시면서... 긴치마가 속옷으로 말려들어간것이었습니다.

지나가는 사람들 제 옆에 걸어가던 사람들 다 킥킥대고 난리 났습니다.

대로변이라 버스에서도 사람들 버스밖으로 고개 내밀고...

 

급한마음에 뛰어가며 셔츠를 벗어서 (제가 면티 한장을 안에 입고 있었거든요..더운데무슨 지랄이냐 싶으셨겠지만... 촌스런것도 제 스타일입니다.)그여자분 엉덩이를 급하게 가렸지요..

 

문제는 와이셔츠로 가려드린다는게... 양손이 여자분 골반을 잡아버린겁니다.

바로 작렬하는 싸대기.......

"어머 이게 뭐하는거에욧!!!!!!!!!!!""

하지만 놓을수 없는손.. 변명할 여지도 없이 한 3-4대 맞은것 같습니다.

 

무슨 여자가 그리 손때가 맵던지.. 볼이 얼얼하더군요...

겨우 입을 열어서...

 

"저기 ... 아가씨 치마가 팬티에 말려 올라가셨어여 ...... ㅠㅠ빨리 빼세요 ㅠㅠㅠㅠㅠㅠㅠㅠㅠ"

 

여자분 그때서야 느끼셨는지.. 얼굴 빨개지셔서 치마 내리고 두손으로 얼굴가리고 열라 뛰어갑니다.

저요? 싸대기 3-4대 맞고 두손은 거의 어정쩡한 포즈로 땅에 주저 앉아서...

멍하니 뛰어가는 그분만 보고 있었지요....

 

그날 회사로 복귀하니...

사장님 : 어이 x 대리 왜 볼따구가 그리 벌겋게 부었노.. 한쪽만 부었네.... 도대체 뭐하다 온거야..

회계여직원 : (완전히 벌레보듯하며) x대리님 여자한테 추근덕 대신거에요? 그렇게 안봤는데.. 실망이에욧~

 

저는 변명할 거리도 없이... 벌겋게 부은 볼따구를 잡고 그날밤 이불속에서 눈물젖은 빵을 먹으면서 잤답니다.

 

그여자분 지금은 치마 제대로 입고 다니시는지 궁금하네요...

아무리 챙피해도 최소한 미안하다는 말은 하고 다닙시다. 뺨만 얻어 맞은 저는 뭡니까 ㅠㅠ

 

---------------------------------------------------------------------------

이야기는 베스트가 꽤(?) 오래 가네요?

소설이라는분도 많으시지만 그 모든 이야기 사실이구요......

테클 거시는 분도 많은데..^^ 머 곤란한 상황에 대해서 괜히 끼면 머하나 하는

그런 무관심이 지금의 사회를 만드는게 아닐까요?

아무튼... 많은 분들께 웃음을 드려서 저도 기분이 약간(?) ^_^ 해피하구요...

진짜 그여자분 잘지내는지 점점더 궁금해지는군요..

 

지금 생각나는건 오로지 뒷모습이라서... 맞느라고 앞모습도 제대로 못봐서.-_-;

 

암튼 이제 이걸로 글은 종료합니다. ㅋㅋ

by doaction | 2009/01/28 10:48 | Story... | 트랙백 | 덧글(0)

내가 처음 운동을 시작하게 된 계기...

중학교 시절..
난 지극히도 내성적이고 소극적인 소년이었다..
지금과는 다르게 키도 무척이나 작아 제일 앞자리에 앉아야만 했던 나는..
중2가 될때까지 학급에서 말도 없었고, 존재감도 거의 없었던
내성적인 중학생이었다..

그때까지 내성적인 내게 어머니의 존재는 절대적이었고,
나의 모든것은 소위 '엄마'의 의견에 모든것이 좌지우지 되고 있었다.

아직도 기억에 남는일이라면.. 어머니는 항상 내게 하얀색 Jean을 입히셨다.
항상 깨끗한 옷을 좋아하셨던 어머니이시기에 나는 어머니가 입혀주는 옷을 입고 다녔고.
내가 좋아하는 옷취향 같은것은 없었다.
그리고 지금은 어렴풋한 기억너머의 우리 노처녀 영어선생님도...
항상 단정하고 깔끔하게 다니는 나를 무척이나 귀여워 하셨었다..

그러던 어느날 점심시간 친구들과 잠시 운동장에 놀다가...
나는 흰색 Jean에 흙이 묻고 옷이 지저분하게 되었다..
그리고 점심시간 이후 시간은 그 노처녀 영어 선생님..

난 영어수업시간 이유없이 텐트폴대로 발바닥을 30여대를 맞은기억이 난다..
'옷이 왜 이렇게더럽니' 라며 .. 책상위에 무릎꿇고 있는 나를 매질하던 선생님...

난 그 이후로 흰색 Jean따위는 다시는 입지 않았고,

점심시간에는 보란듯이 땅바닥을 뒹구는 운동을 하게 되었고...

그것이 우연하게 코치님 눈에 띄게되어 처음으로 핸드볼을 시작하게 되었다...

지금생각해보면 별일도..아닌데..ㅡㅡ;

ps. 근데 내가 왜 이런글을 쓰고 있는건지...;;;;

by doaction | 2009/01/28 10:41 | Story... | 트랙백 | 덧글(1)

How to get client's IP address, Domain using JAVA

출처 : http://www.coderanch.com/t/293684/JSP/How-to-get-clients-IP
  1. String ipAddress  = request.getHeader("X-FORWARDED-FOR");   
  2.         if(ipAddress == null)   
  3.         {   
  4.           ipAddress = request.getRemoteAddr();   
  5.         }   
  6.         System.out.println("ipAddress:"+ipAddress);   

   

by doaction | 2009/01/23 14:48 | Tips | 트랙백 | 덧글(0)

Jsp 에서 GET 방식으로 한글Parameter 넘길때..

jsp 에서는 get방식이든 post방식이든 한글로된 파라미터 값을 넘겨줄때 그냥 주면 한글이 깨진다.
ajax가 파라미터를 utf-8로 전송하기때문인데 해결방법은
파라미터를 보낼 자바스크립트에서
escape(encodeURIComponent('한글'));
이렇게 인코딩을 하고
요청처리될 액션 페이지에서
URLDecoder.decode(request.getParameter("searchText"), "UTF-8");
이렇게 받으면된다.


출처 : http://blog.naver.com/dnms5/50031076855

by doaction | 2009/01/22 14:50 | Tips | 트랙백 | 덧글(0)

2008.10 LG R&D Portal Dev. Project

LG
Project Name : LG Electronics R&D Portal System Development
Place : ChangWon. LG Electronix 2nd Factory
Position : Application Development / Common  Module Part
    - Common Approval Module
    - SMS System
    - Common Mail System
    - System Schedule Daemon(Oracle Package-PL/SQL, Java Daemon)
    - Interface Relation System(IAM/DAPLM)
    - Single Sign On
Period : 2008.10.13 ~ 2009.02.11(4Month)
System Enviroment
   < Dev System >
       Sun Solaris
       Weblogic 8.1
       GAUCE 4.0.3
       Oracle 9i
       JDK 1.4.12
       Eclipse 3.1.2
       Laf/J Framework / Devon
   <Oper. System>
       IBM AIX
       Weblogic 8.1
       GAUCE 4.0.3
       Oracle 10g
       JDK 1.4.12
       Laf/J Framework / Devon


      

by doaction | 2009/01/22 10:23 | MyProject | 트랙백 | 덧글(0)

◀ 이전 페이지          다음 페이지 ▶