Month: June 2014

Firefox 30 Ubuntu Crashing after wakeup

Hola,

I’ve been facing firefox crash problem since few days. I don’t what exactly caused it. I’ve found a solution on internet (Seriously, I don’t know how it fixes the issue but it is working like a charm)
I usually like to explore such things but due to lack of time I decided to take it up at later point of time. Here’s the fix-

Create a text file /etc/pm/config.d/unload_module with below content-

SUSPEND_MODULES="xhci-hcd"

My Specs:
Ubuntu 12.04LTS 64-bit System
Firefox 30

Original Post:
http://gqshen.com/archives/442

Advertisements

Android Application – Use Pre-Loaded Database

Hi Folks,

To use a pre-loaded database, place your database in assets directory (optional; you can use external storage too) of your app. Copy to /data/data/<your package name>/databases/ directory.

Caution: While copying ensure directory structure is present as “new FileOutputStream(filename)” will throw “FileNotFound Exception“. You can use “myfile.mkdirs()” to create directory stucture.

Here is an example code –

//Ifdatabase did not exist, try copying existing databasefrom assets folder.
try {
    InputStream myinput = mContext.getAssets().open(DATABASE_NAME);
    String outfilename = DATABASE_PATH + DATABASE_NAME;
    OutputStream myoutput = new FileOutputStream(outfilename);
    byte[] buffer = new byte[1024];
    int length;
    while((length = myinput.read(buffer))>0){
         myoutput.write(buffer,0, length);
    }
    myoutput.flush();
    myoutput.close();
    myinput.close();
} 
catch (IOException e){
    e.printStackTrace();
}

Note: I’ve found above solution after searching on internet for sometime. I’m not sure if it is the best. Please do let me know if you know something better.

Install and Configuring Apache, PHP, Virtual Host on ubuntu

Hi Every One, I’m writing this post to help newbie understand how to install and configure Apache, PHP and MYSQL. I’ve configured them few times but I still search on internet often. So I decided to write a post which helps everyone in getting started (including me :))

 


To Install Apache  :    sudo apt-get install apache2

To Install PHP         :    sudo apt-get install PHP

To Install MYSQL  :    sudo apt-get install mysql-server


 

After finishing up above mentioned installations, go to /etc/apache2/ directory, Go through apache2.conf file, if you want to change default web directory, firstly you have to give permissions to access that folder.


<Directory /home/XYZ/www/>

Options Indexes FollowSymLinks

AllowOverride None

Require all granted

</Directory>


 

PHP gets configured automatically and apache gets restarted during installation. To configure new Virtual Host, copy “000-default.conf” file content into a new file DOMAIN-NAME.conf

 


  • Change “<VirtualHost *:80>” to “<VirtualHost DOMAIN-NAME*:80>”.
  • Change DocumentRoot value to your new directory, /home/ubuntu/www/DOMAIN-NAME

Note: Here, DOMAIN-NAME is your domain name.


 

How to test if PHP is working? Go to /home/ubuntu/www/DOMAIN-NAME directory and create new file with name “index.php”


<?php echo “Hello World !!”; ?>


 

Copy and Paste above small piece of code into “index.php” file. Now open a web browser and go to your domain. You should be seeing “Hello World !!” message. Hurray!!  Everything is set.