Pages

Tuesday, January 10, 2012

Multiple login in google talk

Most of us have multiple google talk IDs and used third party software to login at a time. But, anyone can do multiple login to gtalk by using a simple trick below:

  • Right click gtalk icon and select properties
  • Add /nomutex at the end of target property like following way
    "C:\Users\Morshed\AppData\Roaming\Google\Google Talk\googletalk.exe" /startmenu /nomutex
  • Click to Apply and Ok

Done! Now click on gtalk icon and open as many as gtalk windows you want. Cheers!!

Saturday, December 31, 2011

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
def login_by_email(user_name, password)
    is_logged_in = false
    if (user_name.match(/.+\b@yourdomain.com$\b/i))
      require 'net/imap'
      require 'openssl'
      client = Net::IMAP.new(host, port, true, nil, false)
      begin
        client.login(user_name, password)
        client.logout
        is_logged_in = true
      rescue Exception => error
        logger.error "Unable to log-in :: #{error.message}"
      end
      client.disconnect
    end
    return is_logged_in
  end
On line#3 I have checked the domain name to provide access for a specific domain. After that modified the authentication method following way:
def authenticate_for_staging_server
    authenticate_or_request_with_http_basic do |user_name, password|
      login_by_email(user_name, password) == true
    end
  end

Sunday, December 4, 2011

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: devpass
testuser: testuserpass

Loaded YML data from application initializer:
HTTP_AUTH_USERS = YAML.load_file("#{Rails.root.to_s}/config/staging_server_users.yml")

Callback and authentication in the application controller:
before_filter :authenticate_for_staging_server, :if => lambda { Rails.env.development? }

private
def authenticate_for_staging_server
  authenticate_or_request_with_http_basic do |user_name, password|
    password == HTTP_AUTH_USERS[user_name]
  end
end

Hope it will help a lot who wants to protect their staging server.

Sunday, November 20, 2011

XForms in PHP

The next generation of HTML form is XForms which is more flexible than the HTML forms and saves a lot of time and effort. It enables the separation of data and logic from presentation as well.

In the XForms, XML used to define forms data, stores and transports data in the XML documents and has two different parts:
  • XForm model - defines the form, what it should do, what data it contains
  • XForm user interface - defines the input fields and how it will displayed

You can see a basic hello world example here - XForms/HelloWorld. You must have to install XForms extension for your Firefox version.

Some more resources are given below:

Saturday, November 19, 2011

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 to recover whenever you want within 14 days.

Steps are given below to deactivate the Facebook account:
  • Go to Account menu on top right corner of the page and select Account Settings.
  • Click to Security from right side menu
  • Click to Deactivate your account link from bottom
  • And, then select reason and click to Confirm button
  • System will open a pop-up box for your password and captcha text. Enter those and click on the confirm button.

After confirmation system will redirect to Facebook's home page, where you will see a message confirming that your account has been deactivated.

To cancel deactivation, log-in again and choose cancel deactivation within 14 days.