반응형

CentOS(리눅스)를 운영중인 장비에 하드디스크 등 저장장치를 추가 하면

 

디스크를 이용하기 위해서 다음과 같은 작업을 해줘야 합니다.

 

디스크 설치 후

fdisk –l 을 이용해서 디스크 정보를 확인합니다.

새로 설치된 디스크는 파티션 정보가 없습니다.

 

디스크 정보를 확인 했으면 fdisk 를 실행 합니다.

fdisk <장치명> (예 : fdisk /dev/sdb)

 

fdisk 메뉴를 확인하고 싶으시면 m을 입력하시면 됩니다.

 

p를 입력해서 파티션 정보를 확인합니다.

파티션이 없는 것을 확인 할 수 있습니다.

n 을 입력하면 파티션을 새롭게 만들 수 있습니다.

n을 누르면 두개의 메뉴가 나옵니다.

e(extended) 확장 파티션과, p(primary partition) 주파티션을 선택 할 수 있습니다.

주로 사용하는 주 파티션을 선택하고 partition number 는 첫번째 파티션 이니까 1번을 선택했습니다.

파티션넘버 다음에는 파티션의 크기를 설정할 수 있습니다. 용량으로 나오지가 않고

Cylinder 크기로 나옵니다. 시작 점과 종료 점을 선택해 주면 됩니다.

디스크 전체를 하나의 파티션으로 설정하는 경우에는 엔터, 엔터 로 진행하셔도 됩니다.

파티션 사이즈까지 설정 완료 하였으면, w를 눌러 정보를 저장합니다.

 

파티션 설정이 끝났으면 원하는 파일 형식으로 파티션을 포맷합니다.

Ext4 형식의 경우에는 아래와 같습니다.

mkfs.ext4 <디스크명> <예 : mkfs.ext4 /dev/sdb1>

 

포멧이 완료 되면 해당 파티션을 마운트 합니다.

 

마운트 방법은

mount –t ext4 /dev/sdb1 /data

mount –t <파일시스템형식> <파티션명> <마운트할위치> 입니다

 

부팅시에 자동으로 마운트를 되게 하기 위해서는 /etc/fstab을 수정해 저야 합니다.

Centos 6.3부터는 fstab 마운트에 UUID를 이용하고 있습니다.

UUID를 확인하기 위해서는 blkid 명령어를 이용하거나

ls –l /dev/disk/by-uuid 를 통해서 확인 하실 수 있습니다.

 

UUID를 확인한 후에 fatab을 열어 마운트할 내용을 추가해 줍니다.

Vi /etc/fatab

UUID = 추가할 파티션의 UUID <마운트할위치> ext4 defaults 1 2

 

 

 

출처 : http://itisyo.tistory.com/entry/CentOS-%EC%A0%80%EC%9E%A5%EC%9E%A5%EC%B9%98HDD-%EC%B6%94%EA%B0%80-%ED%95%98%EA%B8%B0

반응형
반응형

While trying to run a yum update I received the below warning message:

 

Setting up Install Process
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
--> Running transaction check

 

To resolve this yum-complete-transaction is required to complete the unfinished transactions.

 


yum-complete-transaction is a program which finds incomplete or aborted yum transactions on a system and attempts to complete them. It looks at the transaction-all* and transaction-done* files which can normally be found in /var/lib/yum if a yum transaction aborted in the middle of execution.

If it finds more than one unfinished transaction it will attempt to complete the most recent one first. You can run it more than once to clean up all unfinished transactions.

 

 

Run the following to install yum-utils (which provides yum-complete-transaction), cleanup and finish the transactions.

yum install yum-utils
yum clean all
/usr/sbin/yum-complete-transaction --cleanup-only

 

Now yum commands can be run without the unfinished transactions warning.

yum update

Share this blog post on social media:

반응형
반응형

Just discovered how super simple it was to add some gz compression when for example providing JSON data from PHP.

All you need is regular output buffering with the ob_gzhandler as output callback.

// Fetch some data
$data = get_data();

// Turn on output buffering with the gzhandler
ob_start('ob_gzhandler');

// Output as normal
echo json_encode($data);

The cool thing is that it actually looks at what the browser accepts before doing anything.

Before ob_gzhandler() actually sends compressed data, it determines what type of content encoding the browser will accept (“gzip”, “deflate” or none at all) and will return its output accordingly. All browsers are supported since it’s up to the browser to send the correct header saying that it accepts compressed web pages.

Tried adding it for a text field with timezone auto-completing for example, and without this handler:

Content-Length    5517
Content-Type      application/json

With this handler:

Content-Encoding  gzip
Vary              Accept-Encoding
Content-Length    1775
Content-Type      application/json

Do like! 😆

반응형
반응형

 

 

ios app 을 웹 어플리케이션에서 킬때... 사파리에서는 안먹히는 것 해결

반응형
반응형

<p class="price display_custom{$product_custom}"><strike>{$disp_product_custom}</strike></p>

 

위 소스 추가 후 css 에

 

/* 소비자가 0원시 비노출 */

.display_custom { display:none; }

.display_custom0 { display:none; }

 

추가

반응형
반응형

jquery-ui 의 dialog close 버튼이 안보일때

bootstrap.min.js 와 스크립트 충돌로 인한것으로 해당 스크립트를 우선순위를 바꾸거나 제외하면 정상적으로 보인다.

반응형
반응형

var url_regex = /(http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w-.\/?%&=]*)?)/gi;
var email_regex = /([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi;

 

var string = "도메인은 http://www.huzy.net/ 이고 이메일은 root@yjhoon.com 입니다.";

 

var url_result = string.match(url_regex);

=> ["http://www.huzy.net/"]

 

var email_result = string.match(email_regex);

=> [root@yjhoon.com"]

 

 

result 값은 둘다 배열로 리턴되서 나옴 .

반응형
반응형

기본적으로 HttpSessionListener를 구현(Implements)하여 세션이 생성 되는 시점과 세션이 사라지는 시점을 가지고 올 수 있다.

세션을 생성 되는 시점에 DB나 특정 Static 변수에 세션 정보를 저장 하고 세션이 종료될 때 그 세션 정보를 지워 줌으로써

해당 세션의 중복 로그인을 막을 수 있으며 현재 접속중이 접속자 정보를 가지고 올 수 있다.

package com.moainfo.http.session;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

public class MoaSessionListener implements HttpSessionListener
{
 public void sessionCreated(HttpSessionEvent se)
 {
  HttpSession session = se.getSession();
  System.out.println("Create session : " + session.getId());
 }
 public void sessionDestroyed(HttpSessionEvent se)
 {
  HttpSession session = se.getSession();
  System.out.println("Close session : " + session.getId());
  
 }
}

 


출처 - http://definejava.net/


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


HttpSessionBindingListener vs HttpSessionListener

HttpSessionBindingListener 는 이 인터페이스를 임플리먼츠한 객체를 세션에 바인딩 시키거나 언바인딩 될때 이벤트가 발생합니다. 반면에 HttpSessionListener 인터페이스는 톰캣의 web.xml에 리스너로서 등록을 하면 해당사이트에서 세션이 생성될때 ,글구 소멸될때 발생합니다. 순수한 세션 카운팅을 할때 꼭 필요합니다. ^^;;


출처 - http://www.okjsp.pe.kr/seq/28283


반응형

+ Recent posts