Trip Log: Mozilla Kenya

I recently had the unique opportunity to make a short trip to Nairobi with Pierros Papadeas to do a series of talks at various schools and groups there, and attend the Firefox 4 release party there. The superbly organized Mozilla Kenya group made our stay enjoyable, making the most of the time we had there, giving us an opportunity to talk with many many people about Firefox and Mozilla.

Day 1

  • Flew from Chiang Mai to Bangkok, had from 10pm to 2am, did some Skype meetings and code reviews. Sometimes oddly productive, these transient hours.
  • Flew to Doha, Qatar. Barely enough time to peek around the duty-free megastore that the terminal is centered around before flight departs to Nairobi. I’ve never been to either, but from the air Doha looks like Dubai’s younger sibling: lots of tall and shiny new buildings.
  • Land at Nairobi. It’s the middle of the day, and I’ve basically not slept in 24 hours now. The currency exchange before immigration won’t take Thai Baht (hadn’t heard of Thailand!). I need 20USD to get through. I can’t hit the ATM because I lost my debit card in China last week. Immigration holds my passport while I go to the Barclays outside… who won’t give me a cash-advance on my Visa without… my passport! Lovely. Eventually the immigration guy walks down with me, watching closely to make sure I don’t try and escape into Kenya.
  • Got a sim card for 3USD. I’ve been in Africa for 30 minutes and already have 3G.
  • Checked in at the hotel. Met with Alex Wafula, head of Mozilla Kenya for lunch.
  • Tried to stay awake. Didn’t work. Which is fine, because I had so little sleep that I slept mostly through the night.

Day 2

  • Had curry lamb for breakfast at the hotel, and some pieces of fried dough, kinda like a doughnut piece, but with no sugar.
  • Met Pierros for breakfast, and then met Alex and more of the Mozilla Kenya crew in the lobby, and into the pop-top van we go, driving halfway across the country for our first talk!
  • About 45 minutes outside of Nairobi, we come down a mountainside overlooking… the Rift valley! The cradle of civilization. There are craters in the middle, which really add to the awe-inspiring-ness of it.
  • We finally make it to Egerton University in Njoro, about 120km from Nairobi. Still have 3G coverage.
  • Flyer for the talk.
  • Fantastic turnout for the talk! The room is PACKED. We team-presented on general Mozilla stuff and Firefox 4, demo’ing features as we went along.
  • Tons of questions, from high-level to fairly technical. The questions really made the trip worth it – a super interested and engaged group.
  • One subject we talked about was that most people don’t understand how the web works, and therefore have skewed expectations of privacy and security. An idea that came out of it was to warn users every time they’re entering passwords and not on an HTTPS site. Kind of like a lighter and fore-warning HTTPS Everywhere.
  • A woman brought up a bug where if you start a download while tabs are loading, you can see all the throbbers stop. Gotta file a bug and figure out what’s blocking there…
  • Alex then presented on Mozilla Kenya. They are a busy crew: new portal site with forums and a “Faces” feature so you can get to know the community, new localization activity. Wow, super impressive.
  • The Mozilla Kenya peeps and the Egerton organizers. I want a banner like that.
  • Long ride back in the van. Dinner at a local spot. Tasted mugali. It’s something you have to learn to love, methinks.

Day 3

  • Morning meeting with the government ICT group was cancelled in true governmental form: 10 minutes beforehand.
  • We headed out to iHub, a co-working space and cafe. I’d heard of iHub because Mark raved about it after Maker Faire Africa last year. Super cool spot – has mix of pay and non-pay programs, and different work areas. Great espresso, fast wifi, downtempo tunes and a beautiful naturally-lit space. I want one in Portland. Hung out for a few hours hacking and chatting.
  • Afternoon presentation at Strathmore University had a scheduling conflict, so that’s cancelled too. Works out because we were able to spend the time preparing for the Firefox 4 release party, and cleaning up the slide deck.
  • Huge turnout at the party, over 200 people. Tons of younger people. Amazing decorations. Emceed by the amazing @g33kmate, who seems to be all places and involved in all cool things in Nairobi.
  • Very little swag, since the box of swag for the party is stuck in customs. This is an ongoing problem. I will not rant here.
  • Mozilla Kenya unveiled their new web portal for contributors! Super slick design, and features like forums and community phonebook. So cool to see how proactive this group is.
  • Pierros and I presented on Mozilla and Firefox 4, and the future. Alex and Mozilla Kenya unveiled the new web portal!
  • A lot of people stuck around chatting afterwards, asking questions. Did a ton of demos Firefox 4, HTML5, Jetpack, dev tools, etc.
  • Everywhere I go, I demo the new Web console in Firefox 4, and developers 1) haven’t heard of it and 2) freak out. We need to be trumpeting this feature more.
  • We mentioned Firefox mobile in the presentation, and a bunch of people asked me why it doesn’t work on the Android phones in Kenya. Turns out that everyone has this phone: The T-Mobile Comet (Huawei Ideos U8150). It’s priced at just under 100USD. The stock browser works fine. Opera works fine. But Firefox doesn’t run on the CPU it’s got. And it probably doesn’t have the memory required for Firefox to run well. These conversations were not fun for any of us. I want to bring Firefox the handsets of people who live in countries where the handset is the primary communication mechanism. We’re not there yet.
  • CAKE.
  • After a run to the store, where we saw some local specialties, headed back to the hotel, got a beer and worked until 3am.

Day 4

  • Some hacking in the morning, then a three hour meet-up with Mozilla Kenya! Very serious group shot.
  • We talked about the Firefox 4 party, what worked and didn’t. How to improve future big events.
  • We planned for how to reach new audiences in Kenya
  • We talked about Swahili localization efforts, and how to get the community involved.
  • Headed back to iHub to hack the afternoon away.
  • That night, we were lucky enough to notice that the first of FOUR Clasicos was on, so were able to watch the whole thing on a big screen in the hotel bar… the room packed with Kenyan supporters of Real. Awkward.

Day 5

  • Safari! Left the hotel around 6am with Cliff and Vicky, in a pop-top van. Headed to Nairobi park, which is a large nature park just outside the city (about 15 minute drive). You gotta get out there early because almost all the animals hide out during the day, and are invisible by 10am.
  • We saw a huge lioness right off the bat. Then water buffalo, Jackson hartebeast, antelope, gazelle, lions, giraffes, zebras, ostriches, black rhinos, warthogs, giant antelopes, impala.
  • Went back to the hotel, caught a nap.
  • Met up with Kennedy, the local Fedora ambassador, for lunch. Ended up walking to the west side of town, more upscale and Indian neighborhood. Had an amazing meal of, well, Indian food… but not like Indian food. There were some typical items – curries, tikkas, masalas. And there was an assortment of “chips” options – french fries that after being fried, are pan-fried in a curry sauce. SPICY.
  • We kicked it at the hotel for a bit more, then talked our way up to the top of a building that looked about the tallest in Nairobi for some sunset pics.
  • Had dinner at Simmers, at William’s recommendation. Beer, tasty grilled chicken, and an Arsenal game. Not a bad evening at all.

Day 6

  • Early talk at AkiraChix, a group focused on empowering women and their use of technology in Kenya. Gave the Firefox 4 presentation, and then talked about things like WoMoz and P2PU, School of Webcraft.
  • No break, straight to the next talk! This was at Nairobits. This is where Vicky went to school, and this place has a *fantastic* vibe. It had some amazing murals, and a couple of rooms full of computers and students. The school is funded mostly by the Samsung “Real Dreams” project. Vicky graduated from there, and is now doing web dev and teaching at various places around the city, and mentoring some of the students at Nairobits. Seems like a fantastic program. I’d love to see Mozilla get involved in these kinds of educational programs, to teach Open Web technologies and values.
  • The talk went well, but every computer in the room already had Firefox 4 on it, so we didn’t really surprise anyone :)
  • We grabbed some lunch downtown, and then I headed to the airport for another set of 3 different flights. Optimizing for short layovers on the return trip is possibly not optimal…

Trip Log: Yunnan Province, China

4/2 Kunming, largest city in Yunnan province

4/3 A day in Kunming

4/4 Zhongdian

  • Saw what can only be described as “megahousing” developments outside of Kunming.
  • Factories everywhere, in suburbs outside the city. Saw a red cloud over a valley of factories. Red.
  • Oh look, that is a road. On a cliff along the river. How. The. Hell.
  • Himalayan mountains in the distance? Easily twice as tall as the giant mountains we’re flying over.
  • Land in Zhongdian. Small airport, but clearly new. Full of Tibetan items, and cold-weather gear. It’s COLD.
  • One hour flight, landing at 12,000ft above sea-level. Yeah, we all ended up with mild altitude sickness for the first day. That kinda sucked.
  • Zhongdian was renamed Shangri-La 10 years ago to increase tourism.
  • Yak fields on the way to town.
  • More Jetta cabs. Must be state-mandated.
  • Populace is Tibetan mostly, but many other ethnic minorities present.
  • Pink hat ladies! Scarf tied around hats.
  • Old town. Cobblestone streets. Carved wood structures.
  • Fashion for guys is like 80s bad boy. Or black blazer and slacks… for doing manual labor.
  • Women wearing slave-to-fashion wear, or traditional garb. Not much in between.
  • Lunch spots advertise with bao steamers. Ate at East City North Cooked Wheaten Food King. Had three noodle soups. With yak meat. And dumplings.
  • Land of no salad. Seriously, there’s almost no fresh vegetables in any food we had the whole trip. Always cooked.
  • Last day of Cleaning the Grave holiday. Half the town was in the graveyard as we checked in, lighting off firecrackers by the grave.
  • Checked into the guesthouse. No inside heat in the guesthouses.
  • Meet Alek’s friend Meow Meow (sp?)
  • No running water for 4 months during winter because pipes are frozen.
  • Nightly dancing in both the old-town center, and new-town center. They like to dance.
  • New hotels in new town. I bet they have heat and running water and power all year round.
  • Little Potala palace. Megatemple of Tibetan Buddhism.
  • Shiloh rode a wizardly yak.
  • Yak butter tea. Yak snacks (aka jerky).
  • Tibetan dinner. Creaky wooden restaurant. Cold, only space-heaters. Yak SASHIMI, square noodle soup, meat pie (ground yak).

4/5 Zhongdian

4/6 Zhongdian, Tiger Leaping Gorge

  • Hey, the blankets were quite effective, probably yak wool.
  • Bus to Tiger Leaping Gorge.
  • The hike starts with a nice meandering valley stroll, and nice views.
  • Followed by “24 bends”, a long series of switchbacks.
  • “I smell weed. Or poop.” – Shiloh. It was an old man with grandson in lap, smoking weed out of a long skinny pipe.
  • Ladies along the trail selling bags of weed, saffron and snickers.
  • 7 hours of hiking. Beautiful, amazing views every 5 minutes.
  • Got to Halfway House guesthouse. Sat on the deck, had a beer and checked out the view.
  • Alek has a Chinese name: “Overcoming the power of mugwort”. He’s looking for a new one.
  • Dinner: two mushroom dishes, eggplant, gung pao. Damn.
  • Alek went into the kitchen and found their house-infused baijiao. One was mushroom. Yes, mushroom liquor. The other was olive, papaya, goji berry… and other stuff. Both were surprisingly good.
  • Closed it out with biajiao, beer, tea, cards and Snickers.

4/7 Tiger Leaping Gorge to Lijiang

4/8 Lijiang, Dali

4/9 – Dali

  • Breakfast of bao, black boiled eggs, baba stuffed with carmel sauce.
  • Alec’s out, back to Thailand. All three words of Chinese we know will now be put to the test.
  • Somehow it’s lunch already. Asparagus, tofu, emperor oyster mushrooms with dry-cured ham.
  • Taxi to the cable car. Hike from cable car to chairlift is too long, canceling that. Saw a giant chess set, and a mirror pond.
  • Taxi to the chairlift that we didn’t hike to. Beautiful ride. Look down, oh a grave. Oh look, some more. OHHHHH, thousands of them. Chairlift mountain forest graveyard.
  • At the top, we hike to the Higherland Inn, only thousands of steep steps up the mountain. Zero view. WTF. Head back down the trail to the restaurant with a great view. The place has turtles in a tub… adjacent to all the food that’s on the menu. Hmmm.
  • I got some wild mushrooms. Instructions: soak 3 hours, scramble with egg.
  • Did some shopping in the old city, got some pasta, and headed back to the hotel to chill.
  • Watched a kung fu movie with lots of flying. Saw a commercial for cleavage pills.

4/10 Dali

  • Banana pancakes and fresh melon for breakfast. Off to Xishuang for cormorant fishing.
  • Local market. Saw an awesome computer store. Had noodles that were cut off a giant slab that looked like butter. Found the spice they put on the skewers.
  • Cormorant fishing! Rowed. Sang songs.
  • On the way back, taxi driver took us to the obligatory kickback stop, a marble shop. The Chinese word for marble is “stone from Dali”.
  • Shiloh chilled at the hotel while we rode bikes to the lake. Stopped at a bakery where they had a “selection of mini sandwiches” on the menu. Turns out the mini sandwiches meant “all sandwiches on the menu, put into one”. Fail.
  • Before dinner, got a foot massage, where they had us put our feet in BOILING water.
  • Shiloh got a foot steam bath. Shauna: “OK I can smell foot. It smells like a funk dumpling.”
  • Saw some locals smokin’ tough.
  • Hunted down the wild grilled eggplant for dinner again.

4/11 Back to Kunming

  • Bus to Kunming. Buses here are cheap, and constantly running. Gotta keep your valuables with you. And there’s no bus stops, just people waiting on the side of the highway.
  • Another 5 hours on the road. We passed through Mushroom Town. And went through multi-mile long tunnels.
  • Waited a couple of uneventful hours at the airport, spent our last yuan on tea, and flew home.

Github+Bugzilla Add-on Updated

I updated the add-on to either show which bug it’ll add the patch to, or link to the Enter Bug page on Bugzilla. If you choose to create a new bug, the Bugzilla page will open in a new tab.

The “new bug” scenario is still far too bumpy, requiring you to go to a new tab, get the new bug number, go back to the pull request page, update the pull request title, and then reload the page. Maybe in the next version we could put the new bug page in a panel in the current tab, and then automatically submit the attachment after the bug is created?

Install.

Screenshot of bug detected:

Screenshot of no bug detected:


Badged Widgets with the Firefox 4 Add-on SDK

Earlier tonight, Elisée came into #jetpack with some questions, and we got to talking about badging on widgets. He’d built a solution for his project, but we both agreed it should be easier. It’s something that we’ve gotten quite a few requests for, so using Elisée’s approach, I made a standalone module for badging Widgets.

Module source code (and example).

The BadgedWidget API allows you to specify badge text, background color, and background opacity. The API needs to be properly integrated into the core Widget object, should allow updating each property individually, and a few other niceties (full control over styling?). But for now, here’s a bird in your hand. If you’ve got suggestions, let me know in the comments. Screenshot below.

Screenshot


Github + Bugzilla (an Addon for Firefox 4)

We use Github for the source code of the Firefox Add-on SDK (aka Jetpack). We use Bugzilla to track bugs and feature development. These two systems do not play nicely together.

One especially annoying aspect of the workflow we use for the Add-on SDK is that it’s a pain to submit a change in a way that satisfies both the Github and Bugzilla workflows. On Github you need to create a branch for your change, push it to Github, then go the page for the branch and submit a “pull request”, informing the forkees that you have changes you’d like merged into the main repository. On Bugzilla, the typical process is to attach a diff of your changes to a bug, and request review from a specific person.

Atul Varma improved things with a great idea: Submit an HTML file as a bug attachment, which points to the pull-request page on Github. He added a feature to Pybugzilla that, given a pull-request URL and bug id, would generate the HTML file and submit it as an attachment to the bug. We now had something that was attached to a bug, that a reviewer could r+ or r-, making it easy for anyone following along to know where things were at, while allowing the code review itself to be done inline on Github.

However, using the tool isn’t easy. You have to do your development work, then go to the Github page to make the pull request, then go back to the command line to construct the correct invocation of the command, then back to the Bugzilla page to request review from someone.

So I wrote an add-on to reduce the number of steps. With the Github Bugzilla Tweaks add-on, there’s now a button the Github pull-request page that allows you to submit the request as an attachment on a bug in one-click:

To make it work, just title your pull request starting with “bug ######”, replacing # with the bug id from Bugzilla. The add-on logs into Bugzilla with the stored credentials found in the Firefox password manager.

Install.

Source code.


cmd: Quick Command Execution for Firefox 4

Cmd allows you to quickly execute Firefox’s built-in commands via a small keyboard-activated panel. While many of the browser commands might have keyboard shortcuts, I often do not remember them. Now I don’t have to. This add-on allows me to just type the first few characters and hit enter. This add-on does not require a browser restart.

Install.

Source code.

Usage and features:

  • Launch cmd with control+shift+;. In the next release this will be configurable via a preference.
  • Start typing to see matching commands.
  • Hit the tab key to cycle through multiple matches (shift+tab to cycle backwards). Example: type “pre” and hit tab a bunch of times.
  • Hit enter to select the current match.
  • Hit escape to hide cmd without selecting a command.
  • The last executed command is shown by default.

The available commands are based on all existing menu items and registered keyboard shortcuts that reference <command> elements in the browser.

What I use it for:

  • Executing commands without having to know their keyboard shortcut.
  • Bookmarking without having to click the star, while having it default to Unsorted Bookmarks.
  • Quickly getting to the About page, to check for nightly updates.

Some commands don’t work, like “Subscribe to page”. I would really like this command to work. Perhaps in the future I’ll add an API for creating new commands. This tool will never compare to the extreme power of visual command tools like Ubiquity. However it’s a very lightweight way to access built-in commands without needing to remember their shortcuts, or using the mouse.


Open Letter to the World

We stand at a unique time in our history, the rise of the internet and computer technology have contributed to an unparalleled rate of prosperity for the First World.

We have created for ourselves and empire unlike any other, a global network of constant trade and communication, a new age of technological advancement. We have come a long way from our humble roots in the Industrial Revolution and the days of Manifest Destiny. We are now pioneers on new digital frontiers expanding our domain from the quantum world to the far reaches of space.

And yet, the empire faces a crisis, a global recession, growing poverty, rampant violence, corruption in politics, and threats to personal freedom. As it was before in other times of crisis, the old stories have begun to repeat themselves. The half truths, this time repeated nightly on cable news and echoed through a series of tubes onto the internet: the empire is strong, change is unwise, business as usual is the answer. In times of uncertainty there are those who seek to add to the confusion, to prey on our insecurities and fears. Those who would seek to keep us divided for their own gain. The pervasive strategy takes many very convincing forms: Liberals and Conservatives, Christians and Muslims, Black and White, Saved and sinner.

But something unexpected is happening. We have begun telling each other our own stories. Sharing our lives, our hopes, our dreams, our demons. Every second, day in day out, into all hours of the night the gritty details of life on this earth are streaming around the world. As we see the lives of others played out in our living rooms we are beginning to understand the consequences of our actions and the error of the old ways. We are questioning the old assumptions that we are made to consume not to create, that the world was made for our taking, that wars are inevitable, that poverty is unavoidable. As we learn more about our global community a fundamental truth has been rediscovered: We are not so different as we may seem. Every human has strengths, weaknesses, and deep emotions. We crave love, love laughter, fear being alone and dream for a better life.

You must create a better life.

You cannot sit on the couch watching television or playing video games, waiting for a revolution. You are the revolution. Every time you decide not to exercise your rights, every time you refuse to hear another view point, every time you ignore the world around you, every time you spend a dollar at a business that doesn’t pay a fair wage you are contributing to the oppression of the human body and the repression of the human mind. You have a choice, a choice to take the easy path, the familiar path, to walk willingly into your own submission. Or a choice get up, to go outside and talk to your neighbor, to come together in new forums to create lasting, meaningful change for the human race.

This is our challenge:

A peaceful revolution, a revolution of ideas, a revolution of creation. The twenty-first century enlightenment. A global movement to create a new age of tolerance and understanding, empathy and respect. An age of unfettered technological development. An age of sharing ideas and cooperation. An age of artistic and personal expression. We can choose to use new technology for radical positive change or let it be used against us. We can choose to keep the internet free, keep channels of communication open and dig new tunnels into those places where information is still guarded. Or we can let it all close in around us. As we move in to new digital worlds, we must acknowledge the need for honest information and free expression. We must fight to keep the internet open as a marketplace of ideas where all are seated as equals. We must defend our freedoms from those who would seek to control us. We must fight for those who do not yet have a voice. Keep telling your story.  All must be heard.

- Anonymous


Tracking Firefox UI Response Time

I wrote an add-on for Firefox 4 that tracks how long various parts of the browser’s user-interface take to load. It does not require a restart of the browser.

Click here to install.

  • It measures the duration between ‘popupshowing’ and ‘popupshown’ events. This covers menus, menu-like things, and those floating panels you’re starting to see everywhere.
  • You can see your results at about:response. There won’t be anything there if you just installed the add-on. Browse around for a few days and then check it out.
  • It doesn’t track popups without an id yet. It could also be nicer by showing the containing menu name if available.
  • I’d like to add window load times. What else in the front-end could we be measuring? I was thinking about <command> execution, but there’s not a way to do that without modifying the core, afaict.
  • Perhaps we could add a button for users to submit their anonymized data somewhere.

Try it out, let me know if you have any problems. The source code is available on Github.

about-response-screenshot


Building Add-ons with Jetpack, Flightdeck and… Vim.

AddonEditor is an add-on for Firefox that allows you to use an external editor when building add-ons with the Add-ons Builder (aka Flightdeck). Yeah, say that 10 times fast.

While Skywriter (aka Bespin) is nice, it’s just not [insert your favorite editor here]. So I stole the code from the Ubiquity project for loading an external app as editor, and converted it to a CommonJS module for Jetpack (which I’ve listed on the Jetpack Modules page). I built an add-on using Jetpack’s page-mod module to add buttons to the Add-on Builder for loading a file in an external editor:

When you click the button the first time, you’re prompted with a file-open dialog. Select the editor application of your choice, and the file will open in it. From then on, your chosen editor will automatically load files when you click the button. To clear your choice, choose the other button.

Install AddonEditor. Requires Firefox 4 Beta 7 or newer.

Clone and make your own, based on AddonEditor. I built it using Jetpack 0.10, which isn’t released yet. However, I don’t think it takes advantage of anything new, so it might be test-able from the Builder. But the Builder is giving errors when I hit the “test” button (which I’ve reported to Zalun), so I can’t tell for sure yet.

BEWARE:

  • I’ve only tested on Linux. Let me know in the comments if it works or doesn’t for you.
  • Terminal apps not liked, apparently: /usr/bin/vim hangs Firefox completely. /usr/bin/gvim works fine.
  • The UI augmentation to Flightdeck probably made Zalun puke. It should probably just be an option in the context menu or something. Except that you’d never find it. Ideas?

Firefox, Plugins and Jetpack Widgets

Flash was chewing CPU in one of my myriad tabs, so I used Jetpack and the new AddonsManager API to whip up a quick add-on to enable and disable Flash quickly. It’s <30 lines of code and an image. It puts an icon in the Firefox 4 add-on bar that toggles the plug-in, and sends a Growl notification (or whatever system your OS uses) indicating that the plug-in was successfully enabled or disabled. Screenshot:

Install FlashToggle. Requires Firefox 4 beta 7 or newer.

Clone and make your own on the Add-on Builder. This might require a minor change in the code since I built using Jetpack 0.10, which isn’t released yet. Changing ‘contentURL’ to ‘image’ in the widget options should do the trick.

The entire code listing:

function toggleFlash(callback) {
  const { Cu } = require("chrome");
  Cu.import("resource://gre/modules/AddonManager.jsm", this);
  AddonManager.getAddonsByTypes(["plugin"], function(addons) {
    for (let i = 0; i < addons.length; i++) {
      if (addons[i].name == "Shockwave Flash") {
        addons[i].userDisabled = !addons[i].userDisabled;
        callback(addons[i].userDisabled);
        break;
      }
    }
  });
}

let flashLogoURL = require("self").data.url("flash-logo.jpg");
require("widget").Widget({
  label: "Toggle Flash",
  contentURL: flashLogoURL,
  onClick: function() {
    toggleFlash(function(disabled) {
      let message = "Flash is now " + (disabled ? "disabled" : "enabled") + ".";
      require("notifications").notify({
        title: message,
        iconURL: flashLogoURL
      });
    });
  }
});

Follow

Get every new post delivered to your Inbox.