Thursday, February 13, 2014

how to do looping in .bat (batch) windows .bat

for /l %%i in (1,1,5000000) do (
  echo "aaa" >> a.txt
)

Thursday, January 2, 2014

all of a sudden my kindle cannot connect to wifi anymore

Don't be panic.  Please make sure your wifi channel is not set to auto and is set to anything not higher than 11.

Sunday, December 29, 2013

Saturday, December 28, 2013

raspbmc (raspberry pi + xbmc) and remote controller

I had problem with raspbmc.  My remote controller of Samsung TV Series 5 didn't work.  The TV is connected with raspbmc with HDMI cable.  I found out later that it is because of my outdated version of HDMI cable (HDMI cable has versions!!!).  Replaced it with the new one with newer version, then I can use remote controller with raspbmc!

Thursday, December 26, 2013

apache mod qos

Want to control limit of request per each url and etc with apache?  Try mod_qos.

http://opensource.adnovum.ch/mod_qos/

You can install it from debian's repository too.

Wednesday, December 25, 2013

How to reset password of user in TWiki

Simply go to /twiki/data/.htpasswd and replace the password field with the result from "htpasswd -d" ( Force CRYPT encryption of the password).  htpasswd is an Apache's tool.

Monday, December 16, 2013

kindle fails to look up dictionary

The problem is that I can't look up words from English dictionary with this specific book.  I manage to find out that this book's meta data has error.  It is set to be Spanish while, in fact, it has to be English.

Here is an easy fix.
  1. Download the book from amazon.com as .azw format to your computer.
  2. Open Calibre (http://calibre-ebook.com/).  Add this book to Calibre.
  3. Use Calibre to "edit metadata" of this book.  Change it from Spanish into English.
  4. Export this book (save to disk).
  5. Send the new azw file to you Kindle as a personal document (probably via Kindle's email).
YES

Monday, November 25, 2013

apache with security

Ubuntu Linux

#### installation
  • apt-get install apache2-mpm-itk
  • apt-get install acl
  • set acl in /etc/fstab

    e.g. LABEL=cloudimg-rootfs   /        ext4   defaults,acl    0 0
#### instructions for setting up new virtual host

useradd --home /vhdocs/your_web --shell /bin/false your_web
# default permissions
chown -R ubuntu.your_web your_web
chmod -R o-rwx your_web
chmod -R g+rx your_web
chmod -R g-w your_web
setfacl -R -d -m "g:developers:rwx" your_web
setfacl -R -d -m "g:your_web:r-x" your_web

# allow read/write/execute to developers
setfacl -R -m "g:developers:rwx" your_web

# allow write to certain directories
setfacl -R -m "g:your_web:rwx" writable_dir

# everytime after deployment
setfacl -R -m "g:developers:rwx" *

cd /vhdocs/ ; git init

Saturday, November 23, 2013

Tuesday, November 12, 2013

windows มีปัญหา network connection แบบงงสุดๆ

ถ้าหากท่านอยู่ดีๆพบปัญหาว่า Windows ของท่านอยู่ๆเชื่อมต่อ network ไม่ได้ เข้าไปดูค่า network setting ก็ดูปกติดี หรือ บางครั้ง connection ทั้งหมดก็หายไปเฉยๆ อย่าเพิ่งตกใจ ให้ลอง install windows update แล้ว restart เครื่องดูนะครับว่าหายไหม

เหตุเป็นเช่นนี้ ดูเหมือนว่า windows จะมีปัญหาตรง windows update แม้เราจะเลือกว่าให้ download มาแต่อย่าเพิ่ง install แต่จะมีบาง update ที่ทำให้ windows เกิดปัญหากับ network ได้หากไม่ install แล้ว restart ข้าพเจ้าพบปัญหานี้ทั้งใน windows server 2003, windows xp, windows 7 และ windows 8 ตะรึงตรึง