Skip to content

Instantly share code, notes, and snippets.

View phobos182's full-sized avatar

Jeremy Carroll phobos182

View GitHub Profile
#!/bin/bash -e
# This script finds IAM users who have passwords but no MFA.
# Deal with them accordingly.
# Generate a report
aws iam generate-credential-report > /dev/null
# Download report.
REPORT=$(aws iam get-credential-report)
@ddrown
ddrown / gist:20c2969731367cfbf046
Created July 22, 2014 18:24
Per-user rate limiting
#!/bin/sh
iptables -t mangle -A OUTPUT -m owner --uid-owner slowuser -j CLASSIFY --set-class 1:11
tc qdisc add dev em1 root handle 1:0 htb default 99
tc class add dev em1 parent 1:0 classid 1:1 htb rate 1000Mbit ceil 1000Mbit
tc class add dev em1 parent 1:1 classid 1:11 htb rate 1Mbit ceil 1Mbit prio 2
tc qdisc add dev em1 parent 1:11 handle 10: sfq perturb 10
public class MajorCompactServersJob extends AbstractJob {
public static final String SHORT_OPT = "majorCompactServers";
public static final String LONG_OPT = "majorCompactServers";
public static final String DESCRIPTION = "Major compact all regions on a server or list of servers";
private final HBaseAdminWrapper wrapper;
private final SlowCompactionManager compactor;
private final RegionLoadEstimation regionLoadEstimation;
private final HdfsLocalityInfo hdfsLocalityInfo;
@coderanger
coderanger / README.md
Last active August 18, 2023 18:33
How to patch Ubuntu for Heartbleed

How to patch Ubuntu for Heartbleed

  1. sudo apt-get update
  2. sudo apt-get install -y libssl1.0.0 openssl
  3. openssl version -a and confirm the "built on" date is >= 2014-04-07
  4. sudo lsof -n | grep ssl | grep DEL and restart all listed services.

Repeat #4 until no results are returned.

@cbarraford
cbarraford / install_ixgbevf.bash
Last active November 28, 2019 21:35
Install ixgbevf driver for amazon aws enhanced networking (ubuntu)
aptitude install -y build-essential
wget "http://downloads.sourceforge.net/project/e1000/ixgbevf stable/2.11.3/ixgbevf-2.11.3.tar.gz"
tar -zxf ./ixgbevf-*
cd ixgbevf*/src
make install
modprobe ixgbevf
sudo update-initramfs -c -k all
echo "options ixgbevf InterruptThrottleRate=1,1,1,1,1,1,1,1" > /etc/modprobe.d/ixgbevf.conf
@mrflip
mrflip / tuning_storm_trident.asciidoc
Last active October 8, 2024 15:18
Notes on Storm+Trident tuning

Tuning Storm+Trident

Tuning a dataflow system is easy:

The First Rule of Dataflow Tuning:
* Ensure each stage is always ready to accept records, and
* Deliver each processed record promptly to its destination
@liutaihua
liutaihua / nginx-SLA
Created April 28, 2012 09:52
nginx log collector for opentsdb
#!/usr/bin/env python
# -*-mode: python; coding: iso-8859-1 -*-
#
# Copyright (c) Liu taihua <[email protected]>
"""
Usage:
[-h|--help] [-t interval=60] [-c cluster=Nanhui] [-H prefer=hostname|IP] [-v|--verbose True|False]
Example:
@kracekumar
kracekumar / core.py
Created March 4, 2012 09:45
parallelpip demo
#! -*- Coding: utf-8 -*-
from gevent import monkey
monkey.patch_all()
import gevent
import time
from envoy import run
from sys import exit, argv
import subprocess
import pip
@numan
numan / autoscaling_boto.py
Created July 17, 2011 00:42
Example of setting up AWS auto scaling using boto API
"""
The MIT License (MIT)
Copyright (c) 2011 Numan Sachwani
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
@peo3
peo3 / cgroup_event_listener.py
Created April 21, 2011 14:00
A python script doing the same operations as cgroup_event_listener.c
#!/usr/bin/python
# Usage: sudo python cgroup_event_listener.py /sys/fs/cgroup/memory/hoge/memory.usage_in_bytes 263M
import sys
import os, os.path
import struct
import linux