Friday, April 29, 2016

7 สิ่งที่คนมีประสิทธิผลสูงในชีวิตไม่ทำกัน

Done better perfect

Ref: https://www.skilllane.com/blog/7-things-that-effective-people-dont-do?utm_source=Facebook&utm_medium=SkillLane%20Page&utm_campaign=fs_na_blog_7-things-that-effective-people-dont-do_20160427

คุณอยากเป็นคนหนึ่งที่ใช้เวลาน้อยๆ สร้างผลลัพธ์ได้มากๆ หรือไม่?



ถ้าคุณเป็นคนที่รู้สึกว่าตัวเอง “ยุ่ง” ตลอดเวลา แต่ยังไม่ได้ผลลัพธ์มากเท่าที่ตั้งใจล่ะก็

เป็นไปได้ว่าคุณกำลังใช้เวลาของคุณอย่างไม่มีประสิทธิภาพสูงสุด

วันนี้มาดูกันว่าอะไรคือ 7 สิ่งที่คนมีประสิทธิผลสูงในชีวิตไม่ทำกัน



1. ไม่ยึดติดความสมบูรณ์แบบ

ผมเป็นหนึ่งในคนที่ชอบรอให้ทุกอย่างพร้อม และมั่นใจว่าผลลัพธ์จะออกมาดีที่สุด ถึงค่อยลงมือทำ

แค่เราเข้าใจว่า โลกนี้ไม่มีอะไรสมบูรณ์แบบ และพร้อมจะผิดพลาดได้ตลอดเวลา

เราจะเริ่มลงมือทำอะไรที่แต่ก่อนไม่เคย เพราะกลัวผิดพลาดได้เยอะเลยล่ะครับ



2. ไม่ให้ตัวเองเสียโฟกัส

Winston Churchill ประธานาธิปดีที่มีชื่อเสียงของอังกฤษ กล่าวไว้ว่า

“คุณจะไม่มีทางถึงจุดหมายถ้าคุณหยุดขว้างก้อนหินใส่สุนัขทุกตัวที่เห่าคุณ”

คุณต้องไม่ทำในสิ่งที่ไม่สอดคล้องกับเป้าหมายของคุณ

และรวมถึง ไม่สนใจเสียงวิพากษ์วิจารณ์ต่างๆที่จะทำให้คุณเสียโฟกัสด้วย



3. ไม่ให้ความคิดเชิงลบดึงคุณลง

ว่ากันว่า โลกนี้มีนักดับฝันมากกว่านักดับเพลิง

เวลาคุณอยากทำอะไรก็ตามให้สำเร็จ จะมีความไม่เห็นด้วยจากคนบางกลุ่มเสมอ

อย่าให้ความคิดเชิงลบจากคนเหล่านั้นมาฉุดคุณไว้

เลิอกสื่อสารกับคนที่ช่วยเหลือและเป็นกำลังใจให้คุณ



4. ไม่ให้คนอื่นตัดสินใจแทนคุณ

คนที่มีประสิทธิผลสูงไม่ต้องการการยอมรับจากใคร

พวกเขาตัดสินใจด้วยตัวเองว่าเขาต้องการอะไร และจะได้มาซึ่งสิ่งนั้นอย่างไร



5. ไม่จมอยู่กับความล้มเหลวในอดีต

การที่คุณไม่เคยทำอะไรได้ ไม่ได้หมายความว่าคุณทำสิ่งนั้นไม่ได้

หลายคนจมอยู่กับความล้มเหลวในอดีตจนไม่กล้าทำอะไร

บอกตัวเองครับว่า คนสำเร็จมากกว่า ล้มเหลวมากกว่าเสมอ

แล้วจะรออะไร ออกไปล้มเหลวเพิ่มสิครับ



6. ไม่มีความเชื่อที่จำกัดตัวเอง

คุณต้องลบความเชื่อที่จำกัดศักยภาพของคุณ เช่น

ฉันทำไม่ได้ ฉันไม่เก่ง ไม่ดีพอ ไม่คู่ควร ฯลฯ

เพราะความเชื่อเหล่านี้นอกจากจะไม่เป็นความจริงแล้ว

ยังไม่ได้ช่วยเหลืออะไรคุณอีกด้วย



7. ไม่หยุดเรียนรู้ พัฒนา และเติบโต

บางทีเรายุ่งอยู่กับชีวิต ภารกิจประจำวัน จนลืมจัดเวลาในการพัฒนาตัวเอง

คนที่มีประสิทธิผลสูงในชีวิตไม่เคยลืมสิ่งนี้ เขาลับขวานให้คมอยู่เสมอ

เพื่อให้ทำสิ่งที่ทำอยู่ได้อย่างดีที่สุด และพร้อมสำหรับสิ่งใหม่ๆที่จะเข้ามา



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

Tuesday, April 5, 2016

Convert video on Ubuntu by WinFF

  • ประเด็นคือต้องการแปลงไฟล์ mp4 ที่ดาวน์โหลดจาก youtube มาให้เป็น avi แบบ divx หรือ xvid
  • ข้อจำกัดคือ ทำบน Linux Ubuntu
  • คือถ้าไม่มีข้อจำกัดว่าต้องแปลงไฟล์บน Ubuntu นะ บน Windows มีโปรแกรมเยอะแยะ เช่น Total video convertor เป็นต้น
Solved
  • ใน Ubuntu เค้าแนะนำถ้าแบบ CLI ก็ต้อง avconv แต่ถ้า GUI ก็ตัวนี้เลย WinFF
  • WinFF มันต้องแค่ตัวหน้ากาก ของ avconv อยู่ดีนั่นแหละครับพี่น้อง แต่มันทำให้ผู้ใช้ทั่วๆ ไปอย่างตัวผู้เขียนเองไม่ต้องใช้กำลังภายในเยอะ เกินความจำเป็น
  • วิธีใช้ ง่ายๆ คือเลือกชนิดไฟล์ภายทางที่เราต้องการจะแปลงไปเป็นแบบใหน ในที่นี้เลือก AVI ครับพี่น้อง โดยเลือกตรงที่ Conver to: และ Preset: แล้วก็เลือก folder ที่จะวางไฟล์ output
  • จากนั้นก็นำเข้าต้นฉบับโดยการกดปุ่ม Add
  • เมื่อทุกอย่างพร้อมก็ Convert กดมันซะ เรียบร้อยโรงเรียนจีน รอให้มันแปลงให้เสร็จแค่นั้น
  • โดยขณะแปลงไฟล์มันจะมีหน้า terminal ขึ้นมาแสดงการ process ด้วยนะครับพี่น้อง
Related
  • http://juuier.blogspot.com/2015/10/convert-video-and-set-aspect-ratio-by.html
Ref
  • http://askubuntu.com/questions/262631/how-can-i-convert-video-to-divx4-to-play-on-my-kogan-tv
  • https://www.maketecheasier.com/convert-mp4-avi-ubuntu/

FAT Sorter in Ubuntu

  • บน Windows จะมีโปรแกรมชื่อ FAT Sorter เอาไว้เรียงไฟล์ ให้อ่านตามลำดับตัวอักษร สำหรับตัว player บางตัวที่เรียงลำดับตาม sector บน disk คือ ไฟล์ใหน ก๊อปปี้วางก่อนจะได้อยู่ลำดับแรกๆ ที่ตัว player จะเห็น ไม่ว่า จะขึ้นต้น หรือ ชื่อไฟล์เป็นแบบใหนก็ชั่งไม่สนใจ
  • เช่น ตัว player ในเครื่องเล่น DVD , USB ที่ดูบนรถยนต์เป็นต้น
  • ใน Linux Ubuntu ล่ะมีโปรแกรมแนวนี้หรือไม่ คำตอบคือ มีครับ
  • แต่ก็แนว Linux ล่ะน้อ Command Line สิครับพี่น้อง
Solved
  • ขั้นแรกเราต้องรู้ก่อนว่า SD Card หรือ USB Drive ของเราเป็น device path อะไรโดยคำสั่งประมาณนี้ครับ df
  •  หรือ คำสั่งนี้ cat /proc/partitions
  • ให้เราสังเกตพวกประมาณ sdb sdc ... ประมาณนี้แหละครับ เพราะ sda จะเป็น harddisk ที่มากับเครื่องนั้นอยู่แล้ว
  • ในที่นี้ โดยคำสั่ง df จะค่อนข้างชัดเจน /dev/sdb1 ของผู้เขียนจะเป็น External Dive
  • อันที่เราต้องใช้คือ /dev/sdc1 ครับพี่น้อง อันนี้แหละคือ USB Dive  ของเรานั่นเอง
  • เมื่อเราทราบพาธของ drive ที่เราจะ sort แล้วก็ใช้คำสั่งประมาณนี้ได้เลย
sudo fatsort -f /dev/sdc1
  • ถ้าไม่มีอะไรผิดปกติก็จะได้ผลลัพธ์ดังภาพครับ
Related
  • http://juuier.blogspot.com/2014/11/fat-sector-sorter-disk-sector.html
Ref
  • http://askubuntu.com/questions/158781/how-to-change-fat32-sort-order-on-drive
  • http://manpages.ubuntu.com/manpages/lucid/man8/fatsort.8.html
  • http://jansipke.nl/sorting-files-alphabetically-on-fat-filesystems-usb-disks-sd-cards/

Rotate a PDF under Ubuntu Linux by PDF ToolKit

  • ปัญหาคือ pdf ต้นฉบับมันกลับหัว อยากให้มันแสดงผลแบบปกติ ทำยังไง
  • ใน Windows ปกติจะใช้ Adobe Acrobat ช่วย หรือ ใช้เว็บบริการ กลับหัว pdf ออนไลน์ 
  • โจทย์คือ ใช้ Linux Ubuntu นี่แหละช่วย แต่ไม่อยากใช้ เว็บช่วยกลับหัวอะ จะทำไง
  • ลองหาโปรแกรมช่วยแบบ GUI สิ่งที่ได้พบคือ PDF-Shuffler อืม ลองใช้ดู มันบอกว่า ทำได้ทุกอย่างเหมือน Toolkit ทั่วไป แต่พอเราลองเอามาช่วยกลับหัว page ทุกหน้า ปรากฏว่ามีบักซะงั้น ใช้ไม่ได้
  • มาลงเอยที่ Comman Line หว่า
sudo apt-get install pdftk
Man pdftk
EXAMPLES
       Collate scanned pages
         pdftk A=even.pdf B=odd.pdf shuffle A B output collated.pdf
         or if odd.pdf is in reverse order:
         pdftk A=even.pdf B=odd.pdf shuffle A Bend-1 output collated.pdf
       Decrypt a PDF
         pdftk secured.pdf input_pw foopass output unsecured.pdf
       Encrypt a PDF using 128-bit strength (the default), withhold all permissions (the default)
         pdftk 1.pdf output 1.128.pdf owner_pw foopass
       Same as above, except password 'baz' must also be used to open output PDF
         pdftk 1.pdf output 1.128.pdf owner_pw foo user_pw baz
       Same as above, except printing is allowed (once the PDF is open)
         pdftk 1.pdf output 1.128.pdf owner_pw foo user_pw baz allow printing
       Join in1.pdf and in2.pdf into a new PDF, out1.pdf
         pdftk in1.pdf in2.pdf cat output out1.pdf
         or (using handles):
         pdftk A=in1.pdf B=in2.pdf cat A B output out1.pdf
         or (using wildcards):
         pdftk *.pdf cat output combined.pdf
       Remove page 13 from in1.pdf to create out1.pdf
         pdftk in.pdf cat 1-12 14-end output out1.pdf
         or:
         pdftk A=in1.pdf cat A1-12 A14-end output out1.pdf
       Apply 40-bit encryption to output, revoking all permissions (the default). Set the owner PW to
       'foopass'.
         pdftk 1.pdf 2.pdf cat output 3.pdf encrypt_40bit owner_pw foopass
       Join two files, one of which requires the password 'foopass'. The output is not encrypted.
         pdftk A=secured.pdf 2.pdf input_pw A=foopass cat output 3.pdf
       Uncompress PDF page streams for editing the PDF in a text editor (e.g., vim, emacs)
         pdftk doc.pdf output doc.unc.pdf uncompress
       Repair a PDF's corrupted XREF table and stream lengths, if possible
         pdftk broken.pdf output fixed.pdf
       Burst a single PDF document into pages and dump its data to doc_data.txt
         pdftk in.pdf burst
       Burst a single PDF document into encrypted pages. Allow low-quality printing
         pdftk in.pdf burst owner_pw foopass allow DegradedPrinting
       Write a report on PDF document metadata and bookmarks to report.txt
         pdftk in.pdf dump_data output report.txt
       Rotate the first PDF page to 90 degrees clockwise
         pdftk in.pdf cat 1east 2-end output out.pdf
       Rotate an entire PDF document to 180 degrees
         pdftk in.pdf cat 1-endsouth output out.pdf
ตัวอย่างแบบไทย
  • มีไฟล์ pdf ชื่อว่า myfile.pdf ซึ่งมี 10 หน้า ความต้องการดังนี้ 
  • หน้า 1 ไม่ต้องเปลี่ยนแปลง
  • หน้า 2 - 3 กลับหัว 180 องศา
  • หน้า 4 หมุนทวนเข็มนาฬิกา 90 องศา
  • หน้า 5 -  7 หมุนตามเข็มนาฬิกา 90 องศา 
  • หน้าที่เหลือไม่ต้องเปลี่ยนแปลง
  • และตั้งชื่อให้เป็นไฟล์เดิมด้วย
Solved
pdftk myfile.pdf cat 1 2-3down 4left 5-7right 8-end output mytmp.pdf && mv mytmp.pdf myfile.pdf
Ref
  • man pdftk
  • http://makandracards.com/makandra/1487-rotate-a-pdf-under-ubuntu-linux

Saturday, March 19, 2016

การ์ดจอ ATI RADEON HD 4570 อยากใช้ Catalyst Control Center ใน Windows 10

  • ประเด็นตามหัวข้อเลยครับ "การ์ดจอ ATI RADEON HD 4570 อยากใช้ Catalyst Control Center ใน Windows 10"
  • จริงๆ ถ้าตัวเองไม่เรื่องมากก็ไม่ใช่ปัญหาอะไรหรอก พอดีชอบความละเอียดแค่ 1024x768 แต่พอปรับแล้ว Scale มันไม่เต็มจออ่ะ ซึ่งปกติก่อนหน้านี้ จะใช้ Catalyst Control Center เป็นตัวปรับ Scale ให้เต็มจอ 
  • ใน Windows 7 - 8.1 เราก็ไปโหลด Driver suite ของ ATI RADEON มันมาแล้วติดตั้งมันก็ใช้ได้นะ
  • แต่ Windows 10 มันยังไม่ทำ driver ให้กับตัว HD 4570 ( มันคือ HD 4000 Series) รุ่นนี้หว่า
  • ปัญหาคือ โหลดทั้ง Catalyst Software Suite 13.1 และ 13.4 beta แล้วติดตั้ง ได้สมบูรณ์ก็จริง
  • แต่มีแจ้ง warning มาว่าประมาณ driver failed ซะงั้น
  • ลองเปิด Catalyst Control Center เพื่อจะปรับ Scale มันก็เปิดไม่ได้ ทำไงดีล่ะ ที่นี้
Solved
  • ไปเจอในเว็บต่างประเทศมา เค้าใช้ HD 4500 ประมาณนี้และก็มีปัญหาใช้ Control Center ของ ATI ไม่ได้เช่นกัน แต่เค้าแก้ปัญหาโดยโหลดตัว 13.4 มาแล้วติดตั้ง failed ก็ปล่อยมันไป โดยไปโหลดได้ที่
  • http://support.amd.com/en-us/download/desktop/legacy?product=legacy2&os=Windows+8+-+64

  • จากนั้นให้ให้เราคลิกขวาที่ This Computer เลือก Manage
  • เราก็จะได้ได้ต่างประมาณนี้ให้เราไปที่ Device Manager แล้วคลิกที่ ลูกศรชี้ลงหน้า Display adapters เราจะเป็น Driver ที่ตัว การ์ดจอของเครื่องในปัจจุบัน จะเป็น driver ที่มัน bundle มากับ Windows 10 เค้าอยู่แล้ว ซึ่งเราหาวิธีปรับ Scale ให้เต็มจอไม่ได้เมื่อปรับความละเอียด จอให้ต่ำลง
  • จากนั้นคลิกขวาที่ ATI Mobility Radeon HD 4500 เลือก Update Driver Software...
  • เราจะได้หน้าต้างประมาณนี้ แล้วคลิก Browse my computer ... manualy.
  • เลือก Browse... ไปที่พาธประมาณนี้
  • C:\AMD\AMD_Catalyst_13.4_Legacy_Beta_Vista_Win7_Win8\Packages\Drivers\Display\W86A_INF
  • คลิกปุ่ม Next ด้านล่าง
  • จากนั้นก็เป็นอันเรียบร้อย เราลองสังเกตุใน Devices ที่ Display adapters มันจะเปลี่ยนเป็น 4500/5100 Series แล้วนะ
  • เพียงเท่านี้เราก็สามารถใช้ Catalyst Control Center ใน Windows 10 และสามารถใช้ Scaling Options ได้แล้วครับพี่น้อง 

  • ขอบคุณอ้างอิงจากต่างประเทศครับ ขอหาก่อนว่า เว็บใน เดี๋ยวแก้เครดิตทีหลังนะ

Monday, February 1, 2016

แก้ปัญหาบราวเซอร์ถูกยึด (Browser Hijacking) ด้วย Browser Hijacker Removal Tools

  • ประเด็นปัญหามีอยู่ว่า เครื่อง windows 7 ยืนยันตัวตนผ่านระบบอินเทอร์เน็ตของหน่วยงานไม่ผ่าน
  • อาการคือ ใส่ ชื่อผู้ใช้และรหัสผ่าน อะไรก็ช่างเข้าไป มันจะขึ้นหน้าต่าง Please enter username 
  • ลองใช้ private mode ของแต่ละบราวเซอร์ กะบ่หาย
  • สแกนไวรัสด้วย Free avast ก็บ่หาย
  • อาการแบบนี้ มันคืออะไรน้อ แต่ที่รู้แน่ๆ คือ บราวเซอร์มีปัญหา ทุกตัว 
  • ยังไม่ได้ลอง ถอนและติดตั้งบราวเซอร์ใหม่นะ คิดว่าแบบนี้คงฝังใน รีจิสตรี มันแน่ๆ แล้ว
  • กะว่าจะ ติดตั้ง OS ใหม่แล้วนะ พอดีไปเจอเรื่อง browser hijacking เลยลองหาเครื่องมาตามอ้างอิงมาใช้ดูปรากฎว่า ใช้ได้เลยครับพี่น้อง
Solved
  • จากอ้างอิง ผู้เขียนใช้ AdwCleaner
  • อันนี้น่าจะเป็น ฟรีแวร์นะ ใช้ฟรีได้เลย แต่เครื่องเราต้องต่อเน็ตให้มันได้เสีย ก่อน แล้วเครื่องเรามันใช้เน็ตไม่ได้ทำไงดี พอดีเครื่องมี WLAN Card อยู่ใช้ต่อกับเครื่องอื่นๆ ที่แชร์เน็ตให้ผ่าน adhoc แล้วกัน แต่เครื่องต้องถอดสาย LAN ออกก่อน ไม่งั้นออกเน็ตไม่ได้อยู่ดี
  • ต่อเน็ตแล้วก็ดาวน์โหลด แล้วเปิดโปรแกรมขึ้นมา มันจะอัพเดทฐานข้อมูลของโปรแกรมผ่านเน็ตแป๊ปหนึ่ง นะ รอมันอัพเดทเสร็จก็จะโหลดโปรแกรมขึ้นมาได้ดังภาพ
  • จากนั้นให้เราทำการคลิกที่ปุ่ม Scan เมื่อสแกนเรียบร้อยให้เราคลิกที่ปุ่ม Cleaning เป็นอันเรียบร้อย
  • ลองเปิด browser chrome ขึ้นมาทดสอบปรากฏว่าเป็นดังภาพ
  • ไม่สามารถเชื่อมต่อกับพร็อกซี่เซิร์ฟเวอร์ได้ ทำไงล่ะทีนี้ 
  • ไปเปิด Internet Options ขึ้นมาในที่นี้ก็เปิดผ่าน IE นะ เลือก Connections ตามด้วย LAN settings
  • uncheck หน้า Use a proxy ... connections). เอาเครื่องหมายถูกหน้าช่องนี้ออกซะ แล้ว กดปุ่ม OK
  • เป็นอันเรียบร้อยต่อสาย LAN ทดสอบยืนยันตัวตนผ่าน Ethernet ได้เรียบร้อย
เพิ่มเติม
  • โปรแกรมอื่นที่น่าสนในคือ Norton Power Eraser ตัวนี้ยังไม่ได้ลองแต่น่าจะ สแกนเจอ adware พวกนี้เช่นเดียวกัน

  • Updated 7 เมษายน 2559 โดน Hohosearch อันนี้ AdwCleaner ก็ช่วยได้เช่นกันครับ 


  • หลังจากสแกนด้วย AdwCleaner แล้วให้ติดตั้ง browser chrome หรือ firefox ใหม่อีกรอบครับพี่น้อง

อ้างอิง
  • http://www.thewindowsclub.com/free-browser-hijacker-removal-tool
  • http://www.freeware.in.th/windows/8649

Change desktop location in Windows 7


  • On Windows 7, ‘Desktop‘ directory is by default located at [systemdrive]\users\loginid\Desktop. If C: is system drive then it would be inc:\users\loginname\Desktop.
  • For example, administrator’s desktop would be atC:\users\administrator\Desktop
Solved
  • เปิด Run พิมพ์ regedit แล้ว Enter
  • Root ด้านซ้ายมือ ให้เราเข้าไปตามพาธนี้
"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders"
  • ดับเบิ้ลคลิกมัน แล้วเปลี่ยน ค่า location ได้ตามต้องการ ดังตัวอย่าง เปลี่ยนไปที่ drive d คือไปสร้าง  folder ชื่อ Desktop ไว้รอแล้ว ให้เราเปลี่ยนค่าเป็น D:\Desktop 
  • Restart คอมฯ เราซักรอบ จบครับพี่น้อง
เพิ่มเติม

  • ค่าเดิมมันของตัวนี้คือ

%USERPROFILE%\Desktop
Ref
  • http://www.windowstipspage.com/change-desktop-location-windows-7/

Friday, January 22, 2016

Server error 500 when move host for Wordpress

  • ประเด็นง่ายๆ คือ มีเว็บที่สร้างด้วย wordpress 4.4.1 จะย้ายจาก host จริง เป็น public ip ไปที่ VPS (Virtual Private Server) แต่ก็ได้ public ip เช่นกัน 
  • host เดิม และ host ใหม่ ใช้ Ubuntu 14.04.3 LTS Server เหมือนกัน
  • ย้ายโดยการ mysqldump แล้วก็ตามด้วย rsync ทั้ง folder เว็บและฐานข้อมูล
  • สุดท้ายก็นำเข้าฐานข้อมูล แล้วสร้าง user mysql grant user ให้เรียบร้อย
  • รวมทั้ง config apache2 ก็เอามาจากของเดิมทั้งหมด
  • ทำไมรัน Wordpress มัน server error 500 หว่า แล้ว ดูคอนฟิก database มั่นใจว่าไม่มีอะไรผิดปกติ
  • ดู error มันก็ไม่แจ้งอะไรเลยทำไงดีล่ะทีนี้
Solved 
  • เปิด wp-config.php ของ wordpress ใน host ที่เราพึ่งย้ายเข้าไปใหม่ขึ้นมา
  • จากนั้นบรรทัดแรกของโค้ด php เพิ่มค่าประมาณนี้เข้าไปเพื่อให้มันอธิบาย error ให้มากขึ้นสำหรับ error php
ini_set('display_errors',1);
error_reporting(E_ALL);
  • จากนั้นบันทึกไฟล์คอนฟิกให้เรียบร้อย และทำการ refresh หน้าเว็บ wordpress อีกรอบ
  • ที่นี้เราก็จะได้เบาะแสของ error เพิ่มขึ้นแล้ว ซึ่งในกรณีของผู้เขียน แสดงประมาณนี้
  • Faltal error: ... 'Facebook needs the CURL php extension' ...
  • จากนั้นผู้เขียนก็แก้ปัญหาตามที่ error แจ้งซะเลย
  • sudo apt-get install php5-curl && sudo service apache2 restart
  • เรียบร้อยคับ wordpress รันได้เหมือนโฮสเดิมแหละ
อ้างอิง
  • http://stackoverflow.com/questions/8250914/wordpress-move-site-online-500-internal-error

Facebook auto publish Wordpress plugin need PHP CURL extension

  • เข้าใจว่ามันน่าจะลงให้โดยค่าเริ่มต้นตอนติดตั้ง wordpress หรือไม่ก็ตอนลง theme แบบ premium 
  • แต่ไง๋มัน activate ไม่ได้หว่า
Solved
sudo apt-get install php5-curl && sudo service apache2 restart

Wednesday, January 20, 2016

Split the terminal into more than one “view” with tmux

  • เคยมั้ยตอนเรารีโมทเซิร์พเวร์ อยากได้หน้า terminal หลายๆ หน้าให้แสดงในหน้าเดียวแบบนี้

tmux is a terminal multiplexerWhat is a terminal multiplexer? It lets you switch easily between several programs in one terminal, detach them (they keep running in the background) and reattach them to a different terminal. And do a lot more. See the manual.

การใช้งานแบบคร่าวๆ ติดตั้งและรันโปรแกรม sudo apt-get install tmux && tmux
  • Split screen vertically: Ctrlb and Shift5
  • Split screen horizontally: Ctrlb and Shift"
  • Toggle between panes: Ctrlb and o
  • Close current pane: Ctrlb and x
You can achieve more complex layouts by splitting panes. You can also have multiple windows with panes and switch between them.
  • Create windows: Ctrlb and c
  • Switch to next window: Ctrlb and n
  • Switch to previous window: Ctrlb and p
  • Destroy current window: Ctrlb and x
Ref
  • http://tmux.github.io/
  • http://unix.stackexchange.com/questions/7453/how-to-split-the-terminal-into-more-than-one-view

Tuesday, January 19, 2016

Failed to fetch http://th.archive.ubuntu.com & Err http://th.archive.ubuntu.com/ubuntu/ trusty/universe ... 403 Forbidden [IP: ...]

  • ติดตั้ง Ubuntu 14.04.3 LTS Desktop 
  • ตอนแรกก็ติดตั้ง แพคเกจได้ปกติ
  • แต่ทำไมวันนี้ มัน error งี้ล่ะ
Error

user@myhost:~$ sudo apt-get install guake
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libvte-common libvte9 python-vte
The following NEW packages will be installed:
  guake libvte-common libvte9 python-vte
0 upgraded, 4 newly installed, 0 to remove and 11 not upgraded.
Need to get 589 kB of archives.
After this operation, 2,810 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Err http://th.archive.ubuntu.com/ubuntu/ trusty/main libvte-common all 1:0.28.2-5ubuntu1
  403  Forbidden [IP: 192.100.77.186 80]
Err http://th.archive.ubuntu.com/ubuntu/ trusty/main libvte9 amd64 1:0.28.2-5ubuntu1
  403  Forbidden [IP: 192.100.77.186 80]
Err http://th.archive.ubuntu.com/ubuntu/ trusty/main python-vte amd64 1:0.28.2-5ubuntu1
  403  Forbidden [IP: 192.100.77.186 80]
Err http://th.archive.ubuntu.com/ubuntu/ trusty/universe guake amd64 0.4.4-1ubuntu1
  403  Forbidden [IP: 192.100.77.186 80]
E: Failed to fetch http://th.archive.ubuntu.com/ubuntu/pool/main/v/vte/libvte-common_0.28.2-5ubuntu1_all.deb  403  Forbidden [IP: 192.100.77.186 80]

E: Failed to fetch http://th.archive.ubuntu.com/ubuntu/pool/main/v/vte/libvte9_0.28.2-5ubuntu1_amd64.deb  403  Forbidden [IP: 192.100.77.186 80]

E: Failed to fetch http://th.archive.ubuntu.com/ubuntu/pool/main/v/vte/python-vte_0.28.2-5ubuntu1_amd64.deb  403  Forbidden [IP: 192.100.77.186 80]

E: Failed to fetch http://th.archive.ubuntu.com/ubuntu/pool/universe/g/guake/guake_0.4.4-1ubuntu1_amd64.deb  403  Forbidden [IP: 192.100.77.186 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Solved

  • ค้นหาโปรแกรมด้วยคำว่า software & updates 
  • Download from ค่าเริ่มต้นตอนแรกเป็น Thailand ให้เราเปลี่ยนเป็น Main server บันทึกให้เรียบร้อย
  • แล้ว ทำการอัพเดทรายการแพคเกจ แล้วติดตั้งโปรแกรมก่อนหน้านี้ได้เลย
  • เข้าใจว่า repo server ในไทยมันไม่ค่อย support รุ่นเก่าๆ หว่า sudo apt-get update && sudo apt-get install guake ได้เรียบร้อยไม่มีปัญหาแล้วทีนี้
Ref
  • http://askubuntu.com/questions/32064/failed-to-fetch-http-in-archive-ubuntu-com-ubuntu-dists-maverick-release
  • http://askubuntu.com/questions/553765/failed-to-fetch-update-on-ubuntu-14-04-lts-trusty-tahr/553766

What is the difference between authorized_key and known_host file for SSH?

Authorized Keys

By default SSH uses user accounts and passwords that are managed by the host OS. (Well, actually managed by PAM but that distinction probably isn't too useful here.) What this means is that when you attempt to connect to SSH with the username 'bob' and some password the SSH server program will ask the OS "I got this guy named 'bob' who's telling me his password is 'wonka'. Can I let him in?" If the answer is yes, then SSH allows you to authenticate and you go on your merry way.
In addition to passwords SSH will also let you use what's called public-key cryptography to identify you. The specific encryption algorithm can vary, but is usually RSA or DSA. In any case when you set up your keys, using the ssh-keygen program, you create two files. One that is your private key and one that is your public key. The names are fairly self-explanatory. By design the public key can be strewn about like dandelion seeds in the wind without compromising you. The private key should always be kept in the strictest of confidence.
So what you do is place your public key in the authorized_keys file. Then when you attempt to connect to SSH with username 'bob' and your private key it will ask the OS "I got this guy name 'bob', can be be here?" If the answer is yes then SSH will inspect your private key and verify if the public key in the authorized_keys file is its pair. If both answers are yes, then you are allowed in.

Known Hosts

Much like how the authorized_keys file is used to authenticate users the known_hosts file is used to authenticate servers. Whenever SSH is configured on a new server it always generates a public and private key for the server, just like you did for your user. Every time you connect to an SSH server, it shows you its public key, together with a proof that it possesses the corresponding private key. If you do not have its public key, then your computer will ask for it and add it into the known_hosts file. If you have the key, and it matches, then you connect straight away. If the keys do not match, then you get a big nasty warning. This is where things get interesting. The 3 situations that a key mismatch typically happens are:
  1. The key changed on the server. This could be from reinstalling the OS or on some OSes the key gets recreated when updating SSH.
  2. The hostname or IP address you are connecting to used to belong to a different server. This could be address reassignment, DHCP, or something similar.
  3. Malicious man-in-the-middle is happening. This is the biggest thing that key checking is trying to protect you from.
In both cases, known_hosts and authorized_keys, the SSH program is using public key cryptography in order to identify either the client or the server.

Ref

  • http://unix.stackexchange.com/questions/42643/ssh-key-based-authentication-known-hosts-vs-authorized-keys
  • http://security.stackexchange.com/questions/20706/what-is-the-difference-between-authorized-key-and-known-host-file-for-ssh

ว่าด้วยเรื่อง Remote login Ubuntu with root user

  • Ubuntu user รู้อยู่แล้วว่า ติดตั้งระบบ Ubuntu ไม่ว่าจะ Server หรือ Desktop มันจะไม่อนุญาตให้ใช้ root ในการ login ระบบ ทั้ง แบบ local และ remote เราต้องไปคอนฟิกมันเอง
  • ซึ่งมันจะอยู่ที่นี้ /etc/ssh/sshd_config (ก่อนแก้ไขควรสำรองไฟล์ไว้ก่อนนะ)
  • แต่พึ่งรู้ว่า ทำ public key authen ใช้งานโดยที่เราไม่ต้องไปยุ่งกะ sshd_config มันก็ใช้งานได้เลยแฮะ
  • ส่งสัยค่าเริ่มต้นมันจะอนุญาตให้ Login แบบ without password หว่า ทำให้ public key authen มันเลยผ่าน policy ของค่าเริ่มต้น
  • อ้างอิงบน Ubuntu 14.04.3 LTS server edition

Add exist user Ubuntu to group user for permission sudo

  • คนที่ใช้ Ubuntu ก็จะรู้อยู่แล้วว่าตอนติดตั้งระบบใหม่ๆ มันจะให้สร้าง user 1 คนขึ้นมา และมันจะใช้ sudo ได้โดยอัตโนมัติอยู่แล้ว แต่ user ที่สร้างขึ้นภายหลังมันจะใช้ sudo บ่ได้
  • ทำไงล่ะทีนี้ ประมาณว่าต้องทำให้ user ที่เพิ่มภายหลังให้อยู่ในกลุ่ม sudo ด้วยมั้ง
  • อันนี้ทดสอบบน Ubuntu 14.04.3 LTS 
Pattern
sudo adduser
sudo usermod -a -G sudo
Test
sudo adduser user1
sudo usermod -a -G sudo user1
  • ลองใช้ usermod เพิ่ม Group ให้ user แล้วทำไมมันใช้บ่ได้หว่า หรือเรายังไม่ได้ restart service ssh หรือต้อง restart เครื่องเลยหว่า
Method I
sudo adduser user1
sudo adduser user1 sudo
Method II
sudo adduser user1
sudo gpasswd -a user1 sudo
Ref
  • http://askubuntu.com/questions/7477/how-can-i-add-a-new-user-as-sudoer-using-the-command-line
  • http://askubuntu.com/questions/168280/how-do-i-grant-sudo-privileges-to-an-existing-user
  • https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-14-04

Monday, January 18, 2016

Can't install Kali Linux from USB, fails to find CD-ROM drive

  • หลังจากแก้ปัญหาเรื่อง freeze ตอนบูตระบบเพื่อจะติดตั้ง ได้แล้วจากโพสนี้
  • เจอปัญหาใหม่ในขณะติดตั้ง KALI 2.0 คือ พยายามลองติดตั้ง ด้วย USB แล้วมันขึ้น 
fails to find CD-ROM Drive
Solved
when the Window shows CDROM couldn't be mounted ,
  • Unplug your USB from system and re insert it
  • wait for mount/ detection (usb LED glow)
  • Hit Continue
เกี่ยวข้อง
  • http://juuier.blogspot.com/2016/01/hang-on-booting-ubuntu-for-installation.html
อ้างอิง
  • http://superuser.com/questions/962926/cant-install-kali-linux-from-usb-fails-to-find-cd-rom-drive

Hang on booting Ubuntu for installation OS Notebook ASUS

  • ปัญหาเรื้อรังของ Notebook ตัวเองกับ Ubuntu ตั้งแต่ 10.10 เป็นต้นมาคือ
  • ตอนติดตั้ง Ubuntu ใหม่ ไม่ว่าจะติดตั้งด้วย CD หรือ USB ตอนบูตระบบ หน้าจอจะขึ้นสีดำและมี cursor กระพริบแล้วไม่ได้ไปต่อ อาการมันก็ ค้าง หรือ freeze นั่นเอง
  • การแก้ปัญหา ในตอนนั้นคือ ตอนเข้าหน้าเลือก mode การติดตั้งให้เรากด F6 จากนั้นกด Esc และทำการแก้ไข Boot Options โดยมองหาคำว่า quiet splash ให้เราเปลี่ยนคำนี้เป็น pci=nomsi แทนจากนั้นกด Enter เพื่อบูตเข้าระบบติดตั้ง Ubuntu มันถึงจะไม่ค้างคับพี่น้อง
  • หมายเหตุ ในกรณีที่เราทำ USB Live boot โดยโปรแกรมอื่นๆ พอถึงหน้าเลือก mode ในการติดตั้งให้เรากด Tab เพื่อแก้ไข Boot Options แทน F6
  • แล้วจะติดตั้ง Linux distro อื่นๆ ก็ freeze ติดตั้งอะไรไม่ได้เลย จะแก้ Boot Options มันก็หาคีย์เพื่อที่จะแก้ไม่ได้ เลยได้ใช้แต่ Ubuntu กับเครื่อง Notebook ตัวเอง จะลองอะไรใหม่ๆ ก็ไม่ได้ลองสักที
  • พอดี อยากลอง kali แต่ติดตั้งไม่ได้เหมือนเช่นเคยคือ freeze และขึ้นประมาณ นี้ แล้วไม่ไปต่อ
  • Registered Taskstat Version 1
  • หาข้อมูลในเน็ตอยู่นานเจอ กระทู้อ้างอิง ว่ามันเป็นปัญหาของ Notebook ASUS เหมือนกัน และลองทำตามเค้าดู
Solved
  • Go to BIOS by F2 >Security > I / O interface Security> "New interface card"
  • SET IT TO LOCKED!!!
เพิ่มเติม
  • การ ตั้งค่า BIOS ของโพสนี้ นอกจากที่มัน ทำให้ผู้เขียนติดตั้ง KALI Linux บน Notebook ASUS ของผู้เขียนได้แล้วนั้น
  • มันยังช่วยให้ตอนติดตั้ง Ubuntu ไม่ต้องแก้ไขค่า Boot Options เหมือนเดิม ก็สามารถติดตั้งระบบได้เป็นปกติเหมือนชาวบ้านเค้าแล้วครับพี่น้อง
บทความที่เกี่ยวข้อง
  • http://juuier.blogspot.com/2010/10/sata-ubuntu-1010-mervarick.html
  • http://juuier.blogspot.com/2012/05/install-ubuntu-1204-on-asus-f81series.html
  • http://juuier.blogspot.com/2015/05/install-ubuntu-1504-sata-login-display.html
อ้างอิง
  • http://ubuntuforums.org/archive/index.php/t-1662577.html

Popular Posts