Posted
Filed under Linux
 

명령어 : du 그
옵션  : -h(human-사람이 보기 쉽게)
            --max-depths=1(지정한 디렉토리만 크기를 확인할 경우)

# du -h --max-depth=1 .

2009/09/14 10:04 2009/09/14 10:04
Posted
Filed under Htm&Javascript
[원문]http://dev.opera.com/articles/view/handling-events-with-javascript/#eventswhat
1.  자바스크립트를  html 과 분리 한다. (단 Embead 예외)
2. Evnet 지향 프로그램을 한다.
ex) onLoad event 를 body 에 등록 할 필요 없이 ;
     addEvent 메소드를 통해서 등록 한다.

addEvent(window, "load", function () {
  var links = document.getElementsByTagName("a");
    for (var i=0; i<links.length; i++) {
      addEvent(links[i], "click", function () {
        alert("NOPE! I won't take you there!");

        // This line's support added through the addEvent function. See below.
      evt.preventDefault();
    });
  }
});

3. html페이지 안에는 id="id_name" 이런 식으로 Element 를 참조 할 수 있는 id 값만 존재 하게 된다.


49 - Handling events with JavaScript

By robnyman · 3 Feb, 2009

Published in: , , , ,

Introduction

Now you are comfortable with using CSS for styling and layout, and have taken your first stumbling steps with understanding variables, functions, methods, etc. in JavaScript, it is time to start using that knowledge to provide your site visitors with interactivity and dynamic behavior (such as dragging and dropping, animation, etc). Controlling events with JavaScript allows you to step into the role as Doctor Frankenstein and really give life to your creations!

But enough about the joys of JavaScript—this article will get practical, telling you what events are and how to make use of them on your pages. The table of contents is as follows:

Bear in mind that you can download the code example for this article and try it out for yourself.

What are events?

Events occur when some sort of interaction takes place in a web page. This can be the end user clicking on something, moving the mouse over a certain element or pressing down certain keys on the keyboard. An event can also be something that happens in the web browser, such as the web page completing the loading of a page, or the user scrolling or resizing the window.

Through the use of JavaScript, you can detect when certain events happen, and cause things to occur in response to those events.

How events work

When events happen to an HTML element in a web page, it checks to see if any event handlers are attached to it. If the answer is yes, it calls them in respective order, while sending along references and further information for each event that occurred. The event handlers then act upon the event.

There are two types of event order: event capturing and event bubbling.

Event capturing starts with the outer most element in the DOM and works inwards to the HTML element the event took place on and then out again. For example, a click in a web page would first check the HTML element for onclick event handlers, then the body element, and so on, until it reaches the target of the event.

Event bubbling works in exactly the opposite manner: it begins by checking the target of the event for any attached event handlers, then bubbles up through each respective parent element until it reaches the HTML element.

The evolution of events

In the early days of JavaScripting, we used event handlers directly within the HTML element, like this:

<a href="http://www.opera.com/" onclick="alert('Hello')">Say hello</a>

The problem with this approach is that it resulted in event handlers spread throughout the code, no central control and missing out on web browsers' caching features when it comes to external JavaScript file includes.

The next step in event evolution was to apply events from within a JavaScript block, for example:

<script type="text/javascript">
  document.getElementById("my-link").onclick = waveToAudience;
    function waveToAudience() {
      alert("Waving like I've never waved before!");
    }
</script>

<a id="my-link" href="http://www.opera.com/">My link</a>

Note the clean HTML in the last example. This is generally what’s referred to as unobtrusive JavaScript. The benefit of this, besides JavaScript caching and code control, is code separation: you have all your content in one location and your interaction code in another. This also allows for a more accessible approach where the link will work perfectly fine with JavaScript disabled; it is also something that will please search engines.

DOM Level 2 Events

Back in November in 2000, the Document Object Model (DOM) Level 2 Events Specification was released by the W3C, offering a more detailed and granular way to control events in a web page. The new way to apply events to HTML elements looked like this:

document.getElementById("my-link").addEventListener("click", myFunction, false);

The first parameter of the addEventListener method is the name of the event, and you should note that it no longer uses the “on” prefix. The second parameter is a reference to the function we want to call when the event occurs. The third parameter controls the so-called useCapture of the event, ie if event capturing or event bubbling should be used.

The counterpart of addEventListener is removeEventListener, which removes any applied event from an HTML element.

Internet Explorer event model exception

Unfortunately, Internet Explorer has so far not implemented the DOM Level 2 event model, and instead has its own proprietary attachEvent method. It looks like this in action:

document.getElementById("my-link").attachEvent("onclick", myFunction);

Note that the attachEvent still uses the "on" prefix before the name of the actual event, and it doesn't include any support for deciding the capture phase.

The counterpart of attachEvent is detachEvent, to remove any applied event from an HTML element.

Applying events cross-browser

With the inconsistencies between web browsers in event handling implementations, there have been numerous attempts from web developers to offer a good solution for applying events sucessfully across all major browsers. These solutions have different pros and cons, and are usually referred to as addEvent functions.

Most major JavaScript libraries have these built in, and there are also a number of stand-alone solutions available online. One suggestion is to use addEvent by Dean Edwards; you should also consider looking at something like event handling options with the jQuery JavaScript library.

Events and accessibility

Before we delve deeper into explaining how to control and call events, I just want to emphasize accessibility. While it’s normally a broad term for most people, I use it here to convey that what you want to do through the usage of events really should work when JavaScript is disabled or for other reasons blocked in the web browser.

Some people do turn off JavaScript in their web browsers, but more commonly proxy servers, firewalls and overzealous antivirus programs stop JavaScript from behaving as expected. Don’t let this discourage you; my aim is to guide you through creating events that have an accessible fallback in case of JavaScript not being available.

In general, never apply events to HTML elements that don’t already have a built-in behavior for that certain event. You should only apply onclick events to elements like a, which already have a fallback behavior for click events (eg browsing to the location specified in the link, or submitting a form).

Controlling events

Let’s start out with a simple example of an event, and how you can react to it. For the sake of simplicity, I will be using the addEvent solution referred to above, to avoid delving into the intricacies of cross-browser workarounds in each example.

Our first example is the onload event, which belongs to the window object. Generally, any events that affect the browser window (like onload, onresize and onscroll) are available through the window object.

The onload event takes place when everything in the web page has completely loaded. This includes the HTML code itself as well as external dependencies such as images, CSS files and JavaScript files. When all of them have finished loading, window.onload gets called, and you can trigger web page functionality to occur. The following very simple example makes an alert message appear when the page has loaded:

addEvent(window, "load", sayHi);
function sayHi() {
  alert("Hello there, stranger!");	
}

That wasn’t too bad, right? If you want to, you can use so-called anonymous functions instead, eliminating the need for a name for your function. Like this:

addEvent(window, "load", function () {
  alert("Hello there, stranger!");	
});

Applying events to certain elements

To take this further, we should start by looking into adding events to some other elements on the page. For the sake of argument, let’s suppose you want to have an event happen every time a link is clicked. Combining this with what we learned above, this would be the way to go about it:

addEvent(window, "load", function () {
  var links = document.getElementsByTagName("a");
    for (var i=0; i<links.length; i++) {
      addEvent(links[i], "click", function () {
        alert("NOPE! I won't take you there!");

        // This line's support added through the addEvent function. See below.
      evt.preventDefault(); 
    });
  }
});

Ok, what just happened? First we used the onload event to check when the web page had completely loaded. Then we found all the links in the page by using the getElementsByTagName method of the document object. With an established reference to them, we looped through all links and applied an event to them to cause an action to occur once they were clicked.

But what about the cheeky “won’t take you there” part? After the alert has been shown, the line below reads return false. This means that within that context, returning false prevents the default action. We’ll get into other ways to dictate how events behave in the last section of this article.

Event object references

To add more detail to your event handling, you can take different actions depending on certain properties of the event that took place. For instance, if you are dealing with an onkeypress, you might want the event to occur only if the user presses the enter key, but no other keys.

As with the event model, Internet Explorer has decided to use a global event object called event for handling objects, while the W3C-recommended way implemented by all other web browsers is passing event objects belonging just to that specific event. The most common problem with implementing such functionality across browsers is getting a reference to the event itself, and a reference to the element that the event is targeting. This code solves that for you:

addEvent(document.getElementById("check-it-out"), "click", eventCheck);
function eventCheck (evt) {
  var eventReference = (typeof evt !== "undefined")? evt : event;
  var eventTarget = (typeof eventReference.target !== "undefined")? eventReference.target : eventReference.srcElement;
}

The first line in the eventCheck function checks if there’s an event object passed along to the function. If yes, it automatically becomes the first parameter of the function, hence getting the name evt in this example. If it doesn’t exist, meaning that the current web browser is Internet Explorer, it refers to a global property of the window object named event.

The second line looks for a target property on the established event reference. If it doesn’t exist, it falls back to the srcElement property implemented by Internet Explorer.

Note: this control and behavior is also addressed with the above referenced addEvent function, where the event object has been normalized to work the same in all web browsers. The above code is written out as if this is not the case, though, to give you an insight into web browser differences.

Checking an event-specific property

Let’s put this into action. The following example executes a different code block depending on what key was pressed:

addEvent(document.getElementById("user-name"), "keyup", whatKey);
function whatKey (evt) {
  var eventReference = (typeof evt !== "undefined")? evt : event;
  var keyCode = eventReference.keyCode;
  if (keyCode === 13) {
    // The Enter key was pressed
    // Code to validate the form and then submit it
  }
  else if (keyCode === 9) {
    // The Tab key was pressed
    // Code to, perhaps, clear the field
  }
}

The code inside the whatKey function checks a property on the event that took place, namely keyCode, to see which key was actually pressed on the keyboard. The number 13 means the Enter key and the number 9 means the Tab key.

Event defaults and event bubbling

There are a number of cases where you would be interested in stopping the default behavior of an event. For instance, you might want to prevent the user from submitting a form if certain fields aren’t filled out. The same goes for event bubbling, and this part will explain how you can take control of such situations.

Preventing the default behavior of events

Just as with event model and event object differences, there are two ways to go about this to support IE, and all other browsers. Building on the previous code for getting an event object reference, the next listing includes code to stop the default link behaviour occuring when links are clicked:

addEvent(document.getElementById("stop-default"), "click", stopDefaultBehavior);
function stopDefaultBehavior (evt) {
  var eventReference = (typeof evt !== "undefined")? evt : event;
  if (eventReference.preventDefault) {
    eventReference.preventDefault();
  }
  else {
    eventReference.returnValue = false;
  }
}

This approach uses something called object detection, to confirm that a method is actually available before it is called, which helps prevent possible errors. The preventDefault method is available in every web browser but Internet Explorer, and it prevents the default action of an event from happening.

If that method isn’t supported, it falls back to setting the returnValue of the global event object to false, thus stopping the default behaviour in Internet Explorer.

Stopping event bubbling

Consider the following HTML hierarchy:

<div>
  <ul>
    <li>
      <a href="http://www.opera.com/">Opera</a>
    </li>
    <li>
      <a href="http://www.opera.com/products/dragonfly/">Opera Dragonfly</a>
    </li>
  </ul>	
</div>

Suppose you had applied an onclick event to all the a elements, li elements and the ul element. The onclick event would first call the event handler of the link, then the list items, and finally the event handler of the unordered list.

If the user clicks the link, most likely, you don’t want to call any possible event handler for the parent li element, but instead just let the user navigate to the corresponding page. However, if the user clicks the li item beside the link, you might want to trigger an event handler for the li as well as the ul element.

Note that with the DOM level 2 Event Model and useCapture enabled, ie using event capturing, it would start with the unordered list, then the list item and finally the link. However, since event capturing isn’t an option in Internet Explorer, this functionality is very seldom used in real practice.

Here’s how to write code to stop the bubbling of an event:

addEvent(document.getElementById("stop-default"), "click", cancelEventBubbling);
function cancelEventBubbling (evt) {
  var eventReference = (typeof evt !== "undefined")? evt : event;
  if (eventReference.stopPropagation) {
    eventReference.stopPropagation();
  }
  else {
    eventReference.cancelBubble = true;
  }
}

Complete event handling example

I have put together an example page showcasing adding an event handler and preventing that event’s default action, depending on certain criteria. The event handler checks whether a form is allowed to be submitted or not depending on if the user has filled out all fields. The JavaScript code is as follows:
addEvent(window, "load", function () {
  var contactForm = document.getElementById("contact-form");
  if (contactForm) {
    addEvent(contactForm, "submit", function (evt) {
      var firstName = document.getElementById("first-name");
      var lastName = document.getElementById("last-name");
      if (firstName && lastName) {
        if (firstName.value.length === 0 || lastName.value.length === 0) {
          alert("You have to fill in all fields, please.");
          evt.preventDefault();
        }
      }
    });
  }
});

Summary

I have merely scratched the surface of event handling in this article, but I hope you have gained a good understanding of how events work. I might have been a little hard on you with web browser inconsistencies, but my belief is that it’s very important to know these issues from the start.

Once you have accepted these issues and learned to master the solutions above, there’s no end to the possibilities you can achieve with JavaScript and event handling!

Exercise questions

  • What is an event?
  • What’s the difference between event capture and event bubbling?
  • Is it possible to control the execution of an event, ie stopping the default behavior. How?
  • What’s the main problem with the attachEvent and scope, which triggered a JavaScript web community contest?
2009/09/08 14:32 2009/09/08 14:32
Posted
Filed under Linux

sendmail 구동시 권한 설정
chmod go-w / /etc /etc/mail /usr /var /var/spool /var/spool/mqueue
chown root / /etc /etc/mail /usr /var /var/spool /var/spool/mqueue


본 자료 출처 : http://www.kjist.ac.kr/new/com-services/manual/manual_02.html





1. 자료 받기






2. 압축을 풉니다.




    shell> gzip -cd sendmail-8.10.1.tar.gz |tar xvf -



3. 문서 확인




    README Sendmail 에 대한 소개와, 각 디렉토리 내용소개. 유의할 점.
    INSTALL 설치방법에 대한 개괄.
    FAQ 자주 물어보는 질문들.
    RELEASE_NOTES 새로운 버젼이 나올 때마다 추가되는 사항에 대한 정보.
    KNOWNBUGS 알려진 버그에 대한 정보.



4. 컴파일




    shell> cd sendmail sendmail-8.10.1
    shell> sh Build --> sendmail compile
    shell> /etc/rc.d/init.d/sendmail stop shell> cd cf/cf --> cf/cf 디렉토리로 이동

cf/cf 디렉토리에서, generic-osname_version.mc 와 같은 형식의 file 들 중 , 자신의 os name 과 version에 가장 가까운 것을 선택하여 config.cf 로 복사한다.
(참고: % uname -a 명령으로 자신의 os 종류를 알수 있다. )

    shell> cp generic-linux.mc sendmail.mc shell> vi sendmail.mc
    shell> sh Build sendmail.cf -> sendmail.mc 를 바탕으로 sendmail.cf 를 만든다
sendmail.cf 와 컴파일된 sendmail 을 설치하기 전에, 만일을 대비해 이전에 사용하던sendmail 과 sendmail.cf 를 다음과 같이 다른곳에 복사해둔다.
    shell> cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.8.9.3 shell> cp /usr/lib/sendmail /usr/lib/sendmail.8.9.3
참고: OS 에 따라서, sendmail.cf 와 sendmail 의 위치가 다를수 있다. 일반적으로 sendmail.cf 는 /etc /etc/mail sendmail 은 /usr/sbin /usr/lib 등에 위치한다.
    shell> cp sendmail.cf /etc/mail/sendmail.cf shell> cd ../../sendmail shell> sh Build install
다음은 makemap 디렉토리로 이동하여 makemap 을 설치하는 과정이다. newaliases 등의 명령어로 aliases 등의 db file 들을 갱신할때 필요하다. sendmail 을 실행할때, "class hash not available" 등의 에러메세지가 나온다면, 대부분 makemap 의 문제로 makemap 을 새로 설치할 필요가 있다.
    shell> cd ../makemap shell> sh Build --> makemap 설치를 위한 컴파일
    shell> sh Build installshell> cd /etc/mail shell> touch access relay-domains
access파일은 spam relay를 IP나 HOSTNAME으로 제어하기 위하여 생성된 것이며
relay-domain은 domain name별로 제어하기 위해서다.
    shell> vi /etc/mail/local-host-names abc
    abc.domainname.com
    localhost
    shell> /usr/sbin/makemap hash access < access shell> chmod go-w / /etc /etc/mail /usr /var /var/spool /var/spool/mqueue shell> chown root / /etc /etc/mail /usr /var /var/spool /var/spool/mqueue shell> newaliases shell> /usr/lib/sendmail -bi --> 제대로 설치되었는지 확인. /etc/mail/aliases: 3 aliases, longest 10 bytes, 52 bytes total
만일, /etc/sendmail.cf 를 찾는 err 가 나오면
    shell> ln -s /etc/mail/sendmail.cf /etc/sendmail.cf shell> /etc/rc.d/init.d/sendmail start



<sendmail 설정하기>

Sendmail에서 가장 중요하고도 어려운 부분이 sendmail.cf 파일의 설정입니다. O’Reilly사에서 Sendmail에 대한 전문서적이 나올 정도로 방대하고 다양한 기능을 가지고 있으며 사용법도 매우 다양합니다. Sendmail을 사용하기 위해 기본적으로 알아야 할 설정 파일들에 대해 살펴보겠습니다.





1. /etc/sendmail.cf
Sendmail의 가장 중요한 설정파일로 /etc 또는 /etc/mail 디렉토리에 자동으로 설치되어 있습니다. Sendmail.cf에 대한 자세한 내용은 Bryan Costales 와 Eric Allman이 집필한 O’Reilly의 Sendmail을 참고하십시요. 여기서는 간단히 메일서버를 관리하기 위한 몇 가지 설정에 대해서만 다루겠습니다.

    Fw/etc/mail/local-host-names

메일을 수신할 호스트 이름을 명시한 파일의 위치를 설정합니다.

    FR-o /etc/mail/relay-domains

relay-domains파일에는 Relay를 허용할 호스트의 이름을 설정합니다. 주석으로 처리하면 모든 IP에 대해서 Relay가 허용되므로 스팸메일과 같은 문제가 발생할 수도 있으므로 주의하시기 바랍니다.

    DnMAILER-DAEMON

Sendmail 서버가 에러메시지를 보내야 할 경우 보낸 사람의 이름을 결정합니다. 잘못된 메일이 되돌아 온 경우 FROM : Mail Delivery Subsystem <MAILER-DAEMON>과 같은 메시지를 보신적이 있을 것입니다.

    Kaccess hash /etc/mail/access

Relay를 허용하거나 거부할 특정 IP와 도메인을 설정하는 파일입니다. relay-domains보다 사용이 편리하므로 많이 사용됩니다.

    O ForwardPath=$z/.forward.$w:$z/.forward

여러 개의 메일을 가진 경우, 특정 메일계정으로 들어온 메일을 다른 메일로 곧바로 보내주는 포워딩 파일을 설정합니다.

사용자의 홈 디렉토리에 .forward라는 파일을 만들고 포워딩시킬 메일 주소를 입력하면 됩니다.

    # O MaxMessageSize=1000000

메일의 최대 크기를 결정합니다. 주석을 제거하면 설정한 크기(Byte단위)보다 큰 메일은 전송할 수 없게 됩니다. 지금 써준 1000000은 1메가로 제한한 메일 용량입니다.

    O QueueDirectory=/var/spool/mqueue

큐 디렉토리를 설정합니다.

    O Timeout.queuereturn=5d

메일을 보내려는 호스트에 문제가 생기면 메일은 큐 디렉토리에 저장됩니다. Sendmail 서버는 쌓인 메일을 상대방 호스트에 보내기 위해 주기적으로 접속을 시도하며, 일정한 기간이 지나면 메일을 다시 발송한 사람에게 되돌려 보냅니다. Sendmail이 메일을 보내려고 시도하는 기간을 설정하는 옵션으로 5d는 5일을 의미합니다.

    O Timeout.queuewarn=4h

큐 디렉토리에 쌓인 메일이 지정한 시간안에 전송되지 못할 경우 메일을 보낸 사람에게 경고 메일을 보냅니다. 기본값은 4h로 4시간안에 전송되지 못하면 보낸 사람에게 경고의 메일을 보냅니다.

Mlocal, P=/usr/bin/procmail, F=lsDFMAw5u:/|@qSPfhn9, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL,
T=DNS/RFC822/X-Unix,
A=procmail -Y -a $h -d $u

사용자계정에 대문자가 있는 경우에도 메일을 받을 수 있도록 설정하려면 Mlocal로 시작하는 부분을 찾아 F= 부분에 'u'를 추가합니다.



 2. /etc/mail/access
 




스 팸메일을 방지하기 위해 Relay를 허용할 호스트의 IP와 도메인을 설정하는 매우 중요한 파일입니다. 먼저 vi에디터나 emacs를 사용해 /etc/mail/access파일을 열고 릴레이를 허용하거나 거부할 IP 주소를 아래와 같이 입력합니다.

203.243.88      RELAY -> 203.243.88 네트워크에 속하는 C클래스의 IP주소에 대해서는 메일을 [보내기/받기]를 할 수 있지만 다른 IP주소에서는 메일을 받을 수만 있습니다.

spam.com      REJECT -> spam.com 도메인에 속한 모든 호스트에서 오는 메일은 완전히 거부됩니다.
이와 같이 설정한 후에는 아래의 명령으로 DB파일(access.db)을 만들어 줍니다.

    # cd /etc/mail
    # makemap hash access < access

위의 작업은 access 파일을 수정할 때마다 해주어야 하며, Sendmail을 다시 시작할 필요는 없습니다.

[Relay에 대하여]
그럼 간단하게 Relay에 대한 개념을 알아보겠습니다.

예를 들어 A라는 사람은 IP주소가 203.243.88.21이라는 컴퓨터에서 aroma@mail.linuxul.com이라는 메일을 사용한다고 가정하고, B라는 사람은 IP주소가 168.211.106.34인 컴퓨터에서 nea@yahoo.co.kr 이라는 메일을 사용한다고 가정합니다.

B가 A에게 메일을 보내면 메일은 203.249.88.21로 가는 것이 아니라 mail.linuxul.com서버의 /var/mail 디렉토리 밑에 aroma라는 파일로 복사가 됩니다. 그러면 A는 MUA 프로그램을 사용해 메일을 확인할 수 있지요. 그런데 여기서 중대한 문제점이 생겨나게 됩니다. 아무나 주소를 맞게 보내면 그냥 /var/mail에 쌓이게 되는 것이죠. 그래서 하드디스크가 메일로 꽉 차버리거나, 네트워크 전송량의 증가로 네트워크가 마비되는 경우가 생겨나게 됩니다. 이 문제를 막기 위해서 고안된 방법이 바로 Relay라는 방법입니다.

Relay에는 두 가지 방식이 있습니다.

    o 첫 번째는 메일을 보내는[송신] 컴퓨터의 제한
    o 두 번째는 메일을 받는[수신] 컴퓨터의 제한

Relay로 주로 쓰이는 방법은 메일을 확인하는 컴퓨터는 제한하지 않고 메일을 보내는 것을 제한하는 것입니다. 즉, 위의 그림과 같이 /etc/mail/access파일에 203.243.88의 C클래스를 허용 가능하게 해주면 203.243.88.21 처럼 허용 그룹에 들어 있는 컴퓨터에서는 메일을 보내고/받을 수가 있지만, 그룹에 들지 않은 168.211.106.34 라는 컴퓨터에서는 메일을 확인할 수만 있습니다. 또한 spam.com이라는 도메인에 속한 호스트에서 오는 메일 은 보내기와 받기가 모두 거부됩니다.
/etc/mail/relay-domains을 사용해도 됩니다. 하지만, 차이점은 relay-domains을 사용하면sendmail데몬을 다시 실행시켜 주어야 하지만 /etc/mail/access파일을 사용하면 다시 실행할 필요 없이 makemap hash /etc/mail/access < /etc/mail/access라고 실행만 시켜주면 됩니다.




3./etc/mail/local-host-names
 




메일을 수신할 호스트의 이름을 입력하는 파일로, Sendmail 8.9.x 버전이하에서 사용되었던 sendmail.cw 파일의 명칭이 Sendmail 8.10.x 버전부터는 local-host-names로 변경되었습니다. Sendmail 서버는 이곳에 적힌 호스트 의 이름으로 메일이 들어오면 더 이상 다른 서버로 메일을 보내지 않고 자신의 메일박스에 저장합니다. 아래와 같이 메일서버의 호스트이름을 입력하거나 여러 개의 가상호스트를 사용한다면 모두 입력해야 합니다.




4. /etc/aliases
 




특정 사용자에게 온 메일을 다른 사람에게 보내주거나, 메일링리스트를 작성해야 하는 경우에 사용되는 파일로 보안에 주의하여 사용해야 합니다. aliases 파일을 열어보면 시스템 계정들이 아래와 같이 root로 alias되어 있습니다.
또한 특정 사용자를 다른 사용자로 alias 시킬 수도 있습니다.




5. 메일링 리스트 작성하기
 




메일링리스트란 동일한 메일을 여러 사람에게 보내야 할 경우 사용되며, 그룹을 지정해 구성원들의 목록을 써주거나 특정 파일을 지정하는 방법 등으로 사용됩니다. 예를 들어 aroma, bulpeng, bibi와 같은 사용자들을 test1라는 그룹으로 지정해 보겠습니다.

vi편집기로 /etc/aliases 파일을 열고 아래의 라인을 추가한 후 저장합니다. 앞으로 test1에게 메일을 보내면 지정된 모든 사용자들에게 메일이 도착하게 됩니다.

    test1: aroma, bulpeng, bibi
다른 하나는 특정파일을 지정해 주는 방법으로 include 지시자를 사용한 후에 파일의 경로와 파일이름을 입력합니다.

    test2: :include:/etc/maillist/test2

    # cat /etc/maillist/test2
    aroma
    bulpeng
    bibi


파일을 수정한 후에는 newaliases 명령으로 aliases.db를 만들어 줍니다

    .# newaliases
    /etc/aliases: 40 aliases, longest 28 bytes, 434 bytes total

이제 test1 또는 test2로 메일을 보내면 지정된 사용자들(aroma, bulpeng, bibi)이 모두 메일을 받아볼 수 있습니다.



< MAIL Server에서의 한글 지원문제>
 




메일에서 사용되는 SMTP프로토콜은 기본적으로 7bit문자만을 기반으로 제작되었습니다. 하지만 한글의 경우 EUC-KR로 표현하면 8bit를 사용하기 때문에 문제가 생길 수 있습니다. 따라서 메일에서 사용하기 위해 한글의 7bit 표현방법인 ISO-2022-kr(RFC 1557)이 만들어 졌고 메일의 본문에 사용되었습니다(헤더에는 EUC-KR을 B나 Q인코딩 방법으로 인코딩해서 사용했습니다.).

하지만 대부분의 프로그램에서는 한글을 8bit표현방법인 EUC-KR을 사용했으므로 이 두 표현간의 변환을 해 주는 프로그램이 필요했습니다. 이 작업은 크게 MTA, MDA, MUA에서 해 줄 수 있습니다. MTA에서 변환을 해 주는 대표적인 프로그램이 sendmail 8.6.12h2입니다. 이 프로그램은 프로그램으로부터 8bit표현을 입력으로 받아서 다른 곳으로 전송할때 ISO-2022-kr로 변환한 후 전송을 하고, 네트웍을 통해 받은 ISO-2022-kr로 표현된 메일을 EUC-KR로 변환 후 메일박스에 저장하도록 만들어 졌습니다. 그래서 몇년전까지만 해도 대부분의 메일서버에서 sendmail 8.6.12h2를 사용했었습니다.

하지만 SMTP 프로토콜이 8bit문자를 지원하는 ESMTP 프로토콜로 변하면서 본문에서도 ISO-2022-kr대신에 EUC-KR을 사용하도록 표준이 바뀌었습니다. 하지만 이 안을 정식 표준으로 공표하지 않았고, 아직까지 인터넷에는 ISO-2022-kr 로 표현된 메일이 돌아다니기 때문에 이 메일을 EUC-KR로 변환해 주는 작업이 추가적으로 필요하게 되었습니다.

ISO-2022-kr을 EUC-KR로 변환해 주는 프로그램들은 UNIX환경에서는 많이 만들어 졌습니다. hconv와 hmconv가 대표적인 프로그램입니다. 이제 관리자가 해 줘야 하는일은 sendmail이 받은 메일을 메일박스로 저장하기 전에 이 프로그램을 통과하게 만들어서 ISO-2022-kr을 EUC-KR로 변환만 해 주면 되게 되었습니다. 이렇게 필터링을 가능하게 해 주는 대표적인 프로그램이 procmail입니다.

여기에서는 procmail을 이용하여 한글 메일을 처리하는 과정을 설명드리겠습니다. 여기에서 알아두셔야 할 내용중에 중요한 내용으로 MDA에 대한 이해입니다. MDA(Mail Delivery Agent)는 MTA(Mail Transfer Agent, 대표적인 예는 sendmail입니다.)

가 받은 메일의 최종적인 도착지가 현재 호스트인경우(sendmail의 경우 sendmail.cw를 참고하여 결정합니다.) 메일을 MDA에게 넘겨줍니다. 보통 시스템의 기본적인 MDA는 /bin/mail입니다. procmail은 /bin/mail대신에 사용할 수 있는 프로그램으로 필터링 기능이 강력하여 한글처리에 이용할 수 있습니다.
또 잘못 이해하시는 분들중에 procmail자체가 한글 디코딩을 해준다고 알고 계신분들이 많습니다. 이것은 잘못된 것입니다.
실제로 procmail도 한글 디코딩을 위해 다른 프로그램(보통 hcode나 hmconv를 이용합니다.)을 이용합니다. procmail이 하는일은 단순히 어떤 헤더가 있을때 적당한 프로그램을 불러 한글 디코딩을 해 줍니다.

따라서 procmail뿐만 아니라 한글 디코딩을 위한 프로그램을 설치하셔야 합니다. 여기에서는 hcode를 사용하도록 하겠습 니다.

hcode는 ftp://ftp.kaist.ac.kr/hangul/code/hcode/에서 구할 수 있습니다.
가져온 프로그램을 적당한 디렉토리에 풀고 소스 디렉토리에서 단순히 make를 입력하면 컴파일이 완료됩니다. 컴파일 결과로 생긴 hcode를 /usr/local/bin 에 복사해 둡니다.(다른 디렉토리도 상관없습니다.)

그다음 procmail을 설치합니다. procmail은 대부분의 ftp서버에서 구할 수 있습니다.
프로그램을 구한 후 디렉토리에서 make를 입력한 후 메시지에 나온대로 대답하면 설치할 수 있습니다. 만들어진 procmail을 역시 /usr/local/bin에 설치합니다.

그런다음 /etc/procmailrc을 만들어 환경설정을 해준후 sendmail이 MDA로 procmail을 사용할 수 있도록 sendmai.cf를 적절하게 수정합니다.

%% 일반적으로 PC의 MUA(Mail User Agent)로 사용되는 프로그램인 Microsoft outlook, Netscape messenger이 한글처리를 자동으로 해주므로 유닉스 시스템용 MUA프로그램인 Mutt나 elm을 사용하지 않은 한 한글 메일을 송, 수신한데 불편은 없습니다. 




2009/09/02 17:40 2009/09/02 17:40
Posted
Filed under Linux
/etc/sysconfig/network-scripts/ifcfg-eth0  열어서
ONBOOT=no  되어 있는 것을 yes로  수정 한다.
2009/08/31 15:53 2009/08/31 15:53
Posted
Filed under Link

1. / 파티션의 용량이 거의 없어 증설을 해야 함.

2. 늘어나는 디렉토리는 /home 과 /usr 임

3. /var 의 용량을 너무 과다하게 잡음 (다른 쪽으로 돌리거나 합쳤으면 함)


하드를 구매하신다고 하셨으니 /dev/sdb 로 붙겠죠. (/dev/hda, hdb로 붙을수도 있고)

/dev/sdb로 붙는 가정하에 설명을 드리겠습니다.


일단은 하드를 붙이는 작업 해야겠죠.


PART 1. disk 추가 작업


1. computer의 전원을 끈다. (init 0, or # poweroff)

2. disk를 slave (jumper 조절)로 두고 케이블 연결한다.

3. 전원을 켠다.

4. # fdisk -l 로 보면 /dev/sdb (or hda, hdb)등으로 붙은 것을 확인하실 수 있습니다.


PART 2. 파티셔닝 작업


개요. 이 부분이 문제가 되는데요. 생각해 봐야 할 것이 새로 붙인 파티션을 어디다가

둘 것인가가 문제가 될 것입니다. 새로 하드 디스크를 만드시는 것이니 아마 못해도

20~ 30기가 정도는 되는 하드 디스크라 생각됩니다.

제가 만일 같은 시스템에 구성을 하게 된다면 새로 생성하는 디스크에 3개의 파티션을

두겠습니다. /home, /usr, /var

이렇게 두고 지금 있는 20기가의  (/var) 공간은 백업으로 두면 어떨까 싶습니다.

다른 방법은 저 20기가 부분을 /home으로 둘수도 있는데 그건 잠시 후에 설명을 드리겠습니다.


1. 디스크 파티셔닝을 합니다. (가정 : /home = 20G, /usr= 20G로 잡음, 물론 사이즈 변경 가능)

# fdisk /dev/sdb

Command (m for help): p (화면에 파티션 내용이 표시됩니다. 하나도 없기 때문에 아무 내용도 없습니다. 만일 있다면 지워 줍니다.)

Command (m for help): n (새로 공간을 추가합니다.)

Command action
   e   extended
   p   primary partition (1-4)

p 를 입력합니다. (기본 파티션에 할당해야 합니다. )

Partition number (1-4): 1 (첫번째 파티션에 할당합니다. )

First cylinder (1-29660, default 1):  (1번 실린더부터 시작입니다. default가 1이라 그냥엔터입력)

Last cylinder or +size or +sizeM or +sizeK (1-29660, default 29660): +20g  (+20g라고 입력하고 엔터를 칩니다.) 20기가 용량을 사용하겠다는 이야기입니다.)

다시 p로 확인해 보면 20기가가 생성이 된 것을 보실 수 있습니다.


이런 식으로 다른 파티션도 잡아 줍니다.

지금 생성하고자 하는 볼륨은 3개 입니다. (/home, /usr, /var)

따라서 primary 파티션에 3번까지 쓸 수 있습니다.

모든 파티션을 primary로 사용한다면 4개까지밖에 생성할 수 없습니다.

만일 디스크 용량이 많아 더 많은 파티션을 추가로 할 수 있다면 3번 primary 이후에 4번을 extention으로 주셔야 합니다. (그래야 16개까지 사용할 수 있습니다.)


파티셔닝이 되었고 disk가 /dev/sdb1 = 20g, /dev/sdb2=15g, /dev/sdb3=5g 정도로

잡혀 있다고 가정을 합니다.


2. 포맷


리눅스에서 사용하기 위해서 포맷을 합니다.

# mkfs.ext3 /dev/sdb1

# mkfs.ext3 /dev/sdb2

# mkfs.ext3 /dev/sdb3


PART 3. 디스크 복사 작업


일단 /home 부터 작업을 합니다.


1. mkdir /home2   // (처음 20기가를 마운트해서 copy할 공간을 만들어 줍니다.)

2. mount  -t ext3 /dev/sdb1 /home2  // (ext3로 포맷된 디스크 볼륨 sdb1을 /home2에 마운트)

3. df -h 로 확인해 보시면 마운트 되어 있는 것을 확인하실 수 있습니다.

4. copy 작업

# cp -aruv /home/*  /home2/     // (홈 디렉토리 밑에 있는 모든 파일과 디렉토리들을 권한을 유지하여 /home2 밑으로 복사합니다.)

5. 이름 변경 작업

# mv /home  /home_bak      // ( /home2를 /home으로 옮기기 위해 기존에 있는 /home을 변경합니다.)

6. # mv /home2 /home     // (home2디렉토리를 /home으로 변경합니다.)

7. 이제 부팅해도 자동으로 마운트를 시키기 위해 /etc/fstab에 등록해 줍니다.

# vi  /etc/fstab

 /dev/sdb1               /home            ext3    defaults        1 1 요렇게 한줄 추가시켜 줍니다.

이렇게 하면 부팅 후에도 /home은 자동으로 올라오게 됩니다.

2009/08/31 14:43 2009/08/31 14:43
Posted
Filed under Action Script
function _check():Boolean{
 var retval:Boolean=false;
 //정답의 단어가 문장에 포함 되어 있는지 비교
 var temp:String="";
 for(var i:Number=0; i<_global.troot.tbox.txt.text.length; i++){
    _temp = _global.troot.tbox.txt.text.substr(i,_result[_global.troot.id].length);
   
  if(_temp ==_result[_global.troot.id] ){
   _global.troot.temp[_global.troot.id] =_global.troot.tbox.txt.text;
   retval =true;
   break;
  }
 }
 return retval;
}
2009/08/27 19:51 2009/08/27 19:51
Posted
Filed under music
cristia aguilera


[원본] http://www.jango.com/music/Katy+Perry?l=0 

Decades: 1990's and 2000's

After Britney Spears, Christina Aguilera was the most popular female singer of the late-'90s teen pop revival. Unlike many of her contemporaries, Aguilera was a technically skilled singer with a genuinely powerful voice, belting out her uptempo dance numbers and ballads with a diva's panache. Born Christina Maria Aguilera on December 18, 1980, on Staten Island, her parents were of Irish and Ecuadorian stock and her father's military career meant the family moved quite a bit during her childhood. They eventually settled in Pittsburgh, PA, where Aguilera began performing in talent shows at age six, with considerable success. She appeared on Star Search in 1988 (though she didn't win) and in 1992 joined the cast of the Disney Channel's The New Mickey Mouse Club, which also included Spears, future *NSYNC members Justin Timberlake and JC Chasez, and Felicity star Keri Russell.

After two years, Aguilera moved to Japan, where she recorded the hit duet "All I Wanna Do" with pop star Keizo Nakanishi. Returning to the U.S. in 1998, Aguilera recorded the song "Reflection" for Disney's Mulan; her performance helped earn her a record deal with RCA. Her self-titled debut album was released in the summer of 1999, and with teen-oriented dance-pop all the rage, the lead single "Genie in a Bottle" shot to the top of the charts for five weeks; the album also hit number one on its way to sales of over eight million copies in the U.S. alone. The follow-up, "What a Girl Wants," was the first number one single of the year 2000 and Aguilera consolidated her near-instant stardom by performing at the White House Christmas gala and the Super Bowl halftime show, and winning a Grammy for Best New Artist. Further hits followed in "I Turn to You" and another number one, "Come on Over Baby (All I Want Is You)."

In September 2000, seeking a place in that year's Latin pop boom, the part-Ecuadorian Aguilera recorded a Spanish-language album called Mi Reflejo, learning the lyrics phonetically since she didn't speak Spanish. It was followed quickly by the holiday album My Kind of Christmas; both sold extremely well, a testament to Aguilera's popularity. In the spring of 2001, Aguilera was featured -- along with Pink, Mya, and Lil' Kim -- on the chart-topping blockbuster remake of Patti LaBelle's "Lady Marmalade" featured on the Moulin Rouge soundtrack. Aguilera was by now a fixture at music industry awards shows; as she enjoyed her celebrity, a collection of old demos -- recorded when she was 14 and 15 -- was released under the title Just Be Free, despite Aguilera's vehement objections.

Aguilera attempted to deter the mass media's expectations when she issued her second studio album in fall 2002. Stripped, which appeared in October on RCA, was quickly criticized for its adult yet confident approach. Aguilera's look had gone from glossy to gritty. She appeared topless on the cover of the album and went nude for a fall issue of Rolling Stone. Debut single "Dirrty" revealed her new sexual power and became a chart smash, while "Beautiful" showed her softer side. For her next record, however, Aguilera split from producer Scott Storch and went to work with DJ Premier and Linda Perry, among others, for the 2006 Back to Basics, which debuted at number one on the Billboard 200. The album, a two-disc set that explored her influences, mainly '20s, '30s, and '40s jazz and blues in the style of Etta James or Billie Holiday, portrayed a more mature -- yet at the same time provocative -- singer. The popular single "Ain't No Other Man" won Aguilera the fourth Grammy Award of her career, and she spent much of the following year on the road, releasing the Back to Basics: Live and Down Under concert DVD to document the tour in late 2007. ~ Steve Huey, All Music Guide

2009/08/25 13:11 2009/08/25 13:11
Posted
Filed under Link
http://www.jango.com

무료로 음악을 들을 수 있으며, 다운로드는 불가능.
flashplay 로 음악 링크가 된다.
2009/08/25 12:57 2009/08/25 12:57
Posted
Filed under music
2009/08/20 20:24 2009/08/20 20:24
Posted
Filed under etc
2009/08/20 20:22 2009/08/20 20:22