HollyIT: Vagrant + VirtualBox + New Windows 10 Update = OH NO!

Planet Drupal - mar, 17/11/2015 - 15:23
Categories: DrupalPlanet DrupalTips

A quick post for others that might experience this same problem. Last night Windows 10, with its forced updates, provided me with the big update we've all been waiting for. As I awake, ready to go to work on Drupal 8 upgrades, I tried to start my Vagrant and jump right in. Suddenly I was hit with an error about the connection being in use. Quickly I opened VirtualBox and upgraded that. Once that updated, along with the extension pack, the error still persisted. Trying to open the boxes right from VirtualBox gave me a few more details about the error, but not much more.

Catégories: Elsewhere

Kodamera Screencast: Drupal: Introduction and installation

Planet Drupal - mar, 17/11/2015 - 14:45

Drupal is an awesome CMS (content management system), but it is so much more than just your ordinary blogposting system (though you can use Drupal for that as well). But the road to your own site (and perhaps internet success) must start somewhere, and if you want to set up a local environment on your computer to play around with Drupal (or any other PHP-driven system) you need a program or software to make this happen. In this introductory screencast I show you how to download MAMP and install that on your Macintosh computer, followed by how you download and install Drupal (8, the latest version). Download MAMP MAMP is a bundle of programs, made especially for running a local server on your computer. This means that an installation of Drupal can run on your own computer, not accessible for other people, only for you. To make your webpage accessible for the whole world, you need to upload your files and database to a hosting company of some kind and get some kind of domain name and point that to your hosting companys server. But I'm getting ahead of myself. Back to MAMP. You can find MAMP at https://www.mamp.info/. Download and install the software first of all. The downloaded file ends up in your Downloads folder by default. If you choose some other folder, remember where you put it... Or download it again (yes, we have all made that mistake at least one time.) MAMP is freeware, but you can also buy MAMP Pro which is a more powerful solution if you want to handle or develop many sites simultaneously. Here, we will use the free version of MAMP for this introduction. With MAMP you also get a program called Sequel Pro, which is a program that let's you connect and handle databases. More on that later on. When the installation progress is finished, start the program and press "Start servers". When the on/off-icon turns green, your webserver is up and running. Good job! Download Drupal Next step is to download Drupal. Go to www.drupal.org and choose Download & Extend in the top menu on the page. The Download & Extend page is your first step to downloading Drupal, themes and modules (plugins to Drupal). Is this case we just want to download Drupal, so click the green button. Next up, you get the choice to download different versions of Drupal, but we want the latest version. When we made this screencast the latest version was 8.0.0-rc1, but when you read/watch this, you should just choose the latest version of Drupal, which begins with and 8 (for example: 8.0.0, 8.0.1, 8.1.x etc and so on). The download file (.tar.gz och .zip) ends up in your Downloads-folder (see above). Doubleclick it to extract the files. Get ALL the files, not just the ones you see This is a bit tricky. To make Drupal work, you need all the files you've just extracted. The problem is that some of the files are hidden, and by default Macintosh computers don't show hidden files. There are programs that let you see hidden files, but you can also make the magic happen by writing a simple command in the Terminal program. Click your Spotlight magnifying glass-icon on your computer or open up a Spotlight search via your keyboard (most likely cmd+space) and type in Terminal. Terminal is a terminal emulator included in the OS X operating system by Apple (Wikipedia), and from that you can list files, create folders etc. In short, you can do almost anything you can to in i Finder window - but more. And to make hidden files be visible you open up a terminal windows and type defaults write com.apple.finder AppleShowAllFiles YES Press Enter and on the next line, write killall Finder This sound horrifying, but it's ok, it doesn't kill something you're attached to (your kitten, your parents or your favourite snack or slippers). It just restarts the Finder application on Mac.  By now, if you open the folder the the extracted Drupal files are located in, you should see some files that are halfway see-through. These are the hidden files. Not to hidden now, ey?! Good. Now on to the next step of fun and glory! Choose the web docs folder We need to place the Drupal files in a folder that MAMP can use. If you swich to your MAMP window and press Preferences you can see four tabs: Start/Stop, Ports, PHP and Web server. Click the Web server tab. Here you can see where MAMP will look for the files to execute (run) Drupal. You can choose a completely different folder if you want, but I recommend you to use the folder MAMP suggests which is: Your harddrive > Application > MAMP > htdocs If you click the round icon with an arrow you open up a Finder window that shows the content of the folder we want to use. Let's move all the files Now that we can see all the files, even the hidden ones, we can choose all the files and either drag'n'drop them in the htdocs-folder we just opened.  Choose the Drupalfiles and press cmd+C if you want to copy the files, or drag the files and the folders to the htdocs folder. If you chose to copy and paste the files, just click somewhere in the htdocs window and press cmd+V to paste the copied files into that folder. It should end up looking something like this: Create a database You also need a database for Drupal to work. The database is where your content is stored, at least the text you enter as a blog post or story on your website. (Files you upload doesn't end up in the database, they are stored on the computer's hard drive.) To create a database you can use a program called Sequel Pro, that ships with MAMP. Open up the MAMP applications folder or start Sequel Pro via your Spotlight. Create a connection to the database by entering this information in this way: By default MAMP has set both the Username and Password to root. You also need to enter the port, which in MAMPs case is 8889. You can find this information under the tab named Ports, under MAMP Preferences. Back to Sequel Pro and press the blue button named Connect. If you have entered everything correct you will get connected to the database server. You should see a rather blank window like this. Choose Database in the menu and then Add database.  Choose a name that's easy to remember, for example drupal.  Choose UTF-8 Unicode (utf8) as Database Encoding. End this strange thing by clicking the button named Add. "Are we there yet?" Yes, yes we are. The next step is actually to start the installation of Drupal. Switch to your web browser and enter http://localhost:8888. This instructs MAMP to search the htdocs folder (where you have placed the Drupal files) and see what's there. MAMP will find Drupal's index.php that instructs Drupal to start an installation since we haven't don't that yet. http://localhost:8888 will result in this webpage: If you want some other language than English, you can choose this at this start screen. Language files will automatically load from Drupal's servers and set the default language to whatever you choose. Press Save and continue. Installations profiles Drupal can use installation profiles to make different settings to you system. In this screencast we will only use the standard one, so just click Save and continue during this phase. We will cover installation profiles in a later screencast. Database configuration Now it's time to tell Drupal where to find the database. The only things we need are the name of the database, the database username and password. We have all that so lets type them in. Database name: drupal (we entered that when we created the database earlier) Database username: root (MAMP default) Database password: root (MAMP default) Click Save and continue. Time to configure your site When you have entered the database credentials the installation starts. This will take a minute or so depending on how fast your computer is. It could also take up top 5-10 minutes if you have an older computer. During the installation process Drupal enables all the different parts of Drupal (modules) and sets up the system to make it work. We will cover the different parts in upcoming screencasts. When you see this the installation process is almost finished and it is now time to create your admin account and set the title of your website. Choose some classy and nice information for the following fields: Site name Site email address Username (this will be the first user account, the user/1 account, the head honcho, the big kahuna... you get the picure) Password (password for the big kahuna account, see above) Email address (for the big kahuna account, see above) Default county Default time zone You can also check for updates automatically. This will instruct Drupal to scan to see if there has are any new versions of Drupal and the modules you have downloaded and enabled. Good to know, but not vital if you are just playing around on your local computer. When you go live with your site, you should really see to it to keep your installation updated and secure. That's it! You are done. Drupal is installed and you can begin your Columbus-like journey through the menues and structure of Drupal. In the left part of the website you have the option to create content. Choose to create an Article for example and see what happens. We will make more screencasts on Drupal to make you discover more of Drupal. Check us out on Twitter, our RSS feed or YouTube channel to get continuous updates. Take care!
Read more
Catégories: Elsewhere

ERPAL: How to sell Drupal support with value

Planet Drupal - mar, 17/11/2015 - 13:03

Selling support is not so easy. Mostly you end up with agreements such as getting paid only if there’s a support request. If you want to provide reliable support with a well-defined response time, you need to allocate resources constantly, and that's why you need to get paid separately for the response time.

In this second post of our business support series I'll present you different kinds of support teams and pick up their pros and cons. Read more

Catégories: Elsewhere

Sooper Drupal Themes: How To Improve Your Drupal Site's Traffic Using Google Search Console

Planet Drupal - mar, 17/11/2015 - 10:51

As webmaster or owner of a Drupal website, it’s common practice to look out for new customers. It is also crucial to understand how prospective customers behave when they come to visit your website, and this is possible with the help of Google Analytics. Unfortunately Drupal site owners often fail to see the importance of their websites being properly crawled or indexed by Google. Now, Google has made things easier for businesses with Google Search Console (formerly webmaster tools) by directly communicating with website owners in order to help them get important information.

Google Search Console may not come with the trendiest user interface, but there’s more raw data in there than colorful charts and graphs. Using the system will help you improve your Drupal site's ranking in the Search Engine Results Pages (SERPs) if you take some time to learn how it works.

Let us now try to understand how GSC can help grow your business.

Why Use Google Search Console (GSC)?

Google Search Console is free if you have a Google account. It automatically opens a two-way communication channel between your website and Google. Search Console can help you monitor, maintain, and improve your website presence in Google’s search results. More specifically, once you log into Google Search Console, you will be able to see what search queries are tied to your business and where you could improve your website ranking. You will also be able to manage your website sitemaps, indexing of links, besides determining what Googlebot should be crawling and indexing content from your website.

How to Set Up GSC?

Setting up Google Search Console for your website is simple and easy. If you already have an account, look for it under Search Console. You just have to follow 3 simple steps:

Catégories: Elsewhere

Petter Reinholdtsen: PGP key transition statement for key EE4E02F9

Planet Debian - mar, 17/11/2015 - 10:50

I've needed a new OpenPGP key for a while, but have not had time to set it up properly. I wanted to generate it offline and have it available on a OpenPGP smart card for daily use, and learning how to do it and finding time to sit down with an offline machine almost took forever. But finally I've been able to complete the process, and have now moved from my old GPG key to a new GPG key. See the full transition statement, signed with both my old and new key for the details. This is my new key:

pub 3936R/EE4E02F9 2015-11-03 [expires: 2019-11-14] Key fingerprint = 3AC7 B2E3 ACA5 DF87 78F1 D827 111D 6B29 EE4E 02F9 uid Petter Reinholdtsen <pere@hungry.com> uid Petter Reinholdtsen <pere@debian.org> sub 4096R/87BAFB0E 2015-11-03 [expires: 2019-11-02] sub 4096R/F91E6DE9 2015-11-03 [expires: 2019-11-02] sub 4096R/A0439BAB 2015-11-03 [expires: 2019-11-02]

The key can be downloaded from the OpenPGP key servers, signed by my old key.

If you signed my old key, I'd very much appreciate a signature on my new key, details and instructions in the transition statement. I m happy to reciprocate if you have a similarly signed transition statement to present.

Catégories: Elsewhere

X-Team: Drupal 8: Finally Ready for Production

Planet Drupal - mar, 17/11/2015 - 09:37

It’s been awhile since Drupal 8 was first ready to try out. But even since then, I was checking out news, reading updated docs, working on my Drupal 7 projects… still waiting for something real. And it finally happened – during the keynote at DrupalCon Barcelona, Dries announced the first D8 release candidate and basically...

The post Drupal 8: Finally Ready for Production appeared first on X-Team.

Catégories: Elsewhere

Dirk Eddelbuettel: RcppAnnoy 0.0.7

Planet Debian - mar, 17/11/2015 - 03:54

A new version of RcppAnnoy, our Rcpp-based R integration of the nifty Annoy library by Erik, is now on CRAN. Annoy is a small, fast, and lightweight C++ template header library for approximate nearest neighbours.

This release mostly just catches up with the Annoy release 1.6.2 of last Friday. No new features were added on our side.

Courtesy of CRANberries, there is also a diffstat report for this release.

This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.

Catégories: Elsewhere

Four Kitchens: Austin's Drupal 8 Launch Party Here we come!

Planet Drupal - mar, 17/11/2015 - 03:36

Join us and the rest of the Austin community for a well-deserved par-tay! We have quite the party planned: including BBQ, a cake, a pinata and even a raffle.

Catégories: Elsewhere

Vincent Fourmond: Purely shell way to extract a numbered line from a file

Planet Debian - lun, 16/11/2015 - 22:31
I feel almost shameful to write it down, but as it took me a long time to realize this, I'll write it down anyway. Here's the simplest portable shell one-liner I've found to extract only the, say, 5th line from file:

~ cat file | tail -n +5 | head -n1

Hope it helps...

Catégories: Elsewhere

Drupal @ Penn State: Cache warming authenticated sites with XMLRPC

Planet Drupal - lun, 16/11/2015 - 21:56

This video talks through how XMLRPC Page Load and HTTPRL Spider can be used to warm caches on private / authenticated sites. XMLRPC Page Load provides a callback that tricks Drupal into thinking that it’s delivering a page to certain user account. It does this by simulating page delivery but then never actually writing the output anywhere.

Catégories: Elsewhere

Drupal @ Penn State: The future of Drupal under the hood

Planet Drupal - lun, 16/11/2015 - 21:56

I’m in the middle of several Drupal Camp / Con’s (any event over 1000 people is no longer a “Camp” but that’s for another time) and it’s occured to me: I can no longer learn by going. Now, this is learn in the traditional sense of what I used to go to Camps for (been coming to camps for 8 years now).

Catégories: Elsewhere

Chromatic: TheaterMania: Lessons Learned on Localization

Planet Drupal - lun, 16/11/2015 - 21:28

We recently launched a new site for an existing client, TheaterMania. We helped launch and currently maintain and develop The Gold Club, which is a subscription-based discount theater club in New York City. The new site is the same thing, but in London – same language, same codebase, new database, different servers. We only had to migrate users, which were already exported for us, so nothing exceptional there. Shouldn’t be a big deal, right? We learned that’s not always the case.

Architectural Decisions

One of our first problems, besides the obvious localization issues (currency, date formats, language), was to decide what we were shipping. Were we just building another site? Were we packaging software? There will most likely be more sites in other cities in the future – how far did we want to go in terms of making this a product that we could ship? In the end, we wound up going somewhere in the middle. We had to decide initially if we would use Organic Groups to have one site with multiple “clubs,” one Drupal multisite installation, or multiple Drupal installations. The final decision was to combine the latter two choices – we created multisite-style directories so that if we need to take the site in a multi-site direction, we can easily do that. The sites each have a site-specific settings file, full of various configuration variables.

Now that the site has been launched, we’re not sure if this list of variables will be developer-friendly moving forward, and have been keeping in mind that we may want a more elegant solution for this. The best part about this setup is that we have one codebase, one master branch, and each site is configured to use the appropriate settings. The most important thing is that this is all very thoroughly documented, both in the code, README files, and the repo wiki.

Currency & Recurly: Easier than Expected

One of the issues I thought would be very problematic was currency, but that wasn’t actually an issue. All of the existing transactions are set up in cents – ie, 100 instead of 1.00 for a dollar, and that translates perfectly from dollars to pounds. We use Recurly, an external payment and subscription processor, so we didn’t have to worry about any localization issues on that front. Most of the currency abstractions I did were to remove any hard-coded references to the dollar sign, and create functions and variables to get the appropriate currency symbol.

Dealing with Dates; Ugh.

Date formats were something I expected to be easy, but that wound up being more complex. I discovered hook_date_combo_process_alter() to change the display of the date in calendar popup fields. This made what I’d thought was going to be a difficult series of view handlers really simple. We have several fields using the date combo box on both content types and entities, and this function took care of them.

* Implements hook_date_combo_process_alter().
* Changes the date format.
function gc_display_date_combo_process_alter(&$element, &$form_state, $context) {
  if (isset($element['#entity']->type)) {
    switch ($element['#entity']->type) {
      case 'event':
        $element['value']['#date_format'] = variable_get('date_format_short');

      case 'partner':
        $element['value']['#date_format'] = variable_get('date_format_short');
        $element['value2']['#date_format'] = variable_get('date_format_short');

      case 'promo_offer':
        $element['value']['#date_format'] = variable_get('date_format_short');
        $element['value2']['#date_format'] = variable_get('date_format_short');

  elseif (isset($element['#entity']->field_name)) {
    if ($element['value']['#instance']['widget']['type']  'date_popup' && $element['#entity']->field_name  'field_user_csr_notes') {
      $element['value']['#date_format'] = variable_get('date_format_short');

I took the dozen or so existing date formats from Drupal, altered some of them to meet our needs, and added a few more. My head also started spinning when testing because I’m so used to M/D/Y formats that D/M/Y formats look really strange after a while, especially because code changes needed to be tested on the US and UK sites, so I had to be really careful when visually testing a page to make sure that a US page was showing 9/1/15 and the UK page was showing 1/9/15. In the future, I’d definitely advocate for a testing suite on a project like this. Overall, making sure all of the dates were changed was somewhat tedious, but not difficult. It required a lot of attention to detail and familiarity with PHP date formats, and vigorous testing by the whole team to make sure nothing had been missed.

Proper Use of t() Early == Wins Later

This project made me extremely grateful for the t() function. Since both sites were in English, we didn’t have a need for site-wide translation, but we did need to localize a handful of strings, both for language issues (words like ‘personalize’ vs ‘personalise’), and the general language preference of the stakeholders. It was easy enough to find the strings and list them in locale_custom_strings_en to switch them out. One gotcha we came across that I wasn’t familiar with – you cannot use t() in your settings files. The function isn’t available at that point in the bootstrapping. You can use get_t(), but we opted to remove the translation strings from any variables and make sure that t() was used when the variable was called. This wasn’t something I had run into before, and it caused some problems before we figured it out.


A few tricky miscellaneous problems cropped up, too. There was a geolocation function enabled in Recurly, which was defaulting to the US and we were unable to change the settings – we also didn’t realize this when testing in the US, and we scratched our heads when the London team told us the field was defaulting to US until we came across the culprit. We were able to fix it, and put in a patch for the library causing the issue.

I also realized how many various settings default to the US when working on this project – a lot of the location-related work was just abstracting out country defaults. Something to keep in mind if you’re working on a project with locations. Don’t make more work for developers who live or work on projects outside of the US. Plan for the future! Assume nothing!

Looking Back

I’m really glad that I worked on this project, because it’s made me develop with a better eye for abstraction of all kinds, and making sure that it’s easy for developers or users to work with my code anywhere. In the future, I’d put more thought into managing our configurations from the start, as well as automating the testing process, both for time-saving and better QA.

If you’ve ever worked on a site with challenges like these, I’d love to hear how you handled them! What are your best practices for managing custom locale strings and other site-specific variables? To what extent do you abstract things like dates and currency when developing a site, even when you don’t know if those will ever change?

Catégories: Elsewhere

Steve Kemp: lumail2 nears another release

Planet Debian - lun, 16/11/2015 - 21:15

I'm pleased with the way that Lumail2 development is proceeding, and it is reaching a point where there will be a second source-release.

I've made a lot of changes to the repository recently, and most of them boil down to moving code from the C++ side of the application, over to the Lua side.

This morning, for example, I updated the handing of index.limit to be entirely Lua based.

When you open a Maildir folder you see the list of messages it contains, as you would expect.

The notion of the index.limit is that you can limit the messages displayed, for example:

  • See all messages: Config:set( "index.limit", "all")
  • See only new/unread messages: Config:set( "index.limit", "new")
  • See only messages which arrived today: Config:set( "index.limit", "today")
  • See only messages which contain "Steve" in their formatted version: Config:set( "index.limit", "steve")

These are just examples that are present as defaults, but they give an idea of how things can work. I guess it isn't so different to Mutt's "limit" facilities - but thanks to the dynamic Lua nature of the application you can add your own with relative ease.

One of the biggest changes, recently, was the ability to display coloured text! That was always possible before, but a single line could only be one colour. Now colours can be mixed within a line, so this works as you might imagine:

Panel:append( "$[RED]This is red, $[GREEN]green, $[WHITE]white, and $[CYAN]cyan!" )

Other changes include a persistant cache of "stuff", which is Lua-based, the inclusion of at least one luarocks library to parse Date: headers, and a simple API for all our objects.

All good stuff. Perhaps time for a break in the next few weeks, but right now I think I'm making useful updates every other evening or so.

Catégories: Elsewhere

Acquia Developer Center Blog: Open Sourcing Statsgod, a StatsD Implementation In Go

Planet Drupal - lun, 16/11/2015 - 21:10
Kevin Hankens

Acquia Engineering is excited to be open-sourcing Statsgod, a reimplementation of StatsD we created internally to help scale our metrics collection effort.

Acquia developers often create tooling to build, deploy, and monitor applications we run on Amazon Web Services, and Statsgod is one such tool that we want to make publicly available. Statsgod was designed to be highly scalable and easily deployed.

Tags: acquia drupal planet
Catégories: Elsewhere

DrupalOnWindows: Exposing reverse entity reference fields in Drupal

Planet Drupal - lun, 16/11/2015 - 20:55
Language English

Entity references in Drupal is the mechanism used to do some "proper" (sorry for the quotes but what you can achieve with Drupal is years behind a real ORM such as the Entity Framework in terms of usability, reliability, flexibility and overal quality) data modeling without having to write everything from scratch including queries, widgets and storage. 

More articles...
Catégories: Elsewhere

Daniel Pocock: Quick start using Blender for video editing

Planet Debian - lun, 16/11/2015 - 19:53

Updated 2015-11-16 for WebM

Although it is mostly known for animation, Blender includes a non-linear video editing system that is available in all the current stable versions of Debian, Ubuntu and Fedora.

Here are some screenshots showing how to start editing a video of a talk from a conference.

In this case, there are two input files:

  • A video file from a DSLR camera, including an audio stream from a microphone on the camera
  • A separate audio file with sound captured by a lapel microphone attached to the speaker's smartphone. This is a much better quality sound and we would like this to replace the sound included in the video file.
Open Blender and choose the video editing mode

Launch Blender and choose the video sequence editor from the pull down menu at the top of the window:

Now you should see all the video sequence editor controls:

Setup the properties for your project

Click the context menu under the strip editor panel and change the panel to a Properties panel:

The video file we are playing with is 720p, so it seems reasonable to use 720p for the output too. Change that here:

The input file is 25fps so we need to use exactly the same frame rate for the output, otherwise you will either observe the video going at the wrong speed or there will be a conversion that is CPU intensive and degrades the quality. Also check that the resolution_percentage setting under the picture dimensions is 100%:

Now specify output to PNG files. Later we will combine them into a WebM file with a script. Specify the directory where the files will be placed and use the # placeholder to specify the number of digits to use to embed the frame number in the filename:

Now your basic rendering properties are set. When you want to generate the output file, come back to this panel and use the Animation button at the top.

Editing the video

Use the context menu to change the properties panel back to the strip view panel:

Add the video file:

and then right click the video strip (the lower strip) to highlight it and then add a transform strip:

Audio waveform

Right click the audio strip to highlight it and then go to the properties on the right hand side and click to show the waveform:

Rendering length

By default, Blender assumes you want to render 250 frames of output. Looking in the properties to the right of the audio or video strip you can see the actual number of frames. Put that value in the box at the bottom of the window where it says 250:

Enable AV-sync

Also at the bottom of the window is a control to enable AV-sync. If your audio and video are not in sync when you preview, you need to set this AV-sync option and also make sure you set the frame rate correctly in the properties:

Add the other sound strip

Now add the other sound file that was recorded using the lapel microphone:

Enable the waveform display for that sound strip too, this will allow you to align the sound strips precisely:

You will need to listen to the strips to make an estimate of the time difference. Use this estimate to set the "start frame" in the properties for your audio strip, it will be a negative value if the audio strip starts before the video. You can then zoom the strip panel to show about 3 to 5 seconds of sound and try to align the peaks. An easy way to do this is to look for applause at the end of the audio strips, the applause generates a large peak that is easily visible.

Once you have synced the audio, you can play the track and you should not be able to hear any echo. You can then silence the audio track from the camera by right clicking it, look in the properties to the right and change volume to 0.

Make any transforms you require

For example, to zoom in on the speaker, right click the transform strip (3rd from the bottom) and then in the panel on the right, click to enable "Uniform Scale" and then set the scale factor as required:

Render the video output to PNG

Click the context menu under the Curves panel and choose Properties again.

Click the Animation button to generate a sequence of PNG files for each frame.

Render the audio output

On the Properties panel, click the Audio button near the top. Choose a filename for the generated audio file.

Look on the bottom left-hand side of the window for the audio file settings, change it to the ogg container and Vorbis codec:

Ensure the filename has a .ogg extension

Now look at the top right-hand corner of the window for the Mixdown button. Click it and wait for Blender to generate the audio file.

Combine the PNG files and audio file into a WebM video file

You will need to have a few command line tools installed for manipulating the files from scripts. Install them using the package manager, for example, on a Debian or Ubuntu system:

# apt-get install mjpegtools vpx-tools mkvtoolnix

Now create a script like the following:

#!/bin/bash -e # Set this to match the project properties FRAME_RATE=25 # Set this to the rate you desire: TARGET_BITRATE=1000 WORK_DIR=${HOME}/video1 PNG_DIR=${WORK_DIR}/frames YUV_FILE=${WORK_DIR}/video.yuv WEBM_FILE=${WORK_DIR}/video.webm AUDIO_FILE=${WORK_DIR}/audio-mixed.ogg NUM_FRAMES=`find ${PNG_DIR} -type f | wc -l` png2yuv -I p -f $FRAME_RATE -b 1 -n $NUM_FRAMES \ -j ${PNG_DIR}/%08d.png > ${YUV_FILE} vpxenc --good --cpu-used=0 --auto-alt-ref=1 \ --lag-in-frames=16 --end-usage=vbr --passes=2 \ --threads=2 --target-bitrate=${TARGET_BITRATE} \ -o ${WEBM_FILE}-noaudio ${YUV_FILE} rm ${YUV_FILE} mkvmerge -o ${WEBM_FILE} -w ${WEBM_FILE}-noaudio ${AUDIO_FILE} rm ${WEBM_FILE}-noaudio Next steps

There are plenty of more comprehensive tutorials, including some videos on Youtube, explaining how to do more advanced things like fading in and out or zooming and panning dynamically at different points in the video.

If the lighting is not good (faces too dark, for example), you can right click the video strip, go to the properties panel on the right hand side and click Modifiers, Add Strip Modifier and then select "Color Balance". Use the Lift, Gamma and Gain sliders to adjust the shadows, midtones and highlights respectively.

Catégories: Elsewhere

Pantheon Blog: Better Behavior-Driven Development on Remote Servers

Planet Drupal - lun, 16/11/2015 - 18:48
Behavior-Driven Development is a widely-used testing methodology that is used to describe functional tests—that is, tests that operate on the whole of a system—in natural, readable language called Gherkin syntax. The goal of this methodology is to make the contents of the tests approachable to non-technical stakeholders. This makes it possible for a project’s functional tests to be meaningfully used as the acceptance criteria for the product.
Catégories: Elsewhere

Red Route: How to add classes to links in Drupal 8

Planet Drupal - lun, 16/11/2015 - 17:48

As I start porting the modules I maintain to Drupal 8, I'm hitting a few places where things haven't been intuitive to me. I'll try to work on the drupal.org documentation when I get a chance, but in the meantime I figured it would be worth writing up a few notes.

A common task is creating a link, and adding classes and other attributes to it. The Responsive Share Buttons is basically just a block of links to social networks, so this was a key building block.

In Drupal 7 this was pretty simple - the link building function took three arguments - a title, a path, and an array of options:

$link = l(t('Link Title'), 'http://drupal.org', array(
  'attributes' => array(
    'class' => array(

In Drupal 8, the l function now takes a Url object with attributes, rather than a string, so it's a little different. Here's how to build a link to an external URL and add a class to it: First the Url class needs to be brought into scope:

use Drupal\Core\Url;

And then you can build the Url object and call setOptions on it:

$url = Url::fromUri('http://drupal.org');
$link_options = array(
  'attributes' => array(
    'class' => array(
$link = \Drupal::l(t('Link title'), $url);

Incidentally, the other gotcha here that had me scratching my head for a while was how to get the current page title, and how to get the current URL. Drupal 7 had easily accessible functions for these tasks, but the object-oriented approach

Drupal 7 $title = drupal_get_title();
$current_url = url(current_path(), array('absolute' => TRUE)); Drupal 8 $request = \Drupal::request();
$route_match = \Drupal::routeMatch();
$title = \Drupal::service('title_resolver')->getTitle($request, $route_match->getRouteObject());
$current_url = $request->getUri();

My own learning journey with Drupal 8 is very much in its early days, and a lot of the old Drupalisms are pretty familiar to me, but it does seem a little long-winded. Give it a while, and I'm sure I'll get up to speed, and start seeing the benefits of the object-oriented approach in Drupal 8.

Tags: Drupaldrupal 8
Catégories: Elsewhere

Zivtech: oEmbed in Drupal: Embed all the things!

Planet Drupal - lun, 16/11/2015 - 17:44

​WordPress has great support for oEmbed, allowing content creators to paste in URLs that are automatically displayed as rich embedded content. You may also be familiar with similar behavior on Facebook and in chat services like Slack. Meanwhile in Drupal 7, most sites are using Media module with their WYSIWYG and are able to (with some effort) embed from certain providers. In Drupal 8, we finally have WYSIWYG in core, but no solution for adding videos and other embedded content. How can we have the ease of use of Wordpress for embedding 3rd party content?

oEmbed Module

The Drupal oEmbed module, despite its humble project description, works nicely, and can easily give you a similar experience as you get in Wordpress. I recommend signing up for an account with the Embed.ly service, and setting the cache lifetime high in the oEmbed module settings. This gives you access to a large number of oEmbed providers and for many sites if you use a high cache lifetime you can stay within the free usage tier. OEmbed module gives you the option of using an input filter to turn URLs in your textareas into embeds, or you can use oEmbed Field submodule, which allows you to add link fields and use an oEmbed display formatter.

Asset Module: How are you so awesome and so overlooked?

The ability to use oEmbed in a field got me thinking about one of my favorite (and highly underrated) modules: Asset module. Asset module is essentially an alternative to the widely-used Media module (Scald is a third option in this space). While Media currently boasts 262,680 site installs, Asset is used by a humble 1,167. Drupalers are often advised that a good way to tell which module is the best when choosing between similar modules is to pick based on usage statistics and how much active development is occurring. Unfortunately, this is not foolproof advice: beware echo chambers.

If you've worked with Media module much (disclaimer: I was involved in early stages of Media module architecture and development), you're probably familiar with some of its flaws: an ever-changing variety of complex bugs on its 2.x branch, complicated relationship between Media and File Entity configurations, no straightforward method to add captions to images, multiple dialogs to click through just to add an image, bugs when you disable and re-enable rich text, and difficulty editing items after you add them to the WYSIWYG, to name a few.

Asset module in contrast has a lovely UI, provides common features out of the box (add an image to the WYSIWYG with working captions and right/left alignment), is simple to configure and use, relatively bug-free, and stable. It provides many of the same features as Media, like a library of reusable media assets you can add to a WYSIWYG or display in Views and the ability to add your own fielded bundles for various types of assets. In addition Asset module lets you pick your own WYSIWYG button icons and have a separate button in your WYSIWYG for each type of asset (image, video, document) and unlike Media module it is not directly tied to files. This means you can create Asset types for reusable, centrally-managed structured content that are not file-based at all. I like to make Asset types for things like Addresses and Calls to Action which authors can use within their WYSIWYG. You can quickly explore the wonders of Asset module on its demo site - make sure in addition to the WYSIWYG buttons you try out the 'Asset Widget' on the right side of the content creation page and see how you can drag existing assets into not only textareas but also entityreference fields.

oEmbed with Asset Module

What does this have to do with oEmbed? Well, guess what happens if you add a new Asset type with a link field you set to display as oEmbed? Yup, now you have an Embed button on your WYSIWYG that lets your authors paste in a URL from any of those services, or reuse embeds they've already added to their Asset library. No more adding separate modules to be able to integrate with YouTube, Vimeo, and more. In fact, now we have a better user experience than WordPress! The embeds even show up already rendered right in your WYSIWYG.

Here are some examples of embeds I can put into this WYSIWYG (content from myself and my old band from around the internet):

A song on Rdio

A video on YouTube

A tweet

.@tizzo at work pic.twitter.com/MMymGtT5mn

— Jody Hamilton (@JodyHamilton) June 28, 2015

A photo on Flickr

A LinkedIn user

A Github gist

A JibJab

Editor Experience

Want to see how it looks in my WYSIWYG? Let me embed a screenshot with my Asset image button!

My WYSIWYG right now... Like my caption?

The buttons on the right in my WYSIWYG are for Assets. I have a Document, Image, 'Call to Action', and then Embed Asset Types, followed by the Search button that lets me use my Asset library. By the way, the 'Call to Action' is just a link field that outputs like:

Get Asset Module!

When I press the Embed button, I embed an asset like

To add an embed, just paste in a URL. Note you pick your Asset button - here I'm using a heart because I heart this setup. You can also add your own icons (patch in the queue).

Please tune in for Part 2 of this series on how to set this up on your Drupal 7 site and Part 3: Embedding in Drupal 8.

Terms: Publishing Workflow Ready for Publishing
Catégories: Elsewhere


Subscribe to jfhovinne agrégateur - Elsewhere