Oct 3, 2012

Install an RPM Package on Ubuntu


 



Installing software on Ubuntu usually entails using Synaptic or by using an apt-get command from the terminal. Unfortunately, there are still a number of packages out there that are only distributed in RPM format.


 


There’s a utility called Alien that converts packages from one format to the other. This doesn’t always mean that an rpm will work on your system, though. You will need to install some prerequisite software packages in order to install alien, however. These packages include gcc and make.


 


Run this command to install alien and other necessary packages:


 


sudo apt-get install alien dpkg-dev debhelper build-essential


 


To convert a package from rpm to debian format, use this command syntax. The sudo may not be necessary, but we’ll include it just in case.


 


sudo alien packagename.rpm


 


To install the package, you’ll use the dpkg utility, which is the internal package management tool behind debian and Ubuntu.


 


sudo dpkg -i packagename.deb


 

Sep 25, 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.


 


Sep 24, 2012

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());


?>




Sep 22, 2012

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




Sep 19, 2012

Disable the Global Menu in Ubuntu


Since Unity Desktop was introduced in Ubuntu, all applications have used one global menu by default. Instead of each application having its own menu bar, it’s now setup that they all share the global menu bar. Maybe this is cool for some, but for others, it’s a real issue.



To get started, press Ctrl + Alt + T on your keyboard to open terminal. When it opens, run the commands below to disable it.


 


sudo apt-get autoremove appmenu-gtk appmenu-gtk3 appmenu-qt


 


Restart your computer to apply the changes.


 


Global menu