Skip to content

Instantly share code, notes, and snippets.

View d8aninja's full-sized avatar
🐙

Jeff d8aninja

🐙
View GitHub Profile
@oaass
oaass / thpsetup.py
Last active April 12, 2023 00:54
This will install the additional tools to Kali recommended by "The Hacker Playbook". It will install the tools in /opt/tools
#!/bin/bash
echo ""
echo "=========================================================================="
echo "= Pentest Attack Machine Setup ="
echo "= Based on the setup from The Hacker Playbook ="
echo "=========================================================================="
echo ""
# Prepare tools folder
## install pyenv on ds dev cluster
yum -y install git gcc readline-devel zlib-devel bzip2-devel sqlite-devel openssl-devel
git clone git://github.com/yyuu/pyenv.git /usr/local/pyenv
chmod -R 777 /usr/local/pyenv/
echo 'export PYENV_ROOT=/usr/local/pyenv' >>/etc/profile
echo 'export PATH=$PYENV_ROOT/bin:$PATH' >> /etc/profile
echo 'eval "$(pyenv init -)"' >> /etc/profile
echo 'pyenv global 2.7.7' >> /etc/profile
. /etc/profile
pyenv install -v 3.7.3
@drorata
drorata / gist:146ce50807d16fd4a6aa
Last active June 3, 2024 06:00
Minimal Working example of Elasticsearch scrolling using Python client
# Initialize the scroll
page = es.search(
index = 'yourIndex',
doc_type = 'yourType',
scroll = '2m',
search_type = 'scan',
size = 1000,
body = {
# Your query's body
})
@tomhopper
tomhopper / plot_aligned_series.R
Last active June 25, 2023 17:36
Align multiple ggplot2 graphs with a common x axis and different y axes, each with different y-axis labels.
#' When plotting multiple data series that share a common x axis but different y axes,
#' we can just plot each graph separately. This suffers from the drawback that the shared axis will typically
#' not align across graphs due to different plot margins.
#' One easy solution is to reshape2::melt() the data and use ggplot2's facet_grid() mapping. However, there is
#' no way to label individual y axes.
#' facet_grid() and facet_wrap() were designed to plot small multiples, where both x- and y-axis ranges are
#' shared acros all plots in the facetting. While the facet_ calls allow us to use different scales with
#' the \code{scales = "free"} argument, they should not be used this way.
#' A more robust approach is to the grid package grid.draw(), rbind() and ggplotGrob() to create a grid of
#' individual plots where the plot axes are properly aligned within the grid.
@adrianorsouza
adrianorsouza / sublime-command-line.md
Last active September 26, 2023 16:26
launch sublime text from the command line

Launch Sublime Text from the command line on OSX

Sublime Text includes a command line tool, subl, to work with files on the command line. This can be used to open files and projects in Sublime Text, as well working as an EDITOR for unix tools, such as git and subversion.

Requirements

  • Sublime text 2 or 3 installed in your system within Applications folder

Setup

@MarkEdmondson1234
MarkEdmondson1234 / HWplot.R
Created June 18, 2014 21:29
A function to plot a holtWinters timeseries in ggplot2
#HWplot.R
library(ggplot2)
library(reshape)
HWplot<-function(ts_object, n.ahead=4, CI=.95, error.ribbon='green', line.size=1){
hw_object<-HoltWinters(ts_object)
@davharris
davharris / boot.R
Created June 12, 2014 20:17
code for plotting bootstrap predictions from a nonlinear model
set.seed(1)
# Create fake data
x = runif(100, 0, 5)
y = .25 * x^3 - x^2 + rnorm(length(x))
data = data.frame(x = x, y = y)
# Identify 500 points to include in the plots
x.sequence = seq(0, 5, length = 500)
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@hofmannsven
hofmannsven / README.md
Last active February 2, 2024 20:47
Raspberry Pi Cheatsheet
@mages
mages / WorldBank_demo_with_googleVis.R
Last active December 15, 2015 01:38
World Bank data demo
# Thanks to John Maindonald
library(WDI)
indnams <- c("fertility.rate", "life.expectancy",
"population", "GDP.per.capita.Current.USD",
"15.to.25.yr.female.literacy")
inds <- c('SP.DYN.TFRT.IN','SP.DYN.LE00.IN',
'SP.POP.TOTL','NY.GDP.PCAP.CD',
'SE.ADT.1524.LT.FE.ZS')
wdiData <- WDI(country="all", indicator=inds,
start=1960, end=format(Sys.Date(), "%Y"),