Skip to content

Instantly share code, notes, and snippets.

View adeekshith's full-sized avatar

Deekshith Allamaneni adeekshith

View GitHub Profile
@adeekshith
adeekshith / .git-commit-template.txt
Last active May 7, 2026 13:59 — forked from Linell/.git-commit-template.txt
This commit message template helps you write great commit messages and enforce it across teams.
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
@adeekshith
adeekshith / cURL-every-URL-in-file.sh
Created November 6, 2015 04:50
Applies cURL on every URL in the given file and saves by line number. Each line in the input file should be a URL
#!/bin/bash
lineNum=1
while IFS='' read -r line || [[ -n "$line" ]]; do
echo "Processing line $lineNum : $line"
curl -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3" $line -o scraped-html/$lineNum.html
delayNow=$((RANDOM%10*30+RANDOM%10))
echo "Waiting for $delayNow sec"
sleep $delayNow
lineNum=$((lineNum+1))
done < "$1"
@adeekshith
adeekshith / simple-website-monitor.nb
Created May 5, 2015 02:31
Simple website monitoring script in Mathematica to monitor and visualize any given website performance over time.
(* Monitors given website load time and plots it *)
dataLength = 400;
timeTakenUrlReq :=
First@AbsoluteTiming[Import["http://google.com/"]];
timeTakenTime := {DateList[], timeTakenUrlReq};
data = {timeTakenTime};
Dynamic[Last[AppendTo[data, timeTakenTime]], UpdateInterval -> 10,
TrackedSymbols -> {}]
Dynamic[If[Length[data] < dataLength, Length[data = data],
Length[data = data[[-dataLength ;;]]]]]
(* Gets JSON from a URL and extracts the data *)
(* Gets response in JSON format *)
apiResponse1 = Import["http://****shod.com/logdata/dessfaa/predictlocation", "JSON"];
(* Check returns 0 if an error occurs and Quiet supresses displaying errors *)
Quiet@Check[apiResponse1, 0]
(* Get response from JSON hierarchically *)
"latitude" /. ("prediction" /. apiResponse1)
(* latitude and prediction are the data keys in the JSON *)
@adeekshith
adeekshith / function-overloading.nb
Created May 2, 2015 03:29
Example for function overloading in Mathematica
(* Function overloading in Mathematica *)
SumMultiply[x_?NumericQ, y_Real] :=
Module[
{sum, mul},
sum = x + y;
mul = x y;
{sum, mul}
]
SumMultiply[x_Integer, y_Real] :=
Module[
@adeekshith
adeekshith / random-password-generator.nb
Last active August 29, 2015 14:20
This script generates pseodu random password or string of a given length
(* Pseudo Random Password generator of given length*)
(* Get all \
characters you would like to be a part of your password *)
letters[] := StringSplit[FromCharacterCode[Range[33, 126]], ""]
(* Pick up random characters from the list *)
GeneratePassword[n_] := StringJoin[RandomSample[letters[], n]]
(* Generate password*)
GeneratePassword[12]
@adeekshith
adeekshith / website-monitoring-1
Last active May 8, 2026 19:25 — forked from eriwen/gist:187610
Scripts for website monitoring using Python
#!/usr/bin/env python
# sample usage: checksites.py eriwen.com nixtutor.com yoursite.org
import pickle, os, sys, logging
from httplib import HTTPConnection, socket
from smtplib import SMTP
def email_alert(message, status):
fromaddr = 'you@gmail.com'
" My .vimrc
" Author: Deekshith Allamaneni
" Launch configurration
execute pathogen#infect()
syntax on
filetype plugin indent on
" Colors
syntax enable
# Oh My ZSH Configuration File
# Auhor: Deekshith Allamaneni
# Path to your oh-my-zsh installation.
export ZSH=/Users/deekshitha/.oh-my-zsh
# Setting Default user name
# Replace 'deekshitha' with your user name.
# This removes displaying your username when you are
# logged in from your own machine.
DEFAULT_USER='deekshitha'
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Brute-force string generation
# Copyright (C) 2011 Radek Pazdera
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.