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
defaults write com.apple.Safari IncludeDebugMenu 1 | |
defaults write com.apple.dock no-bouncing -bool TRUE | |
defaults write com.apple.notificationcenterui bannerTime 1 | |
defaults write -g ApplePressAndHoldEnabled -bool false | |
defaults write com.apple.Dock autohide-delay -float 0 | |
defaults write com.apple.dock autohide-time-modifier -float 0.01 | |
killall Dock |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>websocket playground</title> | |
<meta charset="utf-8"> | |
<meta name="description" content="Quick, dirty, and in-browser websocket playground"> | |
<meta name="author" content="@vikrum5000"> | |
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.3.0/bootstrap.min.css"> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> | |
<style type="text/css"> |
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
# On bash + Linux | |
# Show TCP sockstats every 5 seconds | |
$ while [ : ]; do echo -n `date`; echo -n ": "; cat /proc/net/sockstat | sed 'N;s/\n/ /;' | grep TCP; sleep 5; done | |
# Show netstat connection state counts every 5 seconds | |
$ while [ : ]; do echo -n `date`; echo -n ": "; netstat -n | awk '/^tcp/ {t[$NF]++}END{for(state in t){print state, t[state]} }' | tr '\n' ' '; echo ; sleep 5; done | |
# Show top 25 established IPs and their counts | |
$ lsof -n|grep TCP|grep ESTABLISHED|awk '{print $9}' |grep -e "->"|awk -F '->' '{print $2}'|awk -F ':' '{print $1}'|sort -t . -k 1,1n -k 2,2n -k 3,3n -k 4,4n|uniq -c|sort -rn|head -25 |
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
package sandbox; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.concurrent.ConcurrentHashMap; | |
import java.util.concurrent.CountDownLatch; | |
import org.apache.commons.lang3.time.StopWatch; | |
public class LockOnLocksOnLocks { |
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
object App extends Logging { | |
def main(args: Array[String]) = { | |
setupNetty | |
scalaReplConsole | |
} | |
/** | |
* Setup Netty for things like logging, etc. This should happen first. Do not get rid of this. | |
* You'll have a calamity on your hands if it needs to log under stress and it is unable to. |
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
# Courtesy @marius, April 2012 | |
# | |
# "Our most common type of system are mostly stateless, high volume, | |
# low latency RPC systems. For these, we generally use this template:" | |
HEAP_OPTS="-Xmx17G -Xms17G -XX:NewSize=15G -XX:+UseNUMA" | |
GC_OPTS="-XX:+UseConcMarkSweepGC -XX:SurvivorRatio=40 -XX:+CMSScavengeBeforeRemark" | |
GC_LOG_OPTS="-verbosegc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:+PrintTenuringDistribution -XX:+PrintHeapAtGC" | |
GC_LOG="-Xloggc:/var/log/$APP_NAME/gc.log" | |
DEBUG_OPTS="-XX:ErrorFile=/var/log/$APP_NAME/java_error%p.log" |
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
var naturalDist = "abcdefghiklmnopqrstuvwxyz"; | |
var scrabbleDist = "aaaaaaaaabbccddddeeeeeeeeeeeeffggghhiiiiiiiiijkllllmmnnnnnnooooooooppqrrrrrrssssttttttuuuuvvwwxyyz"; | |
var englishDist = "aaaaaaaabbcccddddeeeeeeeeeeeefffgghhhhhhiiiiiiijkllllmmnnnnnnnooooooooppqrrrrrrssssssstttttttttuuuvwwwxyyz"; |
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
var crypto = require('crypto'); | |
var dns = require('native-dns'); | |
var rest = require('restler'); | |
var server = dns.createServer(); | |
server.on('request', function (request, response) { | |
var domain = request.question[0].name; | |
if(domain == 'webutils.flourishworks.com') { | |
// Don't log this because it can't be uniquely identified and subsequently retrieved |
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/perl -w | |
# display linux interface bandwidths on a regular interval | |
# dep: yum -y install perl-Time-HiRes | |
# Copyright (c) 2005 Dean Gaudet <dean@arctic.org> | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a | |
# copy of this software and associated documentation files (the "Software"), |
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 | |
# | |
# seek and kill a mem hog fork()'d child | |
# | |
SEEK="stud" | |
SNOOZE="6000" | |
while [ : ]; do | |
echo Snoozing for $SNOOZE |
OlderNewer