June 18, 2013 asvignesh

There are lots of way to check whether the var is array or not but the easiest way is using instanceof Array Example 1 : var myName=[“Vignesh”,”A”,”Sathiyanantham”]; if (myName instanceof Array) { alert(myName is Array!’); } else { alert(‘myName Not an array’); } This will return you myName is Array! Example 2: var myName=”Vignesh A Sathiyanantham”; if (myName instanceof Array) { alert(myName is Array!’); } else { alert(‘myName Not an array’); } This will return you myName Not an Array! You can write a function to make it reusable function ismyvararray(myVar) {  return (myVar instanceof Array); } This will return…

May 19, 2013 asvignesh 10Comment

Openfire is a real time collaboration server licensed under the Open Source Apache License. It uses the only widely adopted open protocol for instant messaging, XMPP (also called Jabber). Setup Openfire in your windows ( chat server ) First setup web server and Database server Install WAMP or XAMPP ( Apache , MySQL , Php ) A web-based, “wizard” driven setup and configuration tool is built into Openfire. Simply launch Openfire and use a web browser to connect to the admin console. The default port for the web-based admin console is 9090. If you are on the same machine as…

May 5, 2013 asvignesh 1Comment

Recently, Google added an exciting feature to Google Drive “web hosting!” It allows you to host a website build on html , css , js in google drive build a website. And did I mention that it’s free? Yep, it’s just one of the little perks that comes with a Google account. You can see the live demo of my sample web page hosted in google drive https://googledrive.com/host/0BwA2EsYXn4Xea0huYzNrLWlwbkk/index.html In this post i explain you to host a website in google drive Requirements A google account Text editor / WYSIWYG editor for editing html / css / js Step One: Prepare…

May 1, 2013 asvignesh 1Comment

Taking backup dump and importing the dump into database can be done very easily using php. In Last posts i explained how to take the backup of Mysql using php http://asvignesh.in/take-mysql-backup-using-php-passthru-function , http://asvignesh.in/take-mysql-backup-using-php Here is the function to import the sql dump into database function import_dump($folder_name = null , $file_name) { $folder_name = ‘dumps’; $path = ‘assets/backup_db/’; // Codeigniter application /assets $file_restore = $this->load->file($path . $folder_name . ‘/’ . $file_name, true); $file_array = explode(‘;’, $file_restore); foreach ($file_array as $query) { $this->db->query(“SET FOREIGN_KEY_CHECKS = 0”); $this->db->query($query); $this->db->query(“SET FOREIGN_KEY_CHECKS = 1”); } }

May 1, 2013 asvignesh 2Comment

In the last post i explained about taking the MySQL backup using php code , This post explains to take the backup of your MySQL database using the passthru function ( passthru documentation ) The passthru() function is similar to the exec() function in that it executes a command. This function should be used in place of exec() or system() when the output from the Unix command is binary data which needs to be passed directly back to the browser <?php $datestamp = date(“Y-m-d”); // Present date to append in the filename for the identification /* CONFIGURE THE FOLLOWING SEVEN…

May 1, 2013 asvignesh

One of the most important task of developer or administrators is to take backup periodically, Most of the hosting provider and cloud providers charge more for taking backup periodically , SaaS application developers or CMS developers can let the user to take the backup of the data using the interface. Here is the easy way to take the backup dump of the MySQL take_dump(‘DB_HOST’,’UNAME’,’PASS’,’DB’); /* backup the db OR just a table */ function take_dump($host,$user,$pass,$name,$tables = ‘*’) { $link = mysql_connect($host,$user,$pass); mysql_select_db($name,$link); //get all of the tables if($tables == ‘*’) { $tables = array(); $result = mysql_query(‘SHOW TABLES’); while($row = mysql_fetch_row($result))…

April 28, 2013 asvignesh 1Comment

Here is the simple way to host your media files ( images , videos , audios) in Amazon S3 ( Simple Storage Service Amazon’s Simple Storage Service provides a simple web server to access any file that is stored in their storage cloud. This means, you can access files stored at S3, directly via a web browser, if you have set the permissions as “read” for all users. You can teach your clients to use S3 to host media files, which do not need scripting on the web server side and not require a lot of bandwidth to serve, e.g….

April 28, 2013 asvignesh

Some time back there was only one way to run MySQL on the cloud. Setup cloud , install MySQL and maintain it yourself the hard thing is managing backups, handling replication failures, maintaining server. Then AWS RDS came along and can be thought of as a PaaS for MySQL – it hides all the complexities behind the scenes and you only concern yourself with the database and not the database software.  WHY RDS: Simple UI to automate backup , setting backup time and retention copies Easy to restore backup snapshots AWS will apply patches that are security and durability related….

April 28, 2013 asvignesh

Here is the some tips for the web admins and the web developers to speed up the image heavy website The Major drawback in the Image heavy websites is it takes more time to load , user lose their patience and just navigate away from your website Don’t use Flash Animation is unnecessary, but if you feel you need it, try: Spritely, a free jQuery plugin that lets you create animation with HTML and JavaScript or create your own animated GIFs using Photoshop or GIMP ( Image editor ) Use storage service for images Most browsers will only load two or…

April 28, 2013 asvignesh 2Comment

Removing index.php in Codeigniter application url in godaddy shared hosting server Create the .htaccess file under root of application directory RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond $1 !^(index.php|robots.txt) RewriteRule ^(.*)$ index.php?/$1 [L] If you are getting “no input file specified” ( codeigniter / wordpress ) Login to godaddy account Goto hosting Under settings frame select file extension management Here you will find this “.php PHP 5.2.x FastCGI” click on edit button change it to “.php PHP 5.2.x” no need to change for .php5, .php4 Thats it