Skip to content

Instantly share code, notes, and snippets.

View jrelo's full-sized avatar

hed0rah jrelo

View GitHub Profile
@jrelo
jrelo / InfluxDB_cheatsheet.md
Created September 12, 2017 17:59 — forked from tomazursic/InfluxDB_cheatsheet.md
InfluxDB cheatsheet

InfluxDB Cheatsheet

Connect to InfluxDB using the commandline:

$ influx

Create a database foo:

CREATE DATABASE foo
@jrelo
jrelo / linux_performance.md
Created June 16, 2017 20:23 — forked from marianposaceanu/linux_performance.md
Linux simple performance tweaks

Linux simple performance tweaks

Change the I/O Scheduler

Open $ vim /etc/default/grub then add elevator=noop next to GRUB_CMDLINE_LINUX_DEFAULT. Run $ update-grub and $ cat /sys/block/sda/queue/scheduler to be sure that noop is being used:

$ vim /etc/default/grub
$ update-grub
$ cat /sys/block/sda/queue/scheduler

[noop] deadline cfq

@jrelo
jrelo / Hping3 Packet Grenade
Created May 12, 2017 16:41 — forked from Erreinion/Hping3 Packet Grenade
Firewall testing script using hping3
# Packet Grenade
# Feb 13, 2015
# Lists of targets
set pinglist [list www.google.com www.facebook.com]
set httplist [list www.google.com www.facebook.com]
set httpslist [list www.google.com www.facebook.com]
set ftplist [list]
set sshlist [list alt.org thebes.openshells.net]
@jrelo
jrelo / iptables_tcpkill.sh
Created May 6, 2017 17:13 — forked from shekkbuilder/iptables_tcpkill.sh
iptables_killtcp.sh
#!/bin/bash
#more methods: http://rtomaszewski.blogspot.com/2012/11/how-to-forcibly-kill-established-tcp.html
if [ $# -lt 1 ];
then
printf "Usage: $0 <IP>\n" $#
exit 0
fi
raddr=$1
printf "Killing TCP connections to/from ${raddr}...\n"
iptables -I INPUT -s ${raddr} -p tcp -j REJECT --reject-with tcp-reset
@jrelo
jrelo / ns-inet.sh
Created April 30, 2017 01:38 — forked from dpino/ns-inet.sh
Setup a network namespace with Internet access
#!/usr/bin/env bash
set -x
NS="ns1"
VETH="veth1"
VPEER="vpeer1"
VETH_ADDR="10.200.1.1"
VPEER_ADDR="10.200.1.2"
@jrelo
jrelo / extract_sql.pl
Created April 13, 2017 12:40 — forked from leoromanovsky/extract_sql.pl
Extract SQL tables from database dump
#!/usr/bin/perl -w
##############################################################################
##
## Written by: Jared Cheney <[email protected]>
##
## Original Template written by:
## Brandon Zehm <[email protected]> and Jared Cheney <[email protected]>
##
## License:
##
@jrelo
jrelo / ipv6-regex-test.sh
Created April 8, 2017 19:33 — forked from syzdek/ipv6-regex-test.sh
Simple script to test my IPv6 regular expression.
#!/bin/sh
#
# Use posixregex CLI tool from: https://github.com/syzdek/dmstools/blob/master/src/posixregex.c
RE_IPV4="((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])"
posixregex -r "^(${RE_IPV4})$" \
127.0.0.1 \
10.0.0.1 \
192.168.1.1 \
@jrelo
jrelo / Git Cheat Sheet
Created March 22, 2017 17:50 — forked from adamvduke/Git Cheat Sheet
Corey Floyd's git cheat sheet
via: http://groups.google.com/group/phillycocoa/browse_thread/thread/2d05f3eac5a7d260?hl=en
revert file:
git checkout HEAD path/to/file
OR
git checkout filename
pluck one file from another branch
git checkout Branch path/to/file
@jrelo
jrelo / Makefile
Created March 22, 2017 04:12 — forked from america/Makefile
simple makefile for C
TARGET = test
CC = gcc
CFLAGS = -c -v
VPATH = src
SRC = test.c
OBJ = $(SRC:.c=.o)