This file contains 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/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 |
This file contains 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
""" | |
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: |
This file contains 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
#! -*- 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 |
This file contains 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 | |
# -*-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: |
This file contains 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
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 |
This file contains 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
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; | |
This file contains 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/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 | |
This file contains 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 -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) |
OlderNewer