Apr 23

Tentu susah untuk mengingati nombor ip.

Kita boleh letakkan <ip> <nama> dlm /etc/hosts utk memudahkan pengguna.

Masalahnya fail /etc/hosts ini hanya boleh di edit oleh root privileges. Jika anda hanya pengguna biasa, tak boleh lah tambah entry di fail ini.

 

Penyelesaiannya boleh dilakukan dengan ~/.ssh/config

$cat ~/.ssh/config
Host namabaru
       Hostname 202.188.0.133
       User bukangodam
       Port 8888

$ssh namabaru

Arahan di atas sama hasilnya dengan yang dibawah:

$ssh 202.188.0.133 -l bukangodam -p8888

 

written by cperdana

Jul 24

Skima Ethernet adalah Carrirer Sense Multiple Access with Collision Detection(CSMA/CD). CSMA bermaksud banyak mesin mempuyai akses terhadap Ethernet pada masa yang sama.

Semua mesin menentukan network dalam state idle dengan mengecam(sense) tiada gelombang pada carrier(utp cable)

Andaikan pc A ingin menghantar isyarat(frame) pada pc B yang bersambung menggunakan hub.
langkah 1-
Sebelum menghantar sebarang isyarat, network kad pc A perlu sensor carrier(dlm kes biasa adalah utp cable) dan memastikan tiada sebarang message sedang ditransmit (proses carrier sense).

langkah-2
Setelah confirm network idle, baru message dihantar. Setiap transmisi hanya guna masa yg sebentar(kerana setiap frame ada saiz maksimum).

Semasa penghantaran, signal tidak sampai ke semua nod(NIC pc) serentak. Ini adalah kerana kelajuan signal tersebut adalah lebih kurang 70% dari laju cahaya. Jadi mungkin terdapat pc yang terima agak lambat. Kesan dari ini, berlaku kemungkinan terdapat pc C yg cuba menghantar isyarat serentak dgn pc A. Kejadian ini dinamakan collision.

Setiap nic pada pc, selain bertanggungjawab menghantar signal, ia juga perlu mengesan samada berlaku collision. Jika ini berlaku, nic akan menghentikan penghantaran signal serta merta, menunggu pada satu kadar masa tertentu(rawak) sebelum memulakan langkah 1 kembali.

Jika terdapat 24 host pada LAN yang disambungkan pada 1 hub, masa mendapatkan giliran untuk hantar signal akan dibahagi kepada 24. Ini kerana dalam satu-satu masa, hanya 1 nic boleh hantar signal. Kemungkinan berlaku pelanggaran(collision) adalah agak tinggi.

Andaikan anda ingin menambah pc pada LAN.
Jika anda menggunakan 2 hub untuk menambahkan bilangan pc dalam LAN.

(hub 1

  • 23 port utp bersambung dengan 23 pc
  • 1 port utp bersambung dengan hub2

hub 2-

  • 23 port bersambung dengan 23 pc yg lain)

-kemungkinan berlaku pelanggaran adalah semakin tinggi.
-jarak laluan signal bertambah
- masa pembahagian penggunaan ethernet di bahagi kepada 46. (Sebelum pc A hantar signal, ia perlu pastikan kesemua 45 pc yg lain tidak menghantar signal)

Dlm keadaan ini adalah amat sesuai di letakkan bridge diantara hub 1 dan hub 2. Dengan pemasangan ini collision pada network hub 1 tidak akan beri kesan pada network hub 2, kerana bridge hanya akan forwardkan frame yang telah selesai diterima.(Bridge tidak akan forwardkan noise, errors atau frame yang rosak pada segmen yang lain)

Bridge akan memisahkan LAN kepada 2 segmen. Ini bermaksud jika pc A hendak hantar signal, ia hanya perlu pastikan 23 pc lain(yg bersambung pada hub 1) dan brige(E1/port 1) tidak menghantar sebarang signal. Pada masa yg sama jika terdapat host pada hub 2 yang ingin menghantar signal, ianya dibolehkan.

Selain itu bridge juga boleh bertindak bijak dengan menentukan frame mana yang perlu diforward ke segmen sebelah. Bila frame tiba dari Ethernet E1(port 1) ia(bridge) akan simpan maklumat alamat sumber frame dalam jadual E1. Dan bila frame tiba di E2, ia akan simpan alamat sumber di jadual E2. Berdasarkan maklumat dalam jadual ini, bridge boleh buat keputusan samada frame perlu di forward ke segmen sebelah atau tidak.

Bridge biasanya digunakan untuk menyambungkan 2 Ethernet(LAN).

Switched pula mempunyai persamaan dengan Bridge, cuma ianya mempunyai lebih dari satu port. Oleh itu switch boleh sambungkan lebih dari 2 ethernet. Pada masa kini jarang orang yang gunakan bridge kerana switch sudah boleh didapati pada harga yang rendah.

Sebelum ini saya kurang jelas apa beza bridge dan switch, dan kini setelah baca buku internetworking with TCP/IP oleh douglas E comer, barulah faham. Mana tau, mungkin ada rakan lain diluar sana yang sebelum ini sama seperti saya, masa belajar dulu, tidak jelas antara hub, bridge dan switch, harap-harap maklumat ini memberi kefahaman dan manfaat kepada kita.
Majulah IT untuk rakyat malaysia :).

written by cperdana

Jun 02
I’m using FreeDNS these days so that I can  ssh home from anywhere. Its a free service powered by the FreeBSD operating systems. Check it out!

written by adli

Jan 18

Assalamualaikum…

‘TCP Wrappers’  boleh digunakan untuk membenarkan atau tidak membenarkan servis-servis tertentu dari mesin luar ke mesin milik anda.

Caranya tidak terlalu susah hanya sekadar melakukan sedikit pengubahsuaian pada fail berikut iaitu

/etc/hosts.allow

/etc/hosts.deny

Katakan, ada sebuah mesin luar yang mempunyai keinginan untuk melakukan SSH’ atau ‘FTP’ ke mesin kepunyaan anda…. Apa yang berlaku pada mesin anda ialah

  1. Ia akan memeriksa terlebih dahulu fail /etc/hosts.allow dan melihat/memeriksa/memadankan arahan/peraturan yang berkaitan dengan servis tersebut. Jika ia padan, maka sambungan akan diteruskan. Jika tidak ada padanan ia akan ke langkah 2
  1. Ia akan memeriksa fail /etc/hosts.deny dan jika terdapat padanan, ia akan membatalkan servis dan sambungan tersebut

Camner/How/Wow……

Let say, saya ingin membenarkan servis ‘SSH’ ke mesin saya dari satu domain ( cth: libas.com) dan tidak membenarkan dari yang lain.. so… letaklah ayat dibawah pada /etc/hosts.allow

sshd: libas.com

dan pada fail /etc/hosts.deny , letakkan ayat di bawah

sshd: ALL

…. So ape yang berlaku ialah , domain libas.com boleh meng’SSH’ ke mesin anda tetapi domain selain libas.com tidak dibenarkan.

…. Selamat mencuba dengan jayanya….

Rujukan

1, 2 dan 3

written by apis

Nov 25

Quiet Weeks
3bossians (or ahli 3boss :-), has been quite busy lately and so far we only manage to have 1 meetup since the Raya break. Nevertheless we hope to have or organise more OSS related events in the future.

Work

I had to test a debian package (hogwash light br) I built earlier and do a simple web front end for configuring it. Since I didn’t want to mess up my own notebook, I decided to do  everything on Qemu. I have been using qemu for more than a year now so there’s nothing special to report here. This time however I do find the ‘-redir’ option useful. It basically allows to redirect tcp/udp connection on specified ports on your localhost to some specified port or ports on the guest OS.

qemu -hda debian_work.img -redir tcp:8080::80 -redir tcp:2200::22
 
Since I was doing some web development  (php), I can just load my browser and point to localhost:8080 and it’ll be redirected to the web server (I prefer lighttpd  with fast-cgi these days) on the guest OS. In addition, from the example above, you can also figure out by now that other people can also access port 80 or 22 (sshd) on the guest OS by simply by pointing to my IP address and specifying the respective port numbers (8080 for web and 2200 for sshd).

Here’s how you can ssh to the box.

adli@an-nahl:~/documents/ebooks/temp$ ssh root@localhost -p 2200
 
Last login: Sat Nov 25 12:02:54 2006
Linux arnabun 2.6.18-2-486 #1 Wed Nov 8 19:06:23 UTC 2006 i686

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

arnabun:~#

Qemu rocks! :-)

p/s the machine name ‘arnabun’ is named after yomud’s rabbit collection hehe.
p/s/s Yes the guest OS is running Debian Sid .

written by adli

Sep 18

Assalammualaikum,

I have a dream, where RM10 can sustain my mobile phone
for a month.

This is not a proposal but a hope to see one day we
can all talk with minimum ‘tax’.

RM10 five years from now can barely buy us a nice
lunch. Thus a payment for talking from anywhere in
Malaysia should cost just as much as this … RM10. Why
RM10, why not free since talk is free? My dear friend
it is an accepted mantra that there is ‘no free
lunch’, therefore, we have to accept this minimum RM10
tax for administration and to pay the engineers their
salary so that they can buy a Satria Neo. We cannot
expect an engineer to use the bus because our poor
public transport, can we? But we are not talking
about Mr. Samy for now, that will be a different story
altogether. For now please look into the feasibility
study that I’m thinking for years now. Please bear in
mind that this is not a scholarly study rather it is a
continuous thought to improve current situation. Let
the scope be Malaysia even though nothing is
preventing the principle to be applied somewhere else.
Remember charity begin at home!

I’m not sure where it all started but as far as I can
remember I’ve been involved in computer networking for
quite sometimes. This is where it’s all started.
Computer networking is NOT telephony since both use
different concept. For outside world they are the
same but for the engineers there are like apple and
orange. You can make fruit juice, pie, cake, etc.
using both but they are really two different fruits.
Telephony is meant only for voice but networking is for
data. This is the convention but there is always an
exception. For example you can have telephony sending
fax data and networking sending skype voice. Little
that people know that telephony has becomes so
obsolete that most of the telephony voice at the
transmitter is converted into data in the backbone
(read communication trunk) then converted back into
voice at the receiver. This is done to make more
efficient transmission or lower cost so that the
Telcos (telecommunication company) can have MORE
profits but charging us ever increasing charge. To
explain why computer networking is cheaper and
efficient than telephony will deserved its own
article. But suffice to say that computer networking
DOES NOT reserve a connection unlike telephony.
Connection reservation increase the maintenance cost
and limit the efficiency.

In this article we are focusing on wireless or mobile
telephone (voice) since for me home telephone is now
obsolete. I haven’t got telephone in my house when I
was in Malaysia and in the UK. A lot of my friends
are in the same situation. If you have telephone in
your house consider yourselves as belonging to species
waiting for extinction ;-) What people use now are
mobile phones and even 10 years old children has one of
these gadgets.

Now we have our objective plus the scope apparent from
the title and the last few paragraphs. Now I want to
introduce two computer networking technology (read
jargons) relevant for our discussions, namely VoIP and
WiMax. In short VoIP means Voice over Internet
Protocol and WiMax means Wireless Microwave Access.
Basically VoIP is sending voice using data. You can
imagine VoIP as direct competitor to telephony. WiMax
is a new standard (802.16d) for wireless networking
and its mobile version (802.16e) has been recently
standardised. You can think of WiMax as a big brother
to WiFi, wireless standard that we used in the airport
or at overpriced coffee shop Starbucks. WiMax is
direct competitor to cellular wireless telephony
infrastructure that we all have come to reply upon.
Think of VoIP as the bread being delivered by a WiMax
lorry and the Telco companies providing the service as
the corner shop that we buy the bread (service).

I think VoIP needs little introduction since I believe
most of the people have been using Skype or similar
service. But little that we know VoIP can provide us
better quality voice compared to telephony. How many
time we confused ‘s’ and ‘f’ in a telephony
conversation? This problem can be eliminated
altogether using VoIP due to the larger bandwidth
(transmission content). The only major drawback of
VoIP is that emergency called is not guaranteed since
computer networking does not reserve the line. A lot
of PhD students has been spending their precious
research time and have been awarded their PhD in order
to solve this particular problem but apparently is not
been solved until now. Apart from that VoIP is a
clear winner, it is the Roger Federer and the Tiger
Woods of the current communication world.

WiMax is a new kid on the block. It’s been introduced
due the popularity of WiFi wireless LAN (Local Area
Network). WiFi only covers few metres up to 100 metres
and the bandwidth is less than 10 Mbit/s. It is
intended to be used inside a building and its
surroundings. Think of WiFi as similar to bicycle.
Most people use it for travelling in urban setting but
some weird people has travel around the world with
bicycle. Similarly there are many claims that WiFi
can cover entire city but the bottom line it is not
meant for that purpose. As opposed to WiFi, WiMax is
meant to be used for connecting a whole city thus it
is called wireless MAN (Metropolitan Area Network).
Theoretically it can cover up to 50 km (point-to-point
backbone) and about 5 km (omnidirectional – normal
access). The bandwidth is about 70 MBit/s which is
about 70 times the bandwidth of 1Mbit/s
ADSL(Asynchronous Digital subscriber Line) or about
550 times the bandwidth of 128KBit/s 3G (third
generation network) bandwidth! Since this is wireless
connection we will be realistic to say that it can
handles up to 30 MBits/s, therefore, it is still more
than thirty times improvement over the conventional
wired and wireless technology.

Now I’m going to tell you a little secret. The
bandwidth required to transfer voice data for one conversation
is only about 16KBit/s. I won’t bother you with the
mathematical details but suffice to say this bandwidth
can give us better quality voice than the conventional
telephony. Better still you can do other fancy things
for free that telephony would normally cost extra for
the so called ‘premium’ services such as voice
recording, call forwarding, etc. You can also has
other services that are not possible for using
telephony such as presence notification, sending voice
as email attachment or convert voice to email using
voice recognition software for offline meassaging.
The list can goes on. Just think of the new solution as
Yahoo Messenger (with calling feature) on mobile phone.
Let say we have one WiMax tower that can handle 30
MBit/s. Divide 10 MBit/s with 16 KBit/s we can get more
than 1875 users talking at the same time! Hello Telekom
CEO, you will better sleep well at night ;-) The one million
dollar question is how many WiMax tower is needed to cover
the whole nation? If you have any knowledge on this
please tell me. Did I tell you that Intel will put
WiMax receiver chip in every Intel powered laptop by
2007 as it did forWiFi? Future is bright my friends.

The Telco will have us to believe we need more than
talking and the phone can be use for other purpose
like watching a football match. Please do not fall into
this trap. What we need is to talk and talk
should be cheap. If you want to watch football go
watch it with your friends at Mamak stall or go back
home. That’s your 30 inch flat screen with surround
sound system is made for. We just want to talk,
remember this fact. I’ll suggest any company that want to
venture into the market to using the trojan horse
strategy. Make small SD card that come free with the
RM10 subscription. This SD can be inserted inside a
normal mobile phone. When the WiMax signal is in
range use it, but when you are out of range switch
back to the overpriced mobile service. Then soon it
will be a time when we don’t need the mobile service
and the bloated phone. We just need to talk remember?
Imagine a mobile in wrist watch without all the PDA
bloat.

My friends, if we don’t champion this noble effort
others will. But when the others do it they most
probably not doing it for the people but for their outrages
profit desire. So let us act together and make sure
that the dream can comes true for the good of the
nation. Please lobby the government and keep talking
the idea to the people. Sooner or later the mobile
infrastructure is going to be just like our water and
electricity infrastructure that we heavily relying to
continue our daily lives which we can’t live without.

written by teleforce

my pass