Elsewhere

Paul Tagliamonte: Docker PostgreSQL Foreign Data Wrapper

Planet Debian - Fri, 19/09/2014 - 03:49

For the tl;dr: Docker FDW is a thing. Star it, hack it, try it out. File bugs, be happy. If you want to see what it's like to read, there's some example SQL down below.

The question is first, what the heck is a PostgreSQL Foreign Data Wrapper? PostgreSQL Foreign Data Wrappers are plugins that allow C libraries to provide an adaptor for PostgreSQL to talk to an external database.

Some folks have used this to wrap stuff like MongoDB, which I always found to be hilarous (and an epic hack).

Enter Multicorn

During my time at PyGotham, I saw a talk from Wes Chow about something called Multicorn. He was showing off some really neat plugins, such as the git revision history of CPython, and parsed logfiles from some stuff over at Chartbeat. This basically blew my mind.

If you're interested in some of these, there are a bunch in the Multicorn VCS repo, such as the gitfdw example.

All throughout the talk I was coming up with all sorts of things that I wanted to do -- this whole library is basically exactly what I've been dreaming about for years. I've always wanted to provide a SQL-like interface into querying API data, joining data cross-API using common crosswalks, such as using Capitol Words to query for Legislators, and use the bioguide ids to JOIN against the congress api to get their Twitter account names.

My first shot was to Multicorn the new Open Civic Data API I was working on, chuckled and put it aside as a really awesome hack.

Enter Docker

It wasn't until tianon connected the dots for me and suggested a Docker FDW did I get really excited. Cue a few hours of hacking, and I'm proud to say -- here's Docker FDW.

Currently it only implements reading from the API, but extending this to allow for SQL DELETE operations isn't out of the question, and likely to be implemented soon. This lets us ask all sorts of really interesting questions out of the API, and might even help folks writing webapps avoid adding too much Docker-aware logic.

Setting it up The only stumbling block you might find (at least on Debian and Ubuntu) is that you'll need a Multicorn `.deb`. It's currently undergoing an official Debianization from the Postgres team, but in the meantime I put the source and binary up on my people.debian.org. Feel free to use that while the Debian PostgreSQL team prepares the upload to unstable.

I'm going to assume you have a working Multicorn, PostgreSQL and Docker setup (including adding the postgres user to the docker group)

So, now let's pop open a psql session. Create a database (I called mine dockerfdw, but it can be anything), and let's create some tables.

Before we create the tables, we need to let PostgreSQL know where our objects are. This takes a name for the server, and the Python importable path to our FDW.

CREATE SERVER docker_containers FOREIGN DATA WRAPPER multicorn options ( wrapper 'dockerfdw.wrappers.containers.ContainerFdw'); CREATE SERVER docker_image FOREIGN DATA WRAPPER multicorn options ( wrapper 'dockerfdw.wrappers.images.ImageFdw');

Now that we have the server in place, we can tell PostgreSQL to create a table backed by the FDW by creating a foreign table. I won't go too much into the syntax here, but you might also note that we pass in some options - these are passed to the constructor of the FDW, letting us set stuff like the Docker host.

CREATE foreign table docker_containers ( "id" TEXT, "image" TEXT, "name" TEXT, "names" TEXT[], "privileged" BOOLEAN, "ip" TEXT, "bridge" TEXT, "running" BOOLEAN, "pid" INT, "exit_code" INT, "command" TEXT[] ) server docker_containers options ( host 'unix:///run/docker.sock' ); CREATE foreign table docker_images ( "id" TEXT, "architecture" TEXT, "author" TEXT, "comment" TEXT, "parent" TEXT, "tags" TEXT[] ) server docker_image options ( host 'unix:///run/docker.sock' );

And, now that we have tables in place, we can try to learn something about the Docker containers. Let's start with something fun - a join from containers to images, showing all image tag names, the container names and the ip of the container (if it has one!).

SELECT docker_containers.ip, docker_containers.names, docker_images.tags FROM docker_containers RIGHT JOIN docker_images ON docker_containers.image=docker_images.id; ip | names | tags -------------+-----------------------------+----------------------------------------- | | {ruby:latest} | | {paultag/vcs-mirror:latest} | {/de-openstates-to-ocd} | {sunlightlabs/scrapers-us-state:latest} | {/ny-openstates-to-ocd} | {sunlightlabs/scrapers-us-state:latest} | {/ar-openstates-to-ocd} | {sunlightlabs/scrapers-us-state:latest} 172.17.0.47 | {/ms-openstates-to-ocd} | {sunlightlabs/scrapers-us-state:latest} 172.17.0.46 | {/nc-openstates-to-ocd} | {sunlightlabs/scrapers-us-state:latest} | {/ia-openstates-to-ocd} | {sunlightlabs/scrapers-us-state:latest} | {/az-openstates-to-ocd} | {sunlightlabs/scrapers-us-state:latest} | {/oh-openstates-to-ocd} | {sunlightlabs/scrapers-us-state:latest} | {/va-openstates-to-ocd} | {sunlightlabs/scrapers-us-state:latest} 172.17.0.41 | {/wa-openstates-to-ocd} | {sunlightlabs/scrapers-us-state:latest} | {/jovial_poincare} | {<none>:<none>} | {/jolly_goldstine} | {<none>:<none>} | {/cranky_torvalds} | {<none>:<none>} | {/backstabbing_wilson} | {<none>:<none>} | {/desperate_hoover} | {<none>:<none>} | {/backstabbing_ardinghelli} | {<none>:<none>} | {/cocky_feynman} | {<none>:<none>} | | {paultag/postgres:latest} | | {debian:testing} | | {paultag/crank:latest} | | {<none>:<none>} | | {<none>:<none>} | {/stupefied_fermat} | {hackerschool/doorbot:latest} | {/focused_euclid} | {debian:unstable} | {/focused_babbage} | {debian:unstable} | {/clever_torvalds} | {debian:unstable} | {/stoic_tesla} | {debian:unstable} | {/evil_torvalds} | {debian:unstable} | {/foo} | {debian:unstable} (31 rows)

Success! This is just a taste of what's to come, so please feel free to hack on Docker FDW, tweet me @paultag, file bugs / feature requests. It's currently a bit of a hack, and it's something that I think has long-term potential after some work goes into making sure that this is a rock solid interface to the Docker API.

Categories: Elsewhere

Jaldhar Vyas: Scotland: Vote A DINNAE KEN

Planet Debian - Fri, 19/09/2014 - 01:39

From the crack journalists at CNN.

Interesting fact: anyone who wore a kilt at debconf is allowed to vote in the referendum.

Categories: Elsewhere

Drupal core announcements: Drupal core updates for September 18th, 2014

Planet Drupal - Thu, 18/09/2014 - 23:43
What's new with Drupal 8?

The big news this week is we're still on one beta-blocker. Patches for the remaining beta blocker are coming rapidly with @effulgentsia, @plach and @fago working hard to get it over the line. Could we have zero beta blockers by DrupalCon?

Other keys issues to land this week include Remove ArrayAccess from FormState - never again deal with random arrays - rejoice - $form_state is a first-class object!. Thanks to @timplunkett and others who helped get this through. If you have any contrib projects accessing $form_state in an array fashion eg $form_state['values']['fooey']; then you need to familiarize yourself with the change record.

In a further sign that Drupal 8 is maturing into a modern HTTP framework, we now have support for a stack-php based middleware this will allow us to clean up how page caching, conent negotiotiaton, implementing ban.module's functionalty, options requests and various other elements of the request processing pipeline work. For more information on middlewares see Stackphp.com and this article or see the list of existing middlewares supported by stack-php, and therefore likely to be compatible with Drupal.

In the same vein Modularize kernel exception handling brought some much needed cleanup to to the way we handle exceptions and enables contrib modules to easily add their own exception handling, particularly for custom REST formats.

Over in Convert UnitTestBase to PHPUnit and Remove UnitTestBase, @sun, @Berdir and @tim.plunkett have been working towards removing Simpletest-based Unit tests. There are plenty of sessions around the future of testing at Drupalcon Amsterdam so be sure to check these out if testing is your thing.

The Consensus Banana is moving full-steam ahead with loads of issues resolved to move classes out of preprocessing and into templates landing this week. Meanwhile in Split Seven's style.css into SMACSS categories @LewisNyman has been making great strides towards bringing sanity to Seven's CSS structure.

@WimLeers, @alexpott and @chx worked tirelessly in Add cacheability metadata to access checks to harmonize our access-checking systems and add cacheability to the access results in the form of an AccessResultInterface, great work!

Over in Remove text_processing option from text fields, expose existing string field types as plain text in UI @Berdir, @Wim Leers, @dawehner consolidated our text field types, an important change for Site Builders.

Finally, PHPStorm 8 has been released with lots of support for Drupal 8 APIs!

Where's Drupal 8 at in terms of release?

Since the last Drupal Core Update on Sept. 4, we've fixed 19 critical issues and 24 major issues, and added 12 criticals and 19 majors. That puts us overall at 97 release-blocking critical issues and 644 major issues.

Where can I help? Top criticals to hit this week

Each week, we check with core maintainers and contributors for the "extra critical" criticals that are blocking other work. These issues are often tough problems with a long history. If you're familiar with the problem-space of one of these issues and have the time to dig in, help drive it forward by reviewing, improving, and testing its patch, and by making sure the issue's summary is up to date and any API changes are documented with a draft change record, we could use your help!

There are also several beta deadline issues that, while not quite critical, will need to be done before the beta if they're to be done at all. The following beta deadline issues are especially important:

More ways to help
  • Now that we're nearing beta, its time to turn our attention to release-blocking criticals.
  • Beta target issues are issues that can be added to Beta 1, Beta 2, or later, but would be best done sooner rather than later for solid beta releases.
  • With a looming beta, now we can ramp up our efforts on contrib modules - there's a sprint at Amsterdam just for that - so put your name on the list if this is your thing.

As always, if you're new to contributing to core, check out Core contribution mentoring hours. Twice per week, you can log into IRC and helpful Drupal core mentors will get you set up with answers to any of your questions, plus provide some useful issues to work on.

You can also help by sponsoring independent Drupal core development.

Notable Commits

The best of git log --since "2014-09-04" --pretty=oneline (200 commits in total):

  • Issue 2333113 by effulgentsia, plach: Add an EntityDefinitionUpdateManager so that entity handlers can respond (e.g., by updating db schema) to code updates in a controlled way (e.g., from update.php).
  • Issue 1857256 by dawehner, xjm, tim.plunkett, jibran, ParisLiakos, hussainweb, pcambra, ekes, InternetDevels, rhabbachi, rdrh555, tstoeckler, oadaeh, Gábor Hojtsy, vijaycs85: Fixed Convert the taxonomy listing and feed at /taxonomy/term/%term to Views.
  • Issue 2333501 by swentel | marcvangend: Implement ThirdPartySettingsInterface in EntityView|FormDisplay.
  • Issue 1740492 by dawehner, damiankloip, dasjo, xjm: Implement a default entity views data handler.
  • Issue 2331019 by slashrsm: Implement ThirdPartySettingsInterface in Vocabulary.
  • Issue 2320157 by moshe weitzman, Wim Leers, penyaskito, tim.plunkett: Generate placeholder content for Field types - essentially devel generate in core.
  • Issue 2329485 by damiankloip, dawehner: Allow permissions.yml files to declare 'permission_callbacks' for dynamic permissions.
  • Issue 1898478 by joelpittet, Cottser, lokapujya, m1r1k, jstoller, er.pushpinderrana, duellj, organicwire, jessebeach, idflood, Jalandhar, Risse, derheap, galooph, mike.roberts, tlattimore, nadavoid, LinL, steveoliver, chakrapani, likin, killerpoke, EVIIILJ, vlad.dancer, podarok, m86 | c4rl: Menu.inc - Convert theme_ functions to Twig.
  • Issue 1915056 by Arla, Berdir, amateescu | catch: Use entity reference for taxonomy parents.
  • Issue 2321745 by larowlan, tim.plunkett: Add #type => 'path' that accepts path but optionally stores URL object or route name and parameters.
  • Issue 474004 by mdrummond, kim.pepper, Wim Leers, jibran, tim.plunkett, joachim | JohnAlbin: Add options to system menu block so primary and secondary menus can be blocks rather than variables - essentially menu block module in core.
  • Issue 2068331 by roderik, slashrsm, pcambra, Sharique, piyuesh23, vijaycs85 | plach: Convert comment SQL queries to the Entity Query API.
  • Issue 2226493 by Berdir, Wim Leers, m1r1k, mr.baileys, andypost, scor, cbr, joelpittet: Apply formatters and widgets to Node base fields.
  • Issue 2302563 by chx, dawehner: Fixed Access check Url objects.

You can also always check the Change records for Drupal core for the full list of Drupal 8 API changes from Drupal 7.

Drupal 8 Around the Interwebs Drupal 8 in "Real Life" Whew! That's a wrap!

Do you follow Drupal Planet with devotion, or keep a close eye on the Drupal event calendar, or git pull origin 8.0.x every morning without fail before your coffee? We're looking for more contributors to help compile these posts. You could either take a few hours once every six weeks or so to put together a whole post, or help with one section more regularly. Read more about how you can volunteer to help with these posts!

Finally special thanks to KatteKrab for assisting with compiling this edition.

Categories: Elsewhere

Drupal Watchdog: The Automagic Speed-Up Cache

Planet Drupal - Thu, 18/09/2014 - 19:05
Feature Motivation

The granularity of cache expiration in Drupal has been a long-standing problem.

One can have the most effective cache in the world, but if it clears entirely on any content change, it is not really workable. A “page” in Drupal can have blocks, listing, entities, regions, and many other objects. When one contained item changes, the container of that item needs to be fully rebuilt; often, that is the whole page, a problem requiring a much-needed solution.

Why can't we just rebuild the parts that have actually changed?

Consider what would be the best case scenario here. Assume that every item listed above can be cached separately. Now if one single entity changes, the following would be our "perfect" page request:

  1. Drupal bootstraps.
  2. Drupal builds the page.
  3. Drupal notices that only the “content” region has changed and retrieves the remaining regions from cache.
  4. Drupal re-builds the content region.
  5. Drupal notices only one listing in the content region has changed and retrieves the remaining blocks from cache.
  6. Drupal builds the “missing” block.
  7. The block contains a listing of entities.
  8. Drupal re-builds the listing, and entity_view() is called on these entities.
  9. Drupal retrieves all entities except the changed one from cache.

We would have a bootstrap, then we would see just one region call, one block call, one listing call, and one entity building call. Is this really possible?

Yes and no.

There are certain implementation limitations – especially around page assets – and a unified caching strategy needs to take them into account.

State of the Art

Render Caching is the saving of HTML content in a storage cache, while retaining assets like CSS and JS files and other “out-of-band” data. It can be used for reconstructing the page content, without changing the state the page would have without render caching active. The render cached HTML markup needs to be removed from the cache, or updated in the cache when the objects used for generation of the markup change.

Categories: Elsewhere

Acquia: Drupal 8 developer experience wins, the PHP Renaissance and more with Angie Byron

Planet Drupal - Thu, 18/09/2014 - 18:06

Part 2 of a 2-part conversation with Angie Byron in front of the cameras at NYC Camp 2014, held at United Nations headquarters in New York. In this part of our conversation, we talk about improvements in the Drupal developer- and learning-experience thanks to the major changes under the hood in Drupal 8; the "PHP Renaissance"; and about being welcomed "back into the fold" of the greater PHP world thanks to the nature of Drupal 8 being a sort of "meta project" (my words) that includes parts of many others.

Categories: Elsewhere

ThinkShout: The Small Business of Open Source

Planet Drupal - Thu, 18/09/2014 - 16:00

This summer, ThinkShout was named the 9th Fastest Growing Private Company in Portland, Oregon. Admittedly, this came as sort of a shock to me and Lev. Over three and a half years, we’ve grown the company from two dudes renting desks in an incubator space to a full-time team of 17 professionals averaging 10 years of experience each. But most of the time, it doesn’t feel like we’ve come up with any secret sauce for running a successful business. We try to listen to our employees and our peers in the industry. We partner with nonprofit clients trying to make the world a better place, and we do our best to treat them with integrity in all aspects of our work - from our design and engineering practices to our approach to project management and our billing process.

Perhaps there are a few things that we do particularly well. We win our fair share of work in coopetition with our peers in the nonprofit tech industry. But then again, in talking with our friends at ZivTech, Gorton Studios, Aten Design Group, Jackson River, Forum One Communications, and others, what we consistently hear is that there is more than enough work to go around in the world of technology for good.

How is that? What are the mechanics of "the small business of open source" that work for all these firms and, more importantly, for their customers?

You could tackle this question from a number of angles. Conventional wisdom suggests that the business value of open source, both in the for-profit and nonprofit sectors, is simply: you get a lot of stuff for free. This is true. With open source, you avoid licensing fees. With an open source platform such as Drupal, you can pick and choose among literally tens of thousands of free tools and extensions.

But this perspective speaks only to open source’s initial customer appeal. It speaks to the coarse outlines of the sales cycle of open source. You can’t just build a sustainable business off the idea that a platform like Drupal provides a lot of stuff for free.

So, what is the guiding principle of growing a small business around open source? For us, it boils down to:

Our customers benefit tremendously from their own contributions to open source.

Put a bit more bluntly:

Our customers benefit from paying us to give away their code.

To illustrate this point, I’d like to run through some of our numbers as a small business of open source. The following statistics are relative to the publication date of this blog post:

  • ThinkShout’s team includes 8 engineers with a total of 4,269 commits to contributed modules hosted on Drupal.org.

  • We actively maintain 24 contributed modules that represent over 100,000 lines of code.

  • The combined installation base of these modules (i.e., the aggregated number of websites using each of these modules) is over 42,000.

Interestingly, our staff has grown 750% from the end of our first quarter. The growth in adoption of our contributed tools by the community (1,400% since the end of Q1 2011) tracks closely with the growth of our quarterly revenues (1,300%).

Obviously, these statistics are only related anecdotally. On their own, they don’t prove that our open source contributions drive our success.

Still, it is interesting to look at some of the statistics around our client work:

  • Averaging the last four $80-$150K Drupal website projects we’ve completed, a typical project in this price range is made up of 36,289 lines of custom code and exported site configuration (excluding the theme, or the implementation of the graphic design).

  • In addition, most of these projects include the release of 1,000-5,000 lines of contributed code. In other words, clients who engage with us on these sorts of projects pay for us either to contribute back major features to a contributed module, or to release one or two stand-alone modules.

  • But what’s most interesting is that each of these projects leverage at least 4 to 5 of the contributed modules that other clients have paid for on previous projects. Each leverages around 20,000 lines of contributed code that our team has written for similar use cases.

Of course, these statistics reflect the significant cost savings to our clients in going with an open source solution. They get a lot of free stuff…

But more importantly, our clients benefit from becoming financially invested in the direction and cultivation of these open source projects. By becoming committers, they are ensured that their requirements will continue to be prioritized in the future development of the modules their website depend on. They benefit too by the tens, sometimes hundreds, of open source developers reviewing their contributed code for bug fixes and improvements.

Moreover, by releasing the code that powers their websites, our clients connect with other organizations with similar requirements who, in turn, will often contribute additional features to these projects over time. As a case in point, we released the Leaflet module, a web-based mapping solution, on behalf of the Intertwine Alliance in the summer of 2011. The Alliance paid for the initial release, which included a modest yet highly-innovative feature set. Since then, 36 different Drupal developers have contributed code to improve the module, and over 4,500 websites have adopted it.

Similarly, we initially released RedHen CRM, a native CRM solution built entirely within Drupal, for a small cohort of nonprofits with similar needs. In this case, we actually got these nonprofits to work together to brainstorm and prioritize their CRM requirements. Pooling funding, this group helped us launch RedHen publicly in the spring of 2012. Since then, over a dozen of our clients have continued to invest in RedHen, and it has been adopted on over 850 websites around the world. Most impressively, those initial clients that funded our early work on RedHen continue to upgrade their sites with each new release, benefitting from hundreds of thousands of dollars of free development.

Client investments in open source present many less tangible benefits as well. While our developers are inspired to support our mission-driven nonprofit customers, they are particularly excited (and therefore, keenly focused) when their work leads to open source contributions. Not only does this lead to high-quality engineering, it helps reduce turnover among our engineering team, which can be costly for clients. Among our team’s contributors to Drupal, our average turnover is less than half of the industry standard in information technology.

For readers of this post who represent agencies that also contribute to open source, I’d be curious if your data and experience track to ours. Business and nonprofit readers whose teams have paid for open source contributions, I’d be curious to hear your stories as well. After all, open source is all about transparency, which we believe makes us a more effective business.

Categories: Elsewhere

Code Karate: Drupal 7 Entity Registration Views, Access and Wait List

Planet Drupal - Thu, 18/09/2014 - 15:53
Episode Number: 168

Following up on the previous Daily Dose of Drupal episode on the Entity Registration module, this episode looks at some of the additional Entity Registration add on modules.

In this episode you will learn:

Tags: DrupalDrupal 7Drupal Planet
Categories: Elsewhere

Jonathan McDowell: Automatic inline signing for mutt with RT

Planet Debian - Thu, 18/09/2014 - 12:00

I spend a surprising amount of my time as part of keyring-maint telling people their requests are badly formed and asking them to fix them up so I can actually process them. The one that's hardest to fault anyone on is that we require requests to be inline PGP signed (i.e. the same sort of output as you get with "gpg --clearsign"). That's because RT does various pieces of unpacking[0] of MIME messages that mean that a PGP/MIME signatures that have passed through it are no longer verifiable. Daniel has pointed out that inline PGP is a bad idea and got as far as filing a request that RT handle PGP/MIME correctly (you need a login for that but there's a generic read-only one that's easy to figure out), but until that happens the requirement stands when dealing with Debian's RT instance. So today I finally added the following lines to my .muttrc rather than having to remember to switch Mutt to inline signing for this one special case:

send-hook . "unset pgp_autoinline; unset pgp_autosign" send-hook rt.debian.org "set pgp_autosign; set pgp_autoinline"

i.e. by default turn off auto inlined PGP signatures, but when emailing anything at rt.debian.org turn them on.

(Most of the other things I tell people to fix are covered by the replacing keys page; I advise anyone requesting a key replacement to read that page. There's even a helpful example request template at the bottom.)

[0] RT sticks a header on the plain text portion of the mail, rather than adding a new plain text part for the header if there are multiple parts (this is something Mailman handles better). It will also re-encode received mail into UTF-8 which I can understand, but Mutt will by default try to find an 8 bit encoding that can handle the mail, because that's more efficient, which tends to mean it picks latin1.

Categories: Elsewhere

Dariusz Dwornikowski: RFS health in Debian

Planet Debian - Thu, 18/09/2014 - 10:50

I am working on a small project to create WNPP like statistics for open RFS bugs. I think this could improve a little bit effectiveness of sponsoring new packages by giving insight into bugs that are on their way to being starved (i.e. not ever sponsored, or rotting in a queue).

The script attached in this post is written in Python and uses Debbugs SOAP interface to get currently open RFS bugs and calculates their dust and age.

The dust factor is calculated as an absolute value of a difference between bugs's age and log_modified.

Later I would like to create fully blown stats for an RFS queue, taking into account the whole history (i.e. 2012-1-1 until now), and check its health, calculate MTTGS (mean time to get sponsored).

The list looks more or less like this:

Age Dust Number Title 37 0 757966 RFS: lutris/0.3.5-1 [ITP] 1 0 762015 RFS: s3fs-fuse/1.78-1 [ITP #601789] -- FUSE-based file system backed by Amazon S3 81 0 753110 RFS: mrrescue/1.02c-1 [ITP] 456 0 712787 RFS: distkeys/1.0-1 [ITP] -- distribute SSH keys 120 1 748878 RFS: mwc/1.7.2-1 [ITP] -- Powerful website-tracking tool 1 1 762012 RFS: fadecut/0.1.4-1 3 1 761687 RFS: abraca/0.8.0+dfsg-1 -- Simple and powerful graphical client for XMMS2 35 2 758163 RFS: kcm-ufw/0.4.3-1 ITP 3 2 761636 RFS: raceintospace/1.1+dfsg1-1 [ITP] .... ....

The script rfs_health.py can be found below, it uses SOAPpy (only python <3 unfortunately).

#!/usr/bin/python import SOAPpy import time from datetime import date, timedelta, datetime url = 'http://bugs.debian.org/cgi-bin/soap.cgi' namespace = 'Debbugs/SOAP' server = SOAPpy.SOAPProxy(url, namespace) class RFS(object): def __init__(self, obj): self._obj = obj self._last_modified = date.fromtimestamp(obj.log_modified) self._date = date.fromtimestamp(obj.date) if self._obj.pending != 'done': self._pending = "pending" self._dust = abs(date.today() - self._last_modified).days else: self._pending = "done" self._dust = abs(self._date - self._last_modified).days today = date.today() self._age = abs(today - self._date).days @property def status(self): return self._pending @property def date(self): return self._date @property def last_modified(self): return self._last_modified @property def subject(self): return self._obj.subject @property def bug_number(self): return self._obj.bug_num @property def age(self): return self._age @property def dust(self): return self._dust def __str__(self): return "{} subject: {} age:{} dust:{}".format(self._obj.bug_num, self._obj.subject, self._age, self._dust) if __name__ == "__main__": bugi = server.get_bugs("package", "sponsorship-requests", "status", "open") buglist = [RFS(b.value) for b in server.get_status(bugi).item] buglist_sorted_by_dust = sorted(buglist, key=lambda x: x.dust, reverse=False) print("Age Dust Number Title") for i in buglist_sorted_by_dust: print("{:<4} {:<4} {:<7} {}".format(i.age, i.dust, i.bug_number, i.subject))
Categories: Elsewhere

Unimity Solutions Drupal Blog: Modify Apache Solr Queries in Drupal

Planet Drupal - Thu, 18/09/2014 - 07:27

In a recent project I got the opportunity to tweak Drupal’s Apache solr queries.In this blog p

Categories: Elsewhere

Jaldhar Vyas: Scotland: Vote NO

Planet Debian - Thu, 18/09/2014 - 06:21
_ __<; </_/ _/__ /> > 7 ) ~;</7 / /> / _*<---- Perth ~ </7 7~\_ </7 \ /_ _ _ |

If you don't, the UK will have to rename itself the K. And that's just silly.

Also vote yes on whether Alex Trebek should keep his mustache.

Categories: Elsewhere

PreviousNext: Report from Drupal Camp Islamabad

Planet Drupal - Thu, 18/09/2014 - 05:42

After Drupal Camp Lahore and Drupal Camp Islamabad earlier this year, I was once again inivited to Drupal Camp Islamabad to present a session on Drupal 8 as a framework.

Categories: Elsewhere

Forum One: Using Acquia Dev Desktop to Set Up a Drupal 8 Code Sprint Environment

Planet Drupal - Thu, 18/09/2014 - 03:10

With Drupal 8 looming on the horizon, everyone is talking about doing their part to contribute. In fact — shameless plug alert — Forum One is running a Drupal 8 Code Sprint tomorrow night! Come on out and code with us. 

Wanting to get involved but new to Drupal development, I wasn’t really sure where to start. Through a Drupal DC meetup, I was introduced to the Drupal Ladder. Following the Drupal Core Ladder, I got a practice Drupal environment set up, got familiar with the issue queue, and tested some patches! Of course, all the issues and patches written and tested for the LEARN portion of the ladder only affect the sandbox version of D8 used in the tutorials, but it gives you a great idea of what to expect.

After working through the Ladder, I felt ready to attend some Drupal code sprints. However, one of the biggest problems new people have at code sprints is setting up their Drupal environment. As a newbie, I found the quickest way to set up a test environment on my Mac was through the Acquia Dev Desktop. This is a stack built specifically for Drupal (it’s pre-loaded with Apache, MySQL, PHP, etc.), so no downloads other than Drupal itself should be necessary. For this tutorial, we’ll be using Acquia Dev Desktop 2 Beta.

Note: although I am using the Mac version, the Windows instructions should be the same.

Installing Acquia Dev Desktop 2 Beta

From the downloads page, click on Mac / Win Download within the, “Get the Acquia Dev Desktop 2 Beta” box at the top of the page. Locate your download file and double click the file to launch the installer.

  • Click Next on the initial screen. The following screen will give you an overview of what is included in the Dev Desktop package: Apache, MySQL, PHP, etc. Review these and click Next.
  • Review the license agreement, click Yes if you accept the terms, and then click Next.
  • Make note of this next screen. This lets you choose the install locations of your stack and Sites folder. I would recommend leaving these as the default selections.

  • The next screen displays the port settings that will be used by Dev Desktop. Do not change these. Simply make note of them and click Next.

  • Review your information, then click Next, then Next again to begin the installation.
  • Once the installation has completed, click on Finish. If the program pops up, minimize it. We must first download a copy of Drupal 8.
Downloading and Setting Up Your Drupal 8 Environment

After installing Dev Desktop, we can now get our Drupal 8 environment running:

  • Download your desired version of Drupal 8 (use Drupal 8.0.x-dev if you are going to help test and develop D8) by clicking on the .tar file for Mac or .zip for PC in the Download column. Be sure to extract the tar/zip folder if your system does not automatically do it!

  • You can place the files inside your Sites folder, or simply leave it where it downloaded. It is advisable to change the name of the directory from “drupalx.x-x.x” to something simpler (e.g. drupal8, drupaltest, d8dev, etc.).
  • Bring back up Acquia Dev Desktop, or launch it. Click on Start with an existing Drupal site located on my computer.

  • For Local codebase folder, select the Drupal root folder you just downloaded and click on Open. You can leave Local site name as is, or change it up.

  • Drupal 8 requires at least PHP 5.4, so select the PHP version 5.4 your Dev Desktop came with.
  • For Database, select Create a new database. You can leave New database name as is, or alter as you like.

  • Click OK, and your site will be imported into Dev Desktop.
  • Select your site from the left, if it is not already selected. At the top of Dev Desktop, click on your Local site URL and it will come up in your default browser.

  • On initial launch, your site should go to /install.php. If not, manually enter /install.php to the end of your site URL (e.g. http://drupal8.local:8083/install.php). Select your language, and click on Save and continue.
  • Leave Standard selected as your installation profile. Click Save and continue.
  • The database info should transfer and auto-fill into the fields, but just in case, enter the following info:
    • Database name: name you created during the import (New database name)
    • Database username: drupaluser or root
    • Leave the password blank
    • Under the Advanced Options: Host: 127.0.0.1 & Port number: 33067

Click on Save and continue once the information has been filled out.

Drupal will now install your site. Once finished, enter whatever you’d like for the site name, email, and user configuration, and your Drupal site should be up and running! Be sure to remember the username and password for the account you created, as this is your main administrator account (user 1).

That’s All, Folks

Installing Acquia Dev Desktop is fairly quick simple if you follow these steps. Don’t let not having a dev environment stop you from participating in Drupal 8 code sprints, as there are plenty of other AMP stacks available to install, making sure you’re comfortable with one goes a long way. With my development environment setup all that’s left to do now is to actually write a patch…Maybe I’ll take care of that during Forum One’s code sprint tomorrow night!

Categories: Elsewhere

Drupal Easy: Run, Don't Walk to Drupal 8 Migrate in Core Sprints

Planet Drupal - Thu, 18/09/2014 - 01:48

Have you always wanted to get involved with Drupal core development but don’t know where to begin? Have a Drupal 6 site that you’re looking to upgrade to Drupal 8? The Drupal 8 Migrate in Core initiative aims to provide a robust and extensible migration path from Drupal 6 and Drupal 7 to Drupal 8. A lot of work has already been done, but we’re looking to increase our throughput by training up some testers and developers to contribute to the cause.

To that end, we’ve planned two in-person events and an ongoing virtual event where you can get some facetime with other contributors to get you up-to-speed on the current progress and how you can help. Development experience isn’t required! It takes all types of contributors to complete a project of this scope. We have opportunities for manual testing, documentation writing, UX, theming, patch testing, and patch creating. If you need more of a challenge, I’m sure that chx, benjy, and mikeryan can find something for you to sink your teeth into!

If you can’t wait to get started, please check out how you can properly configure your system in order to contribute. Even if you just want to do some manual testing, you’ll want to check this out. Once your system is ready to go, then find me in IRC (#drupal-migrate) or find us at an upcoming event.

-->

read more

Categories: Elsewhere

Drupal Association News: Drupal Global Training Day Omsk

Planet Drupal - Wed, 17/09/2014 - 23:33

This post originally ran on the ADCI blog, and has been reposted with their permission.

On August 30th ADCI Solutions and Omsk Drupal community participated in a worldwide event and organized the first Drupal Global Training Day.

This unique program is being conducted around the world since 2012. Every quarter training activities take place in different countries and cities in a single day. The Drupal Association promotes Drupal Global Training Days where various organizations across the globe host free events to bring people into the Drupal community.

Simultaneously with us 36 companies in Rome, London, Sydney, Madrid, Milan, Chicago, New York, Pakistan, India, and other far-away places conducted trainings for Drupal beginners.

Drupal is an advanced platform with open source software, which is developing dynamically, because about six hundred of thousands of developers around the world are constantly working on the project. Drupal is used for websites of any complexity: from blogs to public and government portals. Sites of the White House, The Beatles, Aeroflot, MTV, Forbes, GEO are working on Drupal.

Learning about Drupal

More than forty people came to get and share knowledge, among them were students, programmers, content managers, experienced developers and newbies who are at their start on the Drupal-way. The training program was built so that students first learned what Drupal is, where it comes from and who it is developed by, what its characteristics are, what open source technology and drupal community are. Then followed a report about advantages and disadvantages of Drupal, for what types of projects it is most effective to use.

During the coffee break, we gave T-shirts with the logo of the Omsk Drupal community to the wiiners of our competitions and made a group photo.

Then we moved on to the practical part. Audience took the basic steps of creating a site. Everybody learned how the Drupal looks and what opportunities it gives out of the box. Without writing a single line of code we made a news site with flexible content filters and sponsors' logos in the footer. Drupal allows an individual, a community of users, or an enterprise to easily publish, manage and organize a wide variety of content on a website. Its modular architecture allows you to put together the components you need to build practically any site. For those who have a general idea of ​​how it works, but have no practical experience, the course was an excellent start.

The day ended with a report on theming. Students learned basic rules that should be followed in order that work with the theme was simple and clear, got aquainted with popular themes and learned how to create their own theme effortlessly.

A Community of Amazing People

As it was the first meeting in the new format of the training, we asked the guests to fill out a short feedback questionnaire. We wanted to know what people are interested in, and what they would like to hear next time. Thanks to the participants, we are pleased to see you. Everyone appreciated the initiative of free educational software. Most noted that they came to learn how to work with Drupal, and this training helped them to make the first step. We were pleased to see the live chat during the break, when the speakers are willing to explain something to beginners with a cup of coffee.

Of course, in the technical sense, Drupal is a CMS/CMF, but for thousands of people it is much more. This community is full of amazing people who are open to dialogue and able to inspire. Last year, the Drupal Association registered 2765 Drupal events. Glad that this year we will fill up this number.

Categories: Elsewhere

Don't Panic: A blog about Drupal: Releasing DrupalCamp Gothenburg&#039;s website. Finally!

Planet Drupal - Wed, 17/09/2014 - 23:30

My blog has been suffering alongside my work with DrupalCamp Gothenburg. It's hard work since we're only two guys making it happen this year, and there's a lot done and more to do. It brings me great pleasure to say that we just passed a major mile-stone when releasing the website for DrupalCamp Gothenburg. It's a new take on camp-sites, at least what I can gather. This site wont disappear after a couple of years, when the community looses interest in it. This site will not only promote this year's camp, it will also act as a collection of the earlier sites, tying sessions together, acting like a "blast from the past" - one site to rule them all. 

Why, you might ask? Well, time is limited and since it's hard to get volonteers in Gothenburg to help out, this is a way to tighten the information flow and a way to skip doing the same thing year after year (making, coding and releasing a new site). Instead, we will focus on presenting the information from former DrupalCamps in a good way on the site, perhaps making it more interesting for our sponsors since their sponsoring presence won't disappear after a couple of years.

This year, though, we have a new design, since it's a new take on the website all together, and Daniel Andréasson is the one pulling the strings behind the curtain. He has done a lot of work on it, and I'm truly grateful for his help. His effort has given me the chance to focus on the sponsoring part, talking to hotels to bring good rebates to our visitors during the camp-weekend, and also see if some of all the other ideas might come to life at the camp.

Well, enough talking, head over to the new site and check it out. And, if you're up for the task - add a session and share your Drupal knowledge!

http://gothenburg.drupalcamp.se/

Categories: Elsewhere

Glassdimly tech Blog: Feeds Extensible Parsers JSONPath Tutorial: Map JSON to Drupal Fields

Planet Drupal - Wed, 17/09/2014 - 22:12

Ever have wanted to import data into your Drupal site from JSON or a big ol' PHP array? You don't need to sweat all the gory details of matching up nodes and fields and coding massive for loops. Let the Drupal Feeds module do that for you.

Categories: Elsewhere

DrupalCon Amsterdam: Join In On the Bicycling Fun in Amsterdam

Planet Drupal - Wed, 17/09/2014 - 20:26


In the immortal words of Queen: “all I wanna do is bicycle!” If you’re heck on two wheels and love nothing more than the feeling of the wind on your face and pavement whizzing underneath your wheels, you may want to consider joining in the Tour de Drupal leading up to DrupalCon Amsterdam.

Drupalers from countries all across Europe are teaming up for the Tour de Drupal, an epic bike ride from the UK and Switzerland to Amsterdam. Taking place the weekend before DrupalCon Amsterdam, the triumphant arrival of the Drupalcyclistas is expected on Sunday, September 28th between 4 and 5 PM at Eta Vondelpark in Amsterdam.

It’s not too late to join in on the bike ride, where you can find information here. Of course, if cross-country bicycling doesn’t do it for you but you still want to cruise around with a crew of awesome folks, consider renting a Yellow Bike during DrupalCon Amsterdam. For €50, you can rent a bike, a bike helmet, two bike locks, a bike map of greater Amsterdam, and insurance. The rental is from Monday-Friday. You can find more information here.
There are a lot of passionate bikers in the Drupal community— and we all care about our causes, too. UK Tour de Drupaler Alan Burke is combining his love of biking and charity by participating in a two-day, 360 kilometer cycle around Galway for charity. For more information about Alan’s ride, click here.

Regardless of whether you fly, bike, or take a train— we’re looking forward to seeing you in Amsterdam.

Image by Sonny Abesamis on Flickr.

Categories: Elsewhere

Steve Kemp: If this goes well I have a new blog engine

Planet Debian - Wed, 17/09/2014 - 19:23

Assuming this post shows up then I'll have successfully migrated from Chronicle to a temporary replacement.

Chronicle is awesome, and despite a lack of activity recently it is not dead. (No activity because it continued to do everything I needed for my blog.)

Unfortunately though there is a problem with chronicle, it suffers from a bit of a performance problem which has gradually become more and more vexing as the nubmer of entries I have has grown.

When chronicle runs it :

  • It reads each post into a complex data-structure.
  • Then it walks this multiple times.
  • Finally it outputs a whole bunch of posts.

In the general case you rebuild a blog because you've made a entry, or received a new comment. There is some code which tries to use memcached for caching, but in general chronicle just isn't fast and it is certainly memory-bound if you have a couple of thousand entries.

Currently my test data-set contains 2000 entries and to rebuild that from a clean start takes around 4 minutes, which is pretty horrific.

So what is the alternative? What if you could parse each post once, add it to an SQLite database, and then use that for writing your output pages? Instead of the complex data-structure in-RAM and the need to parse a zillion files you'd have a standard/simple SQL structure you could use to build a tag-cloud, an archive, & etc. If you store the contents of the parsed-blog, along with the mtime of the source file you can update it if the entry is changed in the future, as I sometimes make typos which I only spot once Ive run make steve on my blog sources.

Not surprisingly the newer code is significantly faster if you have 2000+ posts. If you've imported the posts into SQLite the most recent entries are updated in 3 seconds. If you're starting cold, parsing each entry, inserting it into SQLite, and then generating the blog from scratch the build time is still less than 10 seconds.

The downside is that I've removed features, obviously nothing that I use myself. Most notably the calendar view is gone, as is the ability to use date-based URLs. Less seriously there is only a single theme, which is what is used upon this site.

In conclusion I've written something last night which is a stepping stone between the current chronicle and chronicle2 which will appear in due course.

PS. This entry was written in markdown, just because I wanted to be sure it worked.

Categories: Elsewhere

Acquia: Introducing the Drupal 8 Console scaffolding module generator with Jesus Manuel Olivas

Planet Drupal - Wed, 17/09/2014 - 18:10

Every modern framework nowadays provides a scaffolding tool code generator for speeding up the process of starting a new project and avoiding repetitive tasks. Now Drupal does, too! In this session you can build a module while following along with the live demo. You will learn how to take advantage of the Symfony Console Component to provide a CLI tool that automates the creation of Drupal 8 modules, automatically generating the module directory structure, controllers, forms, services, plugins, and required configuration files.

Categories: Elsewhere

Pages

Subscribe to jfhovinne aggregator - Elsewhere