Dan belajar pun harus mengenal sabar…

Selama ini gw selalu berfikir belajar itu enaknya harus ada ini, harus ada itu yang berbentuk prasarana. Tapi hari ini gw ditampar tampar sama satu kejadian.

Waktu ngelewatin jembatan penyebrangan di daerah margonda, kira-kira jam 7 malam. gw ngeliat anak kecil cewek lagi mengemis, dengan penerangan seadanya dia lagi baca buku, gw sengaja melambatkan jalan gw. Iya anak kecil itu lagi asik mempelajari trigonometri di catatan kucelnya. Entah siapa yang nyuruh anak itu mengemis, dengan asik dia masih terus belajar.

Dan gw pun malu, lebih sering baca timeline path, twitter, 9gag. Daripada baca buku. Dan semangat belajar gw pun kadang alakadarnya.

Install GO di Yosemite

goBuat yang baru coba golang kayak gw, untuk install pertama, emang rada ribet di pengaturan pathnya.
Kalo installnya dari package file, gw kasih tips and tricknya.

secara umum, dokumentasi golang bisa dibaca di websitenya, sangat lengkap ada disini https://golang.org .
oke langsung aja ya kita install

1. Download package nya buat mac os, bisa diliat didapat disini https://golang.org/dl/
2. Setelah install golang, default path yang diinstall akan terletak disini path nya /usr/local/go

Apakah setelah itu beres? dan bisa bermain golang dengan aman sentosa? , sayang sekali jawabannya tidak sodara – sodara. Kalian harus setting path go, supaya command go nya terbaca oleh si mac osx nya.
> sudo nano ~/.bash_profile
Kemudian setelah itu setting variable path seperti ini

export PATH=$PATH:/usr/local/go/bin
export GOPATH=$HOME/Go
export PATH=$PATH:$GOPATH/bin
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin

Terakhir jalankan perintah ini

source ~/.bash_profile

voila, go siap dioprek 😀

after install go, what the next?

This has been the most annoying thing to deal with. In hopes of saving your time.

IF go was installed as root user. The root user of your system’s bash_profile text file ~/.bash_profile needs to have $GOROOT assigned to the go install directory and $GOPATH needs to be assigned to go /src directory.


  ...$# sudo su
  ...$# vi ~/.bash_profile

    ***Story continues in vi editor***

    GOROOT=$GOROOT:/usr/local/go
    GOPATH=$GOPATH:/usr/local/go/src
    ...
    [your regular PATH stuff here]
    ...

be sure the path to go binary is in your path on .bash_profile

PATH=$PATH:$HOME/bin:/usr/local/bin:/usr/local/go/bin

This PATH can be as long a string it needs to be..to add new items just separate by colon :

exit vi editor and saving bash profile (:wq stands for write and quit)

  [esc] 
  [shift] + [:] 
  :wq

You have to log out of terminal and log back in for profile to initiate again..or you can just kick start it by using export.

...$# export GOPATH=/usr/local/go/src

You can verify go env:

...$# go env

Yay!

GOBIN=""
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/usr/local/go/src"
GORACE=""
GOROOT="/usr/local/go"

Now you can sudo and go will be able to download and create directories inside go/src and you can get down to what you were trying to get done.

example

# sudo go get github.com/..

Now you will run into another problem..you might not have git installed..that’s another adventure..:

Ceritanya lagi dokumentasiin git

How to generate ssh key on ubuntu

 

  1. First step we have to create the key pair  on our machine , here is the command

> ssh-keygen -t rsa -C “muhamadabi.wardani@inmagine.com

 

  1.  After thats command, you can just press Enter to continue process

> Enter file in which to save the key (/Users/abiewardani/.ssh/id_rsa): (just press enter)

 

  1. You have to type a passphrase :

 

> Enter passphrase (empty for no passphrase): [Type a passphrase]
> Enter same passphrase again: [Type passphrase again then enter]

 

  1. After you type  a passphrase , you’ll given the fingerprint, or id of your SSH key. the enter key generation process should be like this

  Continue reading