Skip to content

Instantly share code, notes, and snippets.

View abdullahmujahidali's full-sized avatar
:shipit:
I may be slow to respond.

Abdullah Mujahid abdullahmujahidali

:shipit:
I may be slow to respond.
View GitHub Profile
@abdullahmujahidali
abdullahmujahidali / randomWalk.py
Created April 23, 2020 20:50
Random Walk Function
import numpy as np
import random
import matplotlib.pyplot as plt
def randomWalk(L):
# S is a 2d array where x = row1= S[0][:], y = row2 = S[1][:]
S = np.zeros(shape=(2,L+1))
directions = [1,2,3,4]
@cskeeters
cskeeters / broadcast_calc.sh
Created December 8, 2016 19:17
Bash script for calculating network and broadcast addresses from ip and netmask or CIDR Notation
#!/bin/bash
# Calculates network and broadcast based on supplied ip address and netmask
# Usage: broadcast_calc.sh 192.168.0.1 255.255.255.0
# Usage: broadcast_calc.sh 192.168.0.1/24
tonum() {
if [[ $1 =~ ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+) ]]; then