Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#
# A bash script to generate CSRF PoC
#
# Input: File containing the raw HTTP request
#
#
# Version: 0.1
#
# Usage: ./csrfpocmaker.sh <input-file>
# Goes in ~/.bash_aliases or ~/.bashrc
alias disable-touchpad='xinput set-prop `xinput list | grep -i touchpad | cut -f 2 | grep -oE '[[:digit:]]+'` "Device Enabled" 0'
alias enable-touchpad='xinput set-prop `xinput list | grep -i touchpad | cut -f 2 | grep -oE '[[:digit:]]+'` "Device Enabled" 1'
body{
background-color:black;
}

Keybase proof

I hereby claim:

  • I am nitstorm on github.
  • I am nitinvenkatesh (https://keybase.io/nitinvenkatesh) on keybase.
  • I have a public key whose fingerprint is 6684 0047 BA04 7A6E C68E 47F4 E556 E8D6 3805 4D64

To claim this, I am signing this object:

@nitstorm
nitstorm / jekyll_redirect_from_insert_text.sh
Last active August 29, 2015 13:57
A bash script that reads the filename and inserts the "redirect_from" variable in the new URL structure my blog uses (blog/YYYY/MM/DD/title.html -> blog/title/)
# Takes filename of the format YYYY-MM-DD-title-of-post.md as input.
# Adds the line - redirect_from: "blog/YYYY/MM/DD/title-of-post.html" as the second line of the file
#
#!/bin/bash
for file in $@; do
file_stripped="$( cut -d '.' -f 1 <<< "$file" )"
IFS='-' read -r year month date title <<< "$file_stripped"
redirect_url="/blog/$year/$month/$date/$title.html"
insert_text="redirect_from: \"$redirect_url\""
"""
The Introduction to Statistics Wrapper provided by Udacity for their course - https://www.udacity.com/course/st101
"""
from matplotlib import pyplot
from numpy import arange
import bisect
def scatterplot(x,y):
pyplot.plot(x,y,'b.')
@nitstorm
nitstorm / double_summation.py
Created December 31, 2013 19:55
Summation and Double Summation examples for the Loops post @ http://nitstorm.github.io/blog/
x = int(input("Enter x upper limit:"))
y = int(input("Enter y upper limit:"))
total = 0
i,j = 1,1
while i <= y:
while j <= x:
total = total + (x*y)
j += 1
i += 1
print total
@nitstorm
nitstorm / time.py
Created December 31, 2013 19:19
Nested loop example for the blog - http://nitstorm.github.io/blog/
hours = int(input("Please enter number of hours: "))
i = 1
total = 0
#Looping through total number of hours
while i<= hours:
# Setting iterator for minutes
j = 1
# Looping through each minute for current hour
@nitstorm
nitstorm / cookie_monster.py
Last active January 1, 2016 15:59
The cookie monster program for the blog post - Understanding Looping @ http://nitstorm.github.io/blog/
@nitstorm
nitstorm / roundoff_without_builtin.py
Last active December 21, 2015 13:59
A Python3 roundoff function without using the builtin round function (for the LTP skype group). Very amateurish code, doesn't have decimal precision)
def roundoff(number):
##Converts the float to int
whole = int(number)
##Gets the fractal part
frac=number-whole
##Checks the fractal, greater than or equal to 0.5, rounds it up to the next higher digit, else returns the same digit
if frac >= 0.5:
return whole+1