'2017/02/10'에 해당되는 글 2건

  1. 2017.02.10 [OSX El Capitan] ulimit 수정
  2. 2017.02.10 [SimpleCaptcha] 초간단 hello world captcha!! 만들어 보기

[OSX El Capitan] ulimit 수정

ITWeb/개발일반 2017. 2. 10. 18:53

아래와 같이 수정 하시면 됩니다.

파일이 없으면 만드시면 됩니다.


$ sudo vi /Library/LaunchDaemons/limit.maxfiles.plist

<?xml version="1.0" encoding="UTF-8"?>  

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"  

        "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">  

  <dict>

    <key>Label</key>

    <string>limit.maxfiles</string>

    <key>ProgramArguments</key>

    <array>

      <string>launchctl</string>

      <string>limit</string>

      <string>maxfiles</string>

      <string>524288</string>

      <string>524288</string>

    </array>

    <key>RunAtLoad</key>

    <true/>

    <key>ServiceIPC</key>

    <false/>

  </dict>

</plist>  


$ sudo vi /Library/LaunchDaemons/limit.maxproc.plist

<?xml version="1.0" encoding="UTF-8"?>  

<!DOCTYPE plist PUBLIC "-//Apple/DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">  

  <plist version="1.0">

    <dict>

      <key>Label</key>

        <string>limit.maxproc</string>

      <key>ProgramArguments</key>

        <array>

          <string>launchctl</string>

          <string>limit</string>

          <string>maxproc</string>

          <string>2048</string>

          <string>2048</string>

        </array>

      <key>RunAtLoad</key>

        <true />

      <key>ServiceIPC</key>

        <false />

    </dict>

  </plist>


:

[SimpleCaptcha] 초간단 hello world captcha!! 만들어 보기

ITWeb/개발일반 2017. 2. 10. 12:33

일전에 올려던 captcha 관련 링크 참고해서 입맛에 맞는 걸 사용하시면 됩니다.


[관련링크]

http://jjeong.tistory.com/1230


저는 simple captcha 를 이용해서 테스트만 해봤습니다.

아래 테스트 코드 공유 합니다.


[SimpleCaptcha]

http://simplecaptcha.sourceforge.net/


[Maven]

https://mvnrepository.com/artifact/nl.captcha/simplecaptcha/1.2.1


혹시 다운로드가 안되시면 그냥 system path 로 잡아서 올려 주시면 됩니다.


[HelloSimpleCaptch]

public class HelloSimpleCaptcha {
private static final Logger LOG = LoggerFactory.getLogger(HelloSimpleCaptcha.class);

public static void main(String[] args) throws IOException {
File file = new File("/Downloads/hello-simple-capcha.png");
Image image;
Captcha captcha = new Captcha.Builder(200, 50)
.addText()
.build();

ImageIO.write(captcha.getImage(), "png", file);
}
}

너무 쉬워서 뭐라 적을 내용이 없내요. ㅡ.ㅡ;

더 자세한 내용들은 simple captcha 홈페이지를 참고 하시면 됩니다. (또는 구글링 ~)


[Custom]

http://simplecaptcha.sourceforge.net/custom_images.html

http://simplecaptcha.sourceforge.net/custom_audio.html


보셔서 아시겠지만 캡차 이미지 파일로 사용하셔도 되고, 스트림으로 사용하셔도 되고 입맛에 맞게 변환 해서 쓰시면 되겠습니다.

: