All posts by Morshed Alam
Permissions 0755 for ‘certificate.pem’ are too open
You may experience bad permission error and ignoring operation while running a command with AWS. It’s because a AWS are concern about your security and make sure the certificate are only accessible by you, not even to read them or discover their names. That’s basic sensible security and it means no permissions whatsoever for group…
Issues with thinking sphinx
I recently faced some issues with thinking sphinx which sharing here so that it helps others. Has many association not working: I had a model named User which has many tracks and the very basic index definition is as follows: ThinkingSphinx::Index.define :track, :with => :active_record do indexes title indexes [artist.first_name, artist.last_name], :as => :artist_name, :sortable…
Securing secret token by generating new token dynamically
Many of us already know the reason to omit pushing secret token into version repository to secure the application. Attacker can take the secret token and re-generate valid cookies for your applications or check out what other users have inside their account. The solution is to: Generate manual key Not push the token into version…
Using multiple AWS Accounts from command line
A common mistake like launching and creating an app to different account can be happen when anyone managing multiple AWS account at a time. You can easily manage that by configuring command line interface to interact with AWS such as your security credentials and the default region, profile name. To overcome the difficulty, Create a…
Dirty checking to warn for unsaved changes using jQuery
Copy following code snippet into the application. dirtyCount() method return the number of fields have unsaved changes. var dirtyChecking = function () { $(‘input, select, textarea’).each(function () { var ele = $(this); ele.attr(‘data-old’, ele.val()); // Look for changes in the value ele.on(“change keyup paste click”, function (event) { if (ele.attr(‘data-old’) != ele.val()) { ele.addClass(‘unsaved’); }…
Extract Urls from a remote webpage using PHP
Scraping data from website is extremely popular now a days. I have written a simple website parser class to grab all the urls from a website. Shared the class below for all to see and fun. We will use the parser class below to extract all image sources and hyper links from a website. Uses:Create…
ActionView::Template::Error Couldn’t find file ‘jquery-ui’ with Rails 3.2
Today, I have start working after 6 months with one of my existing Ruby on Rails application and found the mentioned error. And then found, jquery-rails removed the jQuery UI and recommended to use jquery-ui-rails or downgrade the gem version. To use latest version:Add jQuery UI in to the application.js: //= require jquery.ui.all Add jQuery…
SMTP, IMAP and POP server settings
GMAIL POP SMTP IMAP Host pop.gmail.com smtp.gmail.com imap.gmail.com Port 995 25 993 SSL Required Yes Yes Yes YAHOO POP SMTP IMAP Host pop.mail.yahoo.com smtp.mail.yahoo.com NA Port 110 25 NA SSL Required Yes Yes NA YAHOO PLUS POP SMTP IMAP Host plus.pop.mail.yahoo.com plus.smtp.mail.yahoo.com NA Port 995 465 NA SSL Required Yes Yes NA Windows Live POP…
Uninitialized constant ActiveSupport::Dependencies::Mutex (NameError)
This error may occur to run older Rails application for conflicting with rubygems version. After a long googling I’ve come out in to following three solutions: Using Bundler.:Click here if you are interested to see the solution. Changing rubygems version: Downgrade the rubygems to an earlier version using gem update –system {version} Add “require ‘thread’”…
Render HTML file in Rails using Nokogiri
You may need to render static HTML template file from a controller action without modifying anything in to file. And, may need to replace some content during render. A template may contain relative path for css, image etc. which may raise an exception as rails may not route that automatically. At that case you have…