Saturday, December 21, 2013

Network Mapping in Linux

1) How to get Default Gateway in linux:

:~$ route -n

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.3.1   0.0.0.0         UG    0      0        0 wlan0
192.168.3.0     0.0.0.0         255.255.255.0   U     9      0        0 wlan0

Then 192.168.3.1 is the default gateway (which resides in the router)

2) traceroute:

Gives echo response from every networking device that we go through.

e.g.:
~$ traceroute linkedin.com
traceroute to linkedin.com (216.52.242.86), 30 hops max, 60 byte packets
 1  * * *
 2  24.4.96.1 (24.4.96.1)  12.809 ms  18.279 ms  18.287 ms
 3  te-0-2-0-0-ur05.santaclara.ca.sfba.comcast.net (68.85.191.161)  18.279 ms  18.277 ms  18.271 ms
 4  te-1-1-0-10-ar01.sfsutro.ca.sfba.comcast.net (68.87.226.118)  25.134 ms te-1-1-0-1-ar01.sfsutro.ca.sfba.comcast.net (69.139.198.90)  25.115 ms te-1-1-0-0-ar01.sfsutro.ca.sfba.comcast.net (69.139.198.82)  25.056 ms
 5  he-3-8-0-0-cr01.sanjose.ca.ibone.comcast.net (68.86.94.85)  28.455 ms  28.475 ms  28.472 ms
 6  50-242-148-34-static.hfc.comcastbusiness.net (50.242.148.34)  45.187 ms  38.972 ms  37.976 ms
 7  vlan70.csw2.SanJose1.Level3.net (4.69.152.126)  47.620 ms  47.597 ms  47.543 ms
 8  ae-71-71.ebr1.SanJose1.Level3.net (4.69.153.5)  47.486 ms  44.121 ms ae-91-91.ebr1.SanJose1.Level3.net (4.69.153.13)  47.694 ms
 9  ae-2-2.ebr3.LosAngeles1.Level3.net (4.69.132.10)  44.047 ms  44.664 ms  44.634 ms
10  ae-73-73.csw2.LosAngeles1.Level3.net (4.69.137.38)  47.430 ms ae-93-93.csw4.LosAngeles1.Level3.net (4.69.137.46)  45.049 ms ae-63-63.csw1.LosAngeles1.Level3.net (4.69.137.34)  46.555 ms


The above command shows all the routers this command goes through to reach the server for linkedin.com. Above shows that linkedin have their main router in Los Angeles.

3) How to get address resolution protocol address:
~$ arp -n

4)How much time does it take to get response from a server/website:

dig archlinux.org | grep "Query time"

5)Who is on my network??

:~$ whowatch

The above is a utility which tells you people connected to the network.

6) Excellent article on loopback:
http://askubuntu.com/questions/247625/what-is-the-loopback-device-and-how-do-i-use-it

7) how to check devices (hosts) in your network:
nmap -w -sP 192.168.3.100/24
 


Monday, December 16, 2013

Great article about node.js

http://stackoverflow.com/questions/1884724/what-is-node-js

Developing client applications if you detest JavaScript: http://www.gwtproject.org/overview.html

Framework for node.js: http://nodeframework.com/

Communities for node.js:
1) http://gruntjs.com/
2) http://momentjs.com/
3) http://mean.io/


Great web developer:

https://medium.com/what-i-learned-building/905b0d7d15c3
(http://sagiisha.com/)
 

Monday, December 9, 2013

General Ubuntu Commands

1) How to check the type of RAM you have.

$ sudo dmidecode --type 17

Result should be like:

SMBIOS 2.7 present.

Handle 0x0008, DMI type 17, 21 bytes
Memory Device
    Array Handle: 0x0007
    Error Information Handle: Not Provided
    Total Width: 64 bits
    Data Width: 64 bits
    Size: 2048 MB
    Form Factor: SODIMM
    Set: None
    Locator: SODIMM1
    Bank Locator: Bank 0
    Type: DDR3
    Type Detail: Unknown

Handle 0x000A, DMI type 17, 21 bytes
Memory Device
    Array Handle: 0x0007
    Error Information Handle: Not Provided
    Total Width: Unknown
    Data Width: Unknown
    Size: No Module Installed
    Form Factor: SODIMM
    Set: None
    Locator: SODIMM2
    Bank Locator: Bank 1
    Type: Unknown
    Type Detail: Unknown

2. Interesting website which tells you about your memory and other things.
crucial.com

Thursday, November 21, 2013

How to deploy on Heroku

Pr-requisites:

1)Heroku account.
2)Working on RoR.

1) Install Heroku using
https://toolbelt.heroku.com/

2)Login to Heroku
Command: heroku login

3)Once logged in, go to your root file of your application.

4)Add a heroku key.
Command: heroku keys:add

5)Push your code.(considering you are on branch master)
Command: git push heroku master

6)

Saturday, November 16, 2013

Facing issues with ImageMagick

Error which I get is:

identify: no decode delegate for this image format `/tmp/stream20131115-12525-1jng9sh.png' @ error/constitute.c/ReadImage/552

What it means: It means that it does not recognize file type extension "png"

Solution:

I configure ImageMagick so that it is able to recognize png format.

What I did:

Checked the list of formats supported:

identify -list format

Found that jpeg and png were not there.

How to add them.

1) Download jpeg and png from http://www.imagemagick.org/download/delegaetes/
2)Execute "tar -xvf file_name.tar"
   Change directories to the newly created "file_name"
   Execute "./configure"
   Execute "make"
   Execute "make install"

Do the above for both jpeg and png.

3) Now we need to reconfigure ImageMagick:

Go to the folder where you have stored it.
 a) execute ./configure --with-jpeg=yes --with-jp2=yes -with-png=yes
 b) sudo make
 c) sudo make install

After this check whether it is there in DELEGATES.

execute
identify -list format

Both the formats should now be a part of format.

If the above gives error like:

“error while loading shared libraries: libjpeg.so.9: cannot open shared object file: No such file or directory”

execute :
sudo apt-get install libjpeg62


This would solve the problem. Enjoy.