Tag Archives: php

When Nagios send alert mails with attachement…

When Nagios send alert mails with attachement… Perhaps this problem is that if a device name or warning message include non-Latin characters.   1. Add new command to nagios configuration Original commands

New commands

  2. Message filter script (PHP)

Actually I wanted to make a filter by Python. But it was less accurate than PHP to determine the encoding of the input string.

Using request of JSON Payload in Slim framework

Slim Framework

How to enable JSON-Payload input in Slim Framework… SlimMiddlewareContentTypes.php



Install nginx + php-fpm on openSUSE

1. Download and install packages

2. Configure php-fpm

3. Configure php-fpm

4. Configure nginx for reverse proxy

5. Restart service

♦ ulimit for open files

  ♦ References http://www.howtoforge.com/perfect-server-opensuse-12.2-x86_64-nginx-dovecot-ispconfig-3-p4 https://www.linux.co.kr/home2/board/subbs/board.php?bo_table=lecture&wr_id=1685 http://stackoverflow.com/questions/7325211/tuning-nginx-worker-process-to-obtain-100k-hits-per-min http://www.codestance.com/tutorials-archive/nginx-tuning-for-best-performance-255 https://www.digitalocean.com/community/tutorials/how-to-optimize-nginx-configuration  

Install PHP-Screw 1.5 on openSUSE

1. Download & Prepare

2. Change encryption seed

3. Compile module

If you get error with below message… Comment out 124 & 133 lines those include CG(extended_info) = 1;  in php_screw.c Then try compile again.  php_screw-1.5/php_screw.c:133: error: ‘struct _zend_compiler_globals’ has no member named ‘extended_info’ 4. Add module to php & restart

5. Compile encryption utility

  ♦ Usage of encryption

  ♦ References https://www.linux.co.kr/home2/board/subbs/board.php?bo_table=lecture&wr_id=1727 http://jswlinux.tistory.com/entry/PHP-Screw-%EC%BB%B4%ED%8C%8C%EC%9D%BC%EC%8B%9C-%EC%97%90%EB%9F%AC%EB%82%A0-%EB%95%8C http://sourceforge.net/projects/php-screw/  

[PHP5] Thumbnail Class

원래 십여년전(?)부터 뜯어고쳐 오며 사용하던 소스를 좀 정리했다. 이전에 GD를 직접 컨트롤 했었는데 조금 찾아보니 WideImage 란 라리브러리가 있기에, 그걸로 바꾸다보니 워낙 기능이 막강해서 정작 내가 만든 클래스는 Wrapping Class가 되어 버렸다 ;; 어쨋든, 밤하늘의 별처럼 널려있는 썸네일 라이브러리들을 마다하고 만든 이유는 단 두가지 이다. 썸네일의 종횡비율에 따라 중앙부분을 기준으로 Crop해서 썸네일을 만들어 주는 기능 PNG포맷에서 Resizing시 원본의 Alpha Channel을 유지 해 주는 기능 그 이외에는 잡다한 기능을 다 빼 버렸다. 복잡해지면 오래 못쓰므로… Licence : GNU LGPL 2.1 Copyright (C) 2013 Aiden, Kihyun Kim.