Skip to content

Instantly share code, notes, and snippets.

View dat-adi's full-sized avatar
🔘
I don't even know what I don't know.

Dat Adithya dat-adi

🔘
I don't even know what I don't know.
View GitHub Profile
@dat-adi
dat-adi / tkinter_classes.py
Created January 24, 2021 09:51
Here's an implementation of working with Classes in Tkinter.
import tkinter as tk
from tkinter import ttk
class windows(tk.Tk):
def __init__(self, *args, **kwargs):
tk.Tk.__init__(self, *args, **kwargs)
# Adding a title to the window
self.wm_title("Test Application")
@dat-adi
dat-adi / undefined
Last active January 17, 2024 01:24
⚡️ GitHub Feed
🗣 Commented on #386 in sfu-db/connector-x
@dat-adi
dat-adi / log_filer.py
Created December 16, 2022 10:23
Creates logs for APs in the network, in a temporary directory.
#!/usr/bin/python
"""
A script to write log files in the /tmp/migrationlogs
directory, and reports changes using the difference between
the current AP state and the log file state, to provide
stations that made it into the AP range.
This information can be used to provide new stations that
have entered the AP range.
"""
@dat-adi
dat-adi / surround_me.py
Created December 16, 2022 10:15
A simple python script to calculate the coordinates to place nodes around a origin point.
#!/usr/bin/python
"""
This is a module used for setting coordinates for
networks.
"""
import math
def rotate(origin, point, angle):
@dat-adi
dat-adi / markov_chain.py
Created December 16, 2022 10:14
A Markov Chain Implementation to create a controller priority list
#!/usr/bin/python
"""
This is a program that implements the Markov Chain algorithm
to calculate the next best possible controller to contact for
executing the source and destination flow modification.
"""
import scipy.linalg
import numpy as np
@dat-adi
dat-adi / heterogeneous_controller_triple_station_migration.py
Created December 16, 2022 10:10
A Mininet-Wifi emulation scenario where one station from every AP migrates to another AP, in a heterogeneous controller environment.
#!/usr/bin/python
"""
This is a script that emulates a triple controller
heterogeneous environment, where mobile stations
migrate from one AP range to another.
"""
from mininet.node import Controller, RemoteController
from mininet.log import setLogLevel, info
from mn_wifi.net import Mininet_wifi
@dat-adi
dat-adi / heterogeneous_controller_station_migration.py
Created December 16, 2022 10:07
This script was made to emulate a station migration scenario, in a heterogeneous controller environment, using Mininet-Wifi.
#!/usr/bin/python
"""
This script is used to emulate a scenario where
a station migrates from one AP to another, while
attempting to ping a station from the third AP.
Controllers used to test: ODL, FL, Ryu.
Emulator used: Mininet-Wifi
Initial state
-------------
@dat-adi
dat-adi / google-auth-test.py
Created January 23, 2021 10:30
Working with the `google-auth` module
import gspread
from google.oauth2 import service_account
from pprint import pprint
# used to retrieve credentials from the *creds.json* file
creds = service_account.Credentials.from_service_account_file("creds.json")
scoped_credentials = creds.with_scopes(
[
"https://spreadsheets.google.com/feeds",
'https://www.googleapis.com/auth/spreadsheets',
@dat-adi
dat-adi / PermissionManagement.md
Created December 22, 2021 09:37
Notes taken on Permission Management in Linux.

Introduction

Before we get started, it is important to execute a command that shows us what we are working with.

ls -l

Executing it on a system's home directory, with a particular file gives us the following response,

-rwxr-x-r-x 1 dat-adi users 2048 Dec 6 12:56 example.sh
@dat-adi
dat-adi / psutil-system-demo.py
Last active December 19, 2021 17:17
A compilation of functions of the `psutil` module.
# Askpython.com, JournalDev.
# G V Datta Adithya
# Importing the module before utilization
import psutil
# Retrieving information regarding the CPU
## Returns the system CPU times as a named tuple
print(psutil.cpu_times())