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 | |
aws cloudformation deploy \ | |
--template-file stack.yaml \ | |
--stack-name edge-lambda-test \ | |
--capabilities CAPABILITY_IAM \ | |
--parameter-overrides Nonce=$RANDOM |
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
require "test/unit" | |
require "csv" | |
class TestCsv < Test::Unit::TestCase | |
def test_default_utf | |
csv = "sponsors.csv" | |
CSV.foreach(csv, :encoding => 'windows-1251:utf-8') do |row| | |
print row |
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 | |
echo "What should the Application be called (no spaces allowed e.g. GCal)?" | |
read inputline | |
name="$inputline" | |
echo "What is the url (e.g. https://www.google.com/calendar/render)?" | |
read inputline | |
url="$inputline" |
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 | |
# Exits bash immediately if any command fails | |
set -e | |
REMOTE_KEY=~/.ssh/builderkey | |
# Will output commands as the run | |
set -x |
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
/* source : http://forums.macrumors.com/showpost.php?p=15332289&postcount=20 | |
It's easy to fix iStat Pro processes for Mountain Lion | |
Steps: | |
1. Locate your widget, it will be under /Library/Widgets or ~/Library/Widgets | |
2. Right click it and select: "Show Package Contents" | |
3. Open Wide.js or Tall.js file in some editor (Wide is for horizontal view, Tall for vertical) |
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 | |
# Get the RTMP url of an arte video url | |
# based on http://blog.wirhabenstil.de/2012/01/25/downloading-arte-7-is-just-a-one-liner-in-linux/ | |
curl "$1" | grep CasPlayerXml.xml | sed "s/%2F/\//g" | cut -d"=" -f11 | grep videos | sed -e "s/\"//g" -e "s/%7B/:/g" -e "s/%3A/:/g" | xargs curl | grep \"fr\" | cut -d" " -f3 | cut -d"\"" -f2 | xargs curl | grep \"sd\" | cut -d">" -f2 | cut -d"<" -f1 |
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
function(i) { | |
var v=i-1; | |
return (v|v>>1|v>>2|v>>3|v>>4|v>>5|v>>6|v>>7|v>>8)+1; | |
} |
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/awk -f | |
# # | |
# | |
# Inspired by http://www.percona.com/doc/percona-toolkit/2.1/pt-tcp-model.html | |
# | |
# Example usage: | |
# $ tcpdump -i any -s 0 -nnq -tt 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' | |
# 1349692787.492311 IP X.X.X.X.XXXX > X.X.X.X.XXXX: tcp 1448 | |
# $ ./requestor.awk dump.file |
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 | |
default=`find img/* | grep -v "\."` | |
dirs=${1:-$default} | |
for d in $dirs | |
do | |
name=`basename $d` | |
filename=$name.html | |
echo "processing $filename..." |