China says opposes Obama meeting with Dalai Lama

BEIJING – Any meeting between President Barack Obama and the Dalai Lama would harm bilateral relations, China warned Tuesday while repeating Beijing’s refusal to discuss Tibet’s status with the spiritual leader’s envoys.

China says opposes Obama meeting with Dalai Lama

An Obama meeting with the Tibetan spiritual leader would “seriously undermine the political foundation of Sino-U.S. relations,” said Zhu Weiqun, executive deputy head of the Communist Party’s United Front Work Department in charge of recent talks with the Dalai Lama’s representatives.

lama

Zhu was speaking at a news conference where he said Chinese officials told the envoys that Beijing would not make any compromises on its sovereignty over the Himalayan region and that both sides’ views remained “sharply divided.”

The warning to Obama comes after signals from U.S. officials in recent weeks that Obama might soon meet the exiled Tibetan leader — something Chinese officials are keen to avoid before President Hu Jintao travels to Washington, possibly in April.

Zhu said any arguments that the Dalai Lama was just a religious figure were wrong, calling the 1989 Nobel Peace Prize laureate the “head of a separatist group.”

No date for Obama’s meeting with the Dalai Lama has been announced, but White House spokesman Mike Hammer said last month that “the President has made clear to the Chinese government that we intend to meet with the Dalai Lama, it has been his every intention.” The White House did not immediately return a call seeking comment Monday night.

Bilateral relations have already been strained by the U.S. announcement Friday that it planned to sell $6.4 billion worth of arms to Taiwan.

Beijing quickly suspended military exchanges with Washington and announced an unprecedented threat of sanctions against the U.S. companies involved in the sale.

Zhu did not give any details on what China would do if Obama meets the Dalai Lama. “We will take corresponding measures to make the relevant countries realize their mistakes.”

Representatives of the United Front met over the weekend with two emissaries of the Dalai Lama for their first talks in 15 months, but Zhu said China would discuss only the future of the exiled spiritual leader — not any greater autonomy for Tibet.

“There is no room for negotiation or concession on the part of the central government on these issues,” Zhu said.

At the last talks in 2008, China rejected a proposal presented by the Dalai Lama’s envoys for a way for Tibetans to achieve more autonomy under the Chinese constitution — a key demand of the minority community.

During this latest round of talks, the envoys made no revisions or concessions to the proposal, particularly on the position that the Tibetan government-in-exile represented the interests of the Tibetan community, Zhu said.

Zhu said the Chinese government was the only legitimate representative of the Tibetan people, not the envoys sent by the Dalai Lama. He said Beijing was open to future talks but only to discuss the return of the Dalai Lama, who is 75.

“We do want to make it a channel for the Dalai Lama to redress his mistakes,” Zhu said. “We do hope that in the remainder of his life, he can think well about his own future. We don’t want him to end up in foreign soil.”

Zhu said China arranged for the envoys to visit late communist founder Mao Zedong’s former residence in Shaoshan in central Hunan province, as well as to see a region home to Miao and Tujia ethnic minorities.

China maintains that Tibet has been part of its territory for centuries, but many Tibetans say the region was functionally independent for much of its history.

Beijing demonizes the Dalai Lama and says he seeks to destroy China’s sovereignty by pushing independence for Tibet. The Dalai Lama has maintained for decades he wants some form of autonomy that would allow Tibetans to freely practice their culture, language and religion under China’s rule, not independence.

Tibetan areas have been tense in recent years, with the minority community complaining about restrictions on Buddhism, government propaganda campaigns against their revered Dalai Lama, and an influx of Chinese migrants that leave Tibetans feeling marginalized. Those feelings boiled over in deadly anti-Chinese riots in 2008 that shocked Beijing’s leaders.

Surfers risk fraud with online banking login details

Nearly three-quarters (73 per cent) of people recently fraud with online banking, surveyed admitted to using the same login details for their online banking across other websites and social networks.

fraud with online banking
fraud with online banking

Trusteer, the customer protection company for online businesses, said that by reusing these credentials, people put themselves at a serious risk of fraud.

Reusing passwords was the most common mistake made by those asked but 47 per cent also admitted to using exactly the same user ID and password to login to less secure sites.

Criminals have devised various ways to get login details from less secure sites such as online email clients and social networks and then test these credentials on financial sites to commit fraud.

nginx wordpress plugins nginx setup for wordpress

Nginx is becoming very popular to host the websites. WordPress is best and popular CMS in the world now. Nginx gives really great performance with wordpress sites. Earlier I given the Nginx configuration with this code. I given code for wordpress and Nginx configuration. For hosting your wordpress website on Nginx server is the best option.

nginx wordpress plugins nginx setup for wordpress

If you have dedicated server then go with nginx server.

wordpress + Nginx + permalink

nginx wordpress plugins nginx setup for wordpress
nginx wordpress plugins nginx setup for wordpress

I found two plugins which are supported to Nginx installtion. But both plugins are not give you nginx rule for setup nginx rule.

http://wordpress.org/extend/plugins/nginx-compatibility/
http://wordpress.org/extend/plugins/nginx-proxy-cache-integrator/

Now I will show you how setup wordpress site on Nginx server.

Just put following code in your nginx.conf file. This code will fix the wordpress permalink issue also.

server {
listen 80;
server_name localhost.localdomain;
# access_log logs/site.access.log;

location / {
root /usr/share/nginx/html;
index index.php;

if (!-e $request_filename) {
rewrite ^.+?(/wp-.*) /$1 last;
rewrite ^.+?(/.*\.php)$ /$1 last;
rewrite ^(.+)$ /index.php?q=$1 last;
break;
}

location = /50x.html {
fastcgi_pass  localhost:9999;
fastcgi_index index.php;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param SCRIPT_FILENAME  /var/www/example.com$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
root /var/www/nginx-default;
}

}

Note: Dont forgot to install fastcgi on your server. Start the fastcgi server on port no 9000(which is default port)

For wordpressMu use following URL

https://purabtech.in/nginx-rule-for-wordpressmu-with-pretty-url/

Issue with query_posts and pagination

If you are using query_posts in your theme for category and you are facing issue with pagination. usage of query_posts, leave the original query on the home page intact, and modify the query from your functions.php file, using pre_get_posts

Solved issue with query_posts and pagination

we solved Issue with query_posts and pagination. If you are using query_posts in your theme and you are facing issue with pagination. for altering any query

Use following code to fix the issue with pagination.

php
$paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
$sticky=get_option(‘sticky_posts’);
$args=array(
‘cat’=>3,
‘caller_get_posts’=>1,
‘post__not_in’ => $sticky,
‘paged’=>$paged,
);
query_posts($args);
?>

or use following code.

php if (have_posts()) : ?>
php query_posts(“cat=3”); ?>
php while (have_posts()) : the_post(); ?>

replace with above with this code.

php if (have_posts()) : ?>
php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; query_posts(“cat=3&paged=$paged”); ?>
<?php while (have_posts()) : the_post(); ?>

Solved issue with query_posts and pagination
Solved issue with query_posts and pagination

Useful article for query post

http://codex.wordpress.org/Template_Tags/query_posts

Add custom gravatars to your wordPress default gravatar list

By default wordpress has some profile photos. In this tutorial we will show to you to Add custom gravatars to your wordPress default gravatar list.

custom gravatars to your wordPress

Just copy paste following code to functions.php file. This file can be found in your current activated theme folder.

if ( !function_exists('fb_addgravatar') ) {
function fb_addgravatar( $avatar_defaults ) {
$myavatar = get_bloginfo('template_directory').'/images/avatar.gif';
//default avatar
$avatar_defaults[$myavatar] = 'people';

$myavatar2 = get_bloginfo('template_directory').'/images/myavatar.png';
//Avatar for user "admin"
$avatar_defaults[$myavatar2] = 'admin';

return $avatar_defaults;
}

add_filter( 'avatar_defaults', 'fb_addgravatar' );
}
Add custom gravatars to your wordPress default gravatar list
Add custom gravatars to your wordPress default gravatar list

Thanks to WpEngineer for this such great wordpress hack!

I found useful following articles for wordpress plugin developers.

http://codex.wordpress.org/Using_Gravatars

http://codex.wordpress.org/Function_Reference

http://codex.wordpress.org/Function_Reference/add_filter

http://codex.wordpress.org/Plugin_API/Filter_Reference

get first image thumbnail from wordpress post

Most WordPress theme are using custom fields to display thumbs on their blog homepage. How to get first image thumbnail from wordpress post

get first image thumbnail from wordpress post

But you can take easily extract the first image from the post, and display the image as post thumbnail.

Just copy paste the following function in your functions.php file.


function get_first_image($id) {
$PostID = $id;
$all_images =& get_children('post_type=attachment&post_mime_type=image&post_parent=' . $PostID );

if($all_images) {

$arr_of_all_images = array_keys($all_images);

// Get the first image attachment from post
$firstImage = $arr_of_all_images[0];

// Get the thumbnail url for the attachment
// If you want the full-size image instead of the thumbnail, use wp_get_attachment_url() instead of wp_get_attachment_thumb_url().
$thumb_url = wp_get_attachment_thumb_url($firstImage);

// Build the <img> string
$First_thumb_image = '<a href="' . get_permalink() . '">' .
'src="' . $thumb_url . '" width="150" height="150" alt="Thumbnail Image" title="Thumbnail Image" />' .
'</a>';

// Print the thum image form post
echo $First_thumb_image;
}
}

You can call above “get_first_image” function anywhere in your post loop. I loop you need to just copy paste the following lines
to print the first image of post body.

<!--?php get_first_image($post--->ID);  ?>
get first image thumbnail from wordpress post
get first image thumbnail from wordpress post

Follwing article I found useful

http://codex.wordpress.org/Plugin_API/Filter_Reference

http://codex.wordpress.org/Function_Reference/wp_get_attachment_thumb_url

show tweetmeme button and facebook share button

I created custom wordpress theme. In that theme I am using the_excerpt method for showing the post on some pages.
I installed the tweetmeme and facebook-share-new plugins and activated on wordpress site.
I saw one issue with these plugins. These plugins are showing on only single pages or posts.

show tweetmeme button and facebook share button
show tweetmeme button and facebook share button

Facebook and twitter button are not showing when I am using the the_excerpt() function.

I tried google but I did not got any suaitable answer. Everybody is saying about do mannual work when we creating the post.

So did checked the these plugins and I found the solution.

First I am taking about tweetmeme plugin. I opened the “tweetmeme.php” file. This file you will find in wordpress plugins and tweetmeme folder.

Add following code to line no 721 and comment the following line.

add_filter(‘the_excerpt’, ‘tm_update’);
//add_filter(‘get_the_excerpt’, ‘tm_remove_filter’, 9);

Add following code to line no 129
remove_action(‘the_excerpt’, ‘tm_update’);
tweetmeme
When you done with changes you will be able to see tweetmeme button with wordpress post excerpt also.

Updated tweetmeme.php file you can download from here. Please right click and choose save as option.

Now I am going to talk about facebookshare plugin. I opened the facebookshare.php file. This file you will find in wordpress plugins facebook-share-new folder.

Add following code to line no 843

add_filter(‘the_excerpt’, ‘fb_share’);

When you done with changes you will be able to see facebookshare button with wordpress post excerpt also.

Updated facebookshare.php file you can download from here. Please right click and choose save as option.

Solved: header function issue with WordPress

we solved header function issue with WordPress. If you are facing issue with redirecting the one page or post to another page.

All PHP programmer always first try header() function. But when you use header function in worpdress that will not allow you to redirect the page.

Solved: header function issue with WordPress

Instead of using the header function please use wp_redirect() function which is provided by WordPress API.

<?php

global $post; // if outside the loop

if ( is_page() && $post->post_parent ) {

// This is a subpage

wp_redirect(get_option(‘siteurl’) . ‘/wp-login.php’);

} else {

// This is not a subpage

wp_redirect(get_option(‘siteurl’) . ‘/wp-login.php’);

}

?>

Use following URLs for reference.

http://codex.wordpress.org/Conditional_Tags

http://codex.wordpress.org/Function_Reference/wp_redirect

Solved for WordPress old and new versions - PHP Fatal error: Allowed memory size of 33554432 bytes exhausted
Solved for WordPress old and new versions – PHP Fatal error: Allowed memory size of 33554432 bytes exhausted

How we configure memcached on fedora with machine restart

In this tutorial we will show you how configure memcached on fedora with machine restart, First install the memcached on server- linux box.

What is Memcahced?

Memcached is free and open-source software, licensed under the Revised BSD license.[2] Memcached runs on Unix-like operating systems (at least Linux and OS X) and on Microsoft Windows. It depends on the libevent library.

configure memcached on fedora

# yum install php-pdo php-mcrypt squirrelmail php-pecl-apc php-xml php-gd php-devel php php-imap php-pgsql php-pear php-soap php-mbstring php-ldap php-mysql php-cli php-pecl-memcache

Using this file you can change the cache and memory size.

[root@kapilk-pc kapil]# vim /etc/rc.d/init.d/memcached

Aslo change the following file also. Do same setting in this file

# /etc/sysconfig/memcached

[root@kapilk-pc kapil]# /etc/init.d/memcached restart
Stopping memcached: [ OK ]
Starting memcached: [ OK ]

Following command will set command as wheneven machine reboots, memcached server will restart.

[root@kapilk-pc kapil]# /sbin/chkconfig memcached on

How to change timezone linux command line

In this article we will tell you to change timezone linux command line. Location of the local time file
Linux looks at /etc/localtime to determine the current time of your machine. This can either be a symbolic link to the correct time zone or a direct copy of the time zone file.

Please use following commands for changing the timezone.

[root@ip-kapilk-pc kapil]# date
Fri Jan 22 06:35:11 MST 2010

[root@ip-kapilk-pc kapil]# ln -sf /usr/share/zoneinfo/
Africa/ Cuba GMT0 Japan Poland Universal
America/ EET GMT-0 Kwajalein Portugal US/
Antarctica/ Egypt GMT+0 Libya posix/ UTC
Arctic/ Eire Greenwich MET posixrules WET
Asia/ EST Hongkong Mexico/ PRC W-SU
Atlantic/ EST5EDT HST Mideast/ PST8PDT zone.tab
Australia/ Etc/ Iceland MST right/ Zulu
Brazil/ Europe/ Indian/ MST7MDT ROC
Canada/ Factory Iran Navajo ROK
CET GB iso3166.tab NZ Singapore
Chile/ GB-Eire Israel NZ-CHAT Turkey
CST6CDT GMT Jamaica Pacific/ UCT

[root@ip-kapilk-pc kapil]# ln -sf /usr/share/zoneinfo/EST /etc/localtime
[root@ip-kapilk-pc kapil]# date
Fri Jan 22 08:40:32 EST 2010
[root@ip-kapilk-pc kapil]#

Change TimeZone Using /etc/localtime File

For this example, assume that your current timezone is UTC as shown below. You would like to change this to Pacific Time.

# date
Mon Sep 17 22:59:24 UTC 2010