ประสบการณ์ขโมยขึ้นบ้านและบทเรียนที่ผมได้รับ

ของที่จากไปแล้วกลับมาใหม่…

สำหรับวันนี้ขอมาเล่าเรื่องต่อจากเมื่อวันที่ 16 พฤษภาคมที่ผมถูกโจรขึ้นบ้านแล้วขโมย Macbook Pro Retina, iPod, iPad, iPad Mini, Plantronics, Samson Mic, a-JAYS Three ไปนะครับ ว่าทำไมผมถึงสามารถตามตัวโจรจนเจอ จนกระทั่งวันนี้ (20 พฤษภาคม) โจรถูกสอบสวนและนำตัวไปขังแล้ว ซึ่งของที่ผมโดนขโมยไปตอนนี้ได้คืนหมดยกเว้น iPad, iPad Mini ที่ถูกปล่อยออกไปแล้ว

ขอเล่าเป็นเนื้อเรื่องเลยแล้วกันนะครับ

เมื่อเช้าวันที่ 16 ผมได้ตื่นขึ้นมาด้วยความสดชื่น เพราะเป็นวันเปิดเทอมวันแรกของลูกชาย แต่พอลงมาที่ชั้นล่างผมกลับพบความผิดปกติหลายๆอย่างจนรู้ว่าของหายไปหลายรายการดังนี้

  • Macbook Pro Retina 15″ CTO
  • กระเป๋า Cote et Ciel
  • iPod Touch Gen 5
  • iPad 2
  • iPad Mini
  • Plantronics Voyager Legend
  • Samson Meteor Mic
  • a-JAYS Three
  • เงินสดจำนวนหนึ่ง

ตอนแรกก็ร้อนรนมาก แต่ก็ไปส่งลูกชายเข้าโรงเรียนตามปกติก่อน แล้วจึงกลับมาบ้านนั่งไล่เขียน S/N ของอุปกรณ์แต่ละตัวที่หายไปแล้วก็ไปแจ้งความที่สถานีตำรวจบางบอนเพื่อขอใบแจ้งความเอาไว้ไปดำเนินการอย่างอื่นต่อ

ด้วยความเซ็งและเหลือความหวังน้อยมากๆที่จะได้ของคืนเพราะผมเปิด Find my iPhone คอยตรวจสอบเครื่อง แต่ก็ไม่มีสัญญานส่งมาบอกสักที (Find my iPhone เป็นโปรแกรมหนึ่งในชุดของ iCloud ของทาง Apple เพื่อใช้ตรวจสอบว่าเครื่องเราตอนนี้อยู่ที่ตำแหน่งไหน) เลยตัดสินใจไปเซ็นทรัล พระรามสองเพื่อไปแจ้งให้ทาง iStudio ทราบว่าถ้ามีเครื่อง Macbook Pro Retina 15 CTO ที่มี S/N ตรงกับของผมเข้ามาที่ศุนย์ให้ทำการยึดเครื่องไว้ (iStudio ของ Comseven บริการดีมากๆ ขอชื่นชมมากๆ แค่เรานำหลักฐานใบแจ้งความติดไปด้วยก็เรียบร้อย) และก็ไปกินๆๆเพื่อให้ลืมความเจ็บใจ

หลังจากเข้าไปแจ้งที่ iStudio เสร็จก็เข้าไปกินอาหารที่ฟูจิกันต่อ พอกินเสร็จ อิ่มเต็มที่…​ เดินออกจากร้านปุ๊บก็มีเสียงดังจากไอโฟนของแฟนผมบอกว่า พบเครื่อง Macbook Pro ของผมแล้ว!

ผมเลยรีบไปดูในโปรแกรม Find my iPhone แล้วพบว่าพิกัดของเครื่อง Macbook Pro ของผมอยู่ที่เซ็นทรัล พระรามสองที่เดียวกับที่ผมกำลังเดินอยู่เลย!

Found

แน่นอนว่าผมไม่รู้หรอกว่ามันอยู่ส่วนไหนของเซ็นทรัล ก็เลยซูมๆเข้าไปใกล้ๆพบว่าอยู่ทางด้านติดกับโชว์รูมรถเบ๊นซ์ด้านหลังๆของเซ็นทรัล ผมก็เก็ทเลยว่าต้องเป็นชั้นสองบริเวณตู้รับซื้อ-ขายพวกมือถือแน่นอน!

ก็เลยรีบวิ่งไปที่โซนตู้นั้น แล้วก็ไม่ต้องอะไรมาก ผมรีบไล่ดูทีละร้านเลยว่าร้านไหนมีเครื่อง Macbook Pro Retina บ้าง ผมแยกกันหากับแฟนอยู่ราวๆ 45 นาที ก็เจอเครื่องนึงเป็น Macbook Pro 15 แต่ไม่รู้ใช่ Retina หรือเปล่าเลยเข้าไปถามว่านี่รับซื้อเครื่องมาหรือเปล่าครับ?

ร้านก็บอกว่าไม่ใช่ มีคนเอามาฝากลงโปรแกรม ผมเลยโชว์ใบแจ้งความและบอกว่าเครื่องผมถูกขโมยเมื่อคืนนี้ ผมสงสัยว่าคนร้ายเอามาปล่อยแถวนี้ เพราะมีพิกัดแจ้งอยู่ ผมเลยขอดู S/N ของเครื่องๆนั้น

ระหว่างที่ผมสัมผัสเครื่อง ผมรู้ทันทีว่าใช่ เพราะว่า Macbook Pro Retina 15 ไม่ค่อยมีคนติดฟิล์มแบบ Wrapsol ผมจับผิวสัมผัสก็รู้แล้วว่าเครื่องผมแน่

พอพลิกขึ้นมาดู S/N ก็… ใช่เลย เป๊ะๆ

เลยคุยกับร้านว่านี่คือเครื่องที่ถูกขโมยมา ไม่ได้เป็นเครื่องหลุดจำนำแล้วติดรหัสผ่านเหมือนอย่างที่คนที่นำเครื่องมาลงโปรแกรมแจ้งไว้

พอดีคนที่เอาเครื่องมาไปเดินเล่นเพื่อรอลงโปรแกรมเสร็จ เราก็เลยวางแผนกับร้านว่าเดี๋ยวพอเค้ามาเอาเครื่อง ร้านก็ส่งมอบเครื่องให้คนๆนั้น แล้วปล่อยให้เค้าเดินไปสักพักเราค่อยจับกุมตัวกัน

พอได้แผนแล้วผมก็ทำการติดต่อ Guard ของทางเซ็นทรัล ซึ่งได้รับการช่วยเหลืออย่างดีมากๆ ขอชื่นชมมากๆ หัวหน้า Guard พาคนมาถึง 5-6 คน แล้วกระจายกำลังอยู่รอบๆบริเวณร้านเพื่อไม่ให้น่าสงสัย

ผมก็เลยโทรตามตำรวจสายสืบที่เป็นคนรับผิดชอบคดีมาด้วย เป็นสายสืบจากสน.บางบอน ต้องขอขอบคุณมากๆๆๆอีกคน เพราะพอบอกว่าเจอตัวคนร้ายแล้วท่านก็ไม่มีอิดออด รีบมาทันที

victim

ปรากฎว่าทีม Guard กับสายสืบพร้อมก่อนที่ผู้ต้องสงสัยจะมาอีก เราก็รอสักพัก กระจายๆกันยืนกันคนสงสัย พอผู้ต้องสงสัยมา ร้านก็มอบของให้ (Macbook Pro Retina ของผม + ที่ชาร์จ) เราก็ปล่อยให้เค้าเดินไปแป๊บนึงจึงทำการจับตัวไว้ แล้วคุมตัวให้นั่งไปในรถของสายสืบเพื่อไปที่สถานีตำรวจเพื่อสืบสวนต่อ

พอไปถึงสถานีช่วงบ่ายแก่ๆ สายสืบก็ทำการสอบสวนขยายผลจนผู้ต้องหาสารภาพ ช่วงเย็นเลยไปรวบตัวคนร้ายอีกคนจากร้านเกมส์แล้ววิ่งไปค้นหาของกลางที่บ้านมันต่อ ปรากฎว่าเจอของกลางเกือบทั้งหมดยกเว้น iPad 2 และ iPad Mini ซึ่งมันบอกว่าขายไปแล้วได้เงินมาเหลือ 5,000 บาท เสร็จแล้วก็นำตัวมาสถานีตำรวจแล้วสอบสวนกันต่อยันดึก ผมก็ไปอยู่ด้วยยันดึกเพื่อทำการบันทึกปากคำต่างๆ

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

(สรุปเรื่องนะครับคือของผมหายคืนวันที่ 15 ก็คือช่วงเช้ามืดของวันที่ 16 ผมก็ไปไล่ตามจนได้ของคืนมาเกือบทั้งหมดในวันเดียวกัน แต่ยังไม่ได้ของคืน ต้องเก็บไว้ที่สน.ก่อนเพื่อทำการสอบปากคำให้เรียบร้อยถึงจะคืนได้)

ผมก็รอเรื่องจนกระทั่งถึงวันอาทิตย์ที่ 20 จึงได้ของกลางทั้งหมดคืน ซึ่งสภาพของก็ปกติดีทุกอย่างยกเว้นฝาหน้าเครื่อง Macbook Pro ซึ่งโดนปากกาขีดเขียนมา 3 เส้นยาวๆ

mbp

อ่อ… iPod ที่ผมได้คืนปรากฎว่าถูกลบข้อมูลทั้งหมดไปแล้วเช่นกัน และมีการติดตั้งโปรแกรมลงไปใหม่เรียบร้อยพร้อมแหกคุก

ที่น่าตลกก็คือมันเอา iPod ของผมไปติดแผ่นกันหน้าจอให้ผมด้วย 555

นั่นคือเรื่องราวคร่าวๆของเคสที่ผมโดนขโมยขึ้นบ้านแล้วสามารถนำเครื่องคืนมาได้บางส่วนนะครับ ซึ่งผมสรุปออกมาเฉพาะใจความสำคัญได้ว่า…

สิ่งที่ทำให้ผมได้เครื่องคืนมาได้บางส่วนคือ…

  1. ดวง – ถ้าไม่มีดวง ผมจะไม่ได้ไปที่เซ็นทรัลที่เดียวกับขโมยแน่นอน
  2. เทคโนโลยี – ถ้าไม่มี Find my iPhone เฮือกสุดท้าย ผมก็คงไม่รู้ว่าหัวขโมยมันอยู่ที่เดียวกัน
  3. สติ – ถ้าไม่มีสติ ผมจะไม่ได้ไปแจ้งความพร้อม S/N ตั้งแต่ช่วงเช้า ถ้าไม่มีสติ ผมอาจจะยอมแพ้ระหว่างการเดิน(วิ่ง)หาเครื่องในเซ็นทรัล เพราะถึงแม้จะเดาได้ว่าเป็นบริเวณไหน แต่ผมไล่หาเครื่องอยู่เกือบชั่วโมง ถ้ายอมแพ้กลางคันก็คงเป็นศูนย์
  4. ความช่วยเหลือ – Guard ของเซ็นทรัล และตำรวจที่รับผิดชอบคดีนี้ช่วยผมได้มาก ทำงานอย่างรวดเร็ว แค่ไม่กี่ชั่วโมงที่ผมแจ้งว่าเจอตัวขโมย เค้าก็สามารถไปไล่ขยายผล จนได้ของคืนมาเกือบทั้งหมดครับ

ท้ายสุดนี้ ผมได้เรียนรู้หลายๆอย่างจากเหตุการณ์นี้ครับ

  1. การ Backup สำคัญมาก โดยเฉพาะการ Backup ลง Cloud
  2. ข้อมูลของผมที่ไม่ได้อยู่บน Cloud สูญหายหมด ผมไม่กลัวอะไรมากที่มันหาย แต่กลัวกว่าถ้าขโมยรู้วิธีการนำมันไปใช้ ลองคิดดูครับว่าถ้าเค้าสามารถเข้า Gmail, Facebook, Paypal, Aweber ฯลฯ ของเราได้ อะไรจะเกิดขึ้น? โชคดีที่ขโมยมันไม่ค่อยรู้เรื่องพวกนี้
  3. หลังจากที่ผมได้เครื่องกลับมาผมจึงทำการติดตั้ง Dropbox และเพื่อเป็นการทำให้ไม่เปลืองเนื้อที่มาก ผมจึงมีการใช้ Selective Sync เพื่อ Backup เฉพาะข้อมูลสำคัญลง Cloud
  4. ผมได้เปิดใช้งาน FileVault บน Mac OSX เพื่อที่ว่าถ้าต่อไปมีคนนำเครื่องผมไปได้อีก เค้าจะไม่สามารถเปิดข่้อมูลของผมมาดูได้ เพราะ FileVault เป็นการเข้ารหัสข้อมูลทั้งหมดไว้ ต้องมีรหัสผ่านของผมหรือ Recovery Key ถึงจะถอดรหัสได้
  5. ผมจะไม่ใช้งาน Remember Password / Remember Me บน Browser อีกต่อไป เพราะน่ากลัวมาก
  6. เปิดใช้ iCloud บนอุปกรณ์ Apple เสมอ เพื่อให้ Find my iPhone ใช้ได้ ไม่งั้นยากมากที่จะตามเจอของเราได้
  7. ตำรวจทำงานเร็วมาก ถ้าเราแจ้งเบาะแสได้ชัดเจน ถ้าเบาะแสที่เราแจ้งไม่ชัดเจน เค้าไม่ค่อยอยากมาช่วยเราเท่าไหร่ครับ เพราะฉนั้นเวลาที่เราต้องการพึ่งตำรวจ เราควรพึ่งตัวเองด้วยส่วนนึง ทำไรเองได้ ทำไปก่อนครับ

Find my iPhone คือพระเอกของผม!
ถ้าเพื่อนๆกำลังใช้อุปกรณ์ตระกูล Apple อยู่ ผมแนะนำว่าต้องเปิดใช้ Find my iPhone เลยนะครับเพื่อเวลาสูญหายจะได้พอตามได้ ที่ผมบอกว่าพอตามได้เป็นเพราะว่า… มันไม่ได้สมบูรณ์ 100% ครับ โดยเฉพาะอุปกรณ์ที่ใช้ iOS เป็นระบบปฏิบัติการ (ไม่ใช่ ISO นะ!)

Find my iPhone คือระบบที่เอาไว้ติดตามว่าอุปกรณ์ของเราตอนนี้อยู่ที่ไหน มันจะแสดงบนแผนที่บอกเราเลยครับ แต่มันมีเงื่อนไขอยู่ว่า… อุปกรณ์นั้นๆต้องต่อเน็ท ถึงจะรายงานพิกัดกลับไปบอกเจ้าของได้

ซึ่งพวก iPhone, iPod, iPad นี่… ถ้าคนรู้นิดๆก็สามารถล้างเครื่องโดยที่ Find my iPhone ไม่สามารถตรวจจับได้

แต่ถ้าพวก Mac OS X หรือพวกตระกูล Macbook นี่… เวิร์กมากครับ เคสผมที่ Find my iPhone สามารถแจ้งสัญญานกลับมาได้เป็นเพราะ… หัวขโมยนำเครื่องผมไปลงโปรแกรมใหม่ ซึ่งเครื่อง Macbook เวลาจะลงโปรแกรมใหม่จะต้องมีการต่อเน็ทเพื่อทำการดาวน์โหลด OS ใหม่มาลง (ยิ่งรุ่นหลังๆไม่มี CD/DVD Drive การติดตั้ง Mac OS X จะต้องต่อเน็ทเสมอ) และตอนมันต่อเน็ทนี่ล่ะ เครื่องผมจึงทำการส่งสัญญานมาบอกครับว่ามันอยู่ไหน… ซึ่งเป็นการบอกครั้งสุดท้าย เพราะหลังจากบอกแล้ว มันก็โดนลงโปรแกรมใหม่เรียบร้อย ซึ่งบอกตรงๆว่านี่คือโอกาสสุดท้ายที่เราจะตามหาของได้ ถ้าช้า… ไม่ทันโจรแน่ๆ

ส่วนวิธีเปิดใช้ Find my iPhone ก็ง่ายๆครับ…

สำหรับอุปกรณ์ตระกูล iOS (iPhone, iPod, iPad) ให้ไปที่ Settings -> iCloud แล้วใส่ Apple ID ของเราเข้าไป เสร็จก็ไปเปิดอ๊อปชั่น Find my iPhone/iPad/iPod เอาไว้ครับ

สำหรับพวก Mac OS X (Macbook, iMac) ให้ไปที่ System Preferences -> iCloud ใส่ Apple ID เข้าไป แล้วก็ไปเปิดอ๊อปชั่น Find my Mac ไว้ครับ

เท่านี้เราก็จะสามารถตรวจสอบพิกัดของอุปกรณ์ทุกตัวของเราได้แล้วครับผ่านเว็บ www.iCloud.com หรือโปรแกรม Find my iPhone บน iOS ครับ เมื่อเครื่องหายก็ให้ไปเลือกอ๊อปชั่น Notify me when found ครับ มันจะแจ้งเราทันทีที่พบเครื่อง! :)

Find_my_MBP

สุดท้ายแล้วผมอยากบอกว่าสังคมปัจจุบันตอนนี้น่ากลัวและน่าเป็นห่วงมากเพราะผู้ร้ายสองคนที่เข้าคุกไปแล้วนั้น…

  1. เป็นเด็กอายุ 17 ปี เคยเข้าคุกมาแล้ว 4 ครั้งข้อหาลักทรัพย์ สักข้อความที่หน้าผากว่า “ในอ้อมกอดที่ไร้ไออุ่น” มันบ่งบอกถึงปัญหาทางสังคมได้อย่างดี
  2. วัยรุ่นอายุราวๆ 22 ปี เคยเข้าคุกมาแล้ว 3 ครั้งข้อหาลักทรัพย์และเสพยา สองคนนี้แก๊งค์เดียวกัน รอยสักเต็มตัว

มิจฉาชีพทุกวันนี้อยู่ใกล้เราเกินคาดคิดนะครับ ถ้าไม่เหลือบ่ากว่าแรง จงป้องกันอย่าให้เกิดกับบ้านท่านครับ ติดกล้องวงจรปิด ติดกันขโมย ติดเหล็กดัด ฯลฯ ทำไปเถอะครับ!

ด้วยความปรารถนาดี
ก๊วง

Configure Postgresql for my Rails Application

Hi there, This post I want to write as a log of my success on configuring Postgresql database to production for my Rails application.

Let’s get started. I’ve installed Postgresql 8.4 through apt-get.

The first step I do is to change the password of ‘postgres’ user.

Run the command on root shell.

 passwd postgres 

And I usually allow remote access into my Postgresql database. So, I have to edit the file ‘/etc/postgresql/8.4/main/pg_hba.conf’ by seeing this line.

 local all all ident 

and change it to…

 local all all md5 

Then restart the service.

 /etc/init.d/postgresql-8.4 restart 

The second step I usually do is to install the admin pack.

 su - postgres psql template1 < /usr/share/postgresql/8.4/contrib/adminpack.sql psql -d template1 -c "ALTER USER postgres WITH PASSWORD 'newpassword';" 

The next step is to create a new database and user to be used by your application. Assume the application is named ‘Social Dating’.

 createdb socialdatingdb createuser socialdatinguser --pwprompt psql socialdatingdb GRANT ALL TO socialdatinguser 

Then you can test CRUD on the database with…

 psql -U socialdatinguser -W socialdatingdb 

Enjoy Postgresql!

Please share this page to anyone who think it is helpful for them. :)

How to Set-up Rails 3.1 Applications on Linode

Hi guys,

This thread was written by me to be used as a future reference of mine and I would like to share here for some people who is struggling with setting up Rails applications on their own Linode cloud VPS.

Linode

First of all, let me introduce what is Linode and why I choose it over its alternatives.

Linode is a cloud VPS provider which is quite well known by people who is working on cloud technology.

Linode offer various cheap plans when compared to competitors and its performance is still better from them. (based on the benchmark I found from here)

With just $19.95/mo, I got 20GB disk space, 200GB outgoing bandwidth (now incoming bandwidth is free) and 512MB of memory.

This entry level offer is unbeatable while compared to Slicehost (now bought and managed by Rackspace), Amazon EC2 or Prgmr.

Let’s me say that before I decide to go with Linode, I’ve research a lot about Rails application hosting which finally ends up with Heroku because my project has a short time of development and deployment so I can’t waste my time setting up a box for it.

When the app is live and running smoothly, now I want to improve my ROI and want to make it more cost effective when I demand for more resources.

That’s the reason why I’m moving out from Heroku and ends up with Linode.

That’s a short introduction why I ends up with Linode and now let’s get started seeing how do I set up a Rails application on Linode cloud VPS successfully.

How to set-up Rails application on Linode.

1st, Sign-up for Linode

Just pick a plan you think it is fit for your needs. For me, the Linode 512 is more than enough by now.

After picked up a plan, you will be asked to enter credit card and choose the data center location, just pick one that close to your target visitors. I saw last time there is Asia data center, anyway, I choose Newark, NJ, USA as my target will be in USA.

2nd, Create your Linux node

After sign-up was completely, now I’m going to create a new node by choosing a linux distribution to be use with. I choose Ubuntu 10.0.4 LTS which is 32-bit because there are many sources saying that 32-bit performance is better than 64-bit of Ubuntu.

Just allocate the disk space and swap size that you think it will fits your needs. For me, I just choose the maximum because I need to setup only single node. If you want to separate database server from your web server, just remain some space for your second node.

After the node was built, just push the “Boot” button to start your node now.

3rd, connect to your node using SSH

Now click on the “Remote Access” tab from your dashboard to see the IP address of your node.

Let’s see the “SSH Access” field, it should have some text like “ssh root@11.22.33.44″.

This is the command being used to connect to your node remotely.

Let’s say you are using Mac OSX or Linux, you can use terminal to execute the command.

Then, enter your specified password and you will ends up connected to your node completely.

Note that, you can remote access into your Linode without entering password by appending your computer’s public key to Linode’s authorized keys. This can be done by…

  • Open up your terminal
  • If you don’t have an existing public key (the file ‘id_rsa.pub’ in ‘~/.ssh/’ folder), then you should do it by issuing this command
</div>
<div>ssh-keygen -t rsa -C "youremail@email.com"</div>
<div># Note that you will be asked to enter the passphrase. Just enter and remember it.</div>
<div>
  • Run this command to copy the content of your public key to the clipboard ‘cat ~/.ssh/id_rsa.pub | pbcopy’
  • Now connect to your Linode through ssh
  • Create a file ‘~/.ssh/authorized_keys’ and paste the content of your public key there, then save
Now try to logout from ssh and login again and you don’t need to enter the password any more. :)

4th, basic configuration

Begin with updating system, run these commands.


apt-get update

apt-get upgrade --show-upgraded

Next is to set the host name. This is not actually a host name or domain name you want your Linode to host. It can be anything. Let’s say I’ve named it ‘mickey’.

Run the following commands. (don’t forget to change ‘mickey’ to your own host name)


echo "mickey" > /etc/hostname

hostname -F /etc/hostname

Now it’s time to update your /etc/hosts file to let them know your host name.

I issue the command ‘vi /etc/hosts’ to edit the file.

Add the following lines into the file. (you have to enter your Linode’s IP address in the first line, and the IPv6 in the second line, also don’t forget to change ‘mickey’ and host name with your desired name)


12.34.56.78    mickey.example.com    mickey

1234:1234::1234:1234:1234:1234    mickey.example.com    mickey

Next, it’s time to configure the time zone. I usually set UTC as my time zone for all of my Linodes.


dpkg-reconfigure tzdata

Select UTC from the list, or just select your desired time zone.

Then you need to make a symbolic link to your time zone info.


ln -sf /usr/share/zoneinfo/UTC /etc/localtime

If you are using any other time zone than UTC, then you should find your time zone info in the ‘/usr/share/zoneinfo/’ directory.

Ok, let’s go to the next step. I hate ASCII, so I configure my box to use UTF-8 by editing the ‘~/.bashrc’ file to include these lines.


export LANG="en_US.UTF-8"

export LC_CTYPE="en_US.UTF-8"

The basic configuration is completed now.

5th, installing Ruby

First, you need to install some pre-requisite libraries.


apt-get install build-essential bison openssl libreadline6 libreadline6-dev libcurl4-openssl-dev git-core zlib1g zlib1g-dev  libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev curl

Note that the above is a single line command.

If you are using MySQL, you need to execute the following command.


apt-get install mysql-server mysql-client

Also, if you are using Image Magick library, run this command.


apt-get install libmagickwand-dev imagemagick

Now it’s time to install Ruby. I choose to use RVM as it can handle multiple versions of Ruby installation. Run this shell command.


bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)

Check if the RVM was installed correctly.


type rvm | head -1

It should output ‘rvm is a function’. This prove you are correct in this step.

Now I decide to install the latest version of Ruby.


rvm install ruby

If you want to install the specific version of Ruby, you can do it by…


rvm install ruby-1.9.2

Wait a few minutes and it’s time to configure the default version of Ruby to be used by the Linode.


rvm --default use 1.9.2-p290

rvm gem set use global # install gems to this gemset

gem install rdoc

gem install bundler

Now it’s time to install Passenger and Nginx and make it start up at boot.


gem install passenger

rvmsudo passenger-install-nginx-module

rvm wrapper 1.9.2-p290@global passenger

curl -L http://bit.ly/nginx-ubuntu-init-file > /etc/init.d/nginx

chmod +x /etc/init.d/nginx

update-rc.d nginx defaults

/etc/init.d/nginx start

Wooo Hooo, now my Linode is ready to run Rails app and serve web visitors.

However, for my Linode, I need Postgresql as my production database server. So, I would required to run…


apt-get install postgresql postgresql-contrib

apt-get install libpq-dev

gem install pg

Now the box we created is fully packed with Ruby, Nginx, Passenger, it’s ready now.

6th, time to deploy your Rails application

We will deploy using another user than root regards to security reason. Let’s add one by…


adduser deploy

adduser deploy rvm

Then, logout from current ssh session and re-login using the deploy user.

As I’m using GitHub as my Git server, I need to create a public key for deploy user and add the key to GitHub account.

So, I create a public key by…


ssh-keygen -t rsa -C "youremail@email.com"

Then login to GitHub account and add the key (~/.ssh/id_rsa.pub) to the GitHub account.

Also, I copy the token of my GitHub account.

Then I configure my Git.


git config --global user.name 'FirstName LastName'

git config --global user.email 'myemail@email.com'

git config --global github.user 'githubusername'

git config --global github.token 012345678901234567890 #change the long digit to your GitHub's token

Now get back to your workstation which you are using to develop your Rails application. (The following steps not being run at your Linode box!)

This step is not sure if it required or not, so please try at your own risk.

Create a file ‘setup_load_paths.rb’ in the ‘config’ directory of your Rails application. Then add the following content.

if ENV['MY_RUBY_HOME'] && ENV['MY_RUBY_HOME'].include?('rvm')
begin
rvm_path = File.dirname(File.dirname(ENV['MY_RUBY_HOME']))
rvm_lib_path = File.join(rvm_path, 'lib')
$LOAD_PATH.unshift rvm_lib_path
require 'rvm'
RVM.use_from_path! File.dirname(File.dirname(__FILE__))
rescue LoadError
# RVM is unavailable at this point.
raise "RVM ruby lib is currently unavailable."
end
end

ENV['BUNDLE_GEMFILE'] = File.expand_path('../Gemfile', File.dirname(__FILE__))
require 'bundler/setup'

Then add ‘capistrano’ into your Gemfile and run ‘bundle install’.

Now it’s time to prepare capistrano.


capify .

Then prepend the following lines in the file ‘Capfile’ which was created by the above ‘capify’ command.


# Add RVM's lib directory to the load path.
$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
# Load RVM's capistrano plugin.
require "rvm/capistrano"
# Set it to the ruby + gemset of your app, e.g:
set :rvm_ruby_string, 'ruby-1.9.2-p290@global'

load 'deploy' if respond_to?(:namespace) # cap2 differentiator

# Uncomment if you are using Rails' asset pipeline
# load 'deploy/assets'

Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }

load 'config/deploy' # remove this line to skip loading any of the default tasks

Then edit the file ‘deploy.rb’ in the ‘config’ directory with this content.


set :user, 'deploy'
set :domain, 'myrailsapp.com'
set :application, "myrailsapp"

set :repository, "git@github.com:username/repo.git" # Your clone URL
set :scm, "git"
set :branch, "master"
set :scm_verbose, true
set :deploy_via, :remote_cache
set :scm_passphrase, "password" # The deploy user's password
set :deploy_to, "/home/#{user}/#{domain}"
set :use_sudo, false

require "bundler/capistrano"

default_run_options[:pty] = true
ssh_options[:forward_agent] = true

role :web, domain # Your HTTP server, Apache/etc
role :app, domain # This may be the same as your `Web` server
role :db, domain, :primary => true # This is where Rails migrations will run

namespace :deploy do
task :start do ; end
task :stop do ; end
task :restart, :roles => :app, :except => { :no_release => true } do
run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
end
end

after "deploy:migrations", "deploy:cleanup"

Note that you have to edit each parameters to fit your environment.

Then, you need to configure your Nginx to serve the specified domain name and map to the path to be deployed by capistrano.

Edit the file ‘/opt/nginx/conf/nginx.conf’ and add the following lines.


server {

listen 80;

server_name *.myrailsapp.com;

root /home/deploy/myrailsapp.com/current/public/;

passenger_enabled on;

}

Now it’s time to deploy your Rails application.

capistrano required you to setup for the first time, so you have to run this command for the first time only.


cap deploy:setup

Then, it is a time to deploy actual files.


cap deploy

If you are following the above instructions carefully. You should have a production of your Rails application running now. :)

Cheers!

New Laptop For My Presentation Career, Macbook Air Mid 2011…

Hi there,

Just want to share I’m going to get a new laptop for use on my presentation at client sites.

Here is criteria I’m using to select my new presentation weapon.

  • Mainly for portability
  • Should support for partial works on web development using Ruby on Rails
  • Long life battery
  • Looking good to great
  • In a reasonable price tag
  • 13″ screen, no smaller display because I used to do web development sometime

If you are using the same criteria as mine, you should ends up the same with what I’ve chosen.

It’s Apple Macbook Air 13″ (Mid 2011) because it ends up with these criteria well.

Here is its own strength points.

  • Ultra portability, very slim and light weight
  • Battery life is so good for me, maybe the help of Mac OSX
  • Even the CPU is ULV series but its performance also gained by using SSD storage
  • It’s fast enough for everyday use and satisfy for my Ruby on Rails web development
  • Great display resolution for 13″ screen
  • Price is fair

I will review more soon. Just write this short post to test a functionality in my new Facebook app.

Thanks,
Seree

Corona SDK vs cocos2d, What Will You Choose?

Hi there,

Today I’m going to write a post about what I think on comparing between Corona SDK by anscamobile and Cocos2d framework.

As I’m planning to launch a new project that based on mobile platform primarily on Apple iOS 5, I’m considering between Corona SDK and cocos2d and I decide to avoid the native iOS framework because I need to build an app that can differentiate from normal app.

Also, productivity is the point too as these two frameworks can be boost productivity while comparing to the original iOS framework by Apple.

readline 6.2 Make Error in Mac OS X Lion

After I’ve upgraded my Snow Leopard to Lion, I found many things regard to my development environment doesn’t work anymore.

This is including the process to compile the library readline 6.2 which is a need to be done before installing the latest Ruby. (1.9.2-p290)

When I try to make, I got the error like this.

gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
i686-apple-darwin11-llvm-gcc-4.2: -compatibility_version only allowed with -dynamiclib
make[1]: *** [libreadline.6.2.dylib] Error 1
make: [shared] Error 2 (ignored)

I wonder why it doesn’t work because I just did the same to install Ruby 1.9.2-p181 on my old Snow Leopard.

Then, after I research some information through Google.

I found this solution to make it works.

After configured the source code with ./configure –prefix=/usr/local

Follow this…


cd shlib

sed -e 's/-dynamic/-dynamiclib/' Makefile > Makefile.good

mv Makefile.good Makefile

cd ..

make

sudo make install

This works for me and I’m fairly sure it will works for you too. :)

Such a Top Notch Support I Got From ScrapeBox And XSServer.eu – Five Stars!

As you might known that I’ve posted about one of my top SEO tool in my arsenal is ScrapeBox.

ScrapeBox

Last few days, I feel like ScrapeBox is hogging almost of my home network connection’s resource.

So I decide to move ScrapeBox from home PC to work on VPS.

After I’ve research some to find out where is the best VPS provider that fits for ScrapeBox and it doesn’t cost too high to invest.

And I found XSServer.eu is in the case, it is proven to be able to use ScrapeBox and many white-to-black marketers are using its service.

Then, I pick up a $35/month plan immediately for unmetered bandwidth + 1GB ram which I think it is best fit for ScrapeBox while another plan such as $25 for 512MB of ram also fit for tiny use of ScrapeBox as well but I think I will be a hardcore user so I decide to get at least 1GB of ram. Minimal.

XSServer.eu

After an hour since I’ve made a payment to XSServer, I got an email notified that they created my VPS machine successfully.

I’m a bit happy for their quick response to create a VPS. Anyway, I think they can make it quicker too.

Now I open up my Mac OS X Lion and open Microsoft RDC and connect my VPS remotely. Success.

Anyway, after I’ve uploaded my ScrapeBox archive file into my VPS, I can’t run it successfully.

ScrapeBox show me that it might have some thing block ScrapeBox or some application tampered the TCP data.

If you got the same error like mine, you can have a test by going to Help->Test Server menu and see the result.

For me, I got 5 green lights and red light on the server 1′s Access Test.

This mean I’m getting a problem with ScrapeBox now.

Can’t make it works, so I guess it should be some issue with VPS environment because I didn’t installed any other softwares on it and it is pure vanilla.

So I begin to create a support ticket with XSServer.eu support department.

Well worth, like what I’ve heard from research, they response very quickly. If you are in front of me, I would say… “It’s f*ck’n fast response!”

Anyway, even they have fast response time, but their information not so helpful for my case because finally they want me to contact ScrapeBox to troubleshoot the thing and said it’s not the problem with VPS.

Ok, ok, then I try to contact ScrapeBox. If you are trying to contact ScrapeBox at their contact page, you will ends up seeing it let you contact by sending email to scrapeboxhelp (a) gmail.com.

Anyway, from what I’ve tried myself, I suggest you to use support (a) scrapebox.com instead of the one on gmail.

They do response on the second one much quicker.

And it is awesome!

Their support staff is very very informative, helpful and get straight into the core issue.

They are very professional. Even I don’t know who is the person I communicate with but I would like to say he/she is very professional and impress me.

Even the second license transfer fee, they waived for me.

Finally it works…

By a prove from ScrapeBox log that it is some issue with VPS environment itself, not the ScrapeBox itself.

So I send this information to XSServer.eu support staff, and they response with a very good effort.

They create a pure new VPS in the another node of their network to help me immediately.

And it is working like a charm now! New license is transferring to my new VPS and I can’t wait to get ScrapeBox running now.

6 green lights are great. I really love it.

If you read ’til this line, then I quite sure you already know how to make a great support like this. Right?

Thanks,

My testing site now ranked #1 on 201,000 searches per month keyword (continued…)

Hi folks,

As I’ve written about how backlinks still affects to your website ranking on SERP last time at this post.

Today I can say, it still works, not just works normally but still working great!

Because I just got ranked on the top of Google today. (actually, it might be yesterday or 2-3 days before now)

Top Rank

So, I can say that generating backlinks still be a great thing to invest for your online business today.

If you want to discover how I ranked  #1 on this keyword, the essentials are just two factors.

  • Keyword matching domain name (exact keyword as domain name)
  • Build as many as possible backlinks (I did 1xx,xxx backlinks)
BTW, let me tell you that for building backlinks, I used almost automation tool to make it.
If you have a time to do it manually, then it should be great.
But I just want almost of the SEO tasks as automated as possible.
My automation tool for building backlinks is only ‘Scrapebox’.
It really worth every bucks you paid for it, if you serious on your online business, then, you can’t live without it.
Build more backlinks now!
UPDATED
Last week, my ranking was dropped to #2, but then I try to make my created backlinks get indexed as much as possible.
Today (2 days later), I got back to #1 now.
*You know the #2 is from http://*.msn.com/, saw the power of backlinks?

Does generating more back links to your site still working good on Google SERP today?

Hi Internet marketer folks,

Today I would like to share with you guys how the result I produced from generating more back links to my few web sites to prove on the popular & myth question…

Back links

Does generating more back links still work for your sites to get higher ranking on Google SERP today?

Let me show you one of my few sites I used to test this topic.

I’m using a keyword which have 201,000 global monthly search, low-to-medium competition.

At the first week, I ranked well on page #7, then it is climbing up everyday until I got on the 1st page, but I never get it in the top 5 area. (Actually, I do on ranked #8 and #9)

The second week, I realize that Google might be dancing because sometime, Market Samurai can’t found my site on all indexed pages on Google SERP.

Anyway, sometime it get back to page #1, still in #8, #9 and sometime it disappeared like I got de-indexed, but actually it still in Google index but don’t know why my site is showing on the so so so long pages that no one can browse to that page.

From this point of time, the rank is steadily on #8 and #9 and never get better. It is the same about 2-3 weeks.

So, this is the time to test how back links affect to my site for Google SERP today.

I begin by launching my golden SEO weapon. Scrapebox (if you really serious about SEO, you can’t live without it easily)

Then load up my personal list of websites that do auto approve comments and I begin fast posting through Scrapebox.

Until now, the Scrapebox still running and did successfully post about 51,894 comments. (almost taken 2 days)

So, I launch up another golden SEO weapon, Market Samurai, and doing rank checker.

Wow!

My Market Samurai report that my site ranked on #4 now!

So, you know the answer of this myth question right now?

Back links still get much credits from Google, I believe it should stay the same credibility for back links until Google found out a new method how to detect the popularity of each site in the balance of quality too.

It should not be easy for Google to ignore the power of back links because it is somewhat a nature of web site.

If a website is popular, it should have growing more and more back links.

From my thought, I will do about 100,000 back links and stop adding more back links,

Then I will try to index as much as possible of my back links URLs and see the result. (expected about 30% of it)

When the rank is steadily, I will test the power of social networking to see how it affects to my sites ranking.

Well, I will report here again after the next milestone of my personal test.

Thanks,

Advanced CPA Tactics to Boost Your Profit

Here is a short list of my tactics I’m going to use in my CPA sites to boost my profit.

If you are going to use one of them, few of them or all of them. Please let me know if it works well for you or not.

Boost Profit

Upsell tactic #1

The generic strategy of most CPA marketers is to have the only offer so the visitor will not lack of focus and concentrate on the targeted offer.

However, while the concentration is good but you probably lose a chance to do some upsell-like for them.

So, I decide to place related offers to let them see too but the scenario in my head are…

How to put related offers while the main CPA offer still be able to force visitor to fully concentrate on them?

Luckily, I cracked the code…

What I did are…

  • When I got laser targeted traffic for the main CPA offer, I will show only the main offer. Only***
  • I will change the link to real offer to use some type of pop-over to force visitor to stay on my side while they are taking action (like doing survey)
  • When they completed taken action on the main offer, they close the pop-over
  • Now the page will zoom out the main CPA offer and display related offers in the bottom area of it
This already boost my profit a lot.
You can try on your site too but it requires some technical approaches to implement this tactic.
That’s why I developed my own CPA Profit System.
I’ll keep you posted here, please come back to check.

 

Exit offer tactic #2

Now, on every page of mine, I placed the exit pop-over to capture some visitor before leaving.
Even though it doesn’t work very well when compared to the tactic #1, your profit will increase.

 

Continuity tactic #3

This is by far the only one tactic you have to use on all of your CPA pages or sites.

Yes, I talk about list building, why don’t you ignore this most effective approach to make money continuity from your existing clients?

You can’t ignore this, remember it? New customers required much more to spend when compared to the cost of maintaining the existing customers.

 

I hope these 3 tactics can boost your CPA profit in both in short term and long term.
I did it and you can too.
Cheers,