Friday, July 20, 2012

Useful Linux Commands..

  • SVN related commands
    • To checkout the code
      • svn co SVN_URL
    • To checkout the code for a revision
      • svn co -r REVISION_NUMBER SVN_URL
    • To update the code to latest revision
      • svn update
    • To update the code for a particular revision
      • svn update -r REVISION_NUMBER
  • SendMail related commands
    • To check is SendMail is running successfully
      • ps -aux | grep sendmail
    • To install sendmail in Ubuntu
      • apt-get install sendmail
    • To start sendmail service
      • service sendmail start
  • Memcached related commands
    • To start memcached
      • memcached -m MEMORY_SIZE -p PORT_NUMBER -u nobody -l 0.0.0.0
    • To check is memcached is running successfully
      • ps -eaf | grep memcached
    • To login into memcached host
      • telnet  MEMCACHED_HOST  PORT_NUMBER
    • To flush memcached data

      • echo 'flush_all' | nc  MEMCACHED_HOST PORT_NUMBER

Labels Used:


SVN_URL
Any URL of valid SVN


REVISION_NUMBER
Any valid revision number. Ex: 121


MEMORY_SIZE
Any valid memory number in MegaBytes(MB). Ex: 2000


PORT_NUMBER
Any valid port number. Ex: 11211


MEMCACHED_HOST
Any valid memcached host. Ex: 127.0.0.1 OR localhost


Monday, March 05, 2012

Useful links for integrating Twitter with PHP.

Useful links for XML Parsing using jQuery/PHP.

How to redirect to another host using .htaccess?

RewriteCond %{HTTP_HOST} ^(.*)fromhost\.com [NC]
RewriteCond %{REQUEST_URI} ^/$ [NC]
RewriteRule ^(.*)$ http://tohost.com/page [R=301,L]

List of useful Drupal modules.


Node export This module allows users to export nodes and then import it into another Drupal installation, or on the same site.


List of links for Drupal Multisite setup

Monday, January 30, 2012

Command to flush Memcache data.

For Unix:

Here is the article which explains various ways to clear the memcache data from linux command prompt.

For Windows:

telnet localhost 11211
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
flush_all
OK
quit
Connection to localhost closed by foreign host.

Saturday, January 28, 2012

Saturday, January 14, 2012

How to host node as a service, just like IIS in Windows?

Installing node as a service will help us as below.

  • Run in the background
  • Restart automatically if it crashes

Steps:

  1. Install NSSM (non-sucking service manager). This tool lets you host a normal.exe as a Windows service.
  2. Go to command prompt.
  3. Execute nssm.exe install node-service c:\nodejs-path\node.exe c:\code\sample\server.js
  4. Execute net start  node-service
For more information see here.

Friday, January 13, 2012

How to install NodeJS plugin into Sublime Text editor in Windows?

  • Invoke the command prompt as administrator.
  • Make sure git is already installed.
  • Execute the below command.
git clone git://github.com/tanepiper/SublimeText-Nodejs.git "%APPDATA%\Sublime Text 2\Packages\Nodejs"
  • After successfully installed, restart Sublime text editor.
  • To invoke list of functions use Ctrl + Space.
For more information see here.