Category Archives: Security
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…
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…
Creating authentication from scratch in Rails 3.1
There are some popular authentication libraries like devise, Authlogic, Restful Authentication, Clearance in Ruby on Rails. But, you can implement of your own as well. Here, I’m explaining few simple steps to create your own authentication system in Rails 3.1. First, Create Run following commands from command prompt and then copy the codes in the…
HTTP basic authentication using email address
In my previous article, I have written about HTTP basic authentication in rails using a plain user access YML. Last few days ago, I have modified the logic to log-in using email address and password. So that anyone don’t need to remember another new password. Hope it might help you… Written a news private method…
HTTP basic authentication in rails to protect staging server
Sometimes, you may need to protect your staging server from outside world. It can be done easily by using http basic authentication in rails3. I did following things to use HTTP basic authentication to protect my staging server: YML file with username and password pair: devuser: devpasstestuser: testuserpass Loaded YML data from application initializer: HTTP_AUTH_USERS…
How to deactivate facebook account
Now a days Facebook became part of our busy life and couldn’t think without it. But, if you need to deactivate your account then can do that by following steps below: Once, you deactivate your account, your profile and information will be instantly inactivated. But, information will not be lost however, and will be available…
Disable a user account in Linux
There are some different approaches to do that. The easy way to disable a user account is to alter stored password which is stored to /etc/shadow. In that case password will be lost unless you save save the password in different file. You can alter the password by using following command: passwd {username} {new password}…
Disable text selection on website by using javascript
Sometimes you may need to disable text selection of an HTML page. It is very easy way how you can do it. Below is the source codes: <script type=”text/javascript” language=”JavaScript”>function disableText(e){ return false;}function reEnable(){ return true;}//For browser IE4+document.onselectstart = new Function (“return false”);//For browser NS6if (window.sidebar){ document.onmousedown = disableText; document.onclick = reEnable;}</script> Just copy the…
How to prevent print a block of an HTML page?
Sometimes you may need to prevent printing a block of an html page. You can do it easily. Create a CSS class by following way and add it to your header section: <style type=”text/css” media = “print”>.noprint{display: none;}</style> Note that the media of the css script will be print. Now simply add the css class…