Wednesday, May 20, 2015

Setting Up Amazon S3 along with paperclip gem

Assuming you have already installed paperclip gem. .
My OS : Windows

#AMAZON S3 SETUP :
1. Create new account
2. Create S3 bucket, name it.
3. Go to security credentials, It'll ask you to generate IAM user, generate it.
4. Click access keys & generate a new one. Note down access_key_id & secret_access key.
5. Click policies & add "Administrator access policy".

Note : Step 5 is very imp or you'll get access denied while uploading on heroku server.

#RAILS CODE SETUP:

Step 1 : Add this gem to your gem file :
gem 'aws-sdk', '< 2.0'

Note: it's important that you write it exactly the same as the version above 2.0 will give you errors later on.

Step 2 : Add these lines inside  # config > environment > production.rb

# config/environments/production.rb
config.paperclip_defaults = {
  :storage => :s3,
  :s3_credentials => {
    :bucket => ENV['S3_BUCKET_NAME'],
    :access_key_id => ENV['AWS_ACCESS_KEY_ID'],
    :secret_access_key => ENV['AWS_SECRET_ACCESS_KEY']
  }
}

Note : Don't replace anything in the above code.

Step 3 : Execute these 3 commands from the root directory of your app using terminal
$ heroku config:set S3_BUCKET_NAME=your_bucket_name
$ heroku config:set AWS_ACCESS_KEY_ID=your_access_key_id
$ heroku config:set AWS_SECRET_ACCESS_KEY=your_secret_access_key

Note : Replace your_bucket_name with name of your bucket
For ex: if your bucket_name is hello-world then command will be :
$ heroku config:set S3_BUCKET_NAME=hello-world
Do the same for the accesss key & secret access key that we obtain from Amazon.

Everything is ready ! Go have fun !


Sunday, August 17, 2014

Hat's off to Heath Ledger

To prepare for the role, Ledger lived alone in a hotel room for a month, formulating the character's posture, voice, and personality, and kept a diary, in which he recorded the Joker's thoughts and feelings.[2][3] While he initially found it difficult, Ledger eventually generated a voice unlike Jack Nicholson's character in Tim Burton's 1989 Batman film.[1][3] He was also given Batman: The Killing Joke and Arkham Asylum: A Serious House on Serious Earth, which he "really tried to read and put it down."[13] Ledger also cited A Clockwork Orange and Sid Vicious as "a very early starting point for Christian [Bale] and I. But we kind of flew far away from that pretty quickly and into another world altogether."[14][15] "There's a bit of everything in him. There's nothing that consistent," Ledger said, and added, "There are a few more surprises to him."[14] Ledger was allowed to shoot and mostly direct the videos the Joker sends out as warnings. Each take Ledger made was different from the last. Nolan was impressed enough with the first video shoot that he chose to not be present when Ledger shot the video with a kidnapped reporter (Anthony Michael Hall).[16] On January 22, 2008, after he had completed filming The Dark Knight, Ledger died of an accidental prescription drug overdose, leading to intense press attention and memorial tributes. "It was tremendously emotional, right when he passed, having to go back in and look at him every day [during editing]," Nolan recalled. "But the truth is, I feel very lucky to have something productive to do, to have a performance that he was very, very proud of, and that he had entrusted to me to finish."[15] All of Ledger's scenes appear as he completed them in the filming; in editing the film, Nolan added no "digital effects" to alter Ledger's actual performance posthumously.[17] Nolan has dedicated the film in part to Ledger's memory.[18][19]
Ledger told Empire how he prepared for the role:
"I sat around in a hotel room in London for about a month, locked myself away, formed a little diary and experimented with voices – it was important to try to find a somewhat iconic voice and laugh. I ended up landing more in the realm of a psychopath – someone with very little to no conscience towards his acts"; after reiterating his view of the character as "just an absolute sociopath, a cold-blooded, mass-murdering clown", he added that Nolan had given him "free rein" to create the role, which he found "fun, because there are no real boundaries to what the Joker would say or do. Nothing intimidates him, and everything is a big joke."[3]

Wednesday, July 2, 2014

Amazing Poem!!

Neend bahout aati hai padte padte,
Maa tu hoti to keh dete ki ek cup chai bana de…!!
Thak gaye hai bahar ki roti kha kha k,
Maa tu hoti to keh dete parathe bana de…!!
Bandh gaye hai 1 kamre ki char diwari me,
Maa tu hoti to kehti zara bahar ghum le…!!
Wohi koshish roj khush rhane ki,
Maa tu hoti to muskura lete…!!
Pareshaniya to bhot hai yaha,
Maa tuje btate to tuje bhi rula dete…!!
Bahut door nikal aaye hai ghar se,
Maa tere sapno ki parwah naa hoti to kabke ghar chale
aate…!!

Saturday, January 11, 2014

Conspiracy theory for Courage the cowardly dog

Courage the Cowardly Dog

If you've seen courage The Cowardly Dog, you are probably aware that it is one of the all-time creepiest kids shows that existed. When I was young, I wouldn't watch it, and I don't think I would be able to watch it today without getting freaked out. But for some reason I always found myself sucked into the episodes.
Well, here's one of many theories, but to me it's the most convincing:

Courage is a normal dog, and he sees life through dog eyes. In this theory it is assumed that courage actually lives in a small town, instead of the middle of nowhere. But, having elderly caretakers, they are too unfit or lazy to take him outside. This means that everything outside the house is nothing to him since he's never seen it.
When there is a visitor to Courage's home, it appears very strange to Courage and he freaks out. He wants to protect his owners, and in many episodes he finds himself in a panic trying to do that. Which makes sense, because he's a dog and dogs want to protect.
But since hes not used to the normal outdoors, the visitors appear as monsters and are distorted to be more evil.
Source: http://hubpages.com/hub/Cartoon-Conspiracy-Theories