G33K-TRICKS: Others
Showing posts with label Others. Show all posts
Showing posts with label Others. Show all posts

Wednesday, February 3, 2016

How to Install Numpy python module on Windows [SOLVED]


Simple, tried and tested steps to install Numpy module


Pre-requisite, would be "You are already having Python installed on your system"
Next Download the Numpy module from https://pypi.python.org/pypi/numpy
 [I downloaded the Zipped one, so can you  ;) ]

Unzip the downloaded Numpy and go to
C:\Users\<USERNAME>\Downloads\numpy-1.10.4\numpy-1.10.4
using command prompt. This is where setup.py is available.

Now type commands,
python setup.py build

If building does not throw any errors , run
python setup.py install

In-case you see some error similar to error: Unable to find vcvarsall.bat
Which implies you dont have Microsoft Visual studio to build the module.

Either you can download one or there is another way of doing it.
Download, MinGW (32/64) from http://sourceforge.net/projects/mingw/files/

Select ‘download latest repository catalogues’.
Next you select a folder (i.e. C:\MinGW) and the programming support you require: C and C++  (I kept Fortran and ObjC as deselected).
You need "MinGW Developer Toolkit" installed.
If you select this option you’ll get MSYS as well.
H
Next thing you need to do is to configure your PATH environment variable.

Right-click on My Computer and Select Properties
Go to the tab ‘Advanced’ and select ‘Environment variables’
Select ‘Path’ from the ‘System Variables’ and click the ‘Edit button’
Add the following paths to your variables: ‘C:\MinGW\bin;'  (without quotes)

Now, Edit / Create new file  "distutils.cfg" at C:\Python26\Lib\distutils\distutils.cfg with following change

[build]
compiler=mingw32

Remember, in case you created new file distutils.cfg , the file type should be CFG not TXT
To avoid this, while saving select "Save As" option and then in the "Save as Type" drop down select
"All Files" . Then in the "Filename" field type distutils.cfg and then save.

Open new command prompt and again go to  C:\Users\<USERNAME>\Downloads\numpy-1.10.4\numpy-1.10.4
Run, 
python setup.py build

And if no issues seen,
Run,
python setup.py install



And its Done!!!


Friday, March 7, 2014

How to Measure Throughput (while Uploading or Downloading)


Say ..you want to measure the throughput while uploading or downloading a file...how would you do that...
The answer is Wireshark...a packet sniffing tool.
This tool will measure the throughput upto the exact value as it uses the packets as a real medium for reference.
So, this is how you do it...
Download and install Wireshark

Open Wireshark and a similar window will appear

From top-left panel (Capture) select "eth1". After that the following window will appear
At this time Wireshark is ready to obtain information of all packages that travel on this interface
Start uploading a file from this screen.
You will observe that some colourful rows start appearing on the screen. These are nothing but packets.

   Return to Wireshark window and start looking for all streaming packages. Once package transit stops go to: Capture Menu and select Stop


   Once we have all these information we can continue analyzing it
Go to Edit Menu & select  Find Packet




Following pop-up window will appear



Select String on “Find By” section, type "POST" and press "Find"

From all packages, one of them will be highlighted (the one that contains the string "POST" that is located at the beginning of sent file) you can verify this information on the bottom panel


8.    Once this package was identified, as previous explanation, this is the first package uploaded so is needed to take it as initial reference and this can be done, doing right click and selecting "Set Time reference" option












9.    In Time column of this package the word *REF* will appear, and after it all times will be restarted. Select again this package and doing again, right click select "Follow TCP Stream" option.


10. Other window will appear with all information contained on this package. The goal is to obtain a string located at the end of it. So we need to scroll down and copy the string that starts with "WebKitFormBoundary.xxxxxxxxxxx" (this string changes randonmly)


After select and copy this string we need to follow previous steps to find this string on the stream

Edit > Find Package



NOTE: we need to repeat this step, 2 times in order to find the package that contains this string at the end.

At the same way the package that contain this information will be highlighted, with measured time to upload this file (to verify that this package contains desired string look at below panel, and at the end string will appear)



With this time we can obtain Mbps for this test converting file size to bits (multiplying by 8) and divide it by this time



Saturday, August 31, 2013

How a website sends SMS to a mobile phone




1.The SMS is composed by using a web application which is stored on HTTP server.
2.This application executes the requests on that server and then sent the request through the internet (“using the cloud”) as an email message.
3. The email is received by a Short Message Service Gateway [ SMS Gateway ] .  which then converts the message from an email message to a actual SMS message.
4. Now this SMS message is then handed over to a Short Message Service Center  [ SMSC ] , which is a server that routes the SMS to an individual mobile phone based on the mobile phone number.
5. The message is finally transmitted over the wireless network to the recipient.


You may also like to read :
http://g33ktricks.blogspot.com/p/the-rtsp-real-time-streaming-protocol.html