Posted
Filed under 프로그래밍
mantis에서 비밀번호를 바꿀라면 이메일로 관련내용을 보내는것이 기본세팅이다.
근데 이메일이 갈리가 없지...

그래서 이메일통보가 아니라 비밀번호 없이 로그인해서 즉시 설정이 가능한 상태로
변경이 가능하다.

vi config_defaults_inc.php

$g_send_reset_password  = OFF;

OFF를 ON으로만 변경해주면 된다.

$g_send_reset_password  = ON;

이것도 같이 바꿔주면 한글로 나온다.

$g_default_language             = 'korean';

2015/08/03 17:37 2015/08/03 17:37
Posted
Filed under 프로그래밍
백업은 if 는 장치명 of는 저장할파일명
반대로 하면 복원이다.


이미지 백업
dd if=/dev/mmcblk0 of=/mnt/raspi/rpibackup_20150721.img

이미지 복원
dd if=/mnt/raspi/rpibackup_20150721.img of=/dev/mmcblk0


2015/07/21 12:49 2015/07/21 12:49
Posted
Filed under 프로그래밍
우분투의 경우 apt-get install curlftpfs 로 간단설치

curlftpfs ftp://user:pass@192.168.0.7:21/btsync /mnt/btsync -o allow_other,uid=109,gid=112

uid,gid는 해당 유저와 그룹으로 변경

마운트해제는 fusermount -u /mnt/btsync

아주 간단하다~


2015/07/17 12:23 2015/07/17 12:23
Posted
Filed under 프로그래밍
라즈베리파는 용량이 작다
파이썬으로 되어있는 모니터리툴은 기능은 많은데 파이썬까지 올려야하는 부담이 있다.
본 블로그는 PHP로 돌아가기때문에 PHP로된 모니터링툴을 찾아봤다.

페이지도 심플하고 설치도 그냥 복사만하고 아이디 비번 파일만 생성해주면되니 무쟈게 간단하다.

Raspcontrol - Github


사용자 삽입 이미지
2015/07/14 00:49 2015/07/14 00:49
Posted
Filed under 프로그래밍
어떤건 1일이 일요일이라고 하고 어떤건 0이 일요일이라고 하고 헷갈린다.

우분투 CronHowto

우분투 사이트에 있는 정확한 설명이다.

minute (0-59), hour (0-23, 0 = midnight), day (1-31), month (1-12), weekday (0-6, 0 = Sunday), command

0부터 일요일이다.

0 = 일요일
1 = 월요일
2 = 화요일
3 = 수요일
4 = 목요일
5 = 금요일
6 = 토요일

헷갈리지 말자


2015/07/08 02:17 2015/07/08 02:17
Posted
Filed under 프로그래밍
MongoDB를 2.x에서 3.0.4로 업그레이드 했다.
(업그레이드 참조 : http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/?_ga=1.222986259.926585648.1423043948)


3.x대의 새로운 스토리지 엔진 WiredTiger를 사용해보려고 한것이 이유라서...

일단 기존데이터 파일은 사용하지 못한다.
꼭 옮겨야 한다면 dump뜨고 데이터파일 지우고 다시 넣어야 한다.

난 과감하게 기존데이터 파일을 삭제했다.

1. service mongod stop
2. vi /etc/mongod.conf
3. engine: wiredTiger 를 추가해준다.
4. service mongod start

start를 했는데 안올라온다면 거의 기존 데이터가 남아있어서일꺼다.

8배가 빨라지고 80% 압축이 어쩌고...
얼마나 좋아졌는지 써보자.



storageEngine {
   "name": "wiredTiger" 
}

wiredTiger {
   "uri": "statistics:",
   "LSM": {
     "sleep for LSM checkpoint throttle": NumberInt(0),
     "sleep for LSM merge throttle": NumberInt(0),
     "rows merged in an LSM tree": NumberInt(0),
     "application work units currently queued": NumberInt(0),
     "merge work units currently queued": NumberInt(0),
     "tree queue hit maximum": NumberInt(0),
     "switch work units currently queued": NumberInt(0),
     "tree maintenance operations scheduled": NumberInt(0),
     "tree maintenance operations discarded": NumberInt(0),
     "tree maintenance operations executed": NumberInt(0) 
  },
   "async": {
     "number of allocation state races": NumberInt(0),
     "number of operation slots viewed for allocation":NumberInt(0),
     "current work queue length": NumberInt(0),
     "number of flush calls": NumberInt(0),
     "number of times operation allocation failed": NumberInt(0),
     "maximum work queue length": NumberInt(0),
     "number of times worker found no work": NumberInt(0),
     "total allocations": NumberInt(0),
     "total compact calls": NumberInt(0),
     "total insert calls": NumberInt(0),
     "total remove calls": NumberInt(0),
     "total search calls": NumberInt(0),
     "total update calls": NumberInt(0) 
  },
   "block-manager": {
     "mapped bytes read": NumberInt(0),
     "bytes read": NumberInt(49152),
     "bytes written": NumberInt(368640),
     "mapped blocks read": NumberInt(0),
     "blocks pre-loaded": NumberInt(0),
     "blocks read": NumberInt(12),
     "blocks written": NumberInt(81) 
  },
   "cache": {
     "tracked dirty bytes in the cache": NumberInt(0),
     "tracked bytes belonging to internal pages in the cache":NumberInt(2827),
     "bytes currently in the cache": NumberInt(38408),
     "tracked bytes belonging to leaf pages in the cache":3221222645,
     "maximum bytes configured": 3221225472,
     "tracked bytes belonging to overflow pages in the cache":NumberInt(0),
     "bytes read into cache": NumberInt(0),
     "bytes written from cache": NumberInt(57112),
     "pages evicted by application threads": NumberInt(0),
     "checkpoint blocked page eviction": NumberInt(0),
     "unmodified pages evicted": NumberInt(0),
     "page split during eviction deepened the tree": NumberInt(0),
     "modified pages evicted": NumberInt(0),
     "pages selected for eviction unable to be evicted":NumberInt(0),
     "pages evicted because they exceeded the in-memory maximum":NumberInt(0),
     "pages evicted because they had chains of deleted items":NumberInt(0),
     "failed eviction of pages that exceeded the in-memory maximum": NumberInt(0),
     "hazard pointer blocked page eviction": NumberInt(0),
     "internal pages evicted": NumberInt(0),
     "maximum page size at eviction": NumberInt(0),
     "eviction server candidate queue empty when topping up":NumberInt(0),
     "eviction server candidate queue not empty when topping up":NumberInt(0),
     "eviction server evicting pages": NumberInt(0),
     "eviction server populating queue, but not evicting pages":NumberInt(0),
     "eviction server unable to reach eviction goal": NumberInt(0),
     "pages split during eviction": NumberInt(0),
     "pages walked for eviction": NumberInt(0),
     "eviction worker thread evicting pages": NumberInt(0),
     "in-memory page splits": NumberInt(0),
     "percentage overhead": NumberInt(8),
     "tracked dirty pages in the cache": NumberInt(0),
     "pages currently held in the cache": NumberInt(22),
     "pages read into cache": NumberInt(0),
     "pages written from cache": NumberInt(46) 
  },
   "connection": {
     "pthread mutex condition wait calls": NumberInt(7483),
     "files currently open": NumberInt(14),
     "memory allocations": NumberInt(9273),
     "memory frees": NumberInt(5106),
     "memory re-allocations": NumberInt(283),
     "total read I/Os": NumberInt(24),
     "pthread mutex shared lock read-lock calls": NumberInt(1013),
     "pthread mutex shared lock write-lock calls": NumberInt(362),
     "total write I/Os": NumberInt(137) 
  },
   "cursor": {
     "cursor create calls": NumberInt(747),
     "cursor insert calls": NumberInt(82),
     "cursor next calls": NumberInt(36),
     "cursor prev calls": NumberInt(28),
     "cursor remove calls": NumberInt(0),
     "cursor reset calls": NumberInt(336),
     "cursor search calls": NumberInt(766),
     "cursor search near calls": NumberInt(109),
     "cursor update calls": NumberInt(0) 
  },
   "data-handle": {
     "connection dhandles swept": NumberInt(0),
     "connection candidate referenced": NumberInt(0),
     "connection sweeps": NumberInt(33),
     "connection time-of-death sets": NumberInt(9),
     "session dhandles swept": NumberInt(0),
     "session sweep attempts": NumberInt(86) 
  },
   "log": {
     "log buffer size increases": NumberInt(0),
     "total log buffer size": NumberInt(1048576),
     "log bytes of payload data": NumberInt(15699),
     "log bytes written": NumberInt(18432),
     "yields waiting for previous log file close": NumberInt(0),
     "total size of compressed records": NumberInt(12585),
     "total in-memory size of compressed records":NumberInt(29812),
     "log records too small to compress": NumberInt(7),
     "log records not compressed": NumberInt(15),
     "log records compressed": NumberInt(15),
     "maximum log file size": NumberInt(104857600),
     "pre-allocated log files prepared": NumberInt(1),
     "number of pre-allocated log files to create": NumberInt(1),
     "pre-allocated log files used": NumberInt(0),
     "log read operations": NumberInt(0),
     "log release advances write LSN": NumberInt(37),
     "records processed by log scan": NumberInt(0),
     "log scan records requiring two reads": NumberInt(0),
     "log scan operations": NumberInt(0),
     "consolidated slot closures": NumberInt(0),
     "logging bytes consolidated": NumberInt(0),
     "consolidated slot joins": NumberInt(0),
     "consolidated slot join races": NumberInt(0),
     "slots selected for switching that were unavailable":NumberInt(0),
     "record size exceeded maximum": NumberInt(0),
     "failed to find a slot large enough for record": NumberInt(0),
     "consolidated slot join transitions": NumberInt(0),
     "log sync operations": NumberInt(14),
     "log sync_dir operations": NumberInt(1),
     "log server thread advances write LSN": NumberInt(0),
     "log write operations": NumberInt(37) 
  },
   "reconciliation": {
     "page reconciliation calls": NumberInt(46),
     "page reconciliation calls for eviction": NumberInt(0),
     "split bytes currently awaiting free": NumberInt(0),
     "split objects currently awaiting free": NumberInt(0) 
  },
   "session": {
     "open cursor count": NumberInt(132),
     "open session count": NumberInt(75) 
  },
   "thread-yield": {
     "page acquire busy blocked": NumberInt(0),
     "page acquire eviction blocked": NumberInt(0),
     "page acquire locked blocked": NumberInt(0),
     "page acquire read blocked": NumberInt(0),
     "page acquire time sleeping (usecs)": NumberInt(0) 
  },
   "transaction": {
     "transaction begins": NumberInt(94),
     "transaction checkpoints": NumberInt(5),
     "transaction checkpoint generation": NumberInt(5),
     "transaction checkpoint currently running": NumberInt(0),
     "transaction checkpoint max time (msecs)": NumberInt(20),
     "transaction checkpoint min time (msecs)": NumberInt(7),
     "transaction checkpoint most recent time (msecs)":NumberInt(7),
     "transaction checkpoint total time (msecs)": NumberInt(70),
     "transactions committed": NumberInt(11),
     "transaction failures due to cache overflow": NumberInt(0),
     "transaction range of IDs currently pinned by a checkpoint":NumberInt(0),
     "transaction range of IDs currently pinned": NumberInt(1),
     "transactions rolled back": NumberInt(82) 
  },
   "concurrentTransactions": {
     "write": {
       "out": NumberInt(0),
       "available": NumberInt(128),
       "totalTickets": NumberInt(128) 
    },
     "read": {
       "out": NumberInt(1),
       "available": NumberInt(127),
       "totalTickets": NumberInt(128) 
    } 
  } 
}
2015/07/01 14:44 2015/07/01 14:44
Posted
Filed under 프로그래밍/PHP
slim framework 이 워낙 간단하기때문에 조금만 생각해보면 다국어 지원도 뭐 아주 간단히 해결가능하다.


http://nesbot.com/2012/6/26/multilingual-site-using-slim

https://fiberonofiber.wordpress.com/2014/02/13/slim-php-multi-language-urls/

2015/06/23 14:26 2015/06/23 14:26
Posted
Filed under 프로그래밍
/home/cdn 에 있는 하위디렉토리까지 모든 파일의 시간을 변경한다.

find /home/cdn -print -exec touch -m -t 201506171300 {} \; 
2015/06/17 15:24 2015/06/17 15:24
Posted
Filed under 프로그래밍
http://www.mysqlkorea.com/sub.html?mcode=manual&scode=01&m_no=21703&cat1=12&cat2=353&cat3=0&lang=k

응용이 가능하다.


SELECT * FROM `test` order by case 
    when fileName LIKE "video%" then 1 
    when fileName LIKE "scene%"  then 2 
    else 3 
END


SELECT * FROM ORDER BY FIELD(a,3,4,5)

SELECT * FROM ORDER BY RAND()








2015/06/10 11:59 2015/06/10 11:59
Posted
Filed under 프로그래밍
5.6으로 설치했더니 insert에서 오류가 난다.
이전버전에서는 값을 넘겨주지 않아도 됐는데 default 값이 정해져있지 않으면 invalid value error 오류를 떨군다.
이걸 처리하려면 코드에서
SET SESSION sql_mode=''; 를 해주던가
my.cnf 파일 mysqld 부분에 sql_mode='' 를 추가해준다.
아니면 default값 다 넣어주시던가...


2015/04/22 19:05 2015/04/22 19:05
Posted
Filed under 프로그래밍

더이상 apt-get 지원을 안하는 구버전의 경우는 apt-get을 사용할수가 없다.
아래와같이 해결하자

cd /etc/apt
cp sources.list sources.list.old
sed -i 's,http://.*ubuntu.com,http://old-releases.ubuntu.com,g' sources.list
sed -i -e 's/archive.ubuntu.com\|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
sed -i 's,http://.*ftp.daum.net,http://old-releases.ubuntu.com,g' sources.list

apt-get update
apt-get install update-manager-core
do-release-upgrade


2015/04/22 12:51 2015/04/22 12:51
Posted
Filed under 프로그래밍
Get Users:
curl –i –X GET http://localhost/rest/api/users

Post (create new) User:
curl –i –X POST –d '{"name":"John Doe","email":"anemail@gmail.com","age":28}' http://localhost/rest/api/user

Put (update) User:
curl –i –X PUT –d '{"email":"jdoe@yahoo.com","age":38}' http://localhost/rest/api/user/8

Delete User:
curl –i –X DELETE http://localhost/rest/api/user/8
2015/03/24 12:32 2015/03/24 12:32
Posted
Filed under 프로그래밍/PHP
오호~ slimframework 이 좋아지고 있다.
언제부턴인가 싱글톤도 지원을 하네..ㅋㅋ

class TestTest {
 public function test() {
  echo "a";
 }
}
$app->container->singleton('test', function () {
 return new TestTest();
});
print_r($app->test->test());
exit;


편리하도다~

2015/03/24 11:29 2015/03/24 11:29