April 14, 2013 Vignesh Sathiyanantham

Lots of web servers are running in LAMP stack, as ubuntu is easy to install and configure and many advantages people prefer ubuntu server,  Ubuntu server is completely command based , you need to do all the operation using the ubuntu Terminal… For the Ubuntu Desktop users who are not very good in ubuntu commands Here is the solution to use server like desktop in amazon EC2 instance. Create a new ubuntu server instance in amazon EC2 Make sure the AWS security group has port 22 open for your Instance IP address you are using. ( for SSH access )…

April 14, 2013 Vignesh Sathiyanantham

Highlight your php code in your website or in your blog post Instead of using external tools or third party code to highlight the syntax of php code in your website you can use the inbuilt function of php highlight_string or highlight_file Highlight_string is the function to highlight the php syntax of the block of code Here is the example for the highlight_string <?php $code = ‘ <?php //array with files to allow $allowed = array(“index.php”, “menu.php”, “about.php”); // get the filename $file = $_GET[file]; if(file_Exists($file)){ if(in_array($file, $allowed)){ // check if it is part of the allowed list highlight_file($file); //highlight…

April 7, 2013 Vignesh Sathiyanantham

Session often breaks in codeigniter ??? Here is the fix ! I developed e-commerce website using php codeigniter and it is using database to store session values. But the session is lost if it has more data in it I have spent some days checking about it and changed the third party session library , it has lots of limitations again i switched back to codeigniter default session library and trying to fix the issue finally i found out the issue in it. It was failing to unserialize the session data stored in the user_data field in ci_session table So…

April 7, 2013 Vignesh Sathiyanantham

Best practises in checking codeigniter sessions There are many practices in checking the session conditions for whether the user is logged in or not Usually we check in the codeigniter controllers function my_function() { $user = $this->session->userdata(‘user_id’); if (!isset($user)) { $logged_in = false; } else { $logged_in = true; } } This 4-8 lines of code you need to check in every controller , So you can create a codeigniter library and call the library function in every controller , It is easy to code and also in modifying the code  Create a my_library.php file in application/libraries Copy the following…

March 25, 2013 Vignesh Sathiyanantham

Javascript is often used on the browser client side to perform simple tasks that would otherwise require a full postback to the server. Many of those simple tasks involve processing text or characters entered into a form element on a web page, and it is often necessary to know the javascript keycode associated with a character. Here is a reference. Key Code Key Code Key Code backspace 8 e 69 numpad 8 104 tab 9 f 70 numpad 9 105 enter 13 g 71 multiply 106 shift 16 h 72 add 107 ctrl 17 i 73 subtract 109 alt 18…

March 23, 2013 Vignesh Sathiyanantham

There are two ways to install Zabbix. You can compile and install Zabbix from source, or you can install Zabbix packages, if your distribution supports it. Installing the packages is faster and makes things easier to maintain, but the installed version might be older than what’s available on the Zabbix website. Compiling and installing from source is a longer process, but it works on every distribution If you’re running Ubuntu or Other Debian and would like to install the Zabbix packages, follow these instructions: First we will enter into root sudo -i ( enter your password ) Install Zabbix server…

March 21, 2013 Vignesh Sathiyanantham

Still many people using query string / get method for their URL to getting the value from the user , but these query strings are not Search engine friendly , To create a searchengine friendly url you can make use of URI segments asvignesh.in/blog_post?title=post_name Instead we can use like asvignesh.in/blog_post/post_name I explain you how to fetch the URI segments Here is a set of two php functions that I use regularly to quickly get a specific URI segment or return all segments available. These are very helpful if you have written or are writing your own custom SEF urls <?phpfunction…

March 3, 2013 Vignesh Sathiyanantham

JasperReports provides the necessary features to generate dynamic reports, including data retrieval using JDBC (Java Database Connectivity), as well as support for parameters, expressions, variables, and groups. JasperReports also includes advanced features, such as custom data sources, scriptlets, and subreports. Overview of Jasper Reports Jasperreport is open source Business intelligence reporting tool. Jasper Reports is written in 100% Java. And can be embedded in any Java application. JasperReports is an engine that takes an XML file and forms a report out of that file using the data source specified in the XML file. Various output options PDF, HTML, XLS, CSV,…

February 10, 2013 Vignesh Sathiyanantham 3Comment

I developed an application as a feature of that application i need to fetch the gmail contacts of my  users , I researched many blogs and articles in Google and finally i developed that feature…. Here in this blog i posted How to fetch the users gmail contact and store into your local database using php codeigniter , mysql , oauth , google api First, what is a Google API? The Google API stands for ‘Application Programmable Interface’. As it’s name implies, it is an interface that queries the Google database to help programmers in the development of their applications….

January 10, 2013 Vignesh Sathiyanantham

A here document (also called a here-document, a heredoc, a hereis, a here-string or a here-script) is a way of specifying a string literal in command line shells including Unix shells and in programming or scripting languages such as Perl, PHP, Python, PowerShell and Ruby. It preserves the line breaks and other whitespace (including indentation) in the text. Some languages allow variable substitution and command substitution inside the string. The most common syntax for here documents is << followed by a delimiting identifier, followed, starting on the next line, by the text to be quoted, and then closed by the…