Pages

Sunday, September 18, 2016

domain name registrar (organisasi yang mengatur reservasi domain name di dunia)

list domain name registrar di dunia:

registrar


cara mengecek domain name reseller:

cek domain


cara mengecek propagation dns ( dns yg telah diregisterkan telah dikenali oleh seluruh dns server di dunia )

cek propagation



Friday, September 16, 2016

bridge

bridge = menghubungkan 2 buah LAN / membagi sebuah LAN menjadi 2 buah segmen.
Tujuannya untuk mengurangi traffic agar meningkatkan performa jaringan komputer.



bridge = menghubungkan 2 buah segmen saja. Bridge hanya mengenali alamat fisik host (MAC address).

00:20:d1:c2:e7:50  -> cth mac address.   ( terdapat di NIC  adapter komputer ).

setiap host memiliki mac address yang unik. Sehingga dapat mengetahui host mana yang 1 segmen dan mana yang berbeda segmen. Jika ingin menghubungkan banyak segmen maka harus menggunakan multiport bridge (switch).



beban traffic tinggi = router
beban traffic rendah = bridge.

jika traffic terlalu tinggi dapat menyebabkan bottleneck dan mempengaruhi performa network (bridge).



===============
perbedaan bridge dan router


- bridge

  • tidak mendukung ip address. hanya mengenali MAC.
  • menghubungkan 2 buah segmen namun dalam 1 subnet.
  • tidak dapat memblock traffic dari subnet lain.
  • cocok untuk digunakan pada LAN .

- router

  • mendukung network protokol address seperti IP, IPX, AppleTalk.
  • dapat menghubungkan beberapa subnet yang menggunakan teknologi yang berbeda.
  • mampu memblock traffic antar subnet.
  • cocok digunakan pada sembarang protokol network.
  • instalasi dan konfigurasi memerlukan keahlian khusus.
  • cocok digunakan untuk internet maupun LAN.



Wednesday, September 14, 2016

cisco router documentation (2)

tegangan yang dibutuhkan: +5v / -5v.  +12v / -12v.

RAM : digunakan saat router beroperasi.
FLASH: menyimpan sistem operasi IOS.
NVRAM: menyimpan file konfigurasi secara permanen.
ROM: menyimpan data BIOS (dibaca pada saat booting).
PROCESSOR: otak pemrosesan data.
INTERFACE : perangkat tambahan untuk keperluan transfer data.


koneksi dari pc ke router menggunakan:

  • console connection 
  • modem connection 
  • telnet session   

WAN (synchronous serial port ) = DB-60 (cable).
telnet = DB-15 (cable).
Console port RJ-45 =   access langsung (console connection).  -> butuh cable rollover + adaptor RJ-45 to DB-9 (atau bisa menggunakan usb-db-9).
Console port RJ-45 (AUX) = modem connection.













cisco router documentation (1)

router:

membagi network menjadi beberapa buah subnetwork ( network-network kecil ) sehingga setiap subnetwork terisolir dari network lain sehingga berdampak positif pada performa network.

routing:
kemampuan mengetahui kemana rute perjalanan sebuah informasi (packet). Apakah ditujukan pada network satu atau ditujukan ke network yang lain. Jika paket ditujukan untuk host yang satu network maka router akan menghalangi packet-packet keluar sehingga tidak membanjiri network lain.


cisco router:

fixed.
modular.
modular access for enterprise.


fixed = interface tetap (tidak dapat diganti-ganti).
ex:

  • cisco router 700
  • cisco router 801-804,805,811,813,827
  • cisco router 1000
  • cisco router 2000
  • cisco router 2500
  • cisco router 3000


modular = interface dapat diganti sesuai kebutuhan  (digunakan untuk Wide Area Network yang lebih luas).

  • cisco router 1600
  • cisco router 1720,1750 
  • cisco router 1800,1921
  • cisco router 2500
  • cisco router 2600
  • cisco router 3600
  • cisco router 4000

modular for enterprise = interface dapat diganti-ganti sesuai kebutuhan dan menyediakan fitur tambahan.

  • cisco router 7000
  • cisco router 10000, 12000

cisco router 2500 ->  bisa modular maupun fixed.





Wednesday, September 7, 2016

vi documentation

vi ( editor used at terminal unix / linux )



command mode / insert mode

i = insert mode
esc = command mode


:w welcome.txt  = write buffer ( insert mode ) to welcome.txt  
1L,40c  ->  1 line 40 character




:q = quit


hjkl

h= left
j= down
k= up
l= right



w = word to word
b = back to word before

W= next line
B = line before

$ = end of line
^ = beginning of line
0 = the real beginning (without spaces)


gg = end of file 
G = beginning of file


{ = beginning paragraph
} = end paragraph

f a  = find “a” after word in line
F a = find a before word in line

3fa  = find the third “a” word


3jj = go 3 line down



:set number    = show number
:6   = goto line 6


c=change


x= delete
u= undo
dw = delete word
dd = delete line

2dw = delete 2 word

cw = delete word and go insert mode

cc = dd + go insert mode

2dd = delete 2 line
2cc  = delete 2 line and go inset mode



ct”  =  delete from cursor to “  and go insert mode
ci” =  find word inside quote and change it     ( almost same as ct )
ca” = find  double quote and content inside it and change

ci usually used in () or {}  to change content inside




d => delete / cut


p = paste content forward
P = paste content before

y = copy


yw =copy word
yy = copy entire line
p=paste

10p = 10x paste

14x = delete 14 character
p=paste

docker documentation

docker

docker  - > see all command list

docker search [tutorial]   -> search docker index for tutorial

docker pull learn/tutorial  ->  download image




You can think of containers as a process in a box. The box contains everything the process might need, so it has the filesystem, system libraries, shell and such, but by default none of these are running. You 'start' a container by running a process in it.



### abis didownload imagenya dirun!

docker run [image_name] [command_to_execute]

ex: docker run learn/tutorial echo “hello_world”


### install utilities like ping

docker run [image] [command]

docker run learn/tutorial  apt-get install -y ping



### save changes / commiting.  (save image with new state).

caranya ambil id dari container abs kita install ping trs di commit!

docker ps -l    ## find id of the container created by installing ping


docke commit [3 angka awal dr id] [image/namabaru]

docker commit 698 learn/ping


###coba jalanin image yg udah terinstall ping

docker run learn/ping ping google.co.id



###cara liat running container

docker ps
docker inspect [id]   -> print informasi tentang container




###docker bisa di push ke repo trus di share.

docker images   -> print smua images yg dipake
docker push learn/ping


kita cm bisa ngepush image ke namespace diri sendiri.



#### 

https://hub.docker.com/   -> free docker hub account

https://docs.docker.com/installation   -> install docker engines

rails documentation

ails g controller Say hello goodbye   //camel case controller

@time = Time.now

<%=

  link_to “anchor text”, [nama-controller]_[nama-view]_path

%>






orm -> object relationship mapping

tabel = orders ,  class = order


rows di tabel = object dr class



ages = []

for person in @people
ages << person.age
end




======

rails g scaffold Product title:string description:text image_url:string price:decimal


t.decimal :price, precision: 8 , scale: 2




=======

###cara gunain seed

db/seeds.rb



Product.delete_all

Product.create!(title: 'programing ruby', description:%{<p>ruby programing<p>}, image_url: ruby.jpg, price: 2.00)


“(Note that this code uses ​%{…}​. This is an alternative syntax for double-quoted string literals, convenient for use with long strings. Note also that because it uses Rails’ ​create!​ method, it will raise an exception if records cannot be inserted because of validation errors.)”

Excerpt From: Sam Ruby, Dave Thomas, David Heinemeier Hansson. “Agile Web Development with Rails 4 (for Lorinda Hartzler).” iBooks. 


rake db:seed


=====
### cara gunain git

git init
git add .
git commit -m “Depot Scaffold”

git checkout .         -> ngembaliin ke state terakhir



======
###validation

app/models/product.rb

validates :title, :description, :image_url, presence: true
validates :price, numericality: {greater_than_or_equal_to: 0.01}
validates :title, uniqueness: true



=====
#cara gunain fixtures

fixtures :products

one:
  title: MyString
  description: MyText
  image_url: MyString
  price: 9.99

two:
  title: MyString
  description: MyText
  image_url: MyString
  price: 9.99


======
## adding path and store

root 'store#index', as: ‘store'

as:’store’   —>>   store_path  





======
## cara ngaktifin caching di development!


rails40/depot_e/config/environments/development.rb
​ 
config.action_controller.perform_caching = true”




======
model and references

http://guides.rubyonrails.org/association_basics.html

migration

http://guides.rubyonrails.org/active_record_migrations.html



======

#bikin references

rails g scaffold LineItem product:references cart:belongs_to


-pada level model tdk ada perbedaan antara references sama belongs_to

lineitem belongs_to :product
lineitem belongs_to :cart

“The database now has a place to store the references between line items, carts, and products.”


“here’s an easy way to remember where to put ​belongs_to​ declarations: if a table has foreign keys, the corresponding model should have a ​belongs_to​ for each.”


>> di models/cart.rb

has_many :line_items, dependent: :destroy

#setiap record di cart dependent terhadap linitem shg apabila dihapus ikt terhapus.
#cart mempunyai berpotensial untuk memiliki banyak lineitems


>> di models/product.rb

has_many :line_items
before_destroy :ensure_not_referenced_by_any_line_item



private

def ensure_not_referenced_by_any_line_item
if line_items.empty?
return true
else
errors.add(:base, 'Line Items present')
return false
end
end



#ngasih hubungan antara product & line_items
#memastikan ketika ada item di delete di line items, product ga ikt kedelete.


“Here we declare that a product has many line items and define a ​hook​ method named ​ensure_not_referenced_by_any_line_item​ . A hook method is a method that Rails calls automatically at a given point in an object’s life. In this case, the method will be called before Rails attempts to destroy a row in the database. If the hook method returns false, the row will not be destroyed.

Note that we have direct access to the ​errors​ object. This is the same place that the ​validates​ stores error messages. Errors can be associated with individual attributes, but in this case we associate the error with the base object.”


=====

rails generate migration add_quantity_to_line_items quantity:integer