Skip to content

Instantly share code, notes, and snippets.

@karteek
Created April 19, 2011 12:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karteek/927214 to your computer and use it in GitHub Desktop.
Save karteek/927214 to your computer and use it in GitHub Desktop.
Just a Gist for replacing an image using Squid
#!/usr/local/bin/ruby
def is_logo(url)
url =~ /logo1w.png$/
end
while true
input_url = ARGF.readline.strip().split(' ').first
new_url = input_url
if is_logo(input_url)
new_url = "http://path.to.localserver/images/ashok.png"
end
puts new_url
STDOUT.flush
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment