Install apache mod rewrite on ubuntu

Apache Mod Rewrite mod_rewrite is an apache module which enables rewriting of urls requested by client before the pages are fetched by apache. For example www.site.com/products.php?code=459 can be written as www.site.com/products/459 or www.site.com/products/459.html . The second url is re-written into the first one by mod_rewrite using rewrite rules specified in the .htaccess file. To enable the mod_rewrite : sudo a2enmod rewrite To disable ...

Change column / field order in OpenOffice Base ( HSQL )

Altering the sequence of fields of a table was a feature I was looking for in OpenOffice Base. It is not directly possible to drag the columns or fields and alter their sequence.A SQL workaround can do the same thing.If the sequence of fields is :name , email , address , phoneand phone is to be brought before address like ...

Setup apache for multiple users on ubuntu with userdir module

By default Apache puts all the web files into a single directory (commonly /var/www). If there are multiple users on a system then every user can have his own web directory to store the web files. userdir is the Apache module which enables each user to have a separate directory to store web files. This directory shall be public_html in the ...

Get real IP address of user in php

Client IP address Php applications are mostly web based and often need to get the ip address of the user who is connecting to the application. Ip address is required for various logging purpose, geolocation service etc. The most common way to get the ip address of a remote user is by using the superglobal variable $_SERVER. Here is a quick example //Get ...

Output buffering PHP Apache mod gzip mod deflate

Till recently most of my php scripts were working fine on the servers with instantaneous outputs as and when a echo statement came. One issue that popped a lot on localhost was that of chunky outputs; that is the outputs of big scripts came out in chunks rather than smoothly with every echo or print statement. After some research flush() ...

Remote Login with Curl PHP

Remote login with CURL The curl extension of php can be used to open remote webpages by both GET and POST methods. There are many situations when you need a php script to login into a website and open a certain page. For example when you are writing a bot or web scraper. To login we need 2 important piece of information ...

wxPython display stderr stdout window

wxpython While executing a wxpython script if a error occurs then a white window popups with some message, and it disappears fast enough before it can be read. So here is a fix to pause it and read it what and where the error in the code is : app = wx.App(redirect=False) MyFrame(None).Show() app.MainLoop() The wx.App takes this parameter called redirect which can be True ...

Create excel files in php – simple and easy way

Database applications written in php often need to export data for reporting purpose. A popular export format is excel. Excel is a spreadsheet that lays out data in a grid format. Excel itself is a microsoft proprietory format. There are many libraries available for php like Spreadsheet_Excel_Writer pear package etc that can do the job. However these libraries need to ...

Execute an sql script in jdbc

The SQL Script should have comments starting with - or -- only on new lines and each command should end with a ; . Reading a sql file and putting all of it in a string variable and feeding to the execute command would result in an exception. All instructions must be executed individually. A proper sql script should have all ...

Read write and save configurations to a file in java

Configuration files are used in applications to store settings, user preferences and other configuration parameters of an application so that. When configurations are changed from within the application these need to be saved so that next time the application starts with these new settings. In Java reading and writing to a configuration is pretty simple and straight forward. A configuration file can ...



Connect with us