Loading

Writing Proxy Server for particular site in PHP with one line (HTTP GET only)

I cannot get access to stackoverflow today again.

So here it is tiny proxy server for http get request, I've written today.

<?php echo preg_replace('|"\/|','"/?x=',file_get_contents('http://stackoverflow.com/'.$_GET["x"]));?>

Cheers,

Memo# Couldn't get access to stackoverflow.com

I couldn't get access to stackoverflow.com almost all the days (only about an hour in the evening, its fine)

- downforeveryorjustme says its down there too
- but just-ping says its almost fine from most place
- it could be my company banned it for local machines
- superuser and serverfault got banned page, but stackovflow and meta aren't, just got
The remote server refuses to perform the request. This address is not available.
- I got it works around 1 hours with Opera Turbo.
- It could be my company banned Opera Turbo too, but some others site like whatismyipaddress.com are fine with Opera Turbo
- Or Stackoverflow banned Opera Turbo? may be because of high traffic on same ip (because its shared by many users?)
- I got 1 hour ok, so its mean banning is not permanent, may be just for few hours for high traffic?

still no clue till now. hopes it will be ok later. or I need to tunnel something with my servers.

Memo# Loop with index in Ruby (alternative to enumerate in Python)

irb(main):033:0* d={"a"=>"x","b"=>"y","c"=>"z"}
=> {"a"=>"x", "b"=>"y", "c"=>"z"}

irb(main):052:0> d.each_with_index{|(k,v),i|puts "key: %s, value: %s, index: %i"% [k,v,i]}
key: a, value: x, index: 0
key: b, value: y, index: 1
key: c, value: z, index: 2
=> {"a"=>"x", "b"=>"y", "c"=>"z"}

က်ေနာ္ဖတ္ေသာ အျခား ဘေလာ့ / ဆိုဒ္မ်ား