แสดงบทความที่มีป้ายกำกับ setup แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ setup แสดงบทความทั้งหมด

วันพฤหัสบดี, สิงหาคม 27, 2558

5 สิ่งที่ควรทำหลังลง OSX ใหม่

Imgur

ถ้านับจริงๆมันก็เกินล่ะครับ :P ขอใช้เลข 5 ให้ title มันสวยๆก็แล้วกัน

โพสนี้เป็นเหมือน checklist ที่ผมจะทำหากต้องติดตั้งหรือลง OSX ใหม่ (คือไม่ได้ upgrade แต่เนื่องจาก format harddisk เปลี่ยน harddisk ฯ)

ซอฟต์แวร์ส่วนใหญ่ในนี้จะเป็นของโปรแกรมเมอร์ซะส่วนใหญ่ แต่ถ้า คนอ่านที่หลงเข้ามาไม่ใช่สาย IT ผมก็คิดว่าซอฟต์แวร์บางตัวก็มีประโยชน์กับอาชีพอื่นๆ นอกจากโปรแกรมเมอร์เช่นกัน
ขั้นตอนการติดตั้งซอฟต์แร์ต่างๆ จำเป็นต้องใช้ internet ฉะนั้นก่อนจะพิมพ์คำสั่ง แล้วกด Enter ให้แน่ใจว่าเชื่อมต่อ internet อยู่นะครับ

1 ซอฟต์แวร์พื้นฐาน


Trim Enabler
Trim Enabler ผมใช้ SSD solid state drive จึงต้องลงตัวนี้ก่อน เพื่อ enable TRIM
เจ้า TRIM คืออะไรเอาง่ายๆคือ มันจะทำให้ประสิทธิที่ภาพการเขียนลง SSD disk ดีอยู่เสมอ อาจจะเห็นว่ามันแสดง 10USD โหลดมาเถอะครับ สิ่งที่เราต้องการไม่ต้องเสียเงิน เค้าคิด 10$ หากต้องการใช้ full feature

เขียนอ่าน NTFS partition/drive ได้
ตัวนี้ วิธีทำให้ OSX 10.10 Yosemite อ่าน/เขียน NTFS ได้ ของผมยังคงใช้งานได้อยู่

ohmyzsh
ตัวนี้ผมเรียกว่าเป็น shell utility ทำให้การใช้งาน command line สะดวกสบายขึ้นเยอะ
พิมพ์คำสั่งข้างล่างใน Terminal app เพื่อเริมการติดตั้ง
$ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
ติดตั้งแล้วก็ config มันหน่อย แก้ไข ~/.zshrc
ZSH_THEME="gnzh”
...
plugins=(git sublime osx)
ZSH theme จะเกี่ยวกับเรื่อง สีสันใน terminal และตัว prompt ของเรา
plugin 3 ตัวนี้

git เวลาอยู่ใน directory ที่เป็น Git repository มันจะแสดง prompt ให้เราเห็นชัดเจนเลย ว่าตอนนี้อยู่ใน Git repo แล้วอยู่ branch ไหนก็บอกได้ด้วย

sublime ตัวนี้ลงไว้เพื่อ พิมพ์ subl ชื่อไฟล์ แล้วมันจะเปิด Sublime Text พร้อมไฟล์ที่เราใส่เข้าไปให้เลย

osx เวลาเรานึกหรือขี้เกียจพิมพ์ option ต่างๆ กด tab แล้วมันจะช่วยแสดงออกมาให้
และหากใช้ macbook ต่อกับ window keyboard แบบผม คุณจะใช้ numpad ใน terminal ไม่ได้ ถ้าไม่ได้ใส่ configuration แบบข้างล่างนี้เข้าไปใน ~/.zshrc ด้วย
# 20150102 zsh numpad binding
# Keypad
# 0 . Enter
bindkey -s "^[Op" "0"
bindkey -s "^[On" "."
bindkey -s "^[OM" "^M"
# 1 2 3
bindkey -s "^[Oq" "1"
bindkey -s "^[Or" "2"
bindkey -s "^[Os" "3"
# 4 5 6
bindkey -s "^[Ot" "4"
bindkey -s "^[Ou" "5"
bindkey -s "^[Ov" "6"
# 7 8 9
bindkey -s "^[Ow" "7"
bindkey -s "^[Ox" "8"
bindkey -s "^[Oy" "9"
# + -  * /
bindkey -s "^[Ok" "+"
bindkey -s "^[Om" "-"
bindkey -s "^[Oj" "*"
bindkey -s "^[Oo" "/"
เวบไซด์อย่างเป็นทางการ ohmyz.sh

Command line tools
ตัวนี้จำเป็นสำหรับ ขั้นตอนต่อไป พิมพ์คำสั่งข้างล่างนี้ใน Terminal app
$ xcode-select --install

Homebrew
เค้าเรียกกันว่ามันคือ package manager ที่สาบสูญของ OS X
พิมพ์คำสั่งข้างล่างใน Terminal app เพื่อเริ่มการติดตั้ง
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew จะทำให้เราสามารถใช้คำสั่งเหมือนที่ใช้ใน linux อย่าง Ubuntu ได้ง่ายๆ คือเรียกเอามาติดตั้งได้ง่ายๆ ถ้าอยากจะลง package เช่น subversion, node, iojs พอลง brew เสร็จ มันก็จะลงเจ้าพวกที่ว่ามานี้ได้ง่ายมั่ก
เวบไซด์อย่างเป็นทางการ brew.sh

2 ซอฟต์แวร์สำหรับโปรแกรมเมอร์


Java (JDK)
ณ เวลาที่เขียนนี้ เพิ่งมารู้ว่า Oracle ไม่เปิดให้ download JDK 7 สำหรับบุคคลทั่วไปแล้ว จะต้องเสียเงินถึงจะเข้าไป download ได้ (อยู่ใน section Java SE Support)
ไปดาวโหลด JDK 8 ได้จาก ที่นี่ Java download ได้ dmg มาแล้วก้อ click ขวา open แล้วทำตามขั้นตอนไปตามที่เค้าแนะนำครับ
รวม FAQ https://www.java.com/en/download/faq/java_mac.xml หากอยากถอยไปใช้ Java 6 ก็มีลิ้งบอกวิธีอยู่

ถ้าพัฒนางานด้วย Java จะไม่ติดตั้ง 2 ตัวนี้คงไม่ได้

Java build tools: Ant, Maven
  • Dowload Ant เลือกตัวที่เป็น .tar.gz archive
  • Download Maven เลือกตัวที่เป็น Binary tar.gz archive
ผมชอบที่จะเอา software tools เหล่านี้เอาไว้ที่เดียวกัน ที่ apps folder /Users/dahoba/apps
เมื่อแตกไฟล์ distribution ของทั้ง 2 ตัวแล้วก็ต้องมาเซต PATH ให้มันด้วย ใน ~/.zshrc
...
export ANT_HOME=/Users/dahoba/apps/apache-ant-1.9.6
export M2_HOME=/Users/dahoba/apps/apache-maven-3.3.3
...
export PATH=$PATH:$ANT_HOME/bin:$M2_HOME/bin
...

อื่นๆ ที่ขาดไม่ได้
ถ้ายังไม่มีตัวติดตั้งก็กดที่ลิ้งเพื่อ download ได้เลย

3 ซอฟต์แวร์เพื่อ Productivity


Mozilla Thunderbird อีเมล client หนึ่งในดวงใจ มันเชื่อม Address book เข้ากับ Active directory/LDAP ที่ทำงานผมได้ด้วย

iTerm2
เป็น terminal app ที่ OS X ควรจะเป็น ผมชอบตรงที่มัน split ช่องได้ด้วย keyboard shortcut iTerm2 download

Slate
Utility ตัวนี้ก็ว่ากันว่าเป็น window manager ที่สาบสูญไปจาก OSX อีกเช่นกัน
พิมพ์คำสั่งข้างล่างใน Terminal app เพื่อเริ่มการติดตั้ง
$ cd /Applications && curl http://www.ninjamonkeysoftware.com/slate/versions/slate-latest.tar.gz | tar -xz

Slate นี่มันต้อง config เหนื่อยหน่อยนะครับ ของผมดูแนวทางจาก Tristan Hume blog นี้
ของผมเป็นแบบนี้

ถ้าใครอยากได้ที่มันง่ายๆกว่านี้ ก็ลองหาดู Divvy, Moom, ตัวนี้ฟรี Spectacle

ไฟล์ส่วนตัวใน Cloud

4 เครื่องมือสื่อสารกับทีม


เครื่องมือสื่อสารกับทีม
  • Skype,
  • LINE
  • Google Hangouts
สองตัวหลัง ไม่ต้องติดตั้ง ผมใช้งานใน Chrome เลย

5 Configuration


ปรับการใช้งาน touchpad
ใช้งาน 3 นิ้วพร้อมกันได้ Imgur
ไม่ใช้ natural scroll Imgur
ปรับเวลาเป็นแบบ 24 ชั่วโมง Imgur
ทำ lock icon บน menu bar เวลาจะลุกจากที่นั่งผมชอบที่จะต้อง lock computer เอาไว้ ทำ icon ไว้ตรงนี้จะทำให้สะดวกขึ้นมาก
Imgur
วิธี:
  • เปิด app “Keychain Access” จะใช้ spotlight ค้นหาหรือจะใช้ Finder ก็จะอยู่ใน /Applications/Utilities.
  • เลือก “Show Status in Menu Bar” จากเมนู View
  • ทีนี้เราจะได้ lock icon ที่ menu bar แล้ว ใช้ Lock the screen เพื่อ lock screen เมื่อกลับมา ลาก mouse หรือกด key อะไรๆก็ได้ มันจะถาม password ก่อนจะอนุญาตให้กลับเข้ามาใช้งานได้
ทำครบ checklist พร้อมกลับไปทำงานแล้วล่ะครับ :D

วันเสาร์, มีนาคม 09, 2556

6 Things (or more) to do after buy a new macbook pro

    This blog post kind of instruction but I will not provide all of the details, it's just like the collections of knowledge to do such a things.


1. Buy a Solid state drive (SSD) install it into the macbook.

    I was bought OCZ Agility 3, NOTICE! there's a problem with the OSX 10.8 if it was installed as a second drive; not replace the HDD bay. So, please study/find information as much as you can that which model work flawlessly with OSX 10.8 ;) 

    iFixit website provide the instruction on how to replace the macbook pro's HDD.
here is the link of my model "macbook pro unibody mid 2012"

   I desired to install SSD along with the HDD. Start the OSX with SSD and keep the data in the HDD. To do this I need a accessory called "OptiBay" or "Optical Bay" you can google with that keyword ;) if you want one.

   The Optical bay will replace the macbook's optical drive (the DVD drive). Again, I find the how to took the optical drive off from the iFixit website. Replace the DVD drive with the Optical bay with the HDD inside.
   
    Check the new hardware installation; after install the SSD & the Optical bay (with HDD).  Turn on the macbook; hold on the Command button, to select disk to boot. We must select the MacintoshHD disk.

   Time to install an OSX into a new SSD :) 

2. Install fresh OSX Mountain Lion into the new SSD. with/from a Flashdrive.

    We already remove the DVD drive so we need a flashdrive to install a fresh OSX, The Mountain Lion. I successful with the instruction from the osxdaily.com website.

    BTW, You will need following things, to complete this bullet:
  • a Flashdrive, at least 8GB.
  • an OSX Mountain Lion copy, ISO or DVD.
3. Move the User's home to the HDD.

    This is one of many thing to tweak and it's best for SSD life. You can find the instruction and the more SSD tweaks from this website, "optimizing macosx lion for ssd".

4. NTFS disk/partition auto mount/unmount, so I can use External HDD, Flashdrive with the Window machine.
    
    I successful do this with the instruction from this website https://fernandoff.posterous.com/ntfs-write-support-on-osx-lion-with-ntfs-3g-fntfs-write-support-on-osx-lion-with-ntfs-3g-f

That was on posterous.com, afraid that some day it might disappeared so I do made a note, what I had done to succeed. (In Thai)

Write/Read in 10.8, 10.7 using MacPorts
ref: https://fernandoff.posterous.com/ntfs-write-support-on-osx-lion-with-ntfs-3g-f
ดูตามหัวข้อ Fuse4x + NTFS-3G from MacPorts 

Summary step:
  1. ลง Fuse4x-0.9.2.dmg ก่อนแล้วตามด้วย  NTFS-3G.dmg *ไม่ต้องลง macports ถ้าลงแบบใช้ dmg ข้าม port selfupdate ฯ ไปเลย
  2. แก้ไข script, /sbin/mount_ntfs
  3. NOTE: ให้ลองตรวจสอบว่า ntfs-3g ที่ลง ลงไปที่ /opt/local/bin/ntfs-3g ตาม guide หรือไม่แต่ตอนที่ทำสำเร็จมันไปอยู่ที่ /usr/local/bin/ntfs-3g 
  4. สามารถใช้คำสั่ง (at Terminal app) $which ntfs-3g เช็ค มันจะแสดง absolute path มันออกมา 
  5. ถ้าไม่ใช่ /opt ก็กลับไปแก้ที่ script ก่อน
  6. จากนันให้ทดลองเรียก ntfs-3g ที่ terminal มันจะถามว่าอยากจะให้ automount หรือไม่ ตอบ Y 
  7. restart OS ครั้งนึง กลับเข้ามาอีกที เสียบ ext HDD ที่เป็น ntfs มันน่าจะ mount แบบทั้ง read/wri้te ได้
5. Learn the OSX Tips & Trick.
  
    Time to learn more about the OSX, learn some tricks, tips that might help my productivity.

วันอาทิตย์, มกราคม 22, 2555

Ubuntu: Android development setup resources

To setup Ubuntu desktop ready for Android development


Eclipse SDK  

    Eclipse Classic 3.7.1 http://www.eclipse.org/downloads/

Android SDK

    Download http://developer.android.com/sdk/index.html

    Installing http://developer.android.com/sdk/installing.html

Android ADT
    http://developer.android.com/sdk/eclipse-adt.html

Optional

Subclipse (Subversion plugin for eclipse)http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA

    Eclipse update site URL: http://subclipse.tigris.org/update_1.6.x