Skip to content

Instantly share code, notes, and snippets.

ags-ext.amazon.com
arcus-uswest.amazon.com
cdws.eu-west-1.amazonaws.com
cognito-identity.us-east-1.amazonaws.com
cortana-gateway.amazon.com
cz15y20kg2.execute-api.us-east-1.amazonaws.com
dcape-na.amazon.com
device-messaging-na.amazon.com
device-metrics-us.amazon.com
digprjsurvey.amazon.eu
@github-shakti
github-shakti / Ubuntu Commands
Last active September 17, 2017 19:32
List of Ubuntu Commands
sudo apt-get install virtualbox-guest-additions-iso
sudo mkdir /media/windows-share
sudo mount -t vboxsf Shared_Folder /media/windows-share
wget https://github.com/Automattic/simplenote-electron/releases/download/v1.0.8/simplenote-1.0.8.deb
sudo dpkg -i simplenote-1.0.8.deb
sudo apt-get install octave
@github-shakti
github-shakti / MNIST Perceptron tf.py
Last active September 17, 2017 19:45
Perceptron Model
#! python3
#This is a perceptron implementation written using tensor flow to learn basics of tensor flow
#from tensorflow.examples.tutorials.mnist import input_data
#mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
#(Train 55k / Test 10k / Validate 10k)
#structure of Data : x:mnist.train.images y:mnist.train.label
#mnist.train.images : rc [55000, 784]
#mnist.train.labels : rc [55000, 10]
#y=softmax(Wx+b)
from tensorflow.examples.tutorials.mnist import input_data
@github-shakti
github-shakti / test.py
Last active September 10, 2017 22:18
Bio Info Course
# Copy your updated FrequentWords function (along with all required subroutines) below this line
#PatternCount
def PatternCount(Pattern, Text):
count = 0
for i in range(len(Text)-len(Pattern)+1):
if Text[i:i+len(Pattern)] == Pattern:
count = count+1
return count
#FrequentWords
def CountDict(Text, k):
@github-shakti
github-shakti / bioinformatics_basic.py
Last active August 14, 2017 17:54
[Bio info Basics] #Bioinformatics
#PatternCount
def PatternCount(Pattern, Text):
count = 0
for i in range(len(Text)-len(Pattern)+1):
if Text[i:i+len(Pattern)] == Pattern:
count = count+1
return count
#FrequentWords
def CountDict(Text, k):
import pandas as pd
df=pd.read_csv("IDSP.csv")
print 'Total Requests provided in the Data : ' + str(df.shape[0])
dfd = df.iloc[1:49692,:]
print 'Total Requests made during specified period : ' + str(dfd.shape[0])
cph_filter = (dfd["STOREROOM"] == "CPG") | (dfd["STOREROOM"] == "CPN")& (dfd["STOREROOM"] != "AC1")& (dfd["STOREROOM"] != "MC1")& (dfd["STOREROOM"] != "PMC")
filtered_reviews = dfd[cph_filter]
print 'Total Requests made during specified period at CPH ie (CPN & CPG): ' + str(filtered_reviews.shape[0])
@github-shakti
github-shakti / MacroIDSP.bas
Last active September 10, 2017 22:15
IDSP Excel Macro
Sub MacroIDSP()
'
' MacroIDSP Macro
'
'
On Error Resume Next
Columns("C").SpecialCells(xlBlanks).EntireRow.Delete
Range("E1:E200").Select
Selection.NumberFormat = "0"
@github-shakti
github-shakti / xiaomi_callrec_batch_rename.py
Last active September 10, 2017 22:16
Xiaomi Call Rec Batch Rename
import os
import sys
files = os.listdir(os.getcwd())
print files
for index in range(len(files)):
files[index].split('@',1)
extension=files[index].split('@',1)[1][-4:]
print files[index].split('_',1)[1][:4]+" "+files[index].split('_',1)[1][4:6]+" "+files[index].split('_',1)[1][6:8]+" "+files[index].split('_',1)[1][8:14]+" _ "+files[index].split('_',1)[0]+files[index].split('_',1)[1][-4:]
oldname=files[index]
@github-shakti
github-shakti / js_greasemokey.txt
Created August 24, 2015 22:15
Code : Captcha Bypass Script (Grease Monkey Version)
// ==UserScript==
// @name PNR Captcha Bypass
// @namespace http://www.indianrail.gov.in/pnr_Enq.html
// @description Autofill Captcha on Indian Railways Website for PNR Enquiry
// @include http://www.indianrail.gov.in/pnr_Enq.html
// @version 1
// @grant none
// ==/UserScript==
window.addEventListener('load', function() {
document.getElementById("txtInput").value=document.getElementById("txtCaptcha").value;
@github-shakti
github-shakti / irctc_php_captcha.py
Created August 24, 2015 22:05
Code : Captcha Bypass Script (PHP Version)
from mechanize import Browser
from bs4 import BeautifulSoup as bs
import pytesser
import random
enteredpnr = raw_input('Please input your 10 PNR no. : ')
while len(enteredpnr) != 10 or not enteredpnr.isdigit():
print('You have not entered a 10 digit numerical value! Please try again.')
enteredpnr = raw_input('Please input your 10 digit book no. : ')
print "PNR entered by you is "+enteredpnr
raw_input('Press Enter to Continue if correct OR restart the Script')