Changing files and folders so they are accessable by user and apache as well

Follow the commands below to change files and folders so they are accessible to users and the apache group as well by adding the user to the apache group and assigning full read, write, execute privileges to user and apache group.
cd /var/www
find . -type d | xargs chmod 775
find . -type f | xargs chmod 664
chown -R paul.apache *

I assume paul is the user

How to change owner of files or directories recursively in Linux?

To change owner of files or directories recursively in Linux use the following command: (MAKE SURE YU ARE IN THE DIRECTORY YOU WANT TO CHANGE THE FILES/FOLDERS WITHIN)
chown -R user/group — (substitute user/group with the user name and group name.

For example:
chown -R paul/administrator — (paul is the name of the user and administrator is the name of the group)

For future reference, “-R” is used by nearly all programs to specify a recursive action.

How to get/find out the owner of a file or directory in Linux

You can use ls -l command (list information about the FILEs) to find our the file / directory owner and group names.

More information: http://www.cyberciti.biz/faq/unix-linux-find-file-owner-name/

Three Wolf Moon T-Shirt

Three Wolf Moon T-Shirt

The Three Wolf Moon T-Shirt stirred up quite a news in the past few days.

The T-shirt existed quietly for some time but sales of the kitsch Three Wolf Moon T-shirt shot up 2,300% after a spate of ironic reviews went viral. The first review gave the shirt five stars, saying it “Fits my girthy frame, has wolves on it, attracts women” but “cannot see wolves with arms crossed”… and more funny reviews came along and the legend began:
…This item has wolves on it which makes it intrinsically sweet and worth 5 stars by itself, but once I tried it on, that’s when the magic happened. After checking to ensure that the shirt would properly cover my girth, I walked from my trailer to Wal-mart with the shirt on and was immediately approached by women. The women knew from the wolves on my shirt that I, like a wolf, am a mysterious loner who knows how to ‘howl at the moon’ from time to time (if you catch my drift!)…

Since then this video on YouTube has debuted and sales are higher than ever:

So, what are you waiting for get your own chick magnet Three Wolf Moon T-Shirt today! Check back and let everyone know about its powers.

Listing and Editing Cron via Crontab

To list and edit crons, log in via SSH and use the following commands:

crontab -l to list crontabs
crontab -e to edit crontabs

editing is done in VI. Basic VI commands: http://www.cs.colostate.edu/helpdocs/vi.html

How to add rel=”nofollow” to the top links in Magento

It is a good practice to add nofollow attribute to the links that are not important from SEO perspective, so link juice is not trickled down to these pages.

These links are on the top of the Magento pages:

My Account | My Wishlist | My Cart | Checkout | Log In

Here is what you have to do:

1. Open the following file:
app/design/frontend/default/[*yourTheme*]/template/page/template/links.phtml
– Replace [*yourTheme*] with whatever the name of your theme is. Replace it with ‘default’ if you are using the default theme.

2. Add rel=”nofollow” to the code on line 37

3. Test your pages

Where can I add a rel=”nofollow” to “View as: Grid List” and “Sort By” in Magento Commerce

If you are wondering where in the code you can add rel=”nofollow’ to the top bits (view as Grid, sort by etc) of the category and search pages in Magento you came to the right place.

To clarify these links are are

http://www.domain.com/category?mode=list

http://www.domain.com/category?mode=grid

http://www.domain.com/category?mode=grid&limit;=9&p;=2

http://www.domain.com/category?mode=grid&limit;=15

etc.

Open the following file:
/app/design/frontend/default/[*your skin name*]/template/catalog/product/list/toolbar.phtml

– replace [*your skin name*] with the skin name you setup if you use a different design than the default.

If you are using the default design, replace it with ‘default’. In this case the file is here:
/app/design/frontend/default/default/template/catalog/product/list/toolbar.phtml

Add rel=”nofollow” to line 87, 102 and 104.

How to install Midnight Commander 4.6.1

Midnight Commander is a very useful file manager.

Install Midnight Commander
# wget http://www.ibiblio.org/pub/Linux/utils/file/managers/mc/mc-4.6.1.tar.gz
# tar zxvf mc-4.6.1.tar.gz
# cd mc-4.6.1
# ./configure
# make
# make install

To run Midnight commander use

How to add a user to all blogs in WordPress Multi User WPMU

OPEN:

wp-includes/wpmu-functions.php

FIND:

function wpmu_create_blog($domain, $path, $title, $user_id, $meta = ”, $site_id = 1) {
$domain = addslashes( $domain );
$title = addslashes( $title );
$user_id = (int) $user_id;’

Then, A little bit further down FIND:

add_user_to_blog($blog_id, $user_id, ‘administrator’);

after this line ADD:

add_user_to_blog($blog_id, X, ‘administrator’);`

where X is the userid of the user you wish to add, this can be repeated if you have multiple site admins

source: http://mu.wordpress.org/forums/topic.php?id=1445
Thank you Xen

Add users in ‘AllowUsers’ of SSH for SSH access

If users are not listed in ‘AllowUsers’ list for SSH, these users will be blocked from accessing the server via SSH.
Users will need to be added to the /etc/ssh/sshd_config file.

add this line at the end of the file: AllowUsers username1

Don’t forget to restart the server.