หัดใช้ yum

yum = apt-get for fedora core

เป็นตัว install package ต่าง ๆ (ใน format RPM) ของ fedora core โดยจะไปโหลดมาจาก repository ต่าง ๆ คล้าย ๆ กับ apt-get ตรงที่เวลาจะ install อะไร ถ้ามันมี dependencies ต่าง ๆ มันจะไปไล่หาและ d/l package อื่น ๆ ที่ต้องการมาทั้งหมด

สิ่งที่มันเนียนก็คือมีการใช้ pgp เพื่อให้มั่นใจว่า package ที่โหลดมานี่ไม่มั่ว เป็นของจริงที่มีคน test มาแล้ว ลองอ่าน tutorial คร่าว ๆ ได้จาก The Unofficial Fedora FAQ และเราตั้ง repository ต่าง ๆ ได้ง่าย ๆ โดยเข้าไปแก้ไขใน /etc/yum.repo.d นอกจากนี้ package ที่มันโหลดมาแล้วมันจะจับยัดลง cache ให้หมด จะ unistall แล้ว install ใหม่ก็กลายเป็นเรื่องง่าย ๆ

เนียนนะ...

วิธีตั้ง mirror list http://aaltonen.us/archive/2004/11/13/yum-in-fedora-core-3/

Setting new isl2 server

อึม ต้องทำเยอะแยะเลย

  1. upgrade invision power board เป็น ver 2.0.4 (อันนี้ใช้ได้แฮะ มันมีบอกด้วยว่า attachment อันไหนเป็นยังไงกินที่เท่าไรด้วย ดี ๆ)
  2. webmin (ลืมไปว่า port 10000 จุฬา block ไว้)
  3. พยายามจะทำ raid
  4. ลง eGroupWare แล้วลองใช้ดู
  5. svn

อึม ๆ หัดใช้ yum ด้วย ของดีทีเดียว อ้อ ๆ webmin อย่าลืมลง perl module ต่าง ๆที่มันต้องใช้ด้วย

พยายามจะให้หันมาใช้ ssl กันให้หมด แต่กำลังรำคาญ เรื่อง Certificate อยู่ default มัน detail ห่วย ๆ อ่ะ ก็็็็็เลยจะพยายาม sign certificate เอง

ดูมาจาก http://www.rpatrick.com/tech/makecert/

QUOTE

Following is a quick listing of the commands you need to use when setting up an SSL key for Apache that doesn't require a passphrase to be entered during normal operations, and includes a self-signed certificate so you needn't bother with cert requests and CAs. The sequence of events is to create a 3DES key, remove the passphrase, and then generate a self-signed certificate.

The following commands are to be entered via the command line, with each openssl statement requiring interactive input. Performed on Red Hat Linux, these instructions ought to also work on other flavors of Unix with OpenSSL and Apache installed.

openssl genrsa -des3 -out pass.key 1024 openssl rsa -in pass.key -out server.key openssl req -new -key server.key -x509 -out server.crt -days 999

cp server.key /etc/httpd/conf/ssl.key/ cp server.crt /etc/httpd/conf/ssl.crt/

apachectl restart

Verifying that Apache has the correct SSL directives and is using the correct key and certificate created above is left as an exercise for the webmaster.

If your system has a Makefile or symlink in the Apache conf directory, you can opt to pursue an earlier method to this madness using the below steps (provided here only for completeness):

cd /etc/httpd/conf /usr/bin/openssl genrsa 1024 > /etc/httpd/conf/ssl.key/server.key chmod go-rwx /etc/httpd/conf/ssl.key/server.key make testcert

Optionally, if you need a server.pem file for a given application, such as courier-imapd, use the following to create the .pem file from the previously created certificate and key:

cat server.key server.crt >server.pem

Using the above method you can enjoy the encryption protection provided by SSL without having to pay a commercial vendor to sign your server keys. If you don't like the popup presented by some applications (e.g. web browsers) about an untrusted certificate, simply follow the process provided by your application to import or install the certificate, at which point you will no longer have to deal with future dialog boxes regarding an untrusted site.

  • [webmin] ตอนลงอย่าลืมแก้ /etc/webmin/miniserv.conf ให้เป็น port ที่ต้องการด้วย (6666 will do) อ้อ ๆ ตั้ง SSL=1 ด้วย เพื่อ force ให้มันใช้ ssl

  • [upgrade invision board] ทำตามที่มันเขียนไว้ใน Document แต่ว่ามันจะใช้ไม่ได้ ให้สั่ง

      ALTER TABLE isl2_members add sub_end INT(10) NOT NULL default '0';
    

    ในเครื่องเก่าจะใช้ language เป็นภาษาไทย (อยู่ใน folder ชื่อ 2) ซึ่งพอ upgrade มันจะหายไป (ไม่ได้ copy เก็บไว้) ก็เลยต้อง ln -s en 2 ด้วยเพื่อเอาภาษาอังกฤษมาใช้แทน แล้วค่อยให้ admin ไปแก้กลับ

  • [SVN] การใช้ mod_auth_mysql สำหรับ authenticate httpd ผ่าน mysql http://www.diegonet.com/support/mod_auth_mysql.shtml

Latex

อึม ๆ หันมาใช้ pdflatex กันเถอะ

ปัญหามีแค่ตอน includegraphics

อ่านซะ http://www.2pi.info/latex/Includingeps.html

อึม ๆ โดยรวม ๆ แล้วก็มันใช้ได้เหมือนกับ latex ทุก ๆ อย่าง ต่างกันหน่อยตรงเวลา includegraphics ให้ใช้ practice ใหม่ ไม่ต้องใส่ extension ของไฟล์ และ file ที่ include ต้องเป็น pdf ไฟล์ (eps ใช้ไม่ได้)

ถ้าไม่ใส่ extension pdflatex มันจะหา .pdf เป็น default อยู่แล้ว อ้อ ๆ เห็นว่าใช้ .jpg ได้ด้วยเลยทันที

หัดใช้ \usepackage{hyperref} ด้วย มันจะทำ link ใน pdf file ให้อัตโนมัติ

เวลาใช้รูปต้องเป็นรูปแบบ pdf photoshop กะ illust มันแปลงเป็น pdf ให้ได้อยู่แล้ว หัดใช้ซะ

trick อื่น ๆ ให้ไปลองอ่านใน FAQ ของ pdflatex http://www.tug.org/applications/pdftex/

Setup NoCatAuth to work with PDC, Hahaha กว่าจะได้

โอย เหนื่อยจิ๊บ.. กว่าจะได้

ปัญหา.

  1. มี NoCat แยก section ระหว่าง net ของภาค กะ public wireless
  2. เครื่องใน public are เนี่ย อยากให้ login เข้าไปที่ PDC ที่อยู่ใน cp-net ได้ (PDC ใช้ Samba)

ประเด็นคือวิธีต่อกับ pdc เนี่ย มันใช้ broadcast network ซึ่ง.. ไม่ทะลุ nocat gateway มา ืทางแก้คือ...

  1. แก้ LMHOSTS ในเครื่องที่ต้องการต่อมากะ PDC ซะ เพื่อให้มันรู้จัก PDC ตรง ๆ โดยไม่ต้องให้มัน broadcast ถาม

แก้ LMHOSTS ให้เป็นดังนี้

ระวัง!!! ไอ้บรรทัดที่เป็น "CP-NET \0x1b" #PRE เนี่ย ของที่อยู่ใน "" ต้องมีจำนวน 20 ตัวพอดี และต้องลงท้ายด้วย \0x1b (ตัว \ จะอยู่ตำแหน่งที่ 16 พอดี (เริ่มต้นตำแหน่งที่ 1)

ที่ต้องมีบรรทัด atlantic ด้วยเพราะว่า login script ของ pdc ของเราจะ mount directory ของ atlantic มาใช้ด้วย

check โดยสั่ง nbtstat -c เพื่อดูว่าเึครื่องนี้รู้จัก host ที่ต้องการแล้วรึยัง

  1. แก้ NoCat Gateway โดยยอมให้มัน forward ข้อมูลระหว่างเครื่องลูก ๆ กะเครื่องที่เป็น PDC โดยไม่ต้อง authenticate ก่อน

ให้ไปแก้ initialization ของ firewall มัน ดูที่ไฟล์ /usr/local/nocat/gw/bin/initilize.fw

เพิ่มบรรทัดต่อไปนี้

โดยที่ 161.200.92.7 เป็น addr ของ PDC

และทำเหมือนกันอีกรอบกับ addr ของ atlantic ด้วย (ไม่งั้นจะ mount directory ไม่ได้)

เพิ่มไปตรงก่อนที่จะ set DNSAddr ประมาณบรรทัด ที่เขียนว่า

Accept forward and back traffic to/from DNSAddr

คำสั่งดังกล่าวจะ allow traffic ไปยัง PDC ของเรา และให้ทำ masquerade ด้วย (อ้อ ๆ ห้ามไปตั้งข้อกำหนดเรื่อง protocol นะ เพราะ pdc ที่ใช้มันคุยกันไม่ได้ผ่าน tcp/udp อย่างเดียว มันแอบคุยกันด้วยอย่างอื่นด้วย

Setting up NoCatAuth gateway

resource Authentication Gateway howto http://www.faqs.org/docs/Linux-HOWTO/Authe...CATGATEWAYSETUP

Linux Wireless Access Point howto http://oob.freeshell.org/nzwireless/LWAP-HOWTO.html

http://www.tldp.org/HOWTO/Authentication-Gateway-HOWTO/index.html

tip

ว๊าก ๆ set ตั้งนาน..

  1. อย่าลืม package Net::Netmask จาก CPAN
  2. อย่าลืมตั้ง permission ของ folder pgp
  3. อย่าลืมใส่ LocalNetwork ใน nocat.conf ของ authen ด้วย (ไม่มีใน doc นะ มันไม่ได้บอกไว้)
  4. file trusted.pgp ต้องเอาไปไว้ที่ nocat/gw/pgp นะ ไม่ใช่ที่ nocat/gw

สรุปวิธีตั้ง auth server ใน FC3

(เวลา install FC3 อย่า enable SELinux แต่ถ้า Enable ไปแล้วให้ไปเอาออกที่ /etc/selinux/config

  1. ลง NoCatAuth โดย 1.1 make PREFIX=/usr/local/nocat/authserv authserv (ระวัง มันจะหา gpg โดยใช้คำสั่ง which ให้ดูด้วยว่าเครื่องที่จะลงมันมี which อยู่หรือเปล่า FC3 ถ้าลงแบบ server มันจะไม่ลง which ให้) 1.2 make PREFIX=/usr/local/nocat/authserv pgpkey

  2. แก้ /etc/httpd/conf/httpd.conf โดยเพิ่มบรรทัด Include /usr/local/nocat/authserv/httpd.conf ไว้หลัง include มันจะได้ทำ Alias ของ /script

  3. Install Net::Netmask perl module โดย 3.1 untar Net-Netmask.xxxx 3.2 ใน Net-Netmask.xxxx directory พิมพ์ perl Makefile.pl 3.3 พิมพ์ make 3.4 พิมพ์ make install

  4. แก้ config ของ auth server แก้วิธี authenticate ให้ตรงกับที่จะใช้ เพิ่มบรรทัด LocalNetwork 192.168.1.0/24 ด้วย (สำคัญมาก)

  5. copy ไฟล์ /usr/local/nocat/authserv/trustedkeys.gpg ไปที่เครื่อง gateway โดยเอาไว้ที่ /usr/local/nocat/gw/pgp ด้วย

  6. แก้ permission ของ /usr/local/nocat/authserv/pgp ให้ owner เป็นคนเดียวกับที่รัน httpd

  7. restart httpd

---------- FOR FreeBSD --------------- อย่างแรกเลย Authen::Smb มันต้องแก้ #include < malloc.h > มันจะ error ใน FreeBSD ให้แก้เป็น #include < stdlib.h > แทน

แล้วก็ #include < sys/vfs.h> ก้ใช้ไม่ไ้ด ต้องเป็น #include < sys/statvfs.h> แทน

apache เวลาจะให้มันใช้ modssl ด้วยต้อง start ด้วย apachectl startssl ซึ่งมันจะถาม passphrase วิธีเอาออกก็คือ

ดูมาจาก http://www.modssl.org/docs/2.7/ssl_faq.html#ToC31

ต่อไปก็คือ.... เป็นไรไม่รู้ ถ้าให้ apache มัน start ตอน boot เครื่องเองเนี่ย มันจะหา gpg ไม่เจอ (คือตอน authen มันจะร้องด่าว่าหา gpg ไม่เจอ ดูได้จาก http-error.log) แต่ถ้า login เป็น root เข้าไป restart server แล้วมันจะหาเจอ ไม่รู้แก้ไงเหมือนกัน ก็เลย copy gpg ไปไว้ที่ /bin อีกที (ตอนแรกมันอยู่ที่ี /usr/local/bin) ก็ work เลย คงเกี่ยวกะ path ของแม่ง

โอ้วเย็ดดดดด

พยายามทำให้มันใช้ NIS.... ทำตั้งนาน.. ไม่ work ซะที ให้มันใช้ NIS ตรง ๆ (โดยใช้ package Net::Nis) ไม่ work

หันมาใช้ PAM ทดลองแล้วใช้ PAM ก็เหมือนจะ work ดี ลอง set PAM ให้ใช้ pam_permit.so ก็ work ใช้ได้.... แต่พอตั้งให้ให้จริง ๆ กลับไม่ work ไม่รู้เพราะอะไร.. ลองเอา Authen::PAM มา่ใช้ตรงๆ (คือเขียน perl ลองดู) ก็ใช้ได้ แต่พอใช้ใน apache กลับ ไม่ work

สุดท้ายใช้ Samba กะ Authen::Smb... ทีเดียว work เลย.. เฮ่อ...

แก้ไข Authentication server

หน้า web ต่าง ๆ ของ auth server มันมีผิด ๆ อยู่หน่อย อย่างแรกคือเวลา login ได้ถูกต้อง หน้า login_ok.html ที่แสดงออกมา link ที่ให้ click เผื่อเวลาที่ไม่ auto มันเป็น link ที่ผิด (มันใช้อันเดียวกับที่ใส่ไว้ใน content= 5;refresh ตรง header)

ให้ไปแก้ไฟล์ AuthService.pm ใน /usr/local/nocat/authserv/lib/NoCat/

แก้ sub ชื่อ sucess โดยเพิ่มตัวแปร redirect_click ให้ไว้

เวอร์ชั่นที่แก้แล้วจะเป็นยังงี้

แก้ไฟล์ login_ok.html ด้วย ตรงที่ click ให้เป็น

password เครื่องลูก ๆ ในชั้น 17

;sdgjo*(04286

ตอนที่ 2 การสร้าง authentication gateway

หลักจากสร้าง authentication server เสร็จแล้ว รายการต่อมาก็คือการสร้าง authentication gateway

  1. ลง Fedora Core3 (อีกแล้ว...) ตอนลงอย่าลืมเลือกให้มันลง dhcpd มาไว้ด้วย

  2. ตั้ง dhcpd server 2.1 สร้างไฟล์ /etc/dhcpd.conf ดังต่อไปนี้

subnet 161.200.92.0 เอาไว้บอกว่าเครื่องนี้ต่อกะ 2 network แล้วไม่ต้องยุ่งอะไรกะ network ของ 161.200.92.0/23

2.2 ตั้งให้ dhcpd รันทุกครั้งที่เปิดเครื่อง

  1. ลง NoCatAuth โดย 3.0 ตัว script มันจะ detect firewall (iptables) แต่ว่า script มันเขียนไว้ผิด เราต้องไปแก้ script ที่มันเขียนก่อน

ให้แก้ไขไฟล์ bin/detect-fw.sh

ดูตรง

ให้แก้ตรง Linux 2.4 เป็น Linux 2.6 (เพราะ Fedora Core3 มันใช้ 2.6)

3.1 make PREFIX=/usr/lolcal/nocat/gw gateway 3.2 แก้ไขไฟล์ nocat.conf โดยเพิ่ม/แก้ บรรทัดต่อไปนี้

3.3 copy ไฟล์ trustedkeys.gpg จากเครื่อง auth มาไว้ที่ /usr/local/nocat/gw/pgp

  1. ทำให้ service วิ่งได้เองเวลา reboot ให้แก้ไฟล์ /etc/rc.d/rc.local โดยเพิ่ม

อ้อ ๆ อย่าลืมแก้พวก htdocs ต่าง ๆ ใน auth server ให้ตรงกับที่ต้องการ (ไม่จำเป็น)

เช่นแก้ชื่ือให้เป็น CP Network, ใส่คำเตือน, etc.

VMWare, the undisclosed thug

Hahaha, the bad guy of DHCP mayhem is caught. It's Chang. How ridiculous. It is our own guy that sending a false dhcp offer. The problem is from the VMWare. VMWare install dhcp server service to assign an IP for its virtual host, however, to let the virtual network be linked wiht the real network, VMWare install a bridge that connect its virtual network card with the real network card. Now, DHCP service of VMWare is binded to VMNet1, if the bridge of the VMWare is configure to connect VMNet1 with the actual LAN, that dhcp will come to work!!! The solution is to uncheck the VMWare bridge item in the properties of LAN connection of Windows.

So, how this is detected. The mean is the good old one, Aj. Thanisara removed each link from the main hub and see that the bad dhcp still working. Okay, when she removed our room lan cable, the malicious dhcp server is disappeared. This is very stupid. At least, it shows that if someone set up a dhcp server, even unintentionally, we do not have any mean to stop that except to locate by brute force checking. Now, the need of NAT and a segmentation of each lab becomes more and more needed. At least that is what I think.

Hope that Chang does not get so much blame from the crisis. Now I can switch back to good old dhcp.

ICRA, finally.. (fighting with jfig, eps, gs, etc.)

ICRA is almost finished and so is the deadline. We still doing a last proofreading. However, there are a lots of problem in preparing a PDF. First, IEEE requires that all font is embedded. There are some problem in my Distiller, I can not make the .joboptions file from IEEE to work with my Distiller. It keep s saying that the font "Times-Roman" can not be found in the system. I change to GSView to convert my ps to pdf but still, the result pdf does not have "Times-Roman" embedded in. Okey, the problem might be my machine but no other machine in our lab has MikTex or GSView. I change to linux and use ps2pdf to convert. The correct option is

ps2pdf -dCompatibilityLevel=1.3 -dMAxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true -sPAPERSIZE=a4 DRAFT1.ps

However, we still have more problem. JFIG has some bug when rendering the EPS. (Or that is what I think)

Long time no see

Yeah, miss me? huh? Long time since last entry. I went to Japan for IROS presentation. (that's suck, though.) Anyway, I'm back, fully realised that the previous entry is still under construction. Today, our master posted a post-it with TO-DO on our machine. So, we have lots of thing to do in official. Hope that I do not fail any of them.

Just finished "the Geometry of Grasping" of Markenscofff, Ni and Papadimitriou. That's hard paper for me. Parts of it still a mystery for me. I am also supposed to write a little review for it. but I am too lazy right now. (Mr. Fu is playing CS:Source just 2 meter from my place. Lots of eager to join him... and we still addicted to GunBound). I am planning to read the Red/Blue intersection just after this sentence. So, see ya later.