301 redirect is a permanent redirect whereas 302 is a temporary redirect. Permanent redirects tell search engines that old URL is out so that they can pull this new URL in it’s place. 301 is used when you want to preserve the page index and keep the page rank.
Category Archives: Homeschool
Ubisoft Uplay Has Been Blocked By Firefox
Ubisoft Uplay has been blocked by Firefox. It got a security vulnerability that can be exploited by malicious websites to gain control over the user’s system. All Firefox users who have installed this addon are affected so Firefox suggests other users who are currently using this addon to remove it but they are free to continue if they accept the risks described.
How To Protect wp-config.php And .htaccess Files In WordPress ?
You can block access to your site’s wp-config file from browser by adding following code in your .htaccess file:
# Block access to wp-config
<files wp-config.php>
order allow,deny
deny from all
</files>
For blocking access to your .htaccess file add this code inside your .htaccess file:
# Block access to htaccess
<files .htaccess>
order allow,deny
deny from all
</files>
Note:.htaccess file is present in your site’s root at the same place where you find wp-config file.
Lying on your resume http steveblank com 2012…
Lying on your resume – http://steveblank.com/2012/07/30/lying-on-your-resume/
10 year old problem in theoretical computer science…
10-year-old problem in theoretical computer science falls – http://web.mit.edu/newsoffice/2012/interactive-proofs-work-even-if-quantum-information-is-used-0731.html
Facebook there must have been miscommunication with Limited…
Facebook, there must have been miscommunication with Limited Run: http://www.latimes.com/business/technology/la-fi-tn-facebook-limited-run-response-20120730,0,5059899.story
Facebook Announced Improvements In Photos Section
Today Facebook has announced few improvements in the photos section.
Now You Can See Bigger Photos On Facebook
By clicking photos at the top of your timeline you can see larger pictures filling up all over your page. You can use menu for finding shots you are tagged in, images you have shared and albums you have created.
Now You Can Showcase The Photos You Like
You can easily show your favorite photos to your friends from Facebook’s new photos all in one section. Click star button to make important photos stand out as shown in the following image:
Google Talk for Developers
Google Talk for Developers: https://developers.google.com/talk/
Protecting Your WordPress Admin From Hacks
You may use this trick for adding an additional layer of security on your WordPress site so that your site don’t get compromised and hacked:
- Open your cPanel.
- From Security section click Password Protect Directories.
- Now on the Pop Up. Select root then from your WordPress installation select wp-admin.
- Check Password protect this directory.
- Create a user for that directory; there is an option below the check box. That’s it..
Now anytime you visit wp-admin directory you should notice an authentication box asking you for the username and password for authentication.
Sometimes it may show some errors depending on how your server is configured. Don’t worry, just ask me here about the problem(if you face one).
Monitor, Manage And Backup All Of Your WordPress Sites At Once From A Single Place
Using WP Remote you easily monitor, update and backup all of your WordPress sites at the same time from a single place. It communicates with your WordPress site using API like Akismet so there is no need of providing username and password and it is completely free to use.
Features:
Know WP Remote Latest Enhancements
- It can track all of your sites.
- No limitation to number of sites you add.
- It can update WP-Core, all plugins and themes.
- Check WP Remote Security policy here.
Facebook’s Twitter Account https twitter com facebook and Twitter’s…
Facebook’s Twitter Account – https://twitter.com/facebook and Twitter’s Facebook Account – http://www.facebook.com/pages/Twitter/278029242253904
How To Enable Hibernate Feature in Ubuntu 12.04 ?
Latest Release Of Skype – Install Skype 4.0 in Ubuntu 12.04
If Skype is already installed then update is there for you in Update Manager. If you don’t have Skype then enabled Canonical Partners channel.
- Visit Ubuntu Software Center
- Then select Edit > Software Sources
- Click tab: ‘Other Software’
- Check the boxes next to ‘Canonical Partners’
After updating open Software Center and search for and install ‘Skype’ package.
Vimwiki is a personal wiki for Vim a…
Vimwiki is a personal wiki for Vim — a number of linked text files that have their own syntax highlighting. – http://code.google.com/p/vimwiki/
Cracking Passwords on an Intel Celeron CPU
Cracking Passwords on an Intel Celeron CPU – http://16s.us/16crack/defcon_2012/
Technorati Top 100 Blogs http technorati com blogs top100
Technorati Top 100 Blogs http://technorati.com/blogs/top100/
WP-Hack For Adding Google+ Page Badge ‘Add to Circles’ In Your WordPress Blog
Add this code in your theme’s header.php file’s head section:
<link href=”https://plus.google.com/PageID” rel=”publisher” /><script type=”text/javascript”>
(function()
{var po = document.createElement(“script”);
po.type = “text/javascript”; po.async = true;po.src = “https://apis.google.com/js/plusone.js”;
var s = document.getElementsByTagName(“script”)[0];
s.parentNode.insertBefore(po, s);
})();</script>
Replace PageID (in bold text of above code block) with your Google+ Page ID.
Now visit your blog’s wp-admin (Dashboard) >> Appearance >>Widgets and drag text widget to your sidebar.
Paste following code inside your text widget (replacing PageID) :
<g:plus href=”https://plus.google.com/PageID” size=”badge”></g:plus>
For smaller badge use:
<g:plus href=”https://plus.google.com/PageID” size=”smallbadge”></g:plus>
Note: You can get your Google Plus Page ID by visiting your page’s profile and copying the number before /posts or /about in URL.
Function For Defining Default Post Thumbnail In WordPress
Open your theme’s function.php file and add the given function editing the thumbnail image URL (given in bold text) with your own image URL.
add_action( ‘save_post’, ‘wptuts_save_thumbnail’ );
function wptuts_save_thumbnail( $post_id ) {
$post_thumbnail = get_post_meta( $post_id, $key = ‘_thumbnail_id’, $single = true );
if ( !wp_is_post_revision( $post_id ) ) {
if ( empty( $post_thumbnail ) ) {
update_post_meta( $post_id, $meta_key = ‘_thumbnail_id’, $meta_value = ‘https://sangkrit.net/thumbnail.jpg’ );
}
}
}
How To Edit WordPress ‘Posts’ Label ?
You can edit WordPress post label to something Else. For example if you want to edit Posts (label) to Article so that anytime you or any other member visit you wp-admin (dashboard) he can see Article as a label on sidebar menu not posts (which is by default).
For doing this, open your theme’s function.php file and add the following code:
add_filter(‘gettext’, ‘change_post_to_article’);
add_filter(‘ngettext’, ‘change_post_to_article’);
function change_post_to_article($translated) {
$translated = str_ireplace(‘Post’, ‘Article’, $translated);
return $translated;
}
Different Ways Of Defining Arrays In PHP
How to define an empty array ?
$my_array_1 = array();
How to define an auto incremented array?
$my_array_2 = array(“one_1″,”two_2″,”three_3”);
How to define a multidimensional array ?
$multi_dim_array = array();
$multi_dim_array[] = array(“one_1″,”two_2”);
$multi_dim_array[] = array(“three_3″,”four_4”);
echo $multi_dim_array[0][1];
echo $multi_dim_array[1][0];
How to define an array with assigned index stings ?
$my_array_4 = array(
“name”=>”your_name”,
“age”=>20,
“gender” =>”male”
);
How to define an array having assigned index numbers?
$my_array_3 = array
1=>”one_1″,
2=>”two_2″,
3=>”three_3″
);
How To Add Custom User Roles In WordPress ?
Suppose you need to create a new custom post type, may be NEWS. So that you can allow you subscribers to post NEWS on your website. In the given example we will be creating a custom user role for NEWS and the users allotted this role would only be managing only NEWS section from WP-Admin (Dashboard).
Open your theme’s function.php file: site root >> wp-content >>themes >> function.php and add the given code block:
add_role( ‘news_user’, ‘News User’, array( ‘news’ ) );
This function generates new custom user role which can only manage
news section from Dashboard.
Although you may add some more function for new custom user role.
New custom user role can also be removed from WordPress by using the following function in your theme’s function.php file:
remove_role( ‘news_user’ );
From WordPress Function $wp_roles also you can add and remove custom user roles as show below:
global $wp_roles;
$wp_roles->add_cap( ‘news_user’, ‘manage_category’ );
$wp_roles->remove_cap( ‘news_user’, ‘view_post’ );

