Posts

Python Numpy Tutorial #2

Image
In our last tutorial, we talked about numpy arrays. If you have not read it, visit  here.   In this post, we will deeper into numpy and talk a bit about the various tools it provides us.  At first, we will see how arithmetic operations work in numpy arrays and the numpy universal functions, ending this tutorial with broadcasting. Array Maths: Basic element-wise addition, subtraction, multiplication, and division can be done in this way : import numpy as np x = np . array([[ 1 , 2 ],[ 3 , 4 ]]) y = np . array([[ 5 , 6 ],[ 7 , 8 ]]) print (x + y) #element-wise addition print (x - y) #element wise subtraction print (x * y) #element-wise multiplication print (x / y) #element-wise division #For all these operations, the first operand will be from x and the second operand from y The output will be an array of the operation on the two vectors. The dot product of two matrices can be calculated in the following way: import numpy as np x ...

Python Numpy Tutorial #1

Image
Numpy is the major library for scientific computing in Python.NumPy enriches the programming language Python with powerful data structures for efficient computation of multi-dimensional arrays and matrices. If you are familiar with Octave or Matlab, you will find this tutorial easy. NB: Numpy can be imported using import numpy as np  Arrays : You can create an array as follows: a = np . array([ 1 , 2 , 3 , 4 ]) #creates a 1x 4 array b = np . array([[ 1 , 2 , 3 ],[ 1 , 2 , 3 ]]) #creates 2x3 array Along with the array, some important parameters taken by np.array ()  are:    1. dtype: It helps you to pass the desired datatype of the array. The       permitted  datatypes are -> int8, int16, int32, int64, float16, float32, float64, complex64 and complex128. Int is for integers, float can store real numbers and complex can store complex numbers. The number represents the bit of data stored...

Open Source Licences

Image
Many of you have heard about open source software. You might have also heard about the open source platform Github. When I first uploaded code on Github, I chose a license randomly. I thought of what use a open source licence might have, but i was wrong. When one builds such a tool or product, that can be forked by others to build their own versions by tweaking and changing its source code, one needs to decide an open source license for it. Today I am going to talk about the various open source licences. What is a LICENSE? Licenses provide rules and guidelines for others to use your work. Open source licenses help others to contribute to your work or project without seeking special individual permission to do so. The different open source licencses There are numerous licenses . I will list out the most commonly used Licenses. All these licenses are OSI (Open Source Initiative ) approved licenses, except the last one. 1. Apache License 2.0 : It is one of the most popular...

Machine Learning : Regression Analysis #1

Image
Introduction If you are aspiring to become a data scientist, regression will be the first algorithm you will learn.  It is one of the most well known and easiest algorithm in machine learning.  Learning about regression analysis would not only help you to clear job interviews but also to solve real-world problems. This article would mainly focus on Linear Regression, which is a form of regression. What is Regression? Regression is a statistical technique which is used to predict continuous dependent variable given a set of independent variables. Regression Analysis takes certain criteria(we will discuss in another post) to work properly. However, if the criteria are met, the algorithm gives splendid results. Mathematically, linear regression is a function in the form, y = a0 + a1x1 + a2x2+....aNxN   where y is the dependent variable,            x1,x2,x3...xN are the independent variable or features wit...

ACTIVATE YOUTUBE'S HIDDEN DARK MODE!!

Image
Next time you are staying up till three in the morning mindlessly watching youtube videos,  why not reduce the strain of your eyes by turning off all the lights. As it was discovered in a post in  Reddit , Youtube has a hidden dark mode and you would be surprised by the fact that this feature can easily be activated. The steps you should follow are: 1. At first, make sure that you have the recent version of Chrome (version 57 or later). 2. Open Chrome, go to Youtube and log into your account . 3. Open Chrome's Developer Tools panel by hitting Command-Option-I on a Mac or Ctrl-Shift-I on Windows. 4. On the panel that opens on the right side of your Chrome window, click the Console tab. 5.  Copy and paste this line of code:     document.cookie="VISITOR_INFO1_LIVE=fPQ4jCL6EiE"     and then hit Enter. 6. Close the Developer Tools Panel and Refresh Youtube. 7. Click on your profile icon in the top right and you will see a...

MAKE YOUR COMPUTER GREET YOU ON BOOTING UP!!

Image
                  Ever thought of making your computer greet you as soon as you boot up. A woman voice saying to you , '' Welcome back, [your name]! Hope you are okay!! " . It gives you a Tony Stark feeling of genius. So, lets get to it. Prerequisites: 1. Linu x operati ng system 2.Basic knowledge of shell and terminal 3.Espeak:You can download it by typing " sudo apt-get install espeak " in the                         terminal. Step 1: Writing the bash file Open text editor of your preference and write a  bash script. This script would be the base on which we will add some features. #!/bin/sh sleep 60 espeak -v en-us+f3 -s160  "Welcome Back Home [your name]" #using espeak to make the computer greet     espeak -v en-us+f3 -s160  "Hope you did not miss me much...

HOW TORRENTS WORKS-INTRODUCTION TO PEERS, SEEDS AND LEECHERS!!!

Image
         Hello this is virtual. It has been a long time since I posted last. Today I am going to talk a bit about a very interesting download protocol i.e peer2peer (p2p) downloading used in torrent. TRADITIONAL CLIENT-SERVER DOWNLOADING Before knowing how torrent works let us see how traditional client-server downloading works. 1. You open a web page and click on a link to download a file. 2. The web browser tells the server to transfer a copy of the file to your computer. 3. The server sent you the file. The transfer of the file depends on the protocol  involved. HOW BIT TORRENT PROTOCOL WORKS    Let us first understand some terms :  1. Peers :They are computers downloading the same file as you. They contribute to the torrent swarm by uploading bits of data they have already downloaded.   2. Seeds :They are computers having the complete file and is uploading the file  for others to down...

TOR Vs VPN Vs Proxy !!!

Image
TOR: TOR stands for Total  Onion Routing. It is a decentralized  system  that allows users to connect to a system of random  relays, thus  protecting their anonymity. TOR encrypts  the data along with the IP address multiple times before sending it through a virtual circuit comprising of a number of relays. Using TOR  makes it more difficult for the activity to be traced back to the user. Advantages : 1.Free 2.Difficult to trace. Disadvantages : 1.Slow. 2.If the exit node is compromised, then your encrypted data is as good as plain text. 3.Location spoofing is not suitable. 4.Not suitable for  p2p file sharing. VPN: It stands for Virtual Private Network. The computer creates  an encrypted tunnel to a VPN server and all of the browsing appears to come from that VPN server. Advantages : 1.Fast. 2.Location can easily be spoofed. Disadvantages : 1.The internet activity is visible to the VPN provider a...

NMAP FOR RECONNAISSANCE #2

Image
                             Hello this is virtual . In the last tutorial I taught you the basic uses of Nmap . This is a continuation of the previous post concentrating on some advanced uses of Nmap .   1. Zenmap : This is a GUI of Nmap . To access it type ' zenmap ' in the Terminal [in root] . It is much easy for beginners and is interactive . 2 .Scan for an entire subnet :   Let me give an example.If you want to scan for entire Class C subnet with port 80 open type             nmap  <ip>/24 -p 80  Eg. nmap 192.168.0.1/24 -p 80     3 .Evading Intrusion Detection System : Most commercial servers have Intrusion Detecting System which alerts the system administrator in case of malicious activity . The best way to evade them is to slow down the s...