Just found out that I had to change my udev rules for my Nexus One to work with my laptop, which I had made rules for to work with my HTC Magic – the vendor IDs have changed a bit for the Nexus One, so for the Nexus One I use the following rules which reside in /etc/udev/rules.d/50-android.rules
1
2
3
4
| SUBSYSTEM=="usb|usb_device", SYSFS{idVendor}=="18d1", MODE="0660", GROUP="plugdev"
SUBSYSTEM=="usb|usb_device", SYSFS{idVendor}=="0bb4", MODE="0660", GROUP="plugdev"
SUBSYSTEM=="usb|usb_device", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e12", SYMLINK+="android_adb"
SUBSYSTEM=="usb|usb_device", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0fff", SYMLINK+="android_fastboot" |
This works well with both adb and fastboot.
Oh and for reference I had the following rules for my Magic which ought to work with the Dream as well:
1
2
3
| SUBSYSTEM=="usb|usb_device", SYSFS{idVendor}=="0bb4", MODE="0660", GROUP="plugdev"
SUBSYSTEM=="usb|usb_device", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0fff", SYMLINK+="android_fastboot"
SUBSYSTEM=="usb|usb_device", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0c02", SYMLINK+="android_adb" |
Posted by ostebaronen at 9:28 pm on May 14th, 2010.
Tags: Android, Driver, Google, HTC Nexus One, Linux, nexus, Nexus One, One, udev.
So you might be running WordPress on a Lighttpd server, which can be a bit problematic since it does not support slugs per default, and if you are using default permalink setup in WordPress the search page that we are going to create in a minute will not work.
So first we need to do something about the permalinks. For this example I will use the permalink style: http://domainname.test/postname/ for this to work we need to add following lines in the lighttpd.com:
1
2
3
4
5
6
7
8
9
10
11
| url.rewrite-final = (
# Exclude some directories from rewriting
"^/(wp-admin|wp-includes|wp-content|gallery2|stats|awstats|awstatsicons|awstatscss|kloxo|kloxononssl|cgi-bin)/(.*)" => "$0",
# Exclude .php files at root from rewriting
"^/(.*.php)" => "$0",
# Handle permalinks and feeds
"^/(.*)$" => "/index.php/$1"
) |
Remember to reload lighttpd to append these changes.
In the WordPress permalink settings you use the custom setting where you write: /%postname%/ this will result in links like we wanted.
Now we have to make a page where the AdSense for Google results will show. I’ve made a template called gsearch.php, which looks like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
| <?php
/*
Template Name: gsearch
*/
?>
<?php get_header(); ?>
<div id="content" class="widecolumn">
<!-- Google Search Result Snippet Begins -->
<div id="cse-search-results"></div>
<script type="text/javascript">
var googleSearchIframeName = "cse-search-results";
var googleSearchFormName = "cse-search-box";
var googleSearchFrameWidth = 500;
var googleSearchDomain = "www.google.dk";
var googleSearchPath = "/cse";
</script>
<script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script>
<!-- Google Search Result Snippet Ends -->
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?> |
Put this template in your WordPress theme folder, and go to your Dashboard and make a new Page. Call this whatever you want, but remember to choose the template gsearch, and do not write anything else on the page, only fill out the page name.
Now go to your AdSense account, and create a new AdSense for Google Search. In the Wizard where it says which sites you want to search across write your own, also remember to add some keywords, it helps showing ads directed at the content you want to have it showing. But the most important thing is to fill in the Opening for search results page, here you have to check Open results within my own site and then specify the URL for the page you just made with the gsearch template. Now finish up the wizard and have the code created. We will only need the search box code, since we already implemented the search result code.
Since I do not know how to make a new widget, we will just paste the code into the sidebar code for your theme directly. Which you can find under appearance and then press editor. Find the code for your sidebar, probably named sidebar.php.
Paste the generated code from google right after the <div id=”sidebar”> code, save and enjoy. You should now have a functioning AdSense for Google Search implemented on your blog.
You might want to remove the search widget, so it only show the Google Search one and also exclude the page from the pages widget.
Posted by ostebaronen at 7:08 am on December 24th, 2009.
Tags: AdSense, Google, Lighttpd, mod_rewrite, Search, slugs, wordpress.
I find the built in search function a bit lacking, so I decided to shift it out with Google AdSense Custom Search, which searches the webpage while showing some ads, which enables me to earn a bit money, since this page does not pay itself. Though you are not forced to click on the adds, though I’d like you to from time to time as a token of appreciation.
If you need help implementing this on your own wordpress weblog I will write up a blog post on how to do this very soon.
Posted by ostebaronen at 6:29 pm on December 23rd, 2009.
Tags: AdSense, Google, Money, Search, Weblog, wordpress.
I have added the Google Translate tool for you to use on the Blog. It is found in the sidebar on the right at the top, where you can choose a language you want the entire page to be translated into. For more information about this awesome translation tool visit Googles Translate Tools webpage, here you can find the code you need to paste into your template for the tool to function. Super simple and it just works flawlessly! Though the quality of the translation is not perfect, but it will give you an idea what the content is about in the language you translate into.
For now Google Translate tools support 51 languages and will most likely support more in the future. This is also a great opportunity to reach out to an audience which does not speak English, which this Blog is written in. Cool beans!
Posted by ostebaronen at 2:53 pm on October 1st, 2009.
Tags: Google, Language, Plugins, Site updates, Translate.