SQL SERVER 2008


  1. 복구모델 확인

select DATABASEPROPERTYEX(‘디비명’, ‘Recovery’)

  1. 축소쿼리 실행

복구모델이 FULL 로 확인될 경우

alter database 디비명 set recovery simple

dbcc shrinkfile (로그파일의 논리적 이름, 10) : 로그파일을 10M로 줄임


  1. 복구모델 복귀

alter database 디비명 set recovery full


블로그 이미지

엘로드넷

,

email 주소 유효성 체크



Function EmailCheck(stremail)
emailpattern = "^[\w-\.]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]
{2,3}$"
if stremail = "" then 
RegExpEmail = false
else
dim regEx, Matches
Set regEx = New RegExp
regEx.Pattern = emailpattern
regEx.IgnoreCase = True
regEx.Global = True
Set Matches = regEx.Execute(stremail)

if 0 < Matches.count then
EmailCheck = true
Else
EmailCheck = false
end if
end if
End Function


'ASP' 카테고리의 다른 글

ASP 확장자 구하기  (0) 2015.04.18
블로그 이미지

엘로드넷

,
email주소 유효성 체크 :

$email = $_POST['email'];

if (trim($email)=='') { echo "이메일을 입력해 주십시오."; } else if (!preg_match("/([0-9a-zA-Z_-]+)@([0-9a-zA-Z_-]+)\.([0-9a-zA-Z_-]+)/", $email)) { echo "올바른 이메일 형식이 아닙니다."; } else { echo "올바른 이메일입니다."; }



블로그 이미지

엘로드넷

,
1. Jquery UI DatePicker 주말 선택 안하기 :

$(function() {

$('#datepicker').datepicker({ 

dateFormat: "yy-mm-dd",

regional: "ko",

beforeShowDay: function(date){

var day = date.getDay();

return [(day != 0 && day != 6)];

}

});


});





2. 특정요일만 선택하기 :


0 : 일요일

6 : 토요일



//아래 코드는 매주 화요일과 금요일만 선택가능


$(function() {

$('#datepicker').datepicker({ 

dateFormat: "yy-mm-dd",

regional: "ko",

beforeShowDay: function(date){

var day = date.getDay();

return [(day != 0 && day != 1 && day != 3 && day != 4 && day != 6)];

}

});

});




3. 특정일만 선택하기


$(function() {


//선택가능 날짜 

var availableDates = ["2015-01-01", "2015-01-13"];

function available(date) {

var thismonth = date.getMonth()+1;

var thisday = date.getDate();

if(thismonth<10){

thismonth = "0"+thismonth;

}

if(thisday<10){

thisday = "0"+thisday;

}

    ymd = date.getFullYear() + "-" + thismonth + "-" + thisday;


    if ($.inArray(ymd, availableDates) >= 0) {

        return [true,"",""];

    } else {

        return [false,"",""];

    }

}

$('#datepicker').datepicker({ 

dateFormat: "yy-mm-dd",

regional: "ko",

beforeShowDay: available 

});


});

블로그 이미지

엘로드넷

,

JSP 이미지 크기 측정

JSP 2015. 4. 18. 08:27

JSP 이미지 크기 측정

<%@page import=“java.awt.image.BufferedImage” %>
<%@page import=“javax.imageio.ImageIO” %>
<%@page imiport=“java.io.File” %>



String filename = "saved.jpg";
String realFolder = "";
String saveFolder = "filedata/" + filename;            //저장된 파일명
ServletContext scontext = getServletContext();
realFolder = scontext.getRealPath(saveFolder);

int width0 = 0;
int height0 = 0;
File file0 = new File(realFolder);
BufferedImage bi = ImageIO.read(file0);

width0 = bi.getWidth();            //가로크기
height0 = bi.getHeight();          //세로크기



int n_width = 0;
int n_height = 0;


//가로가 세로보다 큰 그림인 경우
if(width0 >= height0){

//가로가 160이상이면 160으로 조정
if(width0 >= 160){
n_width = 160;
n_height = height0*160/width0;
}else{
n_width = width0;
n_height = height0;
}

//세로가 가로보다 큰 그림인 경우
}else{

//세로가 210이상이면 210으로 조정
if(height0 >= 210){
n_width = width0*210/height0;
n_height = 210;
}else{
n_width = width0;
n_height = height0;
}
}

'JSP' 카테고리의 다른 글

이클립스+톰캣 사설인증서 eclipse + tomcat SSL 적용  (0) 2020.10.25
jsp 형변환  (0) 2015.04.23
JSP htmlspecialchars  (0) 2015.04.18
JSP 확장자 구하기  (0) 2015.04.18
블로그 이미지

엘로드넷

,

JSP htmlspecialchars

JSP 2015. 4. 18. 08:21

JSP htmlspecialchars



StringBuffer sb = new StringBuffer();

for(int i=0; i<content.length(); i++){

char c = content.charAt(i);

  switch (c) {

    case '<' : 

      sb.append("&lt;");

      break;

    case '>' : 

      sb.append("&gt;");

      break;

    case '&' :

      sb.append("&amp;");

      break;

    case '"' :

      sb.append("&quot;");

      break;

    case '\'' :

      sb.append("&apos;");

      break;

    default:

      sb.append(c);

}

}



'JSP' 카테고리의 다른 글

이클립스+톰캣 사설인증서 eclipse + tomcat SSL 적용  (0) 2020.10.25
jsp 형변환  (0) 2015.04.23
JSP 이미지 크기 측정  (0) 2015.04.18
JSP 확장자 구하기  (0) 2015.04.18
블로그 이미지

엘로드넷

,

JSP 확장자 구하기

JSP 2015. 4. 18. 08:19

JSP 확장자 구하기 : 


String filePath = "/www/test.jsp";
   int pos = filePath.lastIndexOf( "." );
   String fileExt = filePath.substring( pos + 1 );
   out.println("파일확장자는: "+fileExt);

'JSP' 카테고리의 다른 글

이클립스+톰캣 사설인증서 eclipse + tomcat SSL 적용  (0) 2020.10.25
jsp 형변환  (0) 2015.04.23
JSP 이미지 크기 측정  (0) 2015.04.18
JSP htmlspecialchars  (0) 2015.04.18
블로그 이미지

엘로드넷

,

ASP 확장자 구하기

ASP 2015. 4. 18. 08:17
ASP 확장자 구하기 : 

filePath = "/home/www/test.jpg"
   fileExt = Mid(filePath, InStrRev(filePath, ".") + 1)
   response.Write "파일 확장자는 " & fileExt


'ASP' 카테고리의 다른 글

ASP : email 주소 유효성 체크  (0) 2015.04.18
블로그 이미지

엘로드넷

,

PHP 확장자 구하기

PHP 2015. 4. 18. 08:16
PHP확장자 구하기 :

$fileInfo = pathinfo('/home/www/index.html');
$fileExt = $fileInfo['extension'];
echo "파일의 확장자는 ".$fileExt;


블로그 이미지

엘로드넷

,

cron 설정

Linux 2015. 4. 17. 22:00

데몬위치 : #/etc/init.d/crond 

 

설정값조회 :

#crontab -l (root 사용자)

#crontab -u ellord -l (ellord 사용자)

 

수정 : 

#crontab -e

#crontab -u ellord -e

 

 

형식 : 분분 시시 날짜 월 요일 명령 (시간은 24시간으로 표시)

 

요일 : 0 또는 7 : 일요일


예) 매주 일요일 18시 10분에 /home/backup.sh 실행

10 18 * * 0 /home/backup.sh



 

예)

11월 12일 오전9시 30분

30 09 12 11 * 명령스크립트

 

예2) 매일 오전 9시와 오후 5시에 실행(시간을 쉼표로 구분)

00 09,17 * * * 명령스크립트

 

예3) 특정 시간마다 실행 (매일 09~17시까지 00분마다 실행, 매주 월~금까지 해당)

00 09-17 * * 1-5

 

예4) 매 분마다 실행

* * * * * 명령스크립트

 

예5) 10분마다 실행

*/10 * * * * 명령스크립트

0-10/2 * * * * 명령스크립트트

 

 

키워드

대치 문법

@yearly

0 0 1 1 *

@daily

0 0 * * *

@hourly

0 * * * *

@weekly

0 0 * * 0

@reboot

시스템 시작 시

 



아래 두개는 동일함.


예6) 매일 0시 0분에 시간맞추기


시간맞추는 명령어 : rdate

#rdate -s time.bora.net


@daily /user/bin/rdate -s time.bora.net

0 0 * * * /user/bin/rdate -s time.bora.net


 


 

이메일으로 전송하기

MAILTO="help@ellord.net"

 


 

미리 저장된 설정값을 cron에 적용하기

#crontab mycron.txt




php파일 실행하기

00 00 * * * /usr/local/php/bin/php -q /home/ellord/test.php





'Linux' 카테고리의 다른 글

CentOS 7 minimal network 설정  (0) 2015.07.02
아파치 SSL 연결이 비공개로 설정되어 있지 않습니다.  (2) 2015.06.12
RAID 정리  (0) 2015.04.18
SVN 설치 및 설정  (0) 2015.04.18
리눅스 버전확인, 32/64비트 확인  (0) 2015.04.17
블로그 이미지

엘로드넷

,