How Red Hat developers can create handy shortcuts with Firefox keyword bookmarks

How Red Hat developers can create handy shortcuts with Firefox keyword bookmarks

Firefox offers a simple way to enhance the browsing experience. With a little bit of configuration, you can turn the URL bar into a simple command-line tool to search bug databases, Internet RFCs, and CVEs. This comes in handy when you have an ID for a bug, but you do not have a link to click through. For example, if you have a Red Hat Bugzilla ID, just type rhbz <bugid> into Firefox’s search bar and Firefox will take you directly to that bug in Bugzilla.

In this article, after I show how to set up keyword-based bookmarks, I share a list of my shortcuts that I think will be handy for developers working with Red Hat products, projects, and communities.

To use this feature, you must create a bookmark using the full New Bookmark dialog box. You can open this dialog box from the bookmark window. Press Ctrl+Shift+O to access that, or choose Show All Bookmarks from the Bookmarks menu. In that window, you need to choose New Bookmark … in the Organize menu, and the following dialog box will show.

New Bookmark dialog box

A keyword bookmark has a URL that contains a %s sequence (just as in printf) and a keyword name. When the keyword is entered into the URL bar, the URL is not used directly. Instead, the arguments following the keyword are spliced in the URL instead of the %s placeholder. For example, an example keyword bookmark with the URL https://example.com/%s will turn the URL bar command example sample.html into https://example.com/sample.html.

I find the following keyword bookmarks particularly useful. They allow me to access information quickly when someone mentions an identifier on IRC, without pasting a full hyperlink (or a hyperlink going to a different resource that does not provide the information I want to view).

Keyword URL
swbz https://sourceware.org/bugzilla/show_bug.cgi?id=%s
rhbz https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=%s
gcc https://gcc.gnu.org/%s
deb https://bugs.debian.org/%s
rfc http://tools.ietf.org/html/rfc%s
koji https://koji.fedoraproject.org/koji/search?match=glob&type=package&terms=%s
bzsourceware https://bugzilla.redhat.com/buglist.cgi?f1=ext_bz_bug_map.ext_bz_bug_id&f2=external_bugzilla.url&o1=equals&o2=equals&query_format=advanced&v2=https%3A%2F%2Fsourceware.org%2Fbugzilla&v1=%s

The first entry works for bugs in Sourceware Bugzilla, which covers binutils, glibc, elfutils, and a few others. For example, swbz 18665 shows a glibc bug, and since we create CVE aliases for security bugs, you can get the same bug using swbz CVE-2015-7547.

rhbz works in a similar fashion, but with the Red Hat Bugzilla instance, which covers Fedora and most Red Hat products. For example, rhbz CVE-2015-7547 leads to the flaw bug maintained by Red Hat Product Security.

gcc is a little bit different. To view a bug, you need to use gcc PR89225. But you can also use gcc r268597 to view specific revisions in Subversion. (This relies on the fact that the gcc.gnu.org web server has redirects for PR* and r* URLs at the root.)

The deb shortcut allows you to view individual bugs, such as deb 903514, or all bugs for a binary or source package by using deb libc6 or deb src:glibc.

IETF RFCs can be viewed using rfc 1035.

If you want to locate a package in Koji (Fedora’s build system), you can use something like koji binutils.

bzsourceware allows you to perform a reverse lookup on Sourceware bugs in Red Hat Bugzilla (where these bugs have been linked manually). bzsourceware 18665 again provides information about the glibc vulnerability used as an example above. Such keyword bookmarks can be particularly powerful, but since they are derived from what are essentially web application implementation details, they can bitrot over time and need occasional tweaks to keep them working.

The following shortcuts for accessing information in the Customer Portal are specific to Red Hat:

Keyword URL
cve https://access.redhat.com/security/cve/%s
case https://access.redhat.com/support/cases/#/case/%s

cve CVE-2015-7547 shows the same vulnerability in the Customer Portal. (These resources contain customer-facing vulnerability information.) If you have a valid subscription and a case number, you can enter it after case, and you will be directed to the case overview for that case. (Note that this is the customer-facing view; Red Hat associates working in Support have access to the backend, using different URLs and, unfortunately, different IDs as well.

Of course, there are many Red-Hat-internal resources (using internal, non-public URLs) that can be accessed in the same manner.

I hope this little Firefox feature can be as useful to you as it is to me.

Everything you need to grow your career.

With your free Red Hat Developer program membership, unlock our library of cheat sheets and ebooks on next-generation application development.

SIGN UP

 

Join Red Hat Developer (it’s free) and get access to software, cheat sheets, books, and more.

Share