Skip to content

Instantly share code, notes, and snippets.

@cturra
Last active August 29, 2015 14:07
Show Gist options
  • Save cturra/156154eeaeb038085915 to your computer and use it in GitHub Desktop.
Save cturra/156154eeaeb038085915 to your computer and use it in GitHub Desktop.
# used to test randomness
$host = http.getHostHeader();
$cturra = http.getHeader("cturra");
if ( string.containsI($host, "aus3.mozilla.org") &&
string.containsI($cturra, "true")
){
if ( math.random(100) < 1 ){
http.redirect("http://www.cturra.com");
}
}
---
cturra@anne ~ $ for i in {0..99}; do echo "=> test $i"; curl -Is https://aus3.mozilla.org//update/3/Firefox/10.0.1/20120208060813/Darwin_x86_64-gcc3-u-i386-x86_64/de/release/Darwin%2010/default/cturra/update.xml\?force\=1 -H "cturra:true" | grep Location ; done
=> test 0
=> test 1
=> test 2
=> test 3
=> test 4
=> test 5
=> test 6
=> test 7
=> test 8
=> test 9
=> test 10
=> test 11
=> test 12
=> test 13
=> test 14
=> test 15
=> test 16
=> test 17
=> test 18
=> test 19
=> test 20
=> test 21
=> test 22
=> test 23
=> test 24
=> test 25
=> test 26
=> test 27
=> test 28
=> test 29
=> test 30
=> test 31
=> test 32
=> test 33
=> test 34
=> test 35
=> test 36
=> test 37
=> test 38
=> test 39
Location: http://www.cturra.com
=> test 40
=> test 41
=> test 42
=> test 43
=> test 44
=> test 45
=> test 46
=> test 47
=> test 48
=> test 49
=> test 50
=> test 51
=> test 52
=> test 53
=> test 54
=> test 55
=> test 56
=> test 57
=> test 58
=> test 59
=> test 60
=> test 61
=> test 62
=> test 63
=> test 64
=> test 65
=> test 66
=> test 67
=> test 68
=> test 69
=> test 70
=> test 71
=> test 72
=> test 73
=> test 74
=> test 75
=> test 76
=> test 77
=> test 78
=> test 79
=> test 80
=> test 81
=> test 82
=> test 83
=> test 84
=> test 85
=> test 86
=> test 87
=> test 88
=> test 89
=> test 90
=> test 91
=> test 92
=> test 93
=> test 94
=> test 95
=> test 96
=> test 97
=> test 98
=> test 99
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment