#!/usr/bin/env bash
# Assuming OS X Yosemite 10.10.4
# Install XCode and command line tools
# See https://itunes.apple.com/us/app/xcode/id497799835?mt=12#
# See https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcode-select.1.html
xcode-select --install
This file contains hidden or 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 sh | |
# Download lists, unpack and filter, write to stdout | |
curl -s https://www.iblocklist.com/lists.php \ | |
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \ | |
| xargs wget -O - \ | |
| gunzip \ | |
| egrep -v '^#' |
This file contains hidden or 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
import com.yammer.metrics.Metrics | |
import com.yammer.metrics.core.{Gauge, MetricName} | |
import management.{RuntimeMXBean, ManagementFactory} | |
import com.sun.management.UnixOperatingSystemMXBean | |
class PercentCpuGauge extends Gauge[Double] { | |
val runBean: RuntimeMXBean = ManagementFactory.getRuntimeMXBean | |
val osBean: UnixOperatingSystemMXBean = ManagementFactory.getOperatingSystemMXBean.asInstanceOf[UnixOperatingSystemMXBean] |
This file contains hidden or 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
/** | |
* Written by Gil Tene of Azul Systems, and released to the public domain, | |
* as explained at http://creativecommons.org/publicdomain/zero/1.0/ | |
*/ | |
package org.HdrHistogram; | |
import java.util.concurrent.TimeUnit; | |
import java.util.concurrent.atomic.AtomicLongFieldUpdater; | |
import java.util.concurrent.locks.ReentrantLock; |
This file contains hidden or 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 bash | |
COWS_PATH="/usr/local/share/cows" | |
COW_FILES=($(ls $COWS_PATH)) | |
COWS=${#COW_FILES[@]} | |
rand_cow() { | |
#RAND_IDX=$(($RANDOM % $COWS)) | |
RAND_IDX=$((`od -vAn -N4 -tu4 < /dev/urandom` % $COWS)) |