
New Relic is a great bit of kit - nobody can deny that. I recently needed to configure it on a standalone box so it could be open on a large screen so my colleagues and I could see the current status of our sites. New Relic has a Kiosk Mode which strips out some of the navigation from the page an optimises it for "viewing only". Very handy.
I wanted a setting to force (or at least default) the page into Kiosk mode so that when I opened the bookmark on the browser, I didn't have to scroll to the bottom, click it, scroll back up and then refresh any other relevant tabs. It didn't look like there was a feature for this and the Kiosk Mode link was just a java function call; there was no URL.
So I turned to GreaseMonkey.
Enter GreaseMonkeyGreaseMonkey is a Firefox Addon which allows you to bind custom JS scripts to all (or specific) pages. There is a repository of over 74,000 scripts which let you customize all kinds of sites (Twitter, Gmail, Facebook, etc) including Drupal.
However there was nothing for New Relic.
Until now.
Using GreaseMonkey with New RelicAs it turns out, the script is very simple.
// ==UserScript== // @name New Relic Kiosk Mode // @namespace http://www.thingy-ma-jig.co.uk/ // @icon http://www.thingy-ma-jig.co.uk/sites/thingy-ma-jig.co.uk/files/greasemonkey/NewRelic_inline_small.png // @description Force New Relic into Kiosk mode by setting the cookie on page load if ?kiosk is in the URL // @include https://rpm.newrelic.com/*?kiosk // @updateURL http://www.thingy-ma-jig.co.uk/sites/thingy-ma-jig.co.uk/files/greasemonkey/newrelic-kioskmode.user.js // @version 1.0 // ==/UserScript== unsafeWindow.RPM.kioskMode._setCookie();Once the cookie is set, New Relic handles the rest. All you need to do is append "?kiosk" onto the URL (maybe in your bookmarks?) and the page loads in Kiosk mode.
You can install the script by clicking on this button.
Find It On UserScripts.orgI have also added the script to UserScripts.org, for those that are interested.
Have you ever needed or wanted to pull a remote Git Repository on Drupal.org down as a zip or tarball? You know, the way Github does? Most project releases have fairly recently built tarballs which is awesome - but Sandboxes do not (so it seems - please correct me if I'm wrong!).
The following snippet lets you "archive" a remote repository, pull it down as a tarball, and extract it in-place:
git archive --format=tar --prefix=PROJECT/ --remote=USERNAME@git.drupal.org:sandbox/USERNAME/123456789.git BRACH | tar -xf -Some important notes:
I have tried using the "zip" format, however the unzip bash command doesn't accept stdin as a source. It looks like funzip might hold some promise thought…