Monday, August 4, 2014

Install New Version of Skype.

Hi All,

The older versions of skype like 4.2 is not working, so to get the latest version 4.3 type the below command.

# skype --secondary

This command checked in Ubuntu and working fine.

Monday, July 7, 2014

Combine PDF Documents to Single PDF

Here is the command to combine multiple PDF Documents to Single PDF.

$ gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=final.pdf file1.pdf file2.pdf file3.pdf file4.pdf

Tuesday, May 7, 2013

Installing Node.js in Ubuntu

Here are the steps to install Node.js in Ubuntu.

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install build-essential openssl libssl-dev pkg-config

Download the Nodejs Souce from the below link
http://nodejs.org/download/

Extract and move into the folder

$ ./configure
$ make
$ make install

After completing all the above steps add the below code in any of these files ~/.profile or ~/.bash_profile or ~/.bashrc or ~/.zshenv

export PATH=$PATH:/opt/node/bin

For Detailed Installations please refer to the below link.
https://github.com/joyent/node/wiki/Installation




Command to find the processor in ubuntu

$ uname -m

The Below is the Response.

x86_64 ==> 64-bit kernel
i686   ==> 32-bit kernel

Tuesday, February 19, 2013

Update Skype in Ubuntu



To Remove the Existing Skype in your machine.
             sudo apt-get remove skype skype-bin

 Install Skype on Ubuntu 32bit
  • wget -O skype http://download.skype.com/linux/skype-ubuntu_4.0.0.8-1_i386.deb
  • sudo apt-get install libxss1
  • sudo dpkg -i skype
  • sudo apt-get -f install && sudo rm skype

Install Skype on Ubuntu 64bit

  • wget -O skype http://download.skype.com/linux/skype-ubuntu_4.0.0.8-1_amd64.deb
  • sudo apt-get install libxss1 lib32stdc++6 lib32asound2 ia32-libs libc6-i386 lib32gcc1
  • sudo dpkg -i skype
  • sudo apt-get -f install && sudo rm skype
 

Friday, August 17, 2012

Linux Command to get the System Reboot Time

Hi

Here is the command to know the system Reboot Time.

# last -x|grep reboot

Tuesday, August 14, 2012

Clear MemCache in Ubuntu

Hi Here is the Process to clear the MemCache in Your System.

# telnet localhost 11211
flush_all
quit

if the memcache does not run on localhost 11211, you will have to adjust it.

Saturday, July 28, 2012

Array Unique in Jquery

Here is the code to remove the duplicates from an array in Jquery.

in below code countries is an array which contains all the elements.

var unique_countries = countries.filter(function(itm,i,countries){return i == countries.indexOf(itm);});

Array Difference in Jquery

Hi

Here is the snippet to find the difference between the two arrays in JQUERY.

var array1 = ["test1", "test2","test3", "test4"];
var array2 = ["test1", "test2","test3","test4", "test5", "test6"];

var _array = new Array();

_array = jQuery.grep(array2, function (item) {
     return jQuery.inArray(item, array1) < 0;
});

Friday, March 30, 2012

Cisco VPN in Ubuntu

Hi

Here is the command to install Cisco VPN type in Ubuntu.

# sudo apt-get install network-manager-vpnc

For Detailed Procedure please see the below link:

http://www.ubuntugeek.com/how-to-install-cisco-vpn-client-on-ubuntu-11-10.html

Thursday, March 1, 2012

Create VirtualHost in Ubuntu

Hi All

Here is the Procedure to Create the VirtualHost in Ubuntu.

1. Create the folders that will host your new site. By default, Apache in Ubuntu serves from /var/www. So create this:

mkdir /var/www/site1

2.Copy the current default setting found in /etc/apache2/sites-available/default and name it the same as your new site.

cp /etc/apache2/sites-available/default /etc/apache2/sites-available/site1

3. Edit the new config files for each site using your preferred text editor. Add the line ServerName server1 right below the ServerAdmin line and change both DocumentRoot and Directory to point to your new site.
File:/etc/apache2/sites-available/site1

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName site1

    DocumentRoot /var/www/site1
    <Directory />
        Options FollowSymLinks
        AllowOverride All
    </Directory>
    <Directory /var/www/site1/>
        Options -Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

4. After you have edited the config file, just tell Apache to start serving the new domains

sudo a2ensite site1


5. Add the entry in your hosts file for new site.

file: /etc/hosts
127.0.0.1       site1

6. Now reload apache and you should be able to get new domain:

sudo /etc/init.d/apache2 reload

check the URL:- http://site1.


Note:-
If you have the .htacess files in your project and if you face any problems like NotFound and Internal Server Error Make sure rewrite Module available in "/etc/apache2/mods-enabled" if not please create the Symlink to the rewrite module, here is the code.

ln -s ../mods-available/rewrite.load rewrite.load


Thursday, January 12, 2012

Placing the Contents of a Block in any Location

If you want to embed the contents of a block into a node, a custom block, or a page template, you can use the following snippets.

D6 and earlier:

$block = module_invoke('module_name', 'block', 'view', 'block_delta');
print $block['content'];

D7:

$block = module_invoke('module_name', 'block_view', 'block_delta');
print render($block);

To specify which block from which module, you simply edit the two following variables in the first line:

'module_name' = The machine name of the module (i.e. the module's folder name). This is true for core modules too, so for instance 'search', 'user' and 'comment' would all work here.

'block_delta' = The machine name of the block. You can determine what this is by visiting the block administration page and editing the block.
The URL for editing a webform block, for instance, would be something like:

Drupal 6: admin/build/block/configure/webform/client-block-11
Drupal 7: admin/structure/block/manage/webform/client-block-11/configure

In this example, 'client-block-11' is the block's delta.

Custom blocks will have module name of 'block' and a number for a delta, which you can also find by editing the block.

For More Information Please Click Here

Wednesday, December 28, 2011

SQL Queries

Create A Table with Constrains

CREATE TABLE IF NOT EXISTS `publisher_media_types` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `publisher_id` int(11) NOT NULL,
  `media_type_id` int(11) NOT NULL,
  `created` datetime NOT NULL,
  `modified` datetime NOT NULL,
  `created_by` int(11) NOT NULL,
  `modified_by` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_publisher_media_types_publisher_id` (`publisher_id`),
  KEY `fk_publisher_media_type_id` (`media_type_id`),
  KEY `fk_publisher_media_types_created_by` (`created_by`),
  KEY `fk_publisher_media_types_modified_by` (`modified_by`),
  CONSTRAINT `fk_publisher_media_types_publisher_id` FOREIGN KEY (`publisher_id`)
  REFERENCES `publishers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_publisher_media_type_id` FOREIGN KEY (`media_type_id`)
  REFERENCES `media_types` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_publisher_media_types_created_by` FOREIGN KEY (`created_by`)
  REFERENCES `logins` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_publisher_media_types_modified_by` FOREIGN KEY (`modified_by`)
  REFERENCES `logins` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;


To Remove the Constrain

ALTER TABLE `publisher_media_types` DROP FOREIGN KEY `fk_publisher_media_type_id`;
ALTER TABLE `publisher_media_types` DROP INDEX `fk_publisher_media_type_id`;


To Add the Index

ALTER TABLE `publisher_media_types` ADD KEY `fk_publisher_media_type_id` (`media_type_id`);
ALTER TABLE `publisher_media_types` ADD
CONSTRAINT `fk_publisher_media_type_id` FOREIGN KEY (`media_type_id`)
REFERENCES `media_types` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

Thursday, December 15, 2011

Commands in Ubuntu

Here are the list of commands to install the additional packages in Ubuntu.

For CURL
sudo apt-get install php5-curl

For Chrome Browser
sudo apt-get install chromium-browser

Friday, November 18, 2011

PHP Plugin for Eclipse

Hi Here is the Procedure to install the PHP Plugin in Eclipse. Click Here

Wednesday, November 2, 2011

Jquery Grids

Hi
Here is the nice example for Grids with sorting to Display the content on the Website Using Jquery.
In Advanced Section we have an examples Grids inside Grids and to get the data From Database by using PHP.
Click Here

Wednesday, October 19, 2011

Tool to create the Diagrams in Linux

Hi

Here is a very Good Tool to Create the different types of Diagrams (ex: Flow charts, ER Diagrams, UML Diagrams ...) in Linux.

click here





Thursday, October 13, 2011

How to get the URL arguments in Codeigniter

Hi Here is the way to get the URL Arguments in CodeIgniter.

for ex:- url is http://localhost/app_name/controller_name/method_name/argument

In the above URL If we want to get the argument means we can get by using the following code.

$arg = $this->uri->segment(3);

Wednesday, October 5, 2011

Install Apache,PHP,MySQL in Ubuntu

Hi All Here is the nice tutorial to install the Apache,PHP and MySQL in Ubuntu. http://www.howtoforge.com/ubuntu_lamp_for_newbies

Wednesday, July 13, 2011

Chrome Extension For PHP Manual

Hi All

Here is the Chrome Extension for PHP Manual (quick Reference).

https://chrome.google.com/webstore/detail/clbhjjdhmgeibgdccjfoliooccomjcab

Note:- This will work only in Google Chrome Browsers.