Oct 31, 2012

How to fix links not working error after moving server files in WordPress


If the home page showed up just fine, but posts and inside pages all went right to File Not Found 404 pages. Then do the following steps



Step 1


 


Login as administrator and goto Dashboard.


 


Step 2


 


Go to Dashboard > Settings > Permalinks and simply clicked “Save Changes".


 


No need to change anything. Just click the save changes button then wordpress remove the errors automatically .


Reload your wordpress site and check the links. 


 

Oct 30, 2012

Hide the guest account on ubuntu 12.10 from the logon screen


 



Here’s a quick way to hide the guest account from the logon screen. 



To get started, press Ctrl + Alt + T on your keyboard to open the terminal. When it opens, run the commands below to hide the guest account from the logon screen.


 


sudo sh -c 'echo "allow-guest=false" >> /etc/lightdm/lightdm.conf'


 


Restart your computer and the guest account should be gone.


 


Hide gust account in ubuntu 12.10





Oct 29, 2012

How to use GROUP BY and ORDER BY together in SQL


Step 1



First you need to create one table named employee with 9 fields.



CREATE TABLE employee (


 


    id int unsigned not null auto_increment primary key,


    firstname varchar(20),


    lastname varchar(20),


    title varchar(30),


    age int,


    yearofservice int,


    salary int,


    perks int,


    email varchar(60)


); 


 


Step 2


 


Insert some dummy values into the employee table


 



INSERT INTO employee (firstname, lastName, title, age, yearofservice, 


salary, perks, email) values ("James", "John", 


"Programmer", 31, 3, 120000, 25000, "jj@gmail.com");


 



INSERT INTO employee (firstname, lastName, title, age, yearofservice, 


salary, perks, email) values ("Joe", "Mathew", 


"Teacher", 42, 4, 186000, 32000, "jm@gmail.com");


 



INSERT INTO employee (firstname, lastName, title, age, yearofservice, 


salary, perks, email) values ("Jobin", "Thomas", 


"Programmer", 28, 1, 236000, 36800, "jt@gmail.com");




Oct 24, 2012

Return to Gnome Classic in Ubuntu


As you may well know, Ubuntu comes with Unity Desktop by default and fallback to Unity 2D if your graphic card isn’t capable of running the 3D version of Unity. Now, if Unity is not what you’re used to, you can still switch your desktop session to the classic Gnome Desktop easily by running just one command. And to do the following step.



Press Ctrl + Alt + T on your keyboard to open Terminal. When it opens, run the commands below to enable Gnome Classic.


 


sudo apt-get install gnome-session-fallback


 


Restart and on the logon screen, click the option to change your session.


 


Return gnome 1


 

Oct 20, 2012

How to enable root login in Ubuntu 12.10


 



Here’s a quick way to login as root in Ubuntu 12.10. This is not recommended as the root user account is disabled for a reason.



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


 


sudo passwd root


 


Next, run the commands below to enable root login in Ubuntu 12.10


 


sudo sh -c 'echo "greeter-show-manual-login=true" >> /etc/lightdm/lightdm.conf'


 


Method 1 - Login using terminal


 


To login as root you must open terminal by pressing Ctrl + Alt + T. Run the following command


 


su root


 


Now enter your root password.



Oct 19, 2012

Upload .doc and .docx file using PHP


To download code - Click Here



Step 1



Create one html file named index.html and paste the following code into it.



<html>



<body>



<form enctype="multipart/form-data" method="POST" action="upload.php">This is the code for html:



<table border="0">



<tbody>



<tr>



<td align="left">File:</td>



<td><input accept="doc/docx" name="filename" size="40" type="file" /></td>



</tr>



<tr>



<td><input name="Upload" type="submit" value="Upload" /></td>



</tr>



</tbody></table>



</form>



</body>



</html>




Oct 17, 2012

HTML form validation using JavaScript


To download code - Click here



To view demo click Register button







 




 



 







Step 1



Create one HTML file named index.html and paste the following code and save it.


Disable Overlay Scrollbar in Ubuntu 12.10


 



If you are used to the regular scrollbar that was in previous versions of Ubuntu, then you’ll want to disable this new overlay feature now in Ubuntu.


 


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


 


gsettings set com.canonical.desktop.interface scrollbar-mode normal


 


old scrollbars



Automatically Hide Unity Launcher in Ubuntu


Do you want enable Unity Launcher to automatically hide in Ubuntu 12.04. When you upgrade or install Ubuntu 12.04, the launcher is docked on the left and won’t auto-hide. Enabling it will give you some more space to work it.



To get started, go to ‘Control Gear --> System Settings


 


Next, select ‘Appearance


 


Then the Behavior tab and click the button to turn it on. You can also set the sensitivity level of the launcher from here as well.


 


auto hide




Oct 10, 2012

Ajax - Jquery Auto Refreshing DIV


 


The following demo example display server timestamp on every 2 second. You can easily edit the code and display any database content.


 





 


 


 


You have a div that you would like to be up to date on your website without having the page refresh event, this problem can be solved by using the following script. Let’s say that you want to show the total number of rows in a particular table on every 3 second without performing a page refresh event. Then do the following steps


 



 


Step 1 - Load ajax Script


 


<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>


 


This script load ajax script remotely.



Oct 3, 2012

Insert Data from One Table to another Table in MYSQL - Insert Into Select & Select Into Table


Method 1: INSERT INTO SELECT



This method is used when table is already created in the database earlier and data is to be inserted into this table from another table. If columns listed in insert clause and select clause are same, they are are not required to list them. I always list them for readability and scalability purpose.



----Create TestTable



CREATE TABLE TestTable (FirstName VARCHAR(100), LastName VARCHAR(100))



----INSERT INTO TestTable using SELECT



INSERT INTO TestTable (FirstName, LastName)



SELECT FirstName, LastName



FROM Person.Contact



WHERE EmailPromotion = 2



----Verify that Data in TestTable



SELECT FirstName, LastName



FROM TestTable



----Clean Up Database



DROP TABLE TestTable




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