This file contains hidden or 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
# Ensure that required tools are installed and available in $PATH | |
command -v pdftk >/dev/null 2>&1 || { echo >&2 "pdftk is required but was not found. Aborting."; exit 1; } | |
command -v exiftool >/dev/null 2>&1 || { echo >&2 "exiftool is required but was not found. Aborting."; exit 1; } | |
command -v qpdf >/dev/null 2>&1 || { echo >&2 "qpdf is required but was not found. Aborting."; exit 1; } | |
# Ensure that 1 cmdline argument was passed | |
if [ "$#" -ne 1 ] | |
then | |
echo "Usage: cleanpdf.sh path-to-pdf-file.pdf" | |
echo "" |
This file contains hidden or 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
#!/usr/bin/env bash | |
for i in $(ls $1); do | |
filename_prefix="${i%.*}" | |
filename_extension="${i##*.}" | |
if [ "$filename_extension" == "sam" ]; then | |
samtools view -bs $i > $filename_prefix.bam | |
samtools sort $filename_prefix.bam -o $2 | |
samtools index $2 $2.index | |
rm $filename_prefix.bam |
This file contains hidden or 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
#!/bin/bash | |
FILETYPE=mp4 | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: <path-to-compress.mp4> target-top-level-directory" | |
exit | |
fi | |
# for all the mp4 except the already scaled ones |
This file contains hidden or 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
#!/bin/bash | |
# This script only sets up the interception mechanism, placing your machine | |
# in the middle of target and gateway. | |
# In order to actually capture and view/edit the traffic either run | |
# sslstrip to bypass SSL and tcpdump to capture packets, or | |
# Burp Suite (auto-generates certificates), or any other similar tool(s) | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: bash mitm_https.sh targetIP" |
This file contains hidden or 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
#!/usr/bin/env python | |
# using the low-level elasticsearch-py client. Works for 6.3 | |
from elasticsearch.helpers import scan # abstraction for scroll() | |
# assuming `es_obj` is an `Elasticsearch` instance | |
doc_generator = scan( | |
es_obj, | |
query={"query": {"match_all": {}}}, | |
index="my-index", |
This file contains hidden or 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
#define _XOPEN_SOURCE 500 /* Enable certain library functions (strdup) on linux. See feature_test_macros(7) */ | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <limits.h> | |
#include <string.h> | |
struct entry_s { | |
char *key; | |
char *value; |