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
| require(ggplot2) | |
| png("images/2012-06-04-playing-for-3k-share-or-no-share/pwinning.png") | |
| y <- c() | |
| for (x in 1:40) y <- c(y, x/(x+1)) | |
| d <- data.frame(friends=1:40, prob_winning=y) | |
| ggplot(d, aes(friends, prob_winning)) + geom_point(size=3) + ylab("P(winning)") + xlab("# Invited Friends") | |
| dev.off() | |
| png("images/2012-06-04-playing-for-3k-share-or-no-share/prob_friends.png") |
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
| cd /usr/src | |
| wget http://launchpad.net/graphite/0.9/0.9.10/+download/graphite-web-0.9.9.tar.gz | |
| wget http://launchpad.net/graphite/0.9/0.9.10/+download/carbon-0.9.10.tar.gz | |
| wget http://launchpad.net/graphite/0.9/0.9.10/+download/whisper-0.9.10.tar.gz | |
| tar -zxvf graphite-web-0.9.10.tar.gz | |
| tar -zxvf carbon-0.9.10.tar.gz | |
| tar -zxvf whisper-0.9.10.tar.gz | |
| apt-get install apache2 apache2-utils apache2.2-bin apache2.2-common libapr1 libaprutil1 libaprutil1-dbd-sqlite3 python3.2 libpython3.2 python3.2-minimal libapache2-mod-wsgi | |
| apt-get install libaprutil1-ldap python-cairo-dev python-django python-ldap python-memcache python-pysqlite2 sqlite3 libapache2-mod-python python-setuptools |
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
| #!/bin/bash | |
| USER=your-username | |
| PASSWORD=your-password | |
| DEST=$(wget "http://google.com" --no-check-certificate -O - -S -q 2>&1 | grep Location | cut -d ' ' -f 4) | |
| if [ "$DEST" == "http://www.google.com/" ]; then | |
| echo "You're already connected to the tubes." | |
| exit 1 |
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
| require 'cgi' | |
| role :server, "1.2.3.4", "5.6.7.8" | |
| set :repo, "git@github.com:whatever/project.git" | |
| set :destpath, "/home/myuser/project" | |
| set :user, "myuser" | |
| set :ssh_options, { :forward_agent => true } | |
| after "deploy", "restart" |
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
| //////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
| // Track conversion if user clicks (default) | |
| //////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
| <a class="opbandit" href="/some/video" data-conversion="click"> | |
| Click Here! | |
| </a> | |
| // or |
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
| from robostrippy.resource import attr, attrList, Resource | |
| class Connection(Resource): | |
| subject = attr("h2.postingtitle") | |
| body = attr("section#postingbody") | |
| datetime = attr("time", attribute = "datetime") | |
| class ConnectionListItem(Resource): | |
| url = attr("a", attribute = 'href') |
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
| require 'socket' | |
| require 'timeout' | |
| class StunClient | |
| def initialize(host, port) | |
| @host = host | |
| @port = port | |
| end | |
| def get_ip |
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
| <div class="Picture Left opbandit" style="height:auto;width:160px;" data-opbandit-conversion="anyclick"> | |
| <span onclick="dcsAfm('afm_1_2','2014-09-17T06:26:27.000000','Wiener Dschihadistinnen sind angeblich schwanger');window.location.href='http://www.vol.at/sind-die-wiener-is-kriegerinnen-schwanger/4088445';return false;" class="link"> | |
| <img src="http://cdn2.vol.at/2014/09/d_s-aufmacher-4088492-2-63a927fe9572ed2be910de2259a16b43.jpg" width="160" height="170" alt="Wiener Dschihadistinnen sind angeblich schwanger" /> | |
| </span> | |
| </div> |
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
| <div class="Picture opbandit Left" style="height:auto;width:225px;" data-opbandit-conversion='anyclick'><span onclick="dcsAfm('afm_1_7','2014-09-23T10:19:35.000000','6 Zitate zur Landtagswahl');window.location.href='http://snowball.gentics.com/APA/snowballtest4/Zitate-Landtagswahl.html';return false;" class="link"><img src="http://cdn3.vol.at/2014/09/zitat-scheff-wallner-aufmacher-4094152-2-8b6dc9aee5323a4b990357d011b5ec8f.jpg" width="225" height="157" alt="6 Zitate zur Landtagswahl" /></span></div> | |
| <!-- change to --> | |
| <div class="Picture Left" style="height:auto;width:225px;"><span onclick="dcsAfm('afm_1_7','2014-09-23T10:19:35.000000','6 Zitate zur Landtagswahl');window.location.href='http://snowball.gentics.com/APA/snowballtest4/Zitate-Landtagswahl.html';return false;" class="link opbandit" data-opbandit-conversion='anyclick'><img src="http://cdn3.vol.at/2014/09/zitat-scheff-wallner-aufmacher-4094152-2-8b6dc9aee5323a4b990357d011b5ec8f.jpg" width="225" height="157" alt="6 Zitate zur Landtagswahl" /></span |
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
| <div class="Picture opbandit Left" style="height:auto;width:225px;" data-opbandit-conversion='anyclick'> | |
| <span onclick="dcsAfm('afm_1_7','2014-09-23T10:19:35.000000','6 Zitate zur Landtagswahl');window.location.href='http://snowball.gentics.com/APA/snowballtest4/Zitate-Landtagswahl.html';return false;" class="link"> | |
| <img src="http://cdn3.vol.at/2014/09/zitat-scheff-wallner-aufmacher-4094152-2-8b6dc9aee5323a4b990357d011b5ec8f.jpg" width="225" height="157" alt="6 Zitate zur Landtagswahl" /> | |
| </span> | |
| </div> | |
| <!-- change to --> | |
| <div class="Picture Left" style="height:auto;width:225px;"> | |
| <span onclick="dcsAfm('afm_1_7','2014-09-23T10:19:35.000000','6 Zitate zur Landtagswahl');window.location.href='http://snowball.gentics.com/APA/snowballtest4/Zitate-Landtagswahl.html';return false;" class="link opbandit" data-opbandit-conversion='anyclick'> |