Jul 24, 2012

Add GUI xampp control panel on ubuntu


If you have install and configure xampp on ubuntu or any other linux distribution you might have use terminal for various operation like start and stopping lampp. However Xampp on windows have some graphical interface for this operation. You can simply add graphical user interface for xampp in ubuntu with few codes and tricks. Adding graphical interface gives you flexibility as well as provide simplicity to use the program if you find yourself uneasy messing with the command. therefore here is the quick tutorial to add graphical user interface for xampp on ubuntu.



1. Open the terminal and paste tde following code



sudo gedit ~/.local/share/applications/xampp-control-panel.desktop



2. The text editor will open simply paste tde following code to the text editor and save it



[Desktop Entry] 


Comment=Start and Stop XAMPP 


Name=XAMPP Control Panel 


Exec=gksudo pytdon /opt/lampp/share/xampp-control-panel/xampp-control-panel.py 


Icon[en_CA]=/usr/share/icons/Humanity/devices/24/network-wired.svg 


Encoding=UTF-8 


Terminal=false 


Name[en_CA]=XAMPP Control Panel 


Comment[en_CA]=Start and Stop XAMPP 


Type=Application 


Icon=/usr/share/icons/Humanity/devices/24/network-wired.svg 


 

Jul 18, 2012

Always Show Hidden Files / Folders in windows 7


To enable this, go to Start –> Documents or open any folder. Then select ‘Organize –> Folder and search options’



Show Hidden Files


 


Finally, select ‘View’ tab and in ‘Advanced settings’ choose ‘Show hidden files, folders, and drives’ and press "ok".


 

Jul 16, 2012

Turn Off Error Reporting in Ubuntu 12.04


Once in a while if something goes wrong in Ubuntu, you usually get the error screen that reads ‘Sorry, Ubuntu 12.04 has experienced an internal error’.



This feature is added to Ubuntu by default and is there to help Ubuntu gather information about issues and create a fix for them. It’s recommended that you don’t disable it as it helps Ubuntu develop better software.


 


Even though you’re advised not to turn it off, that option is there when you need it.


 


error-reporting-ubuntu


 


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


 


sudo gedit /etc/default/apport


 

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!");


       }



    }