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
#updating and upgrading | |
sudo apt-get update | |
sudo apt-get upgrade | |
#installing squid3 | |
sudo apt-get install squid3 | |
#installing rvm and rubies | |
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 | |
\curl -sSL https://get.rvm.io | bash -s stable --ruby |
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/env ruby | |
# url rewriter for rubygems squid proxy | |
STDOUT.sync = true | |
while line = gets | |
url = line.split(' ')[0] | |
# Cargo-culted this conditional, not sure if it is necessary | |
response = if url |
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
########################################################################## | |
# | |
# Proof-of-concept squid proxy settings for proxying http://rubygems.org/ | |
# Caches everything so is resilient to network outage or upstream outage. | |
# Works with bundler, gives a significant speed up when cache is warm (100%+) | |
# | |
########################################################################## | |
# Disable default patterns that prevent caching of query params | |
# refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 |