언어별 no-cache 리스트 HTML <META http-equiv="Expires" content="-1"> <META http-equiv="Pragma" content="no-cache"> <META http-equiv="Cache-Control" content="No-Cache"> ASP <% Response.Expires =0 Response.AddHeader "Pragma","no-cache" Response.AddHeader "Cache-Control","no-cache,must-revalidate" %> JSP <% response.setHeader("Cache-Control","no-store"); response.setHeader("Pragma","no-cache"); response.setDateHeader("Expires",0); if (request.getProtocol().equals("HTTP/1.1")) response.setHeader("Cache-Control", "no-cache"); %> PHP <? header("Pragma: no
# ============================= #!/bin/sh for i in $(seq 1 60) do 명령어 sleep 1 done # ============================= 60번 실행되는 스크립트 =============================================== cron을 초단위로 실행시켜야 할 경우 cron을 1분마다 실행시키고 스크립트에서 60번 실행하여 1초마다 실행되는 것처럼 구현한다. 프로그램을 수정하여 1분을 균등하게 분할할 수 있다.
http://cafe.naver.com/q69/7850 php로 mail함수를 이용하여 메일을 보낼때 10만건 이상의 메일을 루프문을 이용해 보내게 되면 메일을 처리할 수 있는 Queue의 용량을 초과하게된다 --------------------------------------------------------------- $result = mysql_query("select name, email from user", $db) while($row = mysql_fetch_row($result)) { . . . mail(.....) } --------------------------------------------------------------- 위와 같은 구조로 메일을 보내게 되면 일정량 이상의 메일을 발송할 때에 Sendmail 데몬에서 처리할 수 있는 메일 큐의 한도가 초과되어서 죽어버립니다. 이럴 때 Sendmail의 설정을 변경해서 처리할 수 있는 메일수를 늘린다던지....Script를 따로 만들어 mail queue를 생성해서 전송한다던지 하는 방법도 있겠지만... 이럴때 간단히 if문을 하나 추가하는것으로 20만건정도의 메일을 하루정도의 시간으로
date 명령어 사용하기 bash 날짜함수 사용법 : 어제, 내일, 지난달, 다음달, 지난해, 다음해 구하기 하루 전 : date -d "1 days ago" 하루 후 : date -d "1 days next" * days대신에 months, years, hours 를 사용하여 같은 값을 구할 수 있다. ===================================================================== 또다른 방법 date +%Y.%m.%d -d '-28days' date +%Y%m%d -d '-28days' 응용
포워딩 하기 <script>location.replace('도메인 및 경로');</script>
ifconfig | grep Bcast | sed -e 's/:/ /g' | awk '{print $3}'
유닉스 계열에서 범용으로 사용할 수 있습니다.find . -name "*.php" -print | xargs grep -l "string" 1. 현재 디렉토리의 모든 c 소스파일에서 "popen" 이 포함된 파일 리스트 출력find . -name "*.[ch]" ! -size 0 ! -type l -print | xargs grep -l "popen" 2. 현재 디렉토리의 모든 c 소스파일에서 "popen" 이 포함된 파일과 내용 출력find . -name "*.[ch]" ! -size 0 ! -type l -print | xargs grep -n "popen" 3. 현재 디렉토리의 모든 c 소스파일에서 "popen" 과 "pclose"가 모두 포함된 파일리스트 출력find . -name "*.[ch]" ! -size 0 ! -type l -print | xargs grep -l "popen" | xargs grep -l "pclose" 4. 현재 디렉토리의 모든 c 소스파일에서 "popen" 또는 "pclose"가 포함된 파일리스트 출력find . -name "*.[ch]" ! -size 0 ! -type l -print | xargs grep -le "p
#!/bin/bash echo -n "디렉토리를 입력하세요(ex. /HOME) : " read DIR echo -n "기능명을 지정하세요(ex. AB01) : " read FUNC_NAME echo -n "오늘로 부터 몇일 이전의 파일을 삭제할까요?(ex. 7) : " read N_DAY PAST_DATE=$(date +%Y%m%d --date "$N_DAY days ago") for filename in $(find $DIR -type f -name "${FUNC_NAME}.*.txt") do FILE_DATE=$(echo $filename | awk -F. '{print $2}') if [ $FILE_DATE -lt $PAST_DATE ]; then rm -f $filename fi done #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# #!/bin/bash echo -n "디렉토리를 입력하세요(ex. /HOME) : " read DIR echo -n "기능명을 지정하세요(ex. AB01) : " read FUNC_NAME echo -n "몇일
sed로 특정 문자열을 포함한 라인 삭제하기 find 명령어를 조합하여 특정 문자열을 포함한 라인 삭제하기 find . -type f -name "*.php" -exec vi -c "%g/문자열/d" -c "wq" "{}" ;