Jul 16, 2012

Enable GNOME Login Sound in Ubuntu


It seems like one distinct feature missing in Ubuntu 12.04 is the Login Sound. In prior versions of Ubuntu, when you login you will always hear Gnome Login Sound welcoming you. However, in Ubuntu 12.04, it is removed. If you want to bring it back, then do the following steps.



Method 1


 


To get started, press Ctrl + Alt + T on your keyboard to open Terminal. When it opens, run the commands below to create a startup program for it.


 


sudo gedit /etc/xdg/autostart/loginsound.desktop


 


Finally, copy and paste the lines below into the file and save it.


 


[Desktop Entry]


Name=GNOME Login Sound


Type=Application


Exec=/usr/bin/canberra-gtk-play --id="desktop-login" --description="GNOME Login sound"


 


Restart your computer and listen for the Login sound.



Jul 12, 2012

Install xampp in ubuntu


Xampp is an application that helps to run local server in your computer.It is a tedious method to install Apache web server add MYSQL, php, perl and other application. There xampp has all the stuff in one package. Therefore xampp make it easy to install all these package from a single application. Xampp is available for all the format including windows , mac and solaris. In compare to windows and mac the installation of xampp is a bit complicated in linux. If you are searching for lampp. you are in right place because xampp is previously called lampp. To begin the installation download xampp from official website. or download via terminal.



wget http://www.apachefriends.org/download.php?xampp-linux-1.7.3a.tar.gz



After downloading place the file in desktop. Don't extract the file. Put as you have downloaded it.



Step1: login into root directory



To install the xampp you have to log in into the root directory to log into root directory run the following command into terminal one by one



cd Desktop


 


(Make sure the initial letter of Desktop is capital)


 


sudo -s


 


Xampp Ubuntu


Unlock the Administrator Account in windows 7


By default, the administrator account is disabled in windows systems and cannot be used to login. 


 


To unlock the administrator in Windows 7, go to Start –> then right-click on ‘Computer’ and select ‘Manage


 


Unlock the Administrator Account 1




 

Jul 6, 2012

String Formatting : length, count and occurrences in PHP


 


Lower to Upper



<?php


$str = "Mary Had A Little Lamb and She LOVED It So";


$str = strtoupper($str);


echo $str; // Print ==> MARY HAD A LITTLE LAMB AND SHE LOVED IT SO


?>


 


Upper to Lower


 


<?php


$str = "Mary Had A Little Lamb and She LOVED It So";


$str = strtolower($str);


echo $str; // Print ==> mary had a little lamb and she loved it so


?>


 


Capitalise First Character


 


<?php


$foo = 'hello world!';


$foo = ucfirst($foo);


echo $foo; // Print ==> Hello world!


?>


 


Jul 3, 2012

Compile and Run a Hello-world Java Program


Step 1


 


Open "Folder" and create a new directory called "myproject" under your home directory to keep all your works.




Step 2


 


Open "Text Editor" (gedit). Enter the following source code and save as "Hello.java" under the "~/myproject" directory created eariler.


 


    public class Hello {   // To save as "Hello.java" under "~/myproject"


       public static void main(String[] args) {


          System.out.println("Hello, world from Ubuntu!");


       }



    }