My Contribution to Debian, 2013-6

DM uploads:
 - Allowed by Thijs Kinkhorst:
    php-http, php-net-ldap, php-net-socket,  php-net-url

- Allowed by Thomas Goirand:
   php-cache-lite, php-calendar, php-html-template-it,
   php-net-dime, php-net-sieve, php-services-weather,
   php-soap, php-mdb2-driver-mysql, php-mdb2-driver-pgsql

ITP (Accepted):
 - ruby-mongo/1.9.0-1, ruby-bson-ext/1.9.0-1, sponsor by Cédric Boutillier

Team upload :
 - ruby-bson/1.9.0-1, sponsor by Cédric Boutillier

RC bugs:
 #710718 python-heatclient: Fails to build from source: depends on python-argparse

Todo:
 - https://wiki.debian.org/ReleaseGoals/pkg-php-tools

My Contribution to Debian, 2013-5

Debian Maintainer (DM):
  https://lists.debian.org/debian-newmaint/2013/05/msg00005.html
  #709133 -- Please add Prach Pongpanich as a Debian Maintainer

ITP (Accepted):
 ocamlrss -- RSS 2.0 parser and printer for OCam, sponsor  by Stéphane Glondu

Upload to unstable:
 libapache2-mod-geoip, sponsor  by Axel Beckert
 doodle, sponsor  by Theppitak  Karoonboonyanan

Team upload:
 php-mdb2, sponsor  by Thomas Goirand

RC bugs:
 #707938 -- gup.postinst: 11: cd: can't cd to /var/lib/gup/
  + patch to fix 

My Contribution to Debian, 2013-4


QA upload:
 - python-libpcap/0.6.4-1, sponsor by Sebastian Ramacher

Team upload:
 - haproxy, upload by Vincent Bernat

Pending uploads (New):
 * Debian Ruby Extras, sponsor by Cédric Boutillier
   - ruby-mongo -- Ruby driver for MongoDB
   - ruby-bson-ext -- C extensions to accelerate the Ruby BSON serialization
 * PKG OpenStack, sponsor by Thomas Goirand
    - python-heatclient -- client library and CLI for OpenStack Heat

Upload to unstable:
 * PKG-PHP-PEAR, sponsor by Thomas Goirand
  - php-calendar
  - php-cache-lite
  - php-html-template-it
  - php-net-dime
  - php-net-sieve
  - php-services-weather
 - enchant , sponsor by Aron Xu

Note:
 - lintian -EvIL +pedantic

i3 window manager

 ช่วงที่ผ่านได้หา Desktop Environment (DE) ไว้ใช้แทน GNOME 3 (ใช้ Mutter เป็น wm) สุดท้ายมาลงเอยที่ i3-wm (Tiling window manager) พัฒนาขึ้นด้วยภาษาซี ผู้พัฒนาและดูแลแพกเกจใน Debian คือ Michael Stapelberg (เป็นคนอัพโหลดแพคเกจแรกในเดเบียนให้ผม) สามารถติดตั้งได้ผ่านระบบจัดการแพคเกจของ Debian และ Ubuntu ( {apt-get,aptitude} install i3)

 เนื่องจาก i3 เป็น wm เครื่องมือที่จะใช้งานเราต้องหามาใช้เองไม่เหมือนกับพวก GNOME, KDE , Xfce ที่จะมีเครื่องมือต่างๆ มาให้พร้อมแล้ว สำหรับการปรับแต่งเบื้องต้นมีดังนี้

 - LightDM แทน GDM3
 - การเปลี่ยนภาษาใช้ setxkbmap สามารถกำหนดให้ทำงานทุกครั้งได้โดยการเพิ่มคอนฟิคไฟล์ดังนี้
   $ echo 'exec_always setxkbmap us,th -option grp:alt_shift_toggle' >> ~/.i3/config
- สำหรับ terminal emulator ใช้ rxvt-unicode เป็นตัวที่ใช้ประจำใน Puppy Linux ปรับสีเป็นแบบ low contrast (ไม่แสบตาดี)
  ดัดแปลงคอนฟิคจาก https://gist.github.com/davidbeckingsale/564084
- จัดการเรื่องการเชื่อมต่อ network ใช้ wicd
- การเชื่อมต่อ 2 จอใช้ xrandr (ถ้าต้องการ GUI ก็ arandr)

 จากประสบการณ์ที่ใช้งานบน Thinkpad X200si - Debian (Sid):
- ทำงานได้เลื่อนดีไม่มีหน่วง
- เอกสารการใช้งานเข้าใจง่าย
- การสั่งงานแบบใช้คีย์ลัดไม่ต้องย้ายมือออกจากแป้นพิมพ์บ่อย แต่จะว่าไปปกติก็ไม่ค่อยได้ย้ายมือออกจากแป้นพิมพ์เพราะใช้ trackpoint
- เรียบง่ายแต่มีประสิทธิภาพ

* ความหมายของ "X Windows", "Window Manager", and "Desktop Environment"

My Contribution to Debian, 2013-3

RC bugs:
#703957 [libarchive] libarchive: CVE-2013-0211
+ patch to fix
#704042 [mongodb] CVE-2013-1892 -- mongodb: Remote shell access via run method's use of native_helper
+  report and link to fix
#703553 [src:furiusisomount] src:furiusisomount: missing source for compiled gettext (.mo) files
+ patch to fix

WNPP:
#682302 ITA: php-net-sieve, #682303 ITA: php-html-template-it, Sponsor by Thomas Goirand
#580680 ITA: enchant, Sponsor by Aron Xu


UDD: bapase.cgi -- output with tablesorter

My Contribution to Debian, 2013-2


RC bugs:
 #701134 : php-soap: directory vs. symlink conflict, NMU fixed and unblock to Wheezy

WNPP bugs:
 #670999: libapache2-mod-geoip , sponsor by Arno Töll
 #529680: php-net-dime, #529687: php-services-weather, team uploaded - sponsor by Thomas Goirand (zigo)

Notes:
 - I joined the pkg-php-pear team after fixed a RC bug (php-soap).
 - http://linux.sut.ac.th/~prach/php-pear-wnpp.txt


My Contribution to Debian, 2013-1



Fixed orphan package:
 #660437 : O: doodle -- Desktop Search Engine, Sponsor by Theppitak  Karoonboonyanan

RC bugs:
 #700355 : stardict: unhandled symlink
   + patch to fix
 #700941 : scim-thai: FTBFS: dh_install: missing files
   + patch to fix
 #701115 : [S] owncloud: multiple vulnerabilities
   + nmu (t-p-u by Gregor Herrmann) 
 #701134 : php-soap: directory vs. symlink conflict
  + patch to fix

Bugs:
 #671790 merge by #674480 libvncserver-dev: "Multi-Arch: same" but files differ across architectures
  + patch to fix

Packaging:
 #701766: RFS: python-libpcap/0.6.2-1 [QA]
 #700296: RFS: libapache2-mod-geoip/1.2.8-1 [ITA]
 #700410: RFS: furiusisomount/0.11.3.1~repack0-2 [ITA]
 #700397: RFS: enchant/1.6.0-8 [ITA]
 #701706: RFS: ocamlrss/2.0-1 [ITP]

Notes:
 - git format-patch -1 commit-SHA

PHP extension for Thai word break


ทดลองเขียน php extension เป็นการตัดคำโดยใช้ libthai ต้องขอบคุณ พี่เทพ สำหรับคำแนะนำ
ได้ผลลัพธ์ตามรูปแต่ยังไม่สมบูรณ์เพราะยังต้องใช้ iconv ของ php ช่วยก่อนจะส่งไปให้  th_brk_line() แล้วก็ยังอีกหลายเรื่องที่ต้องแก้ไข

php:

 $str="การบ้านเยอะมากสงสัยไม่เสร็จแน่เลยนอนตากลมอยู่บ้านดีกว่า";
 $new = th_brk_line(iconv('UTF-8','TIS-620',$str));
 echo iconv('TIS-620','UTF-8',$new);

output:



ref:
http://devzone.zend.com/303/extension-writing-part-i-introduction-to-php-and-zend/
http://linux.thai.net/pub/thailinux/software/libthai/doc/libthai-0.1.7/

My Debian logs

Fixed
  • #656917 - src:tpb: "debconf question should mention what this TPB is"
Patch to fixed. 
  • #661622 - src:isoqlog: "FTBFS"
  • #663563 - src:tnftp: "FTBFS: mv: cannot stat ..."
Patch ideal to fixed
  • #530166 - src:pvpgn "bashism in /bin/sh script"

Setup git server

   การติดตั้งระบบ git server อย่างง่ายใช้ซอฟต์แวร์ทั้งหมดประมาณนี้ (debian or ubuntu) + git + gitosis + ssh + apache + cgit
  • gitosis : ใช้สำหรับจัดการเรื่องสิทธิ์การเข้าใช้ repositories ผ่าน SSH
  • cgit : หน้าเว็บสำหรับ git repositories เขียนด้วยภาษาซี (cgi)
ssh-server: install
server:~$ sudo apt-get install openssh-server
gitosis: install
server:~$ sudo apt-get install git-core gitosis
server:~$ sudo adduser --system --shell /bin/sh --gecos 'git version control' --group --disabled-password --home /home/git git
gitosis: config

   การเริ่มต้นใช้งาน gitosis เราจะต้องใช้ ssh-key (public) ของเราสำหรับเป็น admin ถ้ายังไม่มีต้องทำการ ssh-keygen  (จำ passphrase ให้ดี)ขึ้นมาจากนั้นก็ import เข้าไปใน gitosis
mylaptop:~$ scp ~/.ssh/id_rsa.pub prach@server:./
server:~$ sudo -H -u git gitosis-init < /home/prach/id_rsa.pub
server:~$ sudo chmod +x /home/git/repositories/gitosis-admin.git/hooks/post-update
   หลังจากขั้นตอนนี้เราจะสามารถ config gitosis ผ่านทาง git repo ได้ดังนี้
mylaptop:~$ git clone git@server:gitosis-admin.git
    ในไดเรกทอรี gitosis-admin ให้แก้ไขไฟล์ชื่อ gitosis.conf เพื่อเพิ่มกลุ่มและกำหนดข้อมูลสำหรับ repositories (จากตัวอย่างจะสร้าง repo ชื่อ foobar , โดยมีสมาชิกคือ prach@mail.com) ดังนี้
mylaptop:~$ cd gitosis-admin; editor gitosis.conf
[gitosis]

[group gitosis-admin]
writable = gitosis-admin
members = prachpub@gmail.com

[group developer]
writable = foobar
members = prachpub@gmail.com

mylaptop:~$ git commit -a -m 'add foobar repo'
mylaptop:~$ git push
   เมื่อ config gitosis เรียบร้อยแล้วเราก็จะสร้าง foobar repo ขึ้นมาดังนี้
mylaptop:~$ mkdir foobar; cd foobar; git init
mylaptop:~$ git remote add origin git@server:foobar.git
mylaptop:~$ echo 'hello' > x.txt
mylaptop:~$ git add x.txt
mylaptop:~$ git commit -a -m 'hello'
mylaptop:~$ git push origin master
   สำหรับ foobar สามารถ clone ผ่านทาง ssh ได้ดังนี้
mylaptop:~$ cd /tmp;git clone git@server:foobar.git

apache2: install
 server:~$ sudo apt-get install apache2
cgit: install
server:~$ git clone git://hjemli.net/pub/git/cgi
server:~$ cd cgit;git submodule init;git submodule update
server:~$ sudo apt-get  install libcurl4-openssl-dev build-essential
server:~$ sudo make
server:~$ sudo mkdir -p /var/www/cgit/{cgi-bin,css}
server:~$ sudo cp cgit /var/www/cgit/cgi-bin/cgit.cgi
server:~$ sudo cp {cgit.css,cgit.png} /var/www/cgit/css/
cgit: config

   ตัวอย่างการ config cgit
server:~$ sudo vim /etc/cgitrc
logo=/cgit-css/cgit.png
css=/cgit-css/cgit.css
enable-index-links=1
virtual-root=/git/

repo.url=foobar
repo.desc=Foobar repositories
repo.path=/home/git/repositories/foobar.git

   เพิ่ม config ของ apache ให้รัน cgit.cgi
server:~$ sudo vim /etc/apache2/conf.d/cgit.conf
 Alias /git "/var/www/cgit/cgi-bin"


      Options FollowSymLinks +ExecCGI
      AddHandler cgi-script .cgi
      DirectoryIndex cgit.cgi

      RewriteEngine on
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^.* /git/cgit.cgi/$0 [L,PT]


Alias /cgit-css "/var/www/cgit/css"

      AllowOverride None
      Options None
      Order allow,deny
      Allow from all
  จาก config ไฟล์ของ apache ต้องใช้ mod rewrite ด้วย
server:~$ sudo a2enmod rewrite
server:~$ sudo /etc/init.d/apache2 restart

   เปิด browser แล้วลองเรียกไปที่ http://server/git


Ref:

My GPG key transition

 
http://linux.sut.ac.th/prach/gpg-transition-prach.txt.asc  <- Signed with both keys
http://debianclub.org/node/539 <- Key-Singing

Thailand Mini DebCamp 2010

ประเดิม blog แรกของปีด้วยเรื่องงาน Thailand Mini DebCamp 2010 จัดขึ้นที่ขอนแก่น ต้องขอบคุณ sponsor และ ทีมงานผู้จัดงาน (พี่เทพ, อ.กิตติ์, นิวตรอน) สำหรับอ.กิตติ์ นิต้องนับถือว่าเป็น Utility man อย่างแท้จริง :-) เป็นตั้งแต่ แม่บ้าน คนขับรถ ยันพิธีกร เล่าเรื่องที่ไปกันดีกว่าไม่เอาสาระมากเดี๋ยวรอท่านอื่นมาเล่าเรื่องวิชาการอีกที

วันเดินทาง - ออกเดินทางเช้าวันที่ 12 มีนาคม 2553 พาน้องไปด้วยคือ @etcpe9, @iporsut ไปถึงบ่ายกว่า ๆ เจอ อ.กิตติ์ พี่เทพ นิวตรอน พี่อดุล เข้าไปดูสถานที่จัดงานตกเย็นทีม Opentle มาถึงพร้อมกับชาวต่างชาติ 3 คน ( Paul Wise , Yukiharu YABUKI, Daiki Ueno) กำลังจะตามไปสมทบที่โรงแรมแต่ดวงซวยจัดรถดันยางรั่วโดน (ใช้มา 4 - 5 ปีไม่เคย) เลยต้องได้ออกแรง fix bug รถตัวเองก่อน :-(
  • กลางคืน - ได้นอนกับพี่โชค คิคถึงมาก ไม่ได้นอนด้วยกันนานละ :-)

งานวันแรก (13) Opening
  • เช้า - มี DD มาสมทบอีกคนคือ Andrew Lee เปิดงานได้รับความรู้จาก DD ตัวเป็น ๆ
  • กลางคืน - งานเลี้ยงต้อนรับชาวต่างชาติเจอ "พาแลง" ของทางอีสาน เสร็จจากมื้อค่ำเเริ่มมีการหาเครื่องดื่มเป็นการอุ่นเครื่องโดยพวก DD บอก "local beer only" จัดมาซะงงบางอันไม่เคยเห็น
งานวันที่สอง (14) BSP#1
  • เช้า - เริ่มงาน BSP , ได้รู้เรื่องการทำงานเกี่ยวกับ bugs ของ debian
  • กลางคืน - วันนี้เริ่มคุ้นเคยกับสถานที่มีงาน party ภาคค่ำกันสังสรรค์กันจนดึก ( ชาวต่างติดใจเบียร์ Red Horse - ไม่น่าใช่เบียร์ไทย ) งานกำลังจะเลิกแต่ John Ham ตามมาสมทบอีก ได้พาน้องช้างและ thai whisky มาด้วย งานเข้าอย่างแรงทีนี้
งานวันที่สาม (15) BSP#2
  • เช้า - Zzzz , ผลจากเมื่อคืน hang ไม่ตื่นไปตอนเช้าสองคนผม กับ Andrew ช่วงบ่าย ๆ patch ไปสองบั๊ก #571116, #530166
  • กลางคืน - มี DD ตามาสมทบอีกคน Christian Perrier ต้อนรับด้วยขบวนรถด่วนและแมลงต่าง ๆ งานสังสรรค์คืนนี้จบเร็วเพราะคืนก่อนหน้า :-)
งานวันที่สี่ (16) BSP#3
  • บ่าย - sign key กับ Paul และก็ลาทุกคนเพื่อเดินทางกลับเพราะว่าวันรุ่งขึ้นมีสอน
อีกสามวัน - ไม่ได้ร่วมน่าเสียดาย

เป็นอีกงานที่รู้สึกประทับใจอีกครั้งเพราะได้เห็นการทำงานของ Debian Developer และเจอกับหลาย ๆ ท่านที่รู้จักกันโดยเฉพาะทีม Opentle ยังน่ารักเหมือนเดิมทุกคนจริง ๆ งานนี้ผมเป็นหนึ่งใน local staff แต่ช่วยอะไรไม่ได้มาก :-(

ผลจากงานนี้ - คิดว่าน่าจะเป็นการกระตุ้นเกี่ยวกับเรื่อง F/OSS ในบ้านเราเพิ่มขึ้นอีกมากและทำให้นักพัฒนาในบ้านเราได้เห็น การทำงาน รูปแบบงาน ของพวก F/OSS ของต่างชาติ อีกทั้งคงจะทำให้เกิดนักพัฒนาของไทยที่ทำงานร่วมกับชาวต่างชาติเพิ่มขึ้นอีกด้วย

หวังว่าประเทศของเราคงจะมีโอกาสได้จัด DebConf ซักครั้ง

ปล. ขอเรียกรวมพี่หลาย ๆ คนว่าทีม Opentle เลยละกัน, มีพี่ ๆ SIPA มาด้วย

Taiwan Mini DebConf 2009

เนื่องจากได้มีโอกาสไปด้วยในงานนี้ด้วยพร้อมกับ พี่เทพ อ.กิต และ นิวตรอน ต้องขอขอบคุณ อาจารย์ สมพันธุ์ ชาญศิลป์ หัวหน้าโครงการ SUTLinux ที่ท่านช่วยสนับสนุนค่าเดินทางให้ เพราะถ้าให้ออกเองไม่มีปัญญาไปแน่นอน การไปครั้งนี้ตั้งแต่ตอนเตรียมตัวแล้ว passport ก็ล่าช้ากว่าท่านอื่นแถมขากลับยังจะพาเขาตกเครื่องกันอีก ฮา

เมื่อไปถึงที่พักก็ได้พักอยู่รวมกันทั้ง 4 คน แล้วก็มีสมาชิกห้องเพิ่มอีก 1 คนคือ YABUKI ซึ่งเคยเจอกันแล้วที่งาน AOSS2007 สำหรับบรรยากาศภายในงานเป็นกันเองดีมากแล้วก็มี DD มากันหลายคน
ส่วนหัวข้อที่บรรยายนั้นผมสนใจที่ Debian-Edu เพราะคล้ายกับงานที่ทำอยู่ สำหรับคนที่ผมคุยบ่อย ๆ คือ Holger Levsen DD ชาวเยอรมัน แต่น่าเสียดายที่ภาษาอังกฤษไม่แข็งแรงเลยไม่ค่อยได้คุยกับใครมาก

รายละเอียดของงานดูได้จาก http://wiki.debian.org/DebianTaiwan/MiniDebConf2009

Linux Change MAC address

เขียนไว้กันลืมจะใช้ทีไรต้องหาใหม่ทุกที

# ifconfig eth0 down
#
ifconfig eth0 hw ether 00:80:48:BA:d1:20
# ifconfig eth0 up
# ifconfig eth0 |grep HWaddr

Link http://linuxhelp.blogspot.com/2005/09/how-to-change-mac-address-of-your.html

First time in this years

ไม่ได้บล๊อกเลยตั้งแต่ปลายปีที่แล้วจนถึงตอนนี้ ช่วงที่ผ่านมาศึกษาแต่เรื่องการทำ server เป็นในเชิงพวก web cluster
จากที่ได้ทำการศึกษาจึงได้แบ่งออกเป็นส่วน ๆ ดังนี้

  • High Availability (HA) : Heartbeat
  • Load Balance (LB) : Layer 4 - LVS (ldirectord) Layer 7 -HAProxy, Pound, NGINX
  • Solution for HA and LB : Piranha, Ultra Monkey
  • Cluster File System : Glusterfs, GFS, NFS, Lustre
  • Database Server : MySQL Replication, MySQL Cluster
  • Web Server : Apache, NGINX
  • Benchmark : Apache Benchmark, JMeter, Faban , My software benchmark
  • Solution for Cluster : Centos Cluster Suite, Redhat Enterpise Cluster Suite

ถึงแม้จะเป็นเรื่องที่มีมานานแล้วแต่หาข้อมูลที่สมบูรณ์ได้ยากและส่วนมากที่มีก็จะเป็นแต่พวก static page แต่ตอนนี้เว็บไซต์เกือบทั้งหมดก็จะเป็นแบบ dynamic page

GRUB 2

เนื่องจากตอนทำ SUTLinux ที่ติดตั้งลงบน NTFS แล้วพยายามจะใช้ grub(0.97) เป็นตัวบูตแต่มันไม่สามารถ access เข้าไปใน NTFS ได้ก็เลยได้มารู้ว่ามันมี grub 2 ด้วยตอนนี้อยู่ที่เวอร์ชัน 1.96 โดยเพิ่มความสามารถเข้าไปอีกมากมายแต่ที่สำคัญคือมันสามารถ access NTFS ได้ ข้อแตกต่างระหว่าง grub กับ grub2 ที่เห็นชัด ๆ ก็คือการเรียกเลขของ partition เช่น sda1 ใน grub = hd0,0 , grub2 = hd0,1

ดูตัวอย่างของ config file ได้ที่ grub.cfg

อันนี้เป็นตัวอย่างการใช้ grub 2 ทำ Graphic menu

ส่วนรายละเอียดเพิ่มเติมดูได้ที่ http://www.gnu.org/software/grub/grub-2.en.html

Puppy Linux 4.1 released

ขณะนี้ Puppy Linux ได้ทำการออก version 4.1 โดยมีความสามารถเพิ่มขึ้นจาก Puppy 4.00โดยสรุปดังนี้
  • เพิ่มโปรแกรมใหม่ Psip VOIP and PPLOG personal blog
  • อัพเกรดโปรแกรมต่าง ๆ
  • ปรับแต่งระบบให้บูตเร็วขึ้น
  • ตรวจสอบฮาร์ดแวร์ได้ดีขึ้น
  • เพิ่มระบบ pup_event (including desktop drive icons)
ปล. สำหรับรุ่นนี้จะเป็นรุ่นสุดท้ายที่ Barry Kauler จะนั่งในตำแหน่ง Benevolent Dictator (Project Leader)

สามารถดาวน์โหลดได้ที่ http://mirror.in.th/puppylinux/

SUTinRAM 4.0

งานตัวนี้ released ไปเมื่อเดือนที่แล้ว สำหรับ SUTinRAM 4.0 นั้นยังคงใช้ PuppyLinux เป็นต้นแบบในการพัฒนาเหมือนเดิม
รายละเอียดอ่านเพิ่มเติมได้จาก readmore

Combine PDF files

เราสามารถทำการรวมไฟล์ pdf หลาย ๆ ไฟล์เข้าด้วยกันได้โดยใช้คำสั่งดังนี้


$ gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=output.pdf -dBATCH 1.pdf 2.pdf 3.pdf

Add user & Passwd

ใช้ทีไรก็ต้อง search หาทุกทีเวลาจะเขียน script ให้ add user และกำหนด pass ครั้งละหลาย ๆ คนเลย blog เก็บไว้กันลืมละกัน

#!/bin/bash

for (( i = 1 ; i <= 35; i++ ))

do # Add user name

echo "Add user : user$i"

useradd -m user$i -s /bin/bash

# Set default passwd

echo "user$i:123456" | chpasswd

done