Skip to content

Instantly share code, notes, and snippets.

@mxcl
mxcl / uninstall_homebrew.sh
Created August 26, 2011 11:25
Uninstall Homebrew
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
@hansode
hansode / gen-selfsigned-cert.sh
Created August 2, 2011 20:00
Generate Self-Signed Certificate
#!/bin/sh
#
# based on http://sourcery.blogspot.com/2007/09/script-for-openssl-certificate-signing.html
#
set -e
C=
ST=
L=
@drewrothstein
drewrothstein / aws_usage.py
Created July 11, 2011 20:39 — forked from rcoup/aws_usage.py
A script to query the Amazon Web Services (S3/EC2/etc) usage reports programmatically.
#!/usr/bin/env python
"""
A script to query the Amazon Web Services usage reports programmatically.
Ideally this wouldn't exist, and Amazon would provide an API we can use
instead, but hey - that's life.
Basically takes your AWS account username and password, logs into the
website as you, and grabs the data out. Always gets the 'All Usage Types'
@riywo
riywo / gist:874011
Created March 17, 2011 08:37
bashでパイプとかでつないでバッファされちゃう時

tail -fみたいに流しながら見たいんだけど、色んなコマンドが出力をバッファしちゃうので、困ったときはそのコマンドにバッファしないオプションが無いか探すのがオヌヌメ。 man command -> bufferとかで検索

grep

   --line-buffered
          Use line buffering, it can be a performance penality.

$ iostat -x 1 | grep --line-buffered 'sda'

awk

<!Docutype HTML>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>UserStreamsClient</title>
<script src="http://www.google.com/jsapi"></script>
<script> google.load("jquery", "1.4") </script>
<style>
div.tweet {
border-bottom: 1px solid #999;