Archive for September, 2012

Add Open As Administrator to the Context Menu in Ubuntu

Do you want to enable the command ‘Open as Administrator’ to the context menu in Ubuntu 12.04. When this feature is enabled, you should be able to right-click any file or folder in nautilus and open it as an administrator or root. This will come in handy especially for new users who want to edit or modify files or folders owned by the root user or administrator.

To get started, press Ctrl + Alt + T on your keyboard to open Terminal. When it opens, run the commands below to download it.
 
wget http://www.liberiangeek.net/blog/tools/libnautilus-gksu.so
 
Next, copy the file to the folder using the following command.
 
sudo cp libnautilus-gksu.so /usr/lib/nautilus/extensions-3.0/
 
Restart your computer or use "nautilus -q" to view the changes.
 

How to find id of last inserted row in MYSQL using PHP

 

To find id (auto increment) value of last inserted row, put the following code into the PHP page.

<?php

$link = mysql_connect('localhost', 'mysql_usenamer', 'mysql_password');
if (!$link) {
    die('Could not connect:to the database ' . mysql_error());
}
mysql_select_db('mydb');
 
mysql_query("INSERT INTO mytable (user) values ('jijo')");
printf("Last inserted record has id %d\n", mysql_insert_id());
?>


Read more »

Download and Install Android SDK in Ubuntu 12.04

Android SDK is a development environment for the Android mobile operating system which allows you to write applications for Android devices or gain elevated privileges on android devices with the help of third party software.

This brief tutorial is going to show you how to download and install it in Ubuntu 12.04. To install it, you first need to install Java JDK package or use the openJDK Java alternative that comes with Ubuntu.
 
Step 1 – Install Oracle Java Version
 
First we need to install openJDK version of Java. To install Oracle Java version.
To get started, press Ctrl + Alt + T on your keyboard to open the terminal. When it opens, run the commands below to install OpenJDK.
 
sudo apt-get install openjdk-6-jre openjdk-6-jdk icedtea6-plugin


Step 2 – Download SDK Package
 
Next, download AndroidSDK package by running the commands below. Now the current version was r20. Or click this link to download the .tgz archive file.
 
wget http://dl.google.com/android/android-sdk_r20-linux.tgz


Read more »

Last updated by at .