Saturday, April 9, 2011

stdin: is not a tty

ผมทิ้งโน้ทเรื่องเกี่ยวกับ error message อันนี้ไว้นานเกินไปจนจำไม่ค่อยได้แล้วว่าเหตุการณ์มันเป็นอย่างไร แต่คร่าวๆน่าจะเป็นว่า เวลาผมใช้คำสั่ง scp หรือ rsync แล้วเจอ error message ว่า:

stdin: is not a tty

ให้ลองไปดู file /etc/bashrc บน server แล้ว comment บรรทัดที่เขียนว่า mesg y ซะ ปัญหาจักหมดไป ฉะนั้น

Thursday, April 7, 2011

ลบ tweets เก่าของคุณ ด้วย TwitWipe!!!


การทิ้งข้อความ tweet ทุกอันของเราไว้บน server ของ twitter อาจไม่ใช่เรื่องที่ฉลาดนักสำหรับบางคน ถึงแม้ว่าการย้อนกลับไปดู tweet อันเก่าๆจะทำได้ยากขึ้นเพราะ twitter (และ facebook ก็ด้วย) จู่ๆก็เลิกใช้ระบบการแบ่งหน้าแบบ pagination แต่กลับทำเป็นปุ่ม view more ที่พอกดแล้ว ajax / javascript จะทำการโหลดข้อมูลเก่ามาเพิ่มที่ส่วนท้ายของหน้าเว็บเพจที่เรากำลังดูอยู่ไปเรื่อยๆ ซึ่งเมื่อมากถึงจุดหนึ่ง ram ของท่านก็อาจจะหมดและทำให้ท่านไม่สามารถดูย้อนหลังอีกต่อไปได้ ฉะนั้น

อย่างไรก็ตาม หากมีผู้ที่มีความอยากสู่รู้สู่เห็นในเรื่องของเราอย่างหาที่สุดมิได้ เขาก็อาจจะไปซื้อแรมมาให้มันมากพอสำหรับการย้อนอ่าน tweet ทั้งหมดของเราก็ได้ หรือหากเขามีความรู้ในการเขียนโปรแกรมสักเล็กน้อย เขาก็อาจจะเขียน script ที่ไปเรียกใช้ twitter api เพื่อทำการดาวน์โหลด tweet ย้อนหลังทั้งหมดของเราไปนอนอ่านเล่นก็เป็นไปได้อีก

เมื่อนึกได้ดังนี้ก็ลองไปค้นๆดูใน google ก็พบ TwitWipe ที่หน้าเว็บดูมีชาติตระกูลพอใช้ได้ ลองเข้าไปดู:

http://twitwipe.com

...​แต่ไม่กล้าใช้ ヾ(* ̄д ̄)ツ !!!

ก็ดูมันบอกว่าโห ลบทีเดียวหมดเบยแบบนี้ ใครมันจะกล้าใช้เล่า อย่างน้อยก็ควรกำหนดช่วงเพลาที่ต้องการจะลบได้จริงไหม...

Tuesday, March 29, 2011

wish list ของ porn star


ผม follow porn star คนนึงอยู่ชื่อ Kritina Rose (@kristinarosexxx : http://twitter.com/kristinarosexxx) บน bio ของเธอมี link ไปยัง wish list ของเธอบน amazon:

http://www.amazon.com/Kristina-Rose/wishlist/3BY1BMX3ZNNZA/ref=cm_wl_search_bin_1?tag=533633855-20

ในนั้นจะมีรายการสิ่งของที่เธออยากได้และมีขายบน amazon อ่านรายละเอียดที่เธอเขียนแล้วเดาได้ว่า หากใครซื้อสิ่งของใดๆใน wish list ให้เธอแล้วเธอจะส่งสิ่งตอบแทนให้กลับทาง mail เช่นกัน เดาว่าคงเป็นพวก กางเกงในใช้แล้วไม่ซักของเธอ หรืออะไรประมาณนั้น ไอเดียฟังดูขำดี

Thursday, March 24, 2011

How to install a virtual machine in VirtualBox headlessly

Sure I know there are plenty of documentations and how-to's about this.  But this is my blog and this is where I log what I want for myself : )

Starting by installing an extension pack for VRDP support:

To create a virtual machine, follow these steps:
  • Register a VM: VBoxManage createvm --name "miyabi" --ostype Windows2003 --register
  • Setting RAM, boot device: VBoxManage modifyvm "miyabi" --memory 1024 --acpi on --boot1 dvd
  • Settings bridged mode networking: VBoxManage modifyvm "miyabi" --nic1 bridged --bridgeadapter1 eth0
  • Create a virtual harddisk (in this case 60GB in size):  VBoxManage createhd --filename "miyabi.vdi" --size 60000
  • Add an IDE Controller to the new VM: VBoxManage storagectl "miyabi" --name "IDE Controller" --add ide --controller PIIX4
  • Set the VDI file created above as the first virtual hard disk of the new VM: VBoxManage storageattach "miyabi" --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium "miyabi.vdi"
  • Attach the ISO file that contains the operating system installation that you want to install later to the virtual machine, so the machine can boot from it (use --medium emptydrive to detach the iso): VBoxManage storageattach "miyabi" --storagectl "IDE Controller" --port 0 --device 1 --type dvddrive --medium /full/path/to/win2003.iso
VRDE set up
  • vboxmanage modifyvm miyabi --vrde on
  • vboxmanage modifyvm miyabi --vrdeport 7001 
  • vboxmanage modifyvm miyabi --vrdeauthtype external
  • VBoxManage setproperty vrdeauthlibrary "VBoxAuthSimple"
  • VBoxManage internalcommands passwordhash "your_password"
  • VBoxManage setextradata miyabi "VBoxAuthSimple/users/debian" 404f753f57f...

Others

  •  
  • As root, run:  /etc/init.d/vboxdrv setup
  • If you find error, you may want to try this: insmod /lib/modules/2.6.33-grml/updates/dkms/vboxnetflt.ko
  • I put the command above to my /etc/rc.local .
Useful commands:
  • To start a vm: VBoxHeadless --startvm
  • To get a list of valid ostypes: VBoxManage list ostypes
References:

Wednesday, March 23, 2011

firefox 4 with macosx 10.5 (leopard)

I run macosx 10.5 (leopard).  Today, I decided to replace my Firefox 3.x with Firefox 4.0.  Then I tried to call Firefox Profile but failed:

% /Applications/Firefox.app/Contents/MacOS/firefox-bin -P -no-remote
dyld: unknown required load command 0x80000022
Trace/BPT trap

Zzz... I just CAN'T LIVE WITHOUT FIREFOX PROFILE!!!

OK, thanks to asqueella.blogspot.com!  I have no idea what he is talking about but the solution is to:

% arch -i386 /Applications/Firefox.app/Contents/MacOS/firefox-bin -P -no-remote

Reference

using apt-get through proxy

# export http_proxy=http://username:password@server:port
# export https_proxy=http://username:password@server:port

Export them before using apt-get command :  )

Wednesday, March 16, 2011

how to disable facebook's new photo viewer (aka theatre)

you can install greasemonkey firefox addon and then install this userscript: http://userscripts.org/scripts/show/96773

then you won't see the new photo viewer na