Skip to main content

Raspberry Pi audio playback from Python

Want to play audio on your Raspberry Pi running Raspbian, while logged in to a non-root user account? Me, too!

Seems like such a simple task.

Consider the following code snippet using PyGame:

import time
import pygame
pygame.mixer.init()
pygame.mixer.music.load("testfile.wav")
pygame.mixer.music.play()
while pygame.mixer.music.get_busy() == True:
    time.sleep(.25)

Let's try it:

$ python soundtest.py
Traceback (most recent call last):
  File "./soundtest.py", line 3, in <module>
    pygame.mixer.init()
pygame.error: No available audio device

Living with Windows? These utilities can help prevent malware and crapware infestations

I've abandoned Windows in favor of Linux (Ubuntu) over the last several years, so I don't suffer from malware/crapware infestations (they never really hit me much, me being hyper-vigilant about installing stuff on my systems...) I've moved all family members off Windows as well, if they want me to help maintain their computers.

For those of you working with Windows (and hence subject to all the usual vexations associated with it), these two software utilities look promising:

Automating vote tallying on the Google+ "Light Box" community: The TallyBot

The Light Box is a Google+ community that allows people to submit photos for community review. Qualified community members 'vote' on photos by leaving a comment with sequential hashtags like "#delete1", "#delete2", "save5", etc. The when the saves or deletes reach 10, we have a winner (the first to reach the threshold wins.)

Find the top commenters on a Google+ post

I've created a simple web app to show the top comments and commenters for a Google+ post. There's a simple bookmarklet that allows you to see results for a post you're viewing on Google+.

The current features are early beta test stage. I'll be adding new features over the next few weeks.

Feedback welcome!

Twitter Streaming API utility for Python

I've released twitter-streamer ("Streamer") under the MIT license.

Streamer is a simple Python script that dumps tweets using Twitter's streaming API via the statuses/filter method.

Social Media Smack Down: Sex, Drugs, and Coffee

I've been working on a web app that tracks and displays recent social media trends.

During the limited beta test, I'm using it to monitor social media trends for sex, drugs, and coffee.

Sex, Drugs, and Coffee: by the minute

By the minute, in the last 60 minutes:

Sex, Drugs, and Coffee: by the hour

By the hour, for the last 24 hours:

PyFiddle

PyFiddle

This domain may be for sale. Please contact us for more information.

Google Chrome Hacks and Tips

How do I do the following in Google Chrome? What is this thing doing in Google Chrome?

I'm concerned about privacy. How do protect my privacy while I browse? How do I block tracking cookies and ad networks in Chrome?

Disable Google Instant Search in FireFox and Chrome

I'll show you how to disable Google Instant Search without being signed in to a Google account!

I despise (really!) Google Instant Search. I find it annoying, distracting and unnecessary. If you are a long-time Google search user, you might feel the same way.

Google, once revered for its clean, simple search interface, seems like it's doing everything in its power to alienate users, by rejecting the principles that once attracted users away from bloated, annoying search engines of the past.

How do I turn off Google Instant Search?

You can disable Google Instant search by setting your account preferences while signed in to a Google account.

But what if you aren't signed in? What if you don't have and don't want a Google account?

Easy: Just visit http://www.google.com/search?complete=0 – bookmark that search (or set it as your home page if you like having Google's search page visible when you start your browser). It appears that you can add the complete=0 parameter to any Google search URL and it will disable the Google Instant search feature.

How do I turn off Google Instant in Chrome's OmniBox or FireFox Search Bar?

How to disable Google Instant in Chrome Omnibox

If you use Google's Chrome browser, and you like to use the Omnibox address bar you can disable the instant search feature in results pages (the page you see after you hit enter or 'go') by changing the built-in Google search engine template. Here's how:

Bring up the "Options" form (Wrench button, Options). Click the Manage Search Engines button.

Now, select the Google.com search engine's search template in the third column:

Replace the entire search URL template field with following text:
http://www.google.com/search?complete=0&q=%s

Dismiss the "Search Engines" form.

In addition, you might want to disable the Enable Instant for faster searching and browsing option, as this option is a form of Instant Search within the Omnibox address bar.

How do I turn off Google Instant in FireFox's Search Bar?

But what about FireFox? If you like to use the built-in search bar's Google OpenSearch feature, it's a bit more work.

The easy way

We've provided an OpenSearch plugin installer on this page to simplify the process. Simply drop down your FireFox Search Bar and click "Add Google NoInstant" to your search bar:

The hard(er) way

This method requires that you copy and rename FireFox's built-in Google.xml OpenSearch template, which is found in the FireFox installation folder's "searchplugins" folder, modify it to add the <Param name="complete" value="0"/> parameter entry (see below), then install the new OpenSearch definition in the FireFox profile folder's "searchplugins" folder.

Restart FireFox and click the Search Bar's dropdown button, and you should see Google NoInstant listed; make that your default search provider and you should be rid of the Google Instant curse henceforth.

What is ielowutil.exe and why is it running on my computer?

If you're anything like me, you've noticed that Internet Explorer 8 and 9 seem to be accompanied by a child process named ielowutil.exe. The file properties description for this process isn't very helpful, and, in fact, might lead you to believe that it has something to do with your computer's microphone!

The file description reads: Internet Low-Mic Utility Tool. This sure sounds like it's doing something with your microphone, doesn't it? It turns out that this is a misleading description.

Syndicate content