Feed aggregator

comm-press | Drupal in Hamburg: Everyone can test patches. Really! simplytest.me to the rescue!

Planet Drupal - Tue, 12/02/2013 - 23:34

SimplyTest.me launched and I thought, "Wow! This is so great. People can test Drupal without having to get a local dev environment setup." (And I also got patrickd_drupal confused with someone else!) There are situations where a local environment is really important, but sometimes, people just want to test something.

Now, it's even better, because patches can be applied, right in a UI. This will be huge for testing on phones, at sprints (like #SprintWeekend March 9 and 10), and also for things like getting usability and screenreader testers going easier.

Weiterlesen

Categories: Elsewhere

Midwestern Mac, LLC: Need to evaluate a Drupal module, theme, or distro quickly?

Planet Drupal - Tue, 12/02/2013 - 22:48

...there's a site for that.

I just found out about SimplyTest.me today, and it allows you to, well, simply test any Drupal.org-hosted module, theme, or distribution in seconds.

No longer do you need to spin up (or maintain) a live website locally (which usually takes an extra minute or two—at least) just to check out a module or make sure a theme or distribution fits your needs before using it on a live or development site.

Instead of simply getting a screen shot or trying a theme on a demo site, you get a full Drupal 7 website set up and configured with the module/theme/distro, so you can play with it to your heart's content (for 30 minutes if you don't have an account on the site, an hour if you do).

Categories: Elsewhere

John Goerzen: Catching the mudball

Planet Debian - Tue, 12/02/2013 - 18:33

“Dad, can I bring my mudball inside?” – Jacob

“Ooo, dad, I need a mudball too!” – Oliver

You’d have to have been there to see how excited Jacob was about his mudball. We had been out hiking down by the creek a day after a rain, and he, well, made a mudball and carried it around with him. I’m not used to finding mud all that exciting. To me, mud is something that my car can get stuck in, that my boots can drag into the house, that needs to be suppressed by a little gravel on top.

But to Jacob, he was holding a ball of excitement, of adventure, of discovery. And Oliver wanted in on the fun!

Jacob wasn’t thinking about consequences of bringing a mudball indoors, because he didn’t need to. He wasn’t visualizing the damage it could cause, the time of cleaning it up, or even the fact that a mudball doesn’t really stay a mudball permanently. He just wanted to carry his ball of excitement with him.

Being a parent means being a teacher, an example, and a leader. It is fine for Jacob to not think about the consequences of bringing a mudball into the house at age 6, but part of my duty as a parent is to make sure he thinks about consequences by the time he gets behind the wheel of a car. As we grow up, we are shown, taught, and prodded into thinking about consequences of our choices: getting good grades in school, thinking about the impression the clothes we wear to a job interview might leave, worrying about what people think about us when we talk in front of a group. We take on real responsibilities when we leave childhood, and the consequences of our actions become more significant.

But where’s the “off” switch? Shouldn’t there be a way for us to wonder about bringing the mudball indoors, too?

There was a time in our lives when we didn’t care one bit about whether we were wearing fashionable clothes, making a good impression, or doing things the “right” way. After being in the mindset of taking careful responsibility over life for so many years, it’s hard to re-discover that earlier time.

A colleague forwarded a little speech about Thanksgiving. It contained, “Those who live in thanksgiving daily have a way of opening their eyes and seeing the wonders and beauties of this world as though seeing them for the first time.”

This is something children know how to do, and we adults have often forgotten, because we are too busy worrying about dirty floors and stained curtains to see the potential for fun in mud.

I am convinced that, just as important as being responsible, is learning how to let go, to let our hearts feel peace and joy as if a child. We can’t open our eyes and see the wonders of this world if we’re too busy worrying about convincing someone else to vote for our preferred candidate, about saying things perfectly, about being right.

There’s beauty in that daily commute in a car or subway. Look around, and you might see kids with their noses pressed to the window, even if it’s mostly black tunnel outside. There’s wonder in that business flight, in the mud, in the doctor’s office waiting room.

When I see people using insults in a discussion thread on the Internet, I am saddened, because it means they have lost sight of the wonder of being able to communicate with and understand a person thousands of miles away, instantly, and are more worried about their position looking good, or are unable to see the beauty in a person that thinks differently.

I once had this conversation with Jacob in an airplane, probably surrounded by people impatiently waiting to turn on their electronic devices:

“Jacob, we are in the air!”

“Woooooooow!”

“Jacob, we’re flying!”

“Dad, I don’t know that I’ve ever been a butterfly before!”

I hope we can all find ways to be a butterfly more often.

Categories: Elsewhere

Chris Shattuck: 10 FREE new site-building videos released on BuildAModule from the "Advanced Site Building" video collection

Planet Drupal - Tue, 12/02/2013 - 17:08
Feb 12, 2013

This week we roll out the first batch of videos in our "Advanced Site Building for Drupal 7" collection. These videos address the growing importance of the 'site builder' in Drupal site development, what administration tools can help speed up the building process, and how we can quickly set up a prototype site on our local machine. There will be more to come, but if these videos don't get you excited about the power of site building, then ... well, try watching them again on double-speed.

Welcome to "Advanced Site Building"

In this video, we give a quick introduction to the new video series and describe the set of modules we'll be covering, including Panels, Display Suite, Views, Feeds, a slew of administrative tools and more.

About our project and how project roles work

In this video series we build a practical Drupal site for a company called GiftOfGeek, one of those businesses we all wish we worked at that specializes in geeky products like USB-powered phosphorescent Zen gardens. We also take a look at how tasks are typically split across a web team.

What a "site builder" is and the powerful tools they work with

Throughout this series, we'll be focusing on the role of 'site builder'. In this video we explain where that role begins and ends, and the kinds of tools they use to get their work done.

What wireframes are and where to find them in our resource pack

If you talk to anyone who's had to work with clients to build a web site, they'll tell you how dangerous it is to start with a design. Instead, if you distill the major informational components into a black and white 'wireframe', you give the client a sense of what goes where, without issues like colors and padding getting in the way. In this series we begin with some wireframes, and this video shows you where to find them.

Identifying the components in our blog home page wireframe

The first wireframe we look at is our blog home page. Although it's unassuming and seemingly fairly simple, it touches on a number of techniques and Drupal modules that we'll have to understand in order to make it happen. In this video we discuss the various components of the page briefly and link them up with the modules that will help us build it.

Reviewing our blog post and review page wireframes

Our client site is focusing on two major features: a blog and product reviews, and now that we're hopefully getting into our wireframe groove, we wrap up by looking at our blog post and review page wireframes. These wireframes will set a good foundation for us to explore some different ways of laying out content as we work through this series.

About our step-by-step approach

Thinking about our project in terms of modules and tasks can get overwhelming. We're instead going to take a do-one-thing-at-a-time approach that works well in the real world as long as you don't have too many site building coworkers working on the same project. In this video we talk about that approach.

How to set up our Drupal installation with Acquia Dev Desktop

In previous videos we've talked about installing a default Drupal site with Acquia Dev Desktop, but we're also not ones for skipping steps. So in this video we set up our Drupal site exactly the way you're going to see it for the rest of the series.

About the administration modules we'll be using

Before we start building out our site, we're going to install a few modules to help make the building faster and easier. In this video we briefly talk about the modules we'll be installing and why.

How to install a module the traditional way and configure the Administration Menu module

Throughout this series, we're going to be installing a lot of modules. If you're new to Drupal, we're going to illustrate in this video the traditional way to install a module by downloading it and moving it to your module folder. But there's better ways, and we'll be talking about those next. In this video we also configure the Administration menu to replace our existing top-of-the-page menu with a slick drop-down.

How to install a module using Drush, and how we approach installing modules in this series

It's okay to be afraid of the command line, but at BuildAModule we've put together a series of videos that should help you get over that fear. The payoff is that you get to use Drush to speed up many time consuming tasks like installing modules. In this video we show you how you can shave a minute or so off of each module installation, and a bit about how to make sure Drush works properly with our Acquia Dev Desktop installation. From here on out, whenever we install a module, we're going to flash a screen up with information about the module so you can choose whatever method you're comfortable with to install it.

10 FREE new site-building videos released on BuildAModule from the "Advanced Site Building" video collection
Categories: Elsewhere

Drupal Watchdog: Drupl'Art: Relationships

Planet Drupal - Tue, 12/02/2013 - 16:50
Pronounced "drupal-art", noun referring to Drupal code that is both beautiful and artistic.

We previously explored the idea that software is art, one of many creative disciplines. We examined art through the eyes of both the layman and the artisan, and meandered from traditional art to software art. We looked at pseudo code and glanced at PHP. I looked for beautiful code in Drupal core and concluded that Drupal's beauty is not in its code, but in its API's.

Relational Art

Without the relation the artist has with art (the time and attention that goes into the work), or without the relation the art lover has with art (the time viewing, collecting and enjoying the work), art would be nothing more than an object of clay, canvas, or cloth. We find value in objects, but appreciate beauty through connections.

I find the deepest beauty in relational art; paintings and sculptures that embed relations within the art object itself, mostly those that depict people in loving relationships with each other. Renoir’s Luncheon of the Boating Party is a great example, showing multiple interactions of people, pet, food, and drink.

Author Doug Green

Doug is a 25-year veteran of software development, inventor of the coder module, and core contributor. He specializes in creating interpretive language, development tools, and complex or high performance software. He believes software is functional art, and infuses that belief in everything he does.

Categories: Elsewhere

Mike Kadin: The Module Off Challenge #3 Complete!

Planet Drupal - Tue, 12/02/2013 - 16:30

Challenge #3 has just ended at The Module Off! For this challenge, we only had one submission, but it was great work, so I suggest you check out.

Challenge Summary

One of the major purposes of The Module Off is to help along Drupalists who are just learning to do module development. Thus, this challenge will be a little more open ended than the past two. Your module can have whatever user-facing functionality you'd like; it's up to you, and it doesn't need to be complicated. However, your PHP code should demonstrate the ins and outs of EntityFieldQuery, a powerful query builder for quickly getting lists of entities by filtering on their field and property values. You might want to look at the examples module for examples of example modules :). An EntityFieldQuery example never quite made it in. As a head start, you might want to check out the efq_views module to see EFQ in action.

And the Winner!

Congratulations to HAMbrozilla who created a really solid example of how you can extend EntityFieldQuery and use it in your module. Check out the screencast below and head over to The Module Off to download the code.

The Next Challenge!

The next challenge is all about rules. We're hoping to get some great submissions that will help in finding the difference between two entities within the rules interface. Check it out! A free subscription to Drupalize.me goes to the winner!

Categories: Elsewhere

Aten Design Group: Using Fabric for Web Development

Planet Drupal - Tue, 12/02/2013 - 16:30

If your development workflow involves programming on local environments, you may have found it cumbersome to interact with shared development servers. (I for one definitely have!) Here's a simple example: my favorite terminal app is open to a local directory, where I can use Drush, Compass, or other command-line tools to accomplish various task. I then push code to a shared development environment, where I'd like to immediately perform some of those same tasks. And that means I now have to open another tab of my app, find credentials for the remote server, login, and move to the correct directory, right? Not necessarily.

Fabric to the rescue

Several years ago, a few tools started to appear on the horizon that helped with running SSH commands on one or more remote servers. Capistrano and Fabric were the first two that really came across my radar. I ended up choosing Fabric for a couple reasons:

  1. I liked that it was Python, which is really just personal preference.
  2. Fabric seemed more like an SSH tool (which I liked) while Capistrano was a bit more of a distribution tool. Things have changed around a bit, but I still tend to go with Fabric.

So how does Fabric work? You create a "fabfile" which is a Python file or module and you create tasks. Tasks are generally a command or set of commands you want to run bundled into a function. These can be things you want to run locally or on the remote system (or a mix of both). You can create tasks to transfer files or run a quick database backup. You can then run a command like fab mytask and that will run your task or tasks. You can run a single command or multiple.

Here's how I end up configuring things on my own system.

Create a fabfile directory

Somewhere in your home directory, create a directory called "fabfile". Add a Python file called __init__.py in this folder. This is just generally how you create a Python module. I find a module works better for Fabric as we can easily separate our tasks over several files. The file can be blank, but we're going to create a couple of files within our module. For each new file, we will add a new import statement to include that in our Fabric module.

Then I created an alias for this fabfile directory. With Fabric, you can specify a fabfile that is should load, but rather than type "fab --fabfile ~/fabfile" over and over again, we can create an alias: alias myfab="fab --fabfile ~/fabfile".

Next, I like to create two files: hosts.py and server.py. The hosts file is a bit special. The file contains tasks for connecting to a remote host. In Fabric, you can configure your hosts in many ways, but I find using tasks the most useful. Here's an example task:

from fabric.api import task, env   @task def example(environment="dev"): if environment == 'dev': env.hosts.extend(['rob@dev.example.com']) elif environment == 'prod': env.hosts.extend(['rob@example.com'])

So if I want to connect to this host, I run: fab hosts.example (connects to the development environment) or fab hosts.example:prod (connects to the production environment). You can specify more environments, or even multiple servers if you have multiple web servers for example. Note that these connections work best when you are using key-based authentication but Fabric will prompt for any input that it's needs along the way.

Tasks for good

Tasks are limited only by what is available to you via SSH and Python. Along with the hosts file above, we created one for server related commands. I like to store commands here that are useful for dealing with pretty much any server. A couple task examples from that file include:

@task def php_version(): run('php --version')   @task def restart_apache(): """Restart apache""" sudo('/sbin/service httpd restart')

For Drupal specific functions (namely Drush commands), I create a drupal file and include that in my module. The Drupal file contains many different things including functionality to clear the cache, install a new module, and other tasks you might want to undertake without having to connect to each server and running Drush from there.

@task(alias='dl') def drush_dl(module): """Download a module""" with cd(env.hosts_path): run('drush dl %s' % module)   @task(alias='en') def drush_dis(module): """Disable a module""" with cd(env.hosts_path): run('drush pm-disable %s' % module) run('drush clear-cache all')   @task(alias='en') def drush_en(module): """Enable a module""" with cd(env.hosts_path): run('drush pm-enable %s' % module) run('drush clear-cache all') But what about Drush?

Now some may point out that Drush and many Drush extensions can also accomplish some of this. And that's very true. There are a couple factors that personally draw me to use Fabric though: not every project may have Drush or Drupal available (you may even be working on a non-Drupal site of all things!). Now you have a single interface for running commands across all of your projects. Also, many of the same tasks you create for one project can be used with systems like Jenkins or cron or just other scripts that may need to use an SSH connection. And of course, if you have multiple servers in your production or developments environments, you can run the same task on all of them using Fabric, instead of one at a time. The possibilities are not limited of course to what I've demonstrated here and you can use them with systems outside of a normal PHP/MySQL stack.

Check out Fabric and see what it can help with in your development processes!

Categories: Elsewhere

S1L: Measuring email campaign sales with Drupal Commerce and MailChimp

Planet Drupal - Tue, 12/02/2013 - 16:16

Measuring how much sales are generated from an email campaign becomes easy with Commerce MailChimp module. It connects your Drupal Commerce store to MailChimp, giving you intelligence about how certain email campaigns are performing. You can use that information to create messages that seemlessly fit the needs of your customer. In general the more you're able to meet customer needs the healtier your business will be, so let's have a look at how we do that.

MailChimp campaign ROI with Drupal Commerce

This tutorial shows you the R-part of your ROI for your MailChimp email campaigns. Automatically incorporating the investment part can be a bit more tricky - think labor cost, advertising cost, etc. MailChimp's Analytics360 can help you connecting your website traffic tool to MailChimp campaign data. This would require you to send Drupal Commerce eCommerce data to your website traffic tool. Modules like Commerce Google Analytics can help you with that. Contact me if you'd like to see an article about that (or know about an article I can link to).

Configure a Drupal Commerce store

You'll need a Drupal Commerce store for this. You can easily install a Drupal Commerce store with my basic guide on how to work with Commerce Kickstart. Commerce Kickstart allows you to install a fully functional Drupal Commerce store from scratch.

Configure MailChimp module

Make sure you configured MailChimp module for Drupal. If not, have a look at this tutorial on how to configure it the right way.

Configure Commerce MailChimp module

Drupal Commerce needs to send its order data to your MailChimp account. Learn how to set that up in this tutorial on how to connect Drupal Commerce to MailChimps eCommerce360.

Enable Ecommerce360 in your MailChimp Campaign

If you’ve never created a MailChimp campaign before have a look at this tutorial on how to do it.

At the second step of creating an email campaign from your MailChimp account, make sure to click on the ‘even more options’ setting and check the box at ‘Add Ecommerce360 Tracking To All URLs’.

View the Reports

Purchases made after clicking a link in this email campaign will be accumulated to the total sales revenue of the campaign.
You can see what sales where made through a certain campaign. To view these sales click on the ‘Reports’ tab in your MailChimp account. Click on the title of the campaign you want to see eCommerce statistics from, and click ‘Ecommerce Reports’. You’ll be presented with a screen like below. After a while the campaigns eCommerce data will show up. 

More about viewing the MailChimp eCommerce360 data in this MailChimp tutorial.

 

Category: Drupal Planet Drupal Commerce MailChimp
Categories: Elsewhere

Acquia: Team building: How to spot a budding Drupalist

Planet Drupal - Tue, 12/02/2013 - 15:35
Language Undefined

As a training manager, my job is to help Acquia’s clients develop the skills on their teams through training. I spend time listening to the team leads and matching their requirements to our courses, or our partner's online training services. Over the next couple of months in our training newsletter, I'll be writing advice on how to build and skill up your Drupal team.

Categories: Elsewhere

S1L: Segmenting your email campaign based on Drupal Commerce product purchase activity

Planet Drupal - Tue, 12/02/2013 - 15:15

Having the ability to send a targeted email to all purchasers of ‘product X’ can be priceless.

Think of these example scenarios in case of physical products:

  • you have a great upsell for the product they bought
  • a newer version of the product they bought is released
  • you want to ask people to return the product because it’s defective
  • You want to send a photo of a cat to all customers that purchased a product from your cats product ‘cat’egory
  • Asking your customer how they like the product 2 weeks after they bought it

or in the case when a product is a digital elearning course:

  • Your customers receive weekly emails regarding that weeks lesson from the course they bought.

In all these cases segmenting your list means having the ability to send more targeted emails. The more targeted an email is generally means an increase in chance of you sending a message that actually helps those customers. And because being able to help your customers in general means that you make more money, let's have a look at how you can send a targeted email to all purchasers of one certain Drupal Commerce product.

How it’s made

Let’s see how that works in Drupal. I’m assuming:

You have a Drupal Commerce store

In this tutorial I will be talking about the Drupal Commerce based scenario. You can easily install a Drupal Commerce store with my basic guide on how to work with Commerce Kickstart. Commerce Kickstart allows you to install a fully functional Drupal Commerce store from scratch.

You configured MailChimp module

I'm assuming you're using MailChimp and configured MailChimp module on your Drupal site. If not, have a look at this tutorial on how to configure MailChimp module for Drupal the right way.

You configured Commerce MailChimp module

Drupal Commerce needs to send its order data to your MailChimp list. Learn how to set that up in this tutorial on how to connect Drupal Commerce to MailChimps eCommerce360.

Segmenting based on Drupal Commerce Product

By default segmentation based on product is working out of the box once you’ve setup all the above items correctly. Place a few orders in your Drupal Commerce store. Make sure the email address you’re testing with is on the MailChimp list or make sure to check the ‘Signup to newsletter box’ in those orders. Learn about how to setup a ‘signup during checkout’ pane in this tutorial that shows you how to configure that. http://s1l.org/subscribe-email-list-during-checkout-drupal-commerce-and-...

In MailChimp, create a campaign and click ‘Sent to Segment’. Select ‘Product Purchased’ from the list and you should be able to select the products that you’ve ordered in those test orders you’ve made.

Learn more on how to segment your list from the MailChimp side of things in the tutorial about MailChimp list segmenting based on purchase activity.

Make sure you’ve entered a unique Drupal Commerce product name for each of your products on the product level (and not just for your product displays).

Segmenting based on Drupal Commerce Product Category

To be able to segment your MailChimp list based on product category data you have to place every Drupal Commerce Product into a category. In Drupal Commerce separates products from product displays. Make sure you know the difference between the two, or educate yourself with this guide on Drupal Commerce product displays.

Make sure you understand how MailChimp segmenting works on the MailChimp side of things: it will help you to understand what you’re doing at the Drupal side of things. (MailChimp segmenting tutorial)

Create the Vocabulary

If you haven’t done so yet, add a vocabulary at example.com/admin/structure/taxonomy and add a few terms to it. In this example I’ve created the Vocabulary ‘MailChimp Product Category’ and added 3 terms to it: ‘cat’, ‘dog’ and ‘chimp’.

Create and configure the Term Reference Field 

The second step is to add a Term Reference Field to the product content type. It will reference a term from your Vocabulary. To do this go to example.com/admin/commerce/config/product­variation­types and manage the fields of the product you want to add the Term Reference Field to. You’ll see a screen with options like below:

For this example I named it ‘MailChimp Product Category’. Select ‘Term reference’ as Field Type. Press the ‘save button’.

At the next screen select the Vocabulary you like to use, in my example that’s ‘MailChimp Product Category’ 

Click ‘Save field settings’.

At the next screen leaving everything to default is ok. Save settings.
A little note on using multiple values for this field: setting ‘Number of values’ to 2 or more will work, but only the first term will be sent to MailChimp when a product is categorized into 2 or more categories.

Multiple product types

If you have multiple product types for which you like to send the category data to MailChimp: use ‘Add existing field’ for the other product types.

Manage Display

If you want to hide the ‘MailChimp product category’ for your customers, go to the ‘Manage Display’ tab and move the field to the ‘Hidden’ section.

Categorize the Products

Now go to example.com/admin/commerce/products. This shows you a list of products. Edit the products to put them in a category. In case you have a Commerce Kickstart installation: this url will now technically list Display products. Edit them and you can access & edit the products.

Again be aware of the fact that MailChimp only supports one category term per product. Selecting multiple Taxonomy Terms for a product is possible from within Drupal, but only the first will be sent to MailChimp.

Select what Term Reference Field to use for MailChimp

Now that you’ve created the Vocabulary and assigned a term to each product, you have to select the category is going to be sent to MailChimp along with the other eCommerce data.
In Drupal that means selecting the right Term Reference Field in the Commerce MailChimp settings at example.com/admin/commerce/config/mailchimp 

Don't forget to save. 

Now make a couple of test product purchases, and create a segmented MailChimp campaign based on product category: the categories of the product purchases you made should show up. 

Category: Drupal Planet Drupal Commerce MailChimp
Categories: Elsewhere

Tigerfish: Drupal 7: A sensible structure for the modules folder

Planet Drupal - Tue, 12/02/2013 - 14:23
Site-specific modules can be a bit tricky as there's no fixed structure to use, but we've come up with what we think is the ideal solution, and we thought we'd share!

It seems we're using an ever-increasing number of modules on our Drupal 7 sites, which are getting progressively more complex as clients (understandably) want more features, more eye candy and more value for their money. Some modules are downloaded from drupal.org, some are modified, some are written completely from scratch, and even features are modules. We've come up with a simple organisational method which we think ought to keep everything organised, and we thought we'd share this and let you have your say.

Blogs: Drupal PlanetTags: CheltenhamDrupalDrupal DesignDrupal DevelopmentPHPTigerfishWeb Development
Categories: Elsewhere

Martin Pitt: umockdev: record and mock hardware for debugging and testing

Planet Debian - Tue, 12/02/2013 - 13:39
What is this?

umockdev is a set of tools and a library to mock hardware devices for programs that handle Linux hardware devices. It also provides tools to record the properties and behaviour of particular devices, and to run a program or test suite under a test bed with the previously recorded devices loaded.

This allows developers of software like gphoto or libmtp to receive these records in bug reports and recreate the problem on their system without having access to the affected hardware, as well as writing regression tests for those that do not need any particular privileges and thus are capable of running in standard make check.

After working on it for several weeks and lots of rumbling on G+, it’s now useful and documented enough for the first release 0.1!

Component overview

umockdev consists of the following parts:

  • The umockdev-record program generates text dumps (conventionally called *.umockdev) of some specified, or all of the system’s devices and their sysfs attributes and udev properties. It can also record ioctls that a particular program sends and receives to/from a device, and store them into a text file (conventionally called *.ioctl).
  • The libumockdev library provides the UMockdevTestbed GObject class which builds sysfs and /dev testbeds, provides API to generate devices, attributes, properties, and uevents on the fly, and can load *.umockdev and *.ioctl records into them. It provides VAPI and GI bindings, so you can use it from C, Vala, and any programming language that supports introspection. This is the API that you should use for writing regression tests. You can find the API documentation in docs/reference in the source directory.
  • The libumockdev-preload library intercepts access to /sys, /dev/, the kernel’s netlink socket (for uevents) and ioctl() and re-routes them into the sandbox built by libumockdev. You don’t interface with this library directly, instead you need to run your test suite or other program that uses libumockdev through the umockdev-wrapper program.
  • The umockdev-run program builds a sandbox using libumockdev, can load *.umockdev and *.ioctl files into it, and run a program in that sandbox. I. e. it is a CLI interface to libumockdev, which is useful in the “debug a failure with a particular device” use case if you get the text dumps from a bug report. This automatically takes care of using the preload library, i. e. you don’t need umockdev-wrapper with this. You cannot use this program if you need to simulate uevents or change attributes/properties on the fly; for those you need to use libumockdev directly.
Example: Record and replay PtP/MTP USB devices

So how do you use umockdev? For the “debug a problem” use case you usually don’t want to write a program that uses libumockdev, but just use the command line tools. Let’s capture some runs from libmtp tools, and replay them in a mock environment:

  • Connect your digital camera, mobile phone, or other device which supports PtP or MTP, and locate it in lsusb. For example Bus 001 Device 012: ID 0fce:0166 Sony Ericsson Xperia Mini Pro
  • Dump the sysfs device and udev properties: $ umockdev-record /dev/bus/usb/001/012 > mobile.umockdev
  • Now record the dynamic behaviour (i. e. usbfs ioctls) of various operations. You can store multiple different operations in the same file, which will share the common communication between them. For example: $ umockdev-record --ioctl mobile.ioctl /dev/bus/usb/001/012 mtp-detect $ umockdev-record --ioctl mobile.ioctl /dev/bus/usb/001/012 mtp-emptyfolders
  • Now you can disconnect your device, and run the same operations in a mocked testbed. Please note that /dev/bus/usb/001/012 merely echoes what is in mobile.umockdev and it is independent of what is actually in the real /dev directory. You can rename that device in the generated *.umockdev files and on the command line. $ umockdev-run --load mobile.umockdev --ioctl /dev/bus/usb/001/012=mobile.ioctl mtp-detect $ umockdev-run --load mobile.umockdev --ioctl /dev/bus/usb/001/012=mobile.ioctl mtp-emptyfolders
Example: using the library to fake a battery

If you want to write regression tests, it’s usually more flexible to use the library instead of calling everything through umockdev-run. As a simple example, let’s pretend we want to write tests for upower.

Batteries, and power supplies in general, are simple devices in the sense that userspace programs such as upower only communicate with them through sysfs and uevents. No /dev nor ioctls are necessary. docs/examples/ has two example programs how to use libumockdev to create a fake battery device, change it to low charge, sending an uevent, and running upower on a local test system D-BUS in the testbed, with watching what happens with upower --monitor-detail. battery.c shows how to do that with plain GObject in C, battery.py is the equivalent program in Python that uses the GI binding. You can just run the latter like this:

umockdev-wrapper python3 docs/examples/battery.py

and you will see that upowerd (which runs on a temporary local system D-BUS in the test bed) will report a single battery with 75% charge, which gets down to 2.5% a second later.

The gist of it is that you create a test bed with

UMockdevTestbed *testbed = umockdev_testbed_new ();

and add a device with certain sysfs attributes and udev properties with

gchar *sys_bat = umockdev_testbed_add_device ( testbed, "power_supply", "fakeBAT0", NULL, /* attributes */ "type", "Battery", "present", "1", "status", "Discharging", "energy_full", "60000000", "energy_full_design", "80000000", "energy_now", "48000000", "voltage_now", "12000000", NULL, /* properties */ "POWER_SUPPLY_ONLINE", "1", NULL);

You can then e. g. change an attribute and synthesize a “change” uevent with

umockdev_testbed_set_attribute (testbed, sys_bat, "energy_now", "1500000"); umockdev_testbed_uevent (testbed, sys_bat, "change");

With Python or other introspected languages, or in Vala it works the same way, except that it looks a bit leaner due to “proper” object semantics.

Packages

I have a packaging branch for Ubuntu and a recipe to do daily builds with the latest upstream code into my daily builds PPA (for 12.10 and raring). I will soon upload it to Raring proper, too.

What’s next?

The current set of features should already get you quite far for a range of devices. I’d love to get feedback from you if you use this for anything useful, in particular how to improve the API, the command line tools, or the text dump format. I’m not really happy with the split between umockdev (sys/dev) and ioctl files and the relatively complicated CLI syntax of umockdev-record, so any suggestion is welcome.

One use case that I have for myself is to extend the coverage of ioctls for input devices such as touch screens and wacom tablets, so that we can write some tests for gnome-settings-daemon plugins.

I also want to find a way to pass ioctls back to the test suite/calling program instead of having to handle them all in the preload library, which would make it a lot more flexible. However, due to the nature of the ioctl ABI this is not easy.

Where to go to

The code is hosted on github in the umockdev project; this started out as a systemd branch to add this functionality to libudev, but after a discussion with Kay we decided to keep it separate. But I kept it in git anyway, given how popular it is today. For the bzr lovers, Launchpad has an import at lp:umockdev.

Release tarballs will be on Launchpad as well. Please file bugs and enhancement requests in the git hub tracker.

Finally, if you have questions or want to discuss something, you can always find me on IRC (pitti on Freenode or GNOME).

Thanks for your attention and happy testing!

Categories: Elsewhere

Jon Dowland: squishyball

Planet Debian - Tue, 12/02/2013 - 10:39

On Friday, I uploaded an initial package for squishyball to Debian experimental. It's now in the NEW queue.

squishyball is a command-line tool to help you compare two audio files. It supports basic A/B testing, A/B/X testing and X/X/Y ("triangle") tests to help rule out various selection, confirmation and ordering biases. I'm using it to figure out the optimal lossy audio codec and bitrate to encode my music collection with.

It can be a little fiddly to use if you also use pulseaudio. I specify a specific ALSA device via -d, identified via aplay -L, and keep alsamixer running in a separate window to adjust volume if necessary, since GNOME's volume control shortcuts effect the pulseaudio mixers only. This way I can use headphones via the onboard analog stereo output and leave my desktop session configured to use HDMI output.

For the time being, I've disabled support for the OPUS audio format. This is to prevent squishyball (GPL) from linking against libssl, which is pulled in by libopusfile. A future version of the package might manage to make this work.

Categories: Elsewhere

Petter Reinholdtsen: "Electronic" paper invoices - using vCard in a QR code

Planet Debian - Tue, 12/02/2013 - 10:30
Here in Norway, electronic invoices are spreading, and the solution promoted by the Norwegian government require that invoices are sent through one of the approved facilitators, and it is not possible to send electronic invoices without an agreement with one of these facilitators. This seem like a needless limitation to be able to transfer invoice information between buyers and sellers. My preferred solution would be to just transfer the invoice information directly between seller and buyer, for example using SMTP, or some HTTP based protocol like REST or SOAP. But this might also be overkill, as the "electronic" information can be transferred using paper invoices too, using a simple bar code. My bar code encoding of choice would be QR codes, as this encoding can be read by any smart phone out there. The content of the code could be anything, but I would go with the vCard format, as it too is supported by a lot of computer equipment these days.

The vCard format support extentions, and the invoice specific information can be included using such extentions. For example an invoice from SLX Debian Labs (picked because we ask for donations to the Debian Edu project and thus have bank account information publicly available) for NOK 1000.00 could have these extra fields:

X-INVOICE-NUMBER:1 X-INVOICE-AMOUNT:NOK1000.00 X-BANK-ACCOUNT-NUMBER:16040884339 X-BANK-IBAN-NUMBER:NO8516040884339 X-BANK-SWIFT-NUMBER:DNBANOKKXXX

The X-BANK-ACCOUNT-NUMBER field was proposed in a stackoverflow answer regarding how to put bank account information into a vCard.

The complete vCard could look like this:

BEGIN:VCARD VERSION:2.1 ORG:SLX Debian Labs Foundation ADR;WORK:;;Gunnar Schjelderups vei 29D;OSLO;;0485;Norway URL;WORK:http://www.linuxiskolen.no/slxdebianlabs/ EMAIL;PREF;INTERNET:sdl-styret@rt.nuug.no REV:20130212T095000Z X-INVOICE-NUMBER:1 X-INVOICE-AMOUNT:NOK1000.00 X-BANK-ACCOUNT-NUMBER:16040884339 X-BANK-IBAN-NUMBER:NO8516040884339 X-BANK-SWIFT-NUMBER:DNBANOKKXXX END:VCARD

The resulting QR code created using qrencode would look like this, and should be readable (and thus checkable) by any smart phone, or for example the zbar bar code reader and feed right into the approval and accounting system.

The extension fields will most likely not show up in any normal vCard reader, so those parts would have to go directly into a system handling invoices. I am a bit unsure how vCards without name parts are handled, but a simple test indicate that this work just fine.

Categories: Elsewhere

Wunderkraut blog: Netbeans saved me from my own stupidity

Planet Drupal - Tue, 12/02/2013 - 09:50

So I did some work on the module Semantic fields, to do it exportable. Did some patches, uploaded them and everything seemed ok, not so much activity in the issue queue so nobody else tested my stuff. So I deleted my folder with Semantic fields so I could test the patches myself. Then I realised I forgot to add important files to my patches - the new files with the exportability.

Netbeans have a nice history feature (I am using Netbeans 7.2.1), and you could easily go back in the history to fix terrible new things to nice old things, if needed. But I did not have the files anymore. So I started from the beginning, created the files again, and just by chance I took a look of the history of the new file. And, hey! There were a history. When I created the files with the same names I got the old history back. That was really a nice feture I was not aware of. So thanks Netbeans for helping a really stupid coder out.

Categories: Elsewhere

Web Wash: Using Simple Hierarchical Select Module in Drupal 7

Planet Drupal - Tue, 12/02/2013 - 08:47

The Simple hierarchical select module or SHS for short implements a widget element that allows users to drill down through a hierarchical list of terms within a vocabulary. The module implements a custom formatter, widget and Views filter. You can create a views listing page that allows users to filter content using SHS. The module only works with vocabulary terms so you'll need to have Taxonomy enabled to use this module.

Categories: Elsewhere

10jumps Blog: What's new in Drupal 8

Planet Drupal - Tue, 12/02/2013 - 06:47

 

Hey all now days Drupal community is very hard at work in developing Drupal 8. If you are passionate about Drupal and want to contribute to Drupal 8 but not finding any source to start then this is blog can help you.

What we will cover in this blog :-

1       How to take Drupal 8 stable core to your local machine and start developing with it.

2       What's new in Drupal 8?

3       Some explanation of changes with code.

Below are the steps to setup Drupal 8 stable core to local machine. I am hoping you have GIT installed in your machine.

1       git clone --branch 7.x  http://git.drupal.org/project/drupal.git

2       cd Drupal

3       git checkout 8.x

If you want to go back to your D7 version just do " git checkout 7.x " . For updating your Drupal 8 core do "git pull " . It will update your Drupal 8 code instance .

Now you can start building your custom modules , Themes for Drupal 8 .

In Drupal 8 till now what community has updated has many changes in core . Below is link of list of changes in Drupal 8 .

http://drupal.org/list-changes/drupal

You can check out each change and start writing your code with Drupal 8 .

Menu change example :-In D8 menu links are converted into entities . So in order to create new menu in Drupal 8 you can do like this .

 

<?php $menu_link = entity_create('menu_link', array( 'link_title' => t('Home'), 'link_path' => '<front>', 'menu_name' => 'main', )); $menu_link->save(); ?> Saving menu links with Drupal 8 :- <?php $menu_links = entity_load_multiple_by_properties('menu_link', array('link_path' => $link_path)); foreach ($menu_links as $menu_link) { $menu_link->link_title = t('New link title'); $menu_link->save(); } ?> Some changes are also happens with hooks like :- hook_menu_link_alter() has been replaced by hook_menu_link_presave() hook_translated_menu_link_alter() has been replaced by hook_menu_link_load().

 

 

 

Below are some other links which give you information about Drupal 8 development , roadmap , Documentation , code , contributors , IRC channels , meeting times etc.

http://drupal.org/community-initiatives/drupal-core

http://drupal.org/update/modules/7/8

 

This is link to video which drive you through some custom code development in Drupal 8 .

http://sydney2013.drupal.org/program/core-conversations

 

Some other links for understanding architecture and developing in Drupal 8 :-

http://drupal.org/node/1911346

 

Please feel free to comment and send your queries to me .

Categories: Elsewhere

Aaron Winborn: Open Source Software Developer with Terminal Illness Hopes to Opt Out of Death

Planet Drupal - Tue, 12/02/2013 - 04:29

TLDR: http://venturist.info/aaron-winborn-charity.html

So maybe you've heard about my plight, in which I wrestle Lou Gehrig in this losing battle to stay alive. And I use the phrase "staying alive" loosely, as many would shudder at the thought of becoming locked in with ALS, completely paralyzed, unable to move a muscle other than your eyes.

But that's only half the story. Wait for the punchline.

As if the physical challenges of adapting to new and increasingly debilitating disabilities were not enough, my wife and two young daughters are forced to watch helplessly as the man they knew loses the ability to lift a fork or scratch an itch, who just two years ago was able to lift his infant daughter and run with the 7-year-old. The emotional strain on my family is more than any family should have to bear. Not to mention the financial difficulties, which include big purchases such as a wheelchair van and home modifications, and ultimately round the clock nursing care, all of it exacerbated by the fact that we have had to give up my income both because of the illness and to qualify for disability and Medicaid.

Meet me, Aaron Winborn, software developer and author of Drupal Multimedia, champion of the open source software movement.

Years ago, I worked for the lady of death herself, Elisabeth Kübler-Ross, the author of On Death and Dying. Of course, I knew that one day I would need to confront death, but like most people, I assumed it would be when I was old, not in the prime of my life. Not that I'm complaining; I have lived a full life, from living in a Buddhist monastery to living overseas, from marrying the woman of my dreams to having two wonderful daughters, from teaching in a radical school to building websites for progressive organizations, from running a flight simulator for the US Navy to working as a puppeteer.

I accept the fact of my inevitable death. But accepting death does not, I believe, mean simply rolling over and letting that old dog bite you. Regardless of the prevalent mindset in society that says that people die and so should you, get over it, I believe that the reality we experience of people living only to a few decades is about to be turned upside down.

Ray Kurzweil spells out a coming technological singularity, in which accelerating technologies reach a critical mass and we reach a post-human world. He boldly predicts this will happen by the year 2045. I figured that if I could make it to 2035, my late 60s, that I would be able to take advantage of whatever medical advances were available and ride the wave to a radically extended lifespan.

ALS dictates otherwise. 50% of everyone diagnosed will die within 2 to 3 years of the onset of the disease. 80% will be gone in 5 years. And only 10% go on to survive a decade, most of them locked in, paralyzed completely, similar to Stephen Hawking. Sadly, my scores put me on the fast track of the 50%, and I am coming up quickly on 3 years.

Enter Kim Suozzi.

On June 10 of last year, her birthday, which is coincidentally my own, Kim Suozzi asked a question to the Internet, "Today is my 23rd birthday and probably my last. Anything awesome I should try before I die?" The answer that she received and acted on would probably be surprising to many.

On January 17, 2013, Kim Suozzi died, and as per her dying wish, was cryonically preserved.

She was a brave person, and I hope to meet her someday.

So yes, there we have it. The point that I am making with all this rambling. I hope to freeze my body after I die, in the hope of future medical technologies advancing to the point where they will be able to revive me.

The good news is that in the scheme of things, it is not too terribly expensive to have yourself cryonically preserved. You should look at it yourself; most people will fund it with a $35K-200K life insurance policy.

The bad news for me is that a life insurance policy is out of the question for me; a terminal illness precludes that as an option. Likewise, due to the financial hardships in store for us, self-funding is also out of the question.

When I learned about Kim Suozzi's plight, I reached out to the organization that set up the charity that ultimately funded her cryopreservation. The Society for Venturism, a non-profit that has raised funds for the eventual cryopreservation of terminally ill patients, agreed to take on my case.

Many of you reading this post have already helped out in so many ways. From volunteering your time and effort to our family, to donating money towards my Special Needs Trust to help provide a cushion for the difficult times ahead.

I am so grateful for all of this. It means so much to me and my family to know that there is such a large and generous community supporting us. I hate to ask for anything more, especially for something that may seem like an extravagance.

But is it really an extravagance?

If I were to ask for $100,000 for an experimental stem cell treatment, I doubt that we would even be having this conversation. No one in their right mind would even consider a potentially life-saving procedure to be an extravagance.

And what is cryonics, but a potentially life-saving procedure?

People choose from among many options for their bodies after death. Some choose to be buried, some choose cremation. Some choose to donate their bodies to science. That last is precisely what happens with cryonics: in addition to helping to answer the obvious question of will future revival from cold storage be possible, many developments in cryonics help modern medicine with the development of better preservation for organ transplantation and blood volume expanders.

Yes, I admit that the chances of it working are slim, but have you looked at the state of stem cell research for ALS lately? Consider that the only FDA approved medication to treat ALS, Rilutek, will on average add 3 months to one's lifespan, and you might begin to see my desperation.

But you should be happy with the life you've had. Why do you want to live forever?

The only reasonable response to that is to ask why do you want to die?

I love life. Every morning, even now with my body half paralyzed, I awaken with a new sense of purpose, excited to take on the day. There is so much I have yet to do. There are books to write, games to create, songs to sing. If I can get the use of my arms and hands again, there are gardens to plant, houses to build, space ships to fly. And oh, the people to love.

So please help me to realize this, my dying wish.

http://venturist.info/aaron-winborn-charity.html

"The most beautiful people we have known are those who have known defeat, known suffering, known struggle, known loss, and have found their way out of the depths. These persons have an appreciation, a sensitivity, and an understanding of life that fills them with compassion, gentleness, and a deep loving concern. Beautiful people do not just happen."

- Elisabeth Kübler-Ross

read more

Categories: Elsewhere

Friendly Machine: Fun with Fonts

Planet Drupal - Tue, 12/02/2013 - 01:09

Modules are the workhorses of a Drupal site. Most are useful, some are essential, but there aren't many that qualify as fun. This tutorial is about one of those rare modules that is actually a real good time, @font-your-face

For many years there were only about a dozen web safe fonts that you could use on your site. It retrospect, it was very boring. In the past couple years, however, things have completely changed. We'll skip the glorious story of CSS3 web typography for now and instead get straight into using @font-your-face to trick out your site with some cool new fonts. 

Getting Started

If you're following this tutorial and you're working with one of our themes, the module will already be installed. If you're not using one of ours then download @font-your-face and install it.

After you're all set up, go take a look at the the list of modules included in the @font-your-face package. 

You'll see that there are quite a few listed here. You won't need most of them unless you are using one of the font services associated with the module. For example, if you're a Typekit customer, enable the Typekit API module to use their fonts on your site.

The only ones we're going to focus on in this tutorial are the core @font-your-face module, @font-your-face UI, Google Fonts API and Local Fonts.

Enabling Fonts

OK, now the fun part starts. Go to Appearance > Theme settings and you should see the @font-your-face tab like in the image below. Go ahead and click on it.

What you should see is a list of your enabled fonts. If you've just installed the module, this page will be empty, but the next thing we're going to do will help fix that. Click "Browse all fonts" at the upper right of the screen and...boom! All the web fonts from Google should be waiting for you.

Selecting Fonts

It will probably take you a while to browse the fonts and you might find it a little overwhelming at first. There are a few ways you can make it easier to find just the right fonts to use on your site. You can just do a little trial and error experimentation - my personal favorite. You can check out a tutorial on how to pair fonts, particularly if web typography isn't your strong suit.

You can also visit sites you think have really cool fonts and take a look at the page source to see what they're using. The perfect tool for this is Firebug, of course, but the old right-click "View Page Source" will often work as well. 

Local Fonts

Let's say you've found a really cool font, but it's not available through Google. That means you'll probably have to pay for that font - not necessarily a bad thing - and then use the Local Fonts component of @font-your-face to add it to your collection. 

Let's keep this simple and go step by step:

  1. Pick your font and make sure it's OK to use it on the web. The vendor should be able to tell you or it will often be listed under a "web fonts" section.
  2. The site you buy your font from will probably provide it in the formats you need (yes, multiple files), but if not you can use the @font-face generator at Font Squirrel.
  3. Come back to your site and upload your font files.

The screenshot above is where you'll upload your fonts. It's located at:

http://yoursite.com/admin/config/user-interface/fontyourface/local_fonts

You may be wondering why you need to upload four separate files to get your font set up. Basically it's a browser thing - you want it to work in as many browsers as possible and naturally there isn't a lot of agreement among the browser makers. Same old story, really.

Moving Right Along...

So now that we have our fonts enabled, let's apply them to some of the elements on our site. Head over to:

http://yoursite.com/admin/appearance/fontyourface

You'll see the main @font-your-face page we visited earlier. Below is a screenshot of our Sparta theme and you can see that the headings have the Lato font applied and the rest mostly use Open Sans.

Changing the fonts that are applied to the various elements is as simple as selecting from the dropdown list. If you want more control, select "Other" from the list of options and a textbox appears and you can manually add them, copy and paste, whatever. That's what I've done in the screenshot above.

That's the ten cent tour of @font-your-face. I love it and even if typography isn't your thing, investing a little time picking out some nice fonts can go a long way toward making your site distinct. 

Categories: Elsewhere

FiveRDesign: The Most Valuable Asset Is Time

Planet Drupal - Tue, 12/02/2013 - 01:00
A post about time constraints preventing valuable contributions to the Drupal community and how to change organisational cultures to make them more community friendly.
Categories: Elsewhere

Pages

Subscribe to jfhovinne aggregator