Skip to content

Instantly share code, notes, and snippets.

View jamesbrink's full-sized avatar
💭
:trollface:

James Brink jamesbrink

💭
:trollface:
View GitHub Profile
#!/bin/bash
# Start all needed gource instances and connect them
# to a named pipe.
repo="misc"
mkfifo ./tmp/${repo}.pipe
title=$repo
# Set out video title.
title="ACME Software Development."
@jamesbrink
jamesbrink / README.md
Created July 8, 2019 21:16
DDOS Iptables rules

Aggresive IPTables Rules

echo "service iptables restart"| at now + 2 min

iptables --flush

### Drop invalid packets ### 
iptables -t mangle -A PREROUTING -m conntrack --ctstate INVALID -j DROP

Keybase proof

I hereby claim:

  • I am jamesbrink on github.
  • I am jamesbrink (https://keybase.io/jamesbrink) on keybase.
  • I have a public key ASCSmjflUWTdTg_CR_lxTsCAtWgUcv2u_VOW-5WxIB5qyAo

To claim this, I am signing this object:

@jamesbrink
jamesbrink / mac.sh
Created February 20, 2019 05:16
Generate random MAC
#!/usr/bin/env bash
hexdump -vn3 -e '/3 "52:54:00"' -e '/1 ":%02x"' -e '"\n"' /dev/urandom
@jamesbrink
jamesbrink / Dockerfile
Created February 8, 2019 02:07
IPFS Dockerfile
FROM golang:1.11.5-alpine3.9
ARG IPFS_VERSION="v0.4.18"
ARG IPFS_CLUSTER_VERSION="v0.8.0"
ARG IPFS_WEBUI_VERSION="v2.3.3"
ARG IPFS_SRC_DIR="/go/src/github.com/ipfs"
# Build IPFS & IPFS Cluster from source.
WORKDIR ${IPFS_SRC_DIR}
@jamesbrink
jamesbrink / patch.patch
Last active July 20, 2019 02:30
the file name is not a typo
From b0a9156259c1ff9f1a0d42a86e08250e37248a0b Mon Sep 17 00:00:00 2001
From: James Brink <[email protected]>
Date: Thu, 27 Dec 2018 04:50:56 -0700
Subject: [PATCH] Updated output_files function to prevent segfault.
I have updated the output_files function in patch.c to gracefully
handle the following scenario.
Given a git style patch like the following.
@jamesbrink
jamesbrink / pull_reps.sh
Created January 3, 2019 16:13
Pull all repos from private gitlab server
#!/usr/bin/env bash
BASE_PATH="https://yourgitlab.server/"
GROUP_OUTPUT="{ \"group_name\": .full_path, \"group_id\": .id }"
PROJECT_OUTPUT="{ \"project_name\": .path, \"project_url\": .ssh_url_to_repo }"
if [ -z "$GITLAB_PRIVATE_TOKEN" ]; then
echo "Please set the environment variable GITLAB_PRIVATE_TOKEN"
echo "See ${BASE_PATH}profile/account"
exit 1
fi
gitlab_groups=$(curl -s "${BASE_PATH}api/v4/groups?private_token=$GITLAB_PRIVATE_TOKEN&per_page=9999" | jq --raw-output --compact-output ".[] | $GROUP_OUTPUT")
From b0a9156259c1ff9f1a0d42a86e08250e37248a0b Mon Sep 17 00:00:00 2001
From: James Brink <[email protected]>
Date: Thu, 27 Dec 2018 04:50:56 -0700
Subject: [PATCH] Updated output_files function to prevent segfault.
I have updated the output_files function in patch.c to gracefully
handle the following scenario.
Given a git style patch like the following.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Usage:
instagram_auto_accept [options]
Options:
-h, --help Show this help screen.
-s, --sleep=<interval> How long to sleep between polling default 60 seconds
-t, --throttle=<interval> How long to sleep betwen accepts

testing vim-gist