Magento: Put Out of stock to the end of the Product list




code/local//Mage/Catalog/Model/Layer.php  in function getProductCollection Put this code after line #102

$collection->joinField(‘inventory_in_stock’, ‘cataloginventory_stock_item’, ‘is_in_stock’, ‘product_id=entity_id’,’is_in_stock>=0′, ‘left’)->setOrder(‘inventory_in_stock’, ‘desc’);

Enable Template Path hints for Admin Panel :Magento

Just run this query in your magento database and u can see path hint in admin side of magento…

INSERT INTO core_config_data (scope, scope_id, path, value)

VALUES (‘default’, 0, ‘dev/debug/template_hints’, 1),

(‘default’, 0, ‘dev/debug/template_hints_blocks’, 1);


to Disable it set both value to 0


Install Package Control For Sublime Text 2 Editor in Linux / Ubuntu

open Sublime Text 2 Editor And press this keys   ctrl +`  to open command console and type this code in it.

import urllib2,os; pf=’Package Control.sublime-package’; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),’wb’).write(urllib2.urlopen(‘’+pf.replace(‘ ‘,’%20’)).read()); print ‘Please restart Sublime Text to finish installation’

Install Packages

Its Ready to use now restart sublime n press  shift + ctrl + p

it will open text box type pci in it press enter
wait for a while it will open text box in there u can search Packages and can install it Eg: type  Zencoding
press Enter to install it.

Install Sublime Text 2 Editor in Linux / Ubuntu

You may download Sublime text Sublime Text 2 .

1 . Unzip the file n paste it in  /usr/lib/>

now open terminal

2 . To call Sublime Text from the Terminal by just typing ‘sublime’ , just create a symbolic link in “/usr/bin”  By typing this in Terminal.

sudo ln -s /usr/lib/Sublime\ Text\ 2/sublime_text /usr/bin/sublime

3.To create a launcher in Unity. To do this, we’re going to create a .desktop file in “/usr/share/applications”:

sudo sublime /usr/share/applications/sublime.desktop

And paste the following content in file :

[Desktop Entry]
Name=Sublime Text 2
# Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
# From Ubuntu’s language-pack-kde-XX-base packages, version 9.04-20090413.
GenericName=Text Editor

Icon=/usr/lib/Sublime Text 2/Icon/48×48/sublime_text.png

[NewWindow Shortcut Group]
Name=New Window
Exec=sublime -n

4.To open all files with Sublime Text 2.
The easiest way to do that is to open up the file
associations list

sudo sublime /usr/share/applications/defaults.list

Now You can open Sublime editor from

applications->programming->sublime text 2

sudo: must be setuid root Ubuntu

Booting into recovery mode

Since fixing sudo involves editing system files, and you would otherwise need sudo to do so, you’ll have to boot into recovery mode to gain root (system-wide) access in order to repair sudo.

Restart Your Computer and hold down the Shift key during bootup.

select Recovery mode press enter

now select root then press Enter

Type : mount -o rw,remount /                     Press enter
Type : chown root:root /usr/bin/sudo      Press enter
Type : chmod 4755 /usr/bin/sudo            Press enter
Type : shutdown -r now                               Press enter to Reboot

WordPress :Set Permalinks in ubuntu /Linux

1 .Create .htaccess file in /var/www/wordpress

put this code in it.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]

# END WordPress  /etc/apache/sites-enabled/000-default

put this code after <directory> tag

<Directory /var/www/wordpress/ > #This is the directory where your website is located. It could be different for you.
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all

3. run this code in Terminal

sudo a2enmod rewrite

sudo /etc/init.d/apache2 restart


4. open ur wordpress admin ->settings->permalinks

set your options and click save.


Bingo!!!! open ur post