This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"" | |
Description : Hide data behind steganography | |
Library : https://github.com/computationalcore/cryptosteganography | |
""" | |
import sys | |
import json | |
from getpass import getpass | |
from cryptosteganography import CryptoSteganography |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Description: Rotate encryption key to keep sensitive data more secure | |
1. Read 'secret key' and decrypt the 'secret file'. | |
2. Generate new 'secret key' and encrypt the 'secret file' with new key and store it back to the 'secret file'. | |
3. Update new 'secret key' into the hidden file. | |
""" | |
import os | |
import sys | |
import yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Description: | |
This application maybe imported or used as a command line interface. | |
A skeleton that ll interact with REST API, xml-rpc, cli and other possible interfaces of network devices. | |
Mappings: It pickles data mappings locally in the 'mapping' folder. | |
Configurations: All the configurations are read locally from 'confs' - TODO | |
Logs: All logs are stored and rotated from the folder 'logs' - TODO | |
Before starting this app. Create a directory tree structure as following: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Home Automation</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> | |
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Description: Get current username. Useful in automation. | |
""" | |
#Approach1 | |
import os | |
import pwd | |
pwd.getpwuid( os.getuid() ).pw_name | |
#Approach2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@app.route("/tableCreate") | |
def create_table(): | |
return """ | |
<html> | |
<head> | |
<link rel= "stylesheet" type= "text/css" href= "/static/style.css"> | |
</head> | |
<body> | |
<form action="http://192.168.0.2:5000/form" method="post"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Description: | |
An attempt to create plots from csv dataset. | |
Sample csv auto generation script: | |
import math | |
file = open("Dataset.csv", 'w') | |
file.write( "Linear,AP,GP,EXP,ACTION\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Description: | |
Using pandas display 200 lines of csv at a time. Csv for example could be an import from a database. | |
''' | |
""" | |
If you plan to test this with a sample csv then you may use the following code to generate csv: | |
file = open("large.csv", "w") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__= "Sujayyendhiren Srinivasamurthi" | |
__email__ = "sujayyendhiren.srinivasamurthi@fmr.com" | |
__description__ = """ | |
Manipulating dataframes, especially adding row to a dataframe. | |
""" | |
import numpy as np | |
import pandas as pd | |
df = pd.DataFrame(columns=['Apps', 'Data']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'Sujayyendhiren Srinivasamurthi' | |
__email__ = 'sujayy1983@gmail.com' | |
__description__ = '''Javascript unused variable checker. | |
Tested with a simple PAC file too.''' | |
import os | |
dupvariables = {} | |
def parserfunction( js_file ): |
NewerOlder