Archives for May 2013

Google Chrome Tips

I started this blog post of Chrome tips in 2008. Even though this is a “hairball” post, some of these tips still work.

– control-shift-V will paste your selection as plain text

– control-shift-T will re-open the last tab you closed. You can repeat that to keep re-opening previously closed tabs.

– Hover over a tab to see the title for that page.

– shift-escape to bring up the Chrome process manager

– switch your default search engine: right-click in the Omnibox and select “Edit search engines…” . Select a search engine and click “Make Default”

– Chrome’s user-agent looks like “Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.24 Safari/525.13”

– Click on a tab and drag it to reorder tabs. To move the tab to a new window, click on the tab and drag it away from the tab bar until a “ghost image” of the tab appears.

– Use control-tab and control-shift-tab to shift your tab focus

– The address bar (referred to as an “Omnibox”) in Google Chrome is very smart. You can use it to type urls or to run searches. Once you type a space after a word, the browser will assume that you want to run a search. Once you type a ‘/’, the browser will assume that you want to navigate to a url.

– Here’s another omnibox trick. Visit Amazon.com and do a search for anything (say, Terry Pratchett). Your browser will see that you did a search and will learn that it can search amazon. Now start typing in the omnibox until “amazon.com” is offered as a suggestion, and then hit tab. You will be offered the ability to search directly on Amazon for what you want. So you could type “am” to bring up the “amazon.com” suggestion, then hit tab and Chrome will say “Search amazon.com:” then if you type “Little Brother” and hit return, you’ll be taken directly to Amazon’s search results for Little Brother.

– On Firefox, you’d use control-l to move the focus to the address bar and control-k to move the focus to the search box. Both shortcuts work on Google Chrome. Note that control-k adds a ‘?’ to the beginning of the address bar/omnibox, which is a shorthand way to write “Do a search.” So entering “?tax codes” would do a search for [tax codes]. After you get the hang of the omnibox, you’ll find yourself just typing searches and hitting enter, because you don’t really need the ‘?’ in front.

– Toggle the display of a bookmark bar on and off with control-shift-B. Even if the bookmark bar is off, it will conveniently appear for you on the “New Tab” window.

– Google Chrome doesn’t offer Google Bookmarks functionality, but if you want to use Google Bookmarks with your browser, you can visit google.com/bookmarks and there’s a bookmarklet at the bottom of the page that you can drag up to your bookmarks bar.

– If you delete a tab by accident, open up a new tab with control-t. In the bottom right is a section called “Recently closed tabs” where you can retrieve a tab. That section only lists three recently closed tabs though. You can re-open up to 10 closed tabs with control-shift-T.

– To maximize the Google Chrome window, you can double-click in any unused/blank part of the tab strip

– An Incognito window isn’t just useful for buying gifts or private porn surfing. If you have two different Google Accounts (maybe a work account and a personal account), you can use Incognito mode to keep two browser windows open and the two windows can each use a different Google Account. Open an Incognito window with ctrl-shift-N.

– control-h will open a history window so that you can search over your browser history

– To help prevent phishing, Google Chrome will bold the hostname of the url in the address bar.

– Attach a file in Gmail with simple drag-and-drop.

– Google Chrome has some neat internal pages that you can access. In the address bar, try entering “about:memory” to get a great breakdown of Chrome’s memory statistics. Enter “about:version” to get version information about Google Chrome. Enter “about:dns” to see the time you’ve saved with DNS prefetching. Enter “about:plugins” to find out more about your browser’s plugins. And “about:stats” shows all kinds of information.

How Cuil generates its categories

This “hairball” post about Cuil isn’t really snarky, so I’ll post it. Cuil is no longer around, but it did spawn a funny post on Reddit about Cuil Theory.

Cuil launched this week. For a search engineer, a new search engine is like a Christmas present: you can’t wait to play with it. Most search engineers can get a good feel for the strengths/weaknesses of a new engine within 10-15 queries. And I’d like to think that with another 5-10 queries, I can usually figure out how I’d spam a search engine. It’s my job to protect Google’s index from spam, so naturally I’m intimately familiar with different webspam techniques. 🙂

What’s also fun is to figure out the how a search engine provides various features. For example, for a Cuil search like [matt cutts] you’ll see the following categories:

Cuill categories

Where do those categories come from? Most people didn’t drill down that far, but it’s quite doable to figure out. If you want, take a few minutes to see if you can puzzle out how the categories are generated before reading on.

Google OS figured it out, for example: “Another interesting idea is the explorative category section that shows related Wikipedia categories and topics.” With a little work, it’s easy to verify that the right-hand box comes from Wikipedia category pages. For example, the string “matt cutts” occurs on the Wikipedia page for search engine optimization, and that page also includes a link to a search engine optimization consultants page. Sure enough, one of the categories listed for [matt cutts] is “Search Engine Optimization Consultants” and the entries under that category are from Wikipedia. Likewise, I think the Wikipedia page for Traffic Power and its link to a category page for black hat SEO probably accounts for why the category “Black_hat_seo” appears for my name.

There’s nothing wrong with surfacing Wikipedia category pages, of course, but sometimes that can lead to some drift in topicality. For example, p2pnet wrote about a search for their name: “[The search query] p2pnet.net, however, gave Canadian copyright law, Project Gotham Racing Series, file sharing networks, Wired magazine people, and filesharing programs.” You can see the categories for the search [p2pnet.net] below:

Cuill categories for p2pnet

And this Wikipedia page has the string “p2pnet.net” and also has a category page for “Project Gotham Racing series”. The idea of surfacing Wikipedia category pages will have advantages and disadvantages depending on the user and the query.

Cheap internet-connected scale: Wii Balance Board + Linux

You can ignore this ancient “hairball” blog post. Gather round, kids, and witness this blog post from a time *before internet-connected scales*. That’s right. Back then, we had to hack our Wii balance boards to connect them to the internet. Of course now you can buy wifi-connected scales from Fitbit and Withings. But in a olden days, you had to hack something up or even write it down on paper!

You can easily make an internet-connected scale out of a Wii Balance Board and a Linux machine:

First, find a Bluetooth dongle and configure your Linux machine to talk to the Wiimote.

Next, apply a few extra patches so that your Linux machine can talk to a Wii Balance Board.

Finally, use some Python code to upload your weight to a Google Spreadsheet.

If you’d like to hear me describe how to hook it everything together, you can watch me give a 7-8 minute talk about it (more info in that post), or you can watch it here:

Special thanks to Kevin Kelly and Gary Wolf for kickstarting the Quantified Self movement and encouraging me to talk about this project.

Wanted: bookmarks.html merging program

You can ignore this “hairball” blog post. This post dates back to a time when people actually curated, saved, and managed their bookmarks.html file. Then Google Chrome introduced the ability to save and sync all your bookmarks, extensions, etc. in the cloud. Now I sign in to Chrome and everything is synced in the cloud.

Over the years, I’ve accumulated lots of bookmarks.html files. I’d love someone to write an App Engine program that would let you upload bookmarks.html files and would merge them all into one master file. After that, you could prune/remove useless bookmarks, especially any bookmark items that are installed by default on a new browser but are useless.

Why do it on the Google App Engine?

Because it would be an easy way to get started. Essentially you want to upload a small set of files to one web location from several different computers, and then do something interesting with that data. App Engine is perfect for that kind of thing.

Can App Engine’s version of Python parse bookmarks.html files?

The Mozilla/Firefox bookmarks.html file format is a little strange, but not too strange. I found a few programs to parse bookmarks.html files. For example, one fellow wrote a Python program to merge bookmarks using sgmllib, which I’m guessing would work on App Engine.

Digging into it more, it looks like several people like Beautiful Soup as a parser. First off, you can download it as a single Python file to work in App Engine. It also looks pretty easy to use. I like this short example of extracting favicons to .ico files from a bookmarks.html file using Beautiful Soup. At least one other person has released tools to manipulate bookmarks.html files with Beautiful Soup.

Can you upload files to Google App Engine?

Yes! There’s evidently a limit of 10MB on uploaded files, but my biggest bookmark file was about 500K, and I suspect most people have much smaller bookmark files. Stack Overflow has a good example of file uploading in Google App Engine, plus there’s official examples as well as people helping other people to the point of showing live examples.

Plus browsers are getting better about uploading files to the web easily. Google Chrome supports really easy drag-and-drop file upload. I think Safari supports drag-and-drop file upload as well? And I know Firefox has the dragdropupload extension that eases uploading files to the web.

What about uploading Google Chrome bookmarks files?

Ah, a person after my own heart. The short answer is that Google Chrome can export bookmarks in a format that looks like Firefox to me. Click on the Wrench, then “Bookmark manager,” then Tools->Export Bookmarks… to get a bookmarks.html file. The more fun answer is that “C:Documents and Settings{$USER}Local SettingsApplication DataGoogleChromeUser DataDefault” appears to have a “Bookmarks” file, and it appears to be in JSON format. Can Python parse JSON? It can; Yahoo mentions that simplejson is a great library to use, and it turns out that Google App Engine supports simplejson very easily. Just say “from django.utils import simplejson” to use simplejson. So it wouldn’t be hard to upload raw Chrome bookmark files either.

Aren’t there existing websites to do this?

Maybe, but I don’t know of them. I thought that Foxmarks might be able to do this. Foxmarks (like the now-defunct Google Browser Sync) can synchronize bookmarks across multiple computers. And Foxmarks provides a my.foxmarks.com web interface that lets you manipulate and export your bookmarks, but you can’t upload a raw bookmarks.html file to Foxmarks; instead, you have to upload/sync bookmarks via a browser extension. If Foxmarks added the ability to upload bookmarks.html files (vote for that idea here), that would be pretty sweet.

TimeTrax gone, SXRecorder lives

What’s that? You’ve never heard of an XMPCR? Don’t worry, the rest of the world hasn’t either. You can ignore this “hairball” post as I do spring cleaning on my blog.

TimeTrax was a program that allowed XMPCR owners to listen to XM Radio on their computer. Even nicer, the program would “time shift” the recording by taking the XM meta data and recording the raw audio of a channel to an MP3 with the artist/title of the song.

TimeTrax is not really viable anymore (see the Wikipedia page), but another program called SXRecorder will do much of the same thing.

If you’re using an XMPCR 100, you’ll need to install USB drivers for your device:
http://www.ftdichip.com/Drivers/VCP.htm

From the page: “Virtual COM port (VCP) drivers cause the USB device to appear as an additional COM port available to the PC.” So if you have the FTDI chip in a device (FTDI = Future Technology Devices International) like the XMPCR, it makes that USB device look like a serial port device, so that you can talk to COM ports.

Searching on Google for SXRecorder finds www.backpocket.com/sxrecorder/ . The software is free, but you can donate $25 or buy extra plugins for SXRecorder for $35.

You’ll need to activate your XMPCR receiver, but you can refresh your radio receiver at xmradio.com.

css.php