Feed aggregator

vilepickle.com: Print your theme's logo path in Drupal 8 with Twig

Planet Drupal - Wed, 14/01/2015 - 22:04

I'm updating a Drupal 6 theme to Drupal 8.  One thing I'm doing is making the logo in my Twig template a Twig variable instead of hardcoding the path.  Here's how you do it.  This assumes a theme named 'acton', but you'll change that to your own theme's name.

In 'acton.theme', assuming your logo is 'logo.png' in your theme's root:

read more

Categories: Elsewhere

Lullabot: Nate Haug: Forking Drupal

Planet Drupal - Wed, 14/01/2015 - 22:00

Lullabot has a new monthly show, hosted by Matthew Tift, featuring in-depth interviews with open source and free software advocates.

This inaugural episode of Hacking Culture introduces the idea of software forking, one of the fundamental characteristics of free software, and Matthew talks with Nate Haug about Backdrop, a Drupal fork.

Categories: Elsewhere

Acquia: PHP: Getting the job done, really easily – meet Stephan Hochdörfer

Planet Drupal - Wed, 14/01/2015 - 18:27
Language Undefined

Stephan Hochdörfer from bitExpert AG and I got the chance to sit down and chat in the event hotel lobby following his session (and my keynote address :-) at SymfonyLive Berlin, 2014.

Categories: Elsewhere

Dries Buytaert: Drupal retrospective 2014

Planet Drupal - Wed, 14/01/2015 - 12:43

It's that time again. Time to look back at 2014, and to look forward to 2015. For Drupal in 2014, it was all about Drupal 8. As Drupal 8's development enters its fourth (and hopefully, final) year of development, it's a good time to reflect on all the work achieved by the Drupal 8 team so far, and to talk about Drupal 8's momentum heading into the final stretch to the release.

Drupal 8 will have 200 new features. Among the larger features that I'm excited about are the responsive design, HTML5 support, the native web service support, the much improved multilingual support, the configuration management system, a built-in WYSIWYG editor, in-place editing, streamlined content editing, the improved entity system, and more. The list of improvements is long!

My favorite part of Drupal 8 is that it will make building all types of Drupal sites — both big and small — much easier than with Drupal 7.

Key accomplishments in 2014 include:

Drupal 8 beta 1 released

October 1, 2014, amidst the fanfare at DrupalCon Amsterdam, we released Drupal 8 beta 1. This was an important milestone in the project, marking the finalization of major APIs, which enables contributed modules to begin porting in earnest.

Total number of Drupal 8 contributors surpasses 2,500

Our 2,500th core contributor was Tasya Rukmana (tadityar), a high-school student participating in Google Code-in 2014! Awesome.

Kick-starting contributed modules in Drupal 8

Drupal 8's new object-oriented API represents a significant paradigm shift for developers (there are many benefits to this). To help Drupal 7 pros make the jump to Drupal 8, Acquia funded the Drupal Module Upgrader project. This project will not only scan a Drupal 7 module and generate a report pointing off to the appropriate documentation on how to port it, there is even a mode that automatically re-writes much of your module's code to Drupal 8 to eliminate a huge chunk of the work.

Sprints, sprints and more sprints!

We organized dozens of sprints all around the world, and together hundreds of people came together in "real life" to help get Drupal 8 released. Sprints are a key part of momentum-building in Drupal, by laser-focusing on a specific goal, or by pairing both new and experienced contributors together for mentorship. Not only do sprints make solving tough issues easier, they also provide opportunities for building relationships and "leveling up" your skills.

Drupal 8 accelerate fund

Though it was launched just a month ago, the Drupal Association's Drupal 8 Accelerate Fund is already helping to add velocity to Drupal 8, by paying key contributors to help fix particularly onerous critical issues.

What is in store for 2015? Getting the Drupal 8 release done

Our current focus is resolving the Drupal 8 upgrade path issues, which will allow early adopters of Drupal 8 to upgrade their site data between beta releases, and should result in a further uptick to Drupal 8 development velocity.

Once we reach zero critical issues, we begin the release candidate phase. Among the areas left to polish up after the Drupal 8 upgrade path issues are bringing external libraries up to date, finalizing documentation, and performance.

Continuous improvements after Drupal 8

Unlike prior versions of Drupal, Drupal 8 has adopted a new release cycle that will provide backwards-compatible "feature" releases every 6 months. I'm extremely excited about this change, as it means we can innovate on the core platform for years to come after release, versus holding all of the new goodies until Drupal 9.

Getting more organizations to contribute

We're now one of the largest Open Source projects in terms of active contributors, if not the largest. That growth requires us to evolve how we work. Over the years, we've grown from a 100% volunteer-driven model to a model where there is a mix of volunteers, contributors who are partially funded by their customers or employers, and contributors who are paid full-time to work on Drupal.

While this shift has big benefits in making Drupal more sustainable, it also means there is increasingly more corporate participation and influence. One of our biggest challenges for 2015 is to figure out how we can get more commercial organizations to step up to take on more of the shared maintenance of Drupal, while at the same time respecting the needs and desires of our entire community.

Improving our governance model

There has also been a lot of talk about optimizing the way in which we work, to make it more explicit who is responsible for what, how decisions are made, and so on. This year I plan to work with others in the community to revamp Drupal core's governance model to bring more transparency and appoint additional leadership.

Conclusion

Overall, I'm thrilled with the progress that the Drupal core contributors have made in 2014, and want to extend an enormous thanks to each and every one of our 2,500 contributors who have brought us this far. I'm feeling very positive about our momentum going into 2015.

Drupal 8 will set a new standard for ease of use, power and flexibility, and will have something for everyone to love. Without a doubt, Drupal 8 will take our community to new heights. Let's do this!

Categories: Elsewhere

Ritesh Raj Sarraf: Apport in Debian

Planet Debian - Wed, 14/01/2015 - 11:47

Looking at the PTS entries, I realized that it has been more than 2 yrs, since I pushed the first Apport packages into Debian.

We have talked about it in the past, and do not see a direct need for apport yet. That is one reason why it still resides (and will continue to) in Experimental.

Even though not used as a bug reporting tool, Apport can still be a great tool for (end) users to detect crashes. It can also be used to find further details about program crashes and pointers to look further.

This post is a call for help if there is anybody, who'd be interested to work on maintaining Apport in Debian. Most work include maintaining new upstream releases, and porting the Debian CrashDB to newer versions, as and when necessary.

As said above, it is not going to be a bug reporting tool, but rather a bug monitoring tool.

Categories: Keywords: 
Categories: Elsewhere

Ritesh Raj Sarraf: apt-offline 1.6

Planet Debian - Wed, 14/01/2015 - 11:32

I am pleased to announce the release of apt-offline - 1.6

This release is mostly a bug fix release, which every user should upgrade to. It also fixes a major bug in the way we limited the validation of GPG integrity, for the APT repository lists (Thank you Paul Wise).

Also, In the last release,  we migrated from custom magic library to the python shipped ctype python-magic library. That allowed some bugs to creep, and hopefully now, all those bugs should be fixed. A big thanks to Roland Summers for his bug reports and continuous feedback.

What is apt-offline ?

Description-en: offline APT package manager apt-offline is an Offline APT Package Manager. . apt-offline can fully update and upgrade an APT based distribution without connecting to the network, all of it transparent to APT. . apt-offline can be used to generate a signature on a machine (with no network). This signature contains all download information required for the APT database system. This signature file can be used on another machine connected to the internet (which need not be a Debian box and can even be running windows) to download the updates. The downloaded data will contain all updates in a format understood by APT and this data can be used by apt-offline to update the non-networked machine. . apt-offline can also fetch bug reports and make them available offline.

Debian changelog for the 1.6 release.

apt-offline (1.6) experimental; urgency=medium * [2a4a7f1] Don't abuse exception handlers. Thanks to R-Sommer * [afc51b3] MIME type for a deb package. Thanks to R-Sommer * [ec2d539] Also include debian-archive-keyring. Thanks to Hans-Christoph Steiner (Closes: #748082) * [dc602ac] Update MIME type for .gpg * [c4f9b71] Cycle through possible apt keyrings. Thanks to Paul Wise (Closes: #747163) * [de0fe4d] Clarify manpage for install * [b5e1075] Update manpage with some doc about argparse positional values to arguments * [c22d64d] Port is data type integer. Thanks to Roland Sommer * [67edebe] autodetect release name * [5803141] Disable python-apt support -- Ritesh Raj Sarraf <rrs@debian.org> Wed, 14 Jan 2015 15:34:45 +0530

[1] https://alioth.debian.org/projects/apt-offline/

Categories: Keywords: 
Categories: Elsewhere

Charles Plessy: nodejs-legacy

Planet Debian - Wed, 14/01/2015 - 09:42

apt install nodejs-legacy if you want npm install to work.

Categories: Elsewhere

InternetDevels: Automated testing on Jenkins + Selenium basis

Planet Drupal - Wed, 14/01/2015 - 09:05

Hello everyone! At some point the project evolves to the stage, when you start thinking about some new step in its development. It is quite clear, that you put yourself questions like “What is to be done at the website first of all? Better control on quality assurance?”. If so, it is high time to consider implementing CI.

Read more
Categories: Elsewhere

YesCT: Making MidCamp more accessible

Planet Drupal - Wed, 14/01/2015 - 08:10
Making MidCamp more accessible

Even though it's still two months away, I know that MidCamp 2015 (March 19 - 22) is going to be special. The venue hosting MidCamp this year is the University of Illinois at Chicago. UIC is both my alma mater and present employer. Student Center East (where the training and conference sessions will take place) may be familiar grounds to me, but these days I am looking at it from the perspective of a visitor who is completely unfamiliar with its layout.

UIC Student Center East entrance from Polk and Halsted streetsVenue accessibility

Liz Henry's article Unlocking the Invisible Elevator identifies some of the ways in which conference organizers can be proactive about event accessibility:

Some information is great to have in advance. Maps and explanations of access paths work well. It helps if they’re in web-accessible formats, usable by screen readers, and downloadable. Some information has to be embedded in your conference venue. Signs should clearly mark the accessible paths. Maps are very helpful so that people can estimate distances; this is a big deal for those of us who are exhausted and in pain. Put maps next to your signs please!

In late November, I did a preliminary walkthrough of Student Center East. I meandered around the building, photographing the main entrance to Student Center East, the location, interiors and paths to elevators, escalators and stairways, major "landmarks" for points of reference, and the conference area hallways and rooms. It may sound a bit like I was casing the place, but I learned about traffic flow, congestion areas and different points of entry to each floor, whether by escalator and stairs or elevator.

Next, I contacted folks from UIC Office of Facility and Space Planning to obtain floor plans for each of the buildings and floors where MidCamp events are going to take place. They were quick to respond and the floor plans I got are very detailed. I annotated them, marking session rooms, elevators, restrooms and possible traffic flow. The annotations will serve as blueprint for locations of signs, as well as written directions that will be posted to the website.

Annotated floor plan of Student Center East ground floor, with photos of elevator #6 and escalator overlaid.

This week, MidCamp organizers and I plan to do another walkthrough at UIC. Together we hope to identify and address any accessibility and navigation pitfalls. Photos, annotated floor plans, and navigation information will be posted to the MidCamp website. We want to make sure that there is good information about the venue available ahead of time, as well as informative signs on the spot when you attend MidCamp.

Of course, floor plans and elevators are not the only aspect of conference accessibility. Childcare, real-time captioning, transcripts and captioning of session videos are some of the other ways in which events are made more accessible to diverse audiences. It's a direction that I hope MidCamp will follow.

Anonymized session selection

Another reason why I'm excited about is that MidCamp session submission is now open (it will close on Monday January 19). The session selection committee will pick from anonymized submissions for 20 and 50 minute talks. From the conference website:

  1. A volunteer who is NOT on the selection team will anonymize and remove gendered pronouns from abstracts/bios.
  2. The team will make a first round of selections from the anonymized submissions.
  3. A second round will then make sure we have not selected speakers multiple times (excluding panel participants).

By anonymizing session selection, we hope to give thorough consideration to everyone's proposals without biases ("oh, I know this speaker," or "I've never heard of this speaker"). Having a diverse lineup of speakers from all experience levels is important to us. A few weeks ago, Cathy Theys brainstormed a list of topics spanning social, technical, business, and other aspects of Drupal ecosystem that would be welcome at MidCamp. The list is long, but by no means exhaustive.

Are you on the fence about submitting a proposal? Take a look at the variety of suggestions for topics and fill out the submission form (the deadline is Monday, January 19). I want to see you at MidCamp!

References and resources

Contact me on Drupal.org or on Twitter. -alimac

Categories: Elsewhere

Capgemini Engineering: Drupal 8 PSR-4 Form compatibility in Drupal 7

Planet Drupal - Wed, 14/01/2015 - 01:00

Up until Drupal 8 there has been little to encourage well organised code. It now has PSR-4 autoloading so your classes are automatically included. Even though Drupal 8 is just round the corner, a lot of us will still be using Drupal 7 for quite a while, however that doesn’t mean we can’t benefit from this structure in Drupal 7.

This post covers two parts:

  1. Autoloading class files.
  2. Avoiding extra plumbing to hook into your class methods.

You’re probably familiar with drupal_get_form(‘my_example_form’) which then looks for a function my_example_form(). The issue is that your form definition will no longer be in such a function but within a method in a class. To cover both these parts we will be using two modules:

  1. XAutoLoad - Which will autoload our class.
  2. Cool - Which allows us to abstract the usual functions into class methods.

Drupal 8 was originally using PSR-0 which has been deprecated in favour of PSR-4. As a consequence the Cool module uses PSR-0 in its examples although it does support PSR-4. We will create an example module called psr4_form.

The information on autoloading and folder structure for PSR-4 in Drupal 8 states that we should place our form class in psr4_form/src/Form/FormExample.php however the cool module instead loads from a FormControllers folder: psr4_form/src/FormControllers/FormExample.php.

We can get round this by providing our own hook_forms() as laid out in the Cool module:

/** * Implements hook_forms(). */ function psr4_form_forms($form_id, $args) { $classes = \Drupal\cool\Loader::mapImplementationsAvailable('Form', '\Drupal\cool\Controllers\FormController'); unset($classes['Drupal\\cool\\BaseForm']); unset($classes['Drupal\\cool\\BaseSettingsForm']); $forms = array(); foreach ($classes as $class_name) { $forms[$class_name::getId()] = array( 'callback' => 'cool_default_form_callback', 'callback arguments' => array($class_name), ); } return $forms; }

If you are ok placing your class in the FormControllers folder then you can omit the above function to keep your .module file simple or you could put the hook in another module. Potentially the Cool module could be updated to reflect this.

This class requires a namespace of the form Drupal\<module_name>\Form. It also extends the BaseForm class provided by the Cool module so we don’t need to explicitly create our form functions:

namespace Drupal\psr4_form\Form; class FormExample extends \Drupal\cool\BaseForm { ... }

Within our FormExample class we need a method getId() to expose the form_id to Drupal:

public static function getId() { return 'psr4_form'; }

And of course we need the form builder:

public static function build() { $form = parent::build(); $form['my_textfield'] = array( '#type' => 'textfield', '#title' => t('My textfield'), ); return $form; }

All that is left is to define your validate and submit methods following the Drupal 8 form API.

At the time of writing, the Cool module isn’t up to date with Drupal 8 Form API conventions. I started this blog post with the intention of a direct copy and paste of the src folder. Unfortunately the methods don’t quite follow the exact same conventions and they also need to be static:

Drupal 7 Drupal 8 getId getFormId build buildForm validate validateForm submit submitForm

This example module can be found at https://github.com/oliverpolden/psr4_form.

Taking it further

Drupal 8 is just round the corner but a lot of us will still be using Drupal 7 for the foreseeable future. Taking this approach allows us to learn and make use of Drupal 8 conventions as well as making it easier to migrate from Drupal 7. It would be nice to see the Cool module be brought up to date with the current API, perhaps something I will be helping with in the not so distant future.

Links Modules Information

Drupal 8 PSR-4 Form compatibility in Drupal 7 was originally published by Capgemini at Capgemini on January 14, 2015.

Categories: Elsewhere

Simon Josefsson: Replicant 4.2 0003 on I9300

Planet Debian - Wed, 14/01/2015 - 00:17

The Replicant project released version 4.2 0003 recently. I have been using Replicant on a Samsung SIII (I9300) for around 14 months now. Since I have blogged about issues with NFC and Wifi earlier, I wanted to give a status update after upgrading to 0003. I’m happy to report that my NFC issue has been resolved in 0003 (the way I suggested; reverting the patch). My issues with Wifi has been improved in 0003, with my merge request being accepted. What follows below is a standalone explanation of what works and what doesn’t, as a superset of similar things discussed in my earlier blog posts.

What works out of the box: Audio, Telephony, SMS, Data (GSM/3G), Back Camera, NFC. 2D Graphics is somewhat slow compared to stock ROM, but I’m using it daily and can live with that so it isn’t too onerus. Stability is fine, similar to other Android device I’m used to. Video playback does not work (due to non-free media decoders?), which is not a serious problem for me but still likely the biggest outstanding issue except for freedom concerns. 3D graphics apparently doesn’t work, and I believe it is what prevents Firefox from working properly (it crashes). I’m having one annoying but strange problem with telephony: when calling one person I get scrambled audio around 75% of the time. I can still hear what the other person is saying, but can barely make anything out of it. This only happens over 3G, so my workaround when calling that person is to switch to 2G before and switch back after. I talk with plenty other people, and have never had this problem with anyone else, and it has never happened when she talks with anyone else but me. If anyone has suggestion on how to debug this, I’m all ears.

Important apps to get through daily life for me includes K9Mail (email), DAVDroid (for ownCloud CalDav/CardDAV), CalDav Sync Adapter (for Google Calendars), Conversations (XMPP/Jabber chat), FDroid (for apps), ownCloud (auto-uploading my photos), SMS Backup+, Xabber (different XMPP/Jabber accounts), Yubico Authenticator, MuPDF and oandbackup. A couple of other apps I find useful are AdAway (remove web ads), AndStatus, Calendar Widget, NewsBlur and ownCloud News Reader (RSS readers), Tinfoil for Facebook, Twidere (I find its UI somewhat nicer than AndStatus’s), and c:geo.

A number of things requires non-free components. As I discussed in my initial writeup from when I started using Replicant I don’t like this, but I’m accepting it temporarily. The list of issues that can be fixed by adding non-free components include the front camera, Bluetooth, GPS, and Wifi. After flashing the Replicant ROM image that I built (using the fine build instructions), I’m using the following script to add the missing non-free files from Cyanogenmod.

# Download Cyanogenmod 10.1.3 (Android 4.2-based) binaries: # wget http://download.cyanogenmod.org/get/jenkins/42508/cm-10.1.3-i9300.zip # echo "073a464a9f5129c490502c77374495c38a25ba790c10e27f51b43845baeba6bf cm-10.1.3-i9300.zip" | sha256sum -c # unzip cm-10.1.3-i9300.zip adb root adb remount adb shell mkdir /system/vendor/firmware adb shell chmod 755 /system/vendor/firmware # Front Camera adb push cm-10.1.3-i9300/system/vendor/firmware/fimc_is_fw.bin /system/vendor/firmware/fimc_is_fw.bin adb push cm-10.1.3-i9300/system/vendor/firmware/setfile.bin /system/vendor/firmware/setfile.bin adb shell chmod 644 /system/vendor/firmware/fimc_is_fw.bin /system/vendor/firmware/setfile.bin # Bluetooth adb push cm-10.1.3-i9300/system/bin/bcm4334.hcd /system/vendor/firmware/ adb shell chmod 644 /system/vendor/firmware/bcm4334*.hcd # GPS adb push cm-10.1.3-i9300/system/bin/gpsd /system/bin/gpsd adb shell chmod 755 /system/bin/gpsd adb push cm-10.1.3-i9300/system/lib/hw/gps.exynos4.so /system/lib/hw/gps.exynos4.so adb push cm-10.1.3-i9300/system/lib/libsecril-client.so /system/lib/libsecril-client.so adb shell chmod 644 /system/lib/hw/gps.exynos4.so /system/lib/libsecril-client.so # Wifi adb push cm-10.1.3-i9300/system/etc/wifi/bcmdhd_apsta.bin_b1 /system/vendor/firmware/ adb push cm-10.1.3-i9300/system/etc/wifi/bcmdhd_apsta.bin_b2 /system/vendor/firmware/ adb push cm-10.1.3-i9300/system/etc/wifi/bcmdhd_mfg.bin_b0 /system/vendor/firmware/ adb push cm-10.1.3-i9300/system/etc/wifi/bcmdhd_mfg.bin_b1 /system/vendor/firmware/ adb push cm-10.1.3-i9300/system/etc/wifi/bcmdhd_mfg.bin_b2 /system/vendor/firmware/ adb push cm-10.1.3-i9300/system/etc/wifi/bcmdhd_p2p.bin_b0 /system/vendor/firmware/ adb push cm-10.1.3-i9300/system/etc/wifi/bcmdhd_p2p.bin_b1 /system/vendor/firmware/ adb push cm-10.1.3-i9300/system/etc/wifi/bcmdhd_p2p.bin_b2 /system/vendor/firmware/ adb push cm-10.1.3-i9300/system/etc/wifi/bcmdhd_sta.bin_b0 /system/vendor/firmware/ adb push cm-10.1.3-i9300/system/etc/wifi/bcmdhd_sta.bin_b1 /system/vendor/firmware/ adb push cm-10.1.3-i9300/system/etc/wifi/bcmdhd_sta.bin_b2 /system/vendor/firmware/ adb push cm-10.1.3-i9300/system/etc/wifi/nvram_mfg.txt /system/vendor/firmware/ adb push cm-10.1.3-i9300/system/etc/wifi/nvram_mfg.txt_murata /system/vendor/firmware/ adb push cm-10.1.3-i9300/system/etc/wifi/nvram_mfg.txt_murata_b2 /system/vendor/firmware/ adb push cm-10.1.3-i9300/system/etc/wifi/nvram_mfg.txt_semcosh /system/vendor/firmware/ adb push cm-10.1.3-i9300/system/etc/wifi/nvram_net.txt /system/vendor/firmware/ adb push cm-10.1.3-i9300/system/etc/wifi/nvram_net.txt_murata /system/vendor/firmware/ adb push cm-10.1.3-i9300/system/etc/wifi/nvram_net.txt_murata_b2 /system/vendor/firmware/ adb push cm-10.1.3-i9300/system/etc/wifi/nvram_net.txt_semcosh /system/vendor/firmware/

I hope this helps others switch to a better phone environment!

Categories: Elsewhere

Mediacurrent: Level up your Drush-Fu with aliases that work across all environments

Planet Drupal - Tue, 13/01/2015 - 22:40

Have you noticed how your remote drush aliases (e.g., @my-dev-server) don't work when you're logged into the remote server? It's because aliases with the "remote-host" key specified can't work locally. Quite annoying!

Categories: Elsewhere

Drupal core announcements: Drupal core updates for January 12, 2015

Planet Drupal - Tue, 13/01/2015 - 21:40
What's new with Drupal 8?

Happy New Year everyone! Since the last Drupal Core Update on December 3rd, Drupal 8 passed over 2500 contributors (congratulations to tadityar on becoming the 2500th D8 contributor on December 9)!

Some other highlights of the month were:

How can I help get Drupal 8 done?

See Help get Drupal 8 released! for updated information on the current state of the release and more information on how you can help.

Drupal 8 In Real Life Whew! That's a wrap!

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

Categories: Elsewhere

Daniel Pocock: Silent data loss exposed

Planet Debian - Tue, 13/01/2015 - 21:06

I was moving a large number of image files around and decided to compare checksums after putting them in their new home.

Ouf of several thousand files, about 80GB of data, I found that seventeen of them had a checksum mismatch.

Running md5sum manually on each of those was showing a correct checksum, well, up until the sixth file and then I found this:

$ md5sum DSC_2624.NEF 94fc8d3cdea3b0f3479fa255f7634b5b DSC_2624.NEF $ md5sum DSC_2624.NEF 25cf4469f44ae5e5d6a13c8e2fb220bf DSC_2624.NEF $ md5sum DSC_2624.NEF 03a68230b2c6d29a9888d2358ed8e225 DSC_2624.NEF

Yes, each time I run md5sum on the same file it gives a different result. Out of the seventeen files, I found one other displaying the same problem and the others gave correct checksums when I ran md5sum manually. Definitely not a healthy disk, or is it?

This is the reason why checksumming filesystems like Btrfs are so important.

There are no errors or warnings in the logs on the system with this disk. Silent data loss at its best.

Is the disk to blame though?

It may be tempting to think this is a disk fault, most people have seen faulty disks at some time or another. In the old days you could often hear them too. There is another possible explanation though: memory corruption. The data read from disk is normally cached in RAM and if the RAM is corrupt, the cache would return bad data.

I dropped the read cache:

# echo 3 > /proc/sys/vm/drop_caches

and tried md5sum again and observed the file checksum is now correct.

It would appear the md5sum command had been operating on data in the page cache and the root cause of the problem is memory corruption. Time to run a memory test and then replace the RAM in the machine.

Categories: Elsewhere

Drupal Watchdog: MySQL Query Optimization

Planet Drupal - Tue, 13/01/2015 - 18:52
Feature

A large part of MySQL optimization lies in improving poorly performing SQL queries. While tuning is important, it often has nowhere near the impact of actually fixing a poorly performing query. Fixing queries is also a lot more fun. Obviously query optimization is a large subject, and can’t possibly be covered in full in a single article. I highly recommend that you get a book on this subject; for any Drupal developer, it is well worth learning.

As a web developer using a CMS, you are only slightly removed from the SQL layer. Not completely knowing how to use this layer and how to optimize it is very limiting. To get you started, we will cover some very basic optimization, index usage, and join optimization techniques.

Index Basics

Even though indexes are very important for database performance, they are not completely understood by many developers, which often leads to easily-avoidable problems. The main issue is the mystical belief that the MySQL optimizer should be able to quickly run a query if an index so much as touches the columns in question. Sadly, indexes are not magical.

It is best to think of an index as a tree, largely because they are trees in most DB systems. (B+Trees, specifically; for more information, see http://wdog.it/4/1/btree.)

Thus, if you have an example index test that covers (columnA, columnB), you literally have a tree of columnA values, with columnB values in the leaves. If you have a query that has a WHERE condition on these two columns, MySQL will go through this tree looking for the correct columnA value first, and then go into the leaves of that object, and find the correct columnB value.

Categories: Elsewhere

OpenLucius: Drupal Grants, what to do with this node access system?

Planet Drupal - Tue, 13/01/2015 - 17:48
Viewing, editing and deleting pages in Drupal

When you have some experience with Drupal it will be clear that you can set your rights for content management in the permission table (/admin/people/permissions).

Check the appropriate permissions and everyone will get the required rights to view, add, edit or delete content. In other words the so-called CRUD actions: Create, Read, Update, Delete.

So far so good.

Categories: Elsewhere

Jonathan McDowell: Tracking a ship around the world

Planet Debian - Tue, 13/01/2015 - 17:07

I moved back from the California Bay Area to Belfast a while back and for various reasons it looks like I'm going to be here a while, so it made sense to have my belongings shipped over here. They haven't quite arrived yet, and I'll do another post about that process once they have, but I've been doing various tweets prefixed with "[shipping]" during the process. Various people I've spoken to (some who should know me better) thought this was happening manually. It wasn't. If you care about how it was done, read on.

I'd been given details of the ship carrying my container, and searching for that turned up the excellent MarineTraffic which let me see the current location of the ship. Turns out ships broadcast their location using AIS and anyone with a receiver can see the info. Very cool, and I spent some time having a look at various bits of shipping around the UK out of interest. I also found the ship's itinerary which give me some idea of where it would be calling and when. Step one was to start recording this data; it was time sensitive and I wanted to be able to see historical data. I took the easy route and set up a cron job to poll the location and itinerary on an hourly basis, and store the results. That meant I had the data over time, if my parsing turned out to miss something I could easily correct it, and that I wasn't hammering Marine Traffic while writing the parsing code.

Next I wanted to parse the results, store them in a more manageable format than the HTML, and alert me when the ship docked somewhere or set off again. I've been trying to learn more Python rather than doing my default action of turning to Perl for these things, and this seemed like a simple enough project to try out. Beautiful Soup seemed to turn up top for HTML parsing in Python, so that formed the basis. Throwing the info into a database so I could do queries felt like the right move so I used SQLite - if this had been more than a one off I'd have considered looking at PostgreSQL and its GIS support. Finally Tweepy made it very easy to tweet from Python in about 4 lines of code. The whole thing weighed in at only 175 lines of code, mostly around pulling the info out of the HTML and then a little to deal with checking for state changes against the current status and the last piece of info in the database.

The pieces of information I chose to store were the time of the update (i.e. when the ship sent it, not when my script ran), reported area, reported state, the position + course, reported origin, reported destination and eta. The fact this is all in a database makes it very easy to do a few queries on the data.

How fast did the ship go?

sqlite> SELECT MAX(speed) FROM status; MAX(speed) 21.9

What areas did it report?

sqlite> SELECT area FROM status GROUP BY area; area - Atlantic North California Caribbean Sea Celtic Sea English Channel Hudson River Pacific North Panama Canal

What statuses did we see?

sqlite> SELECT status FROM status GROUP BY status; status At Anchor Moored Stopped Underway Underway using Engine

Finally having hourly data lets me draw a map of where the ship went. The data isn't complete, because the free AIS info depends on the ship being close enough to a receiving station. That means there were a few days in the North Atlantic without updates, for example. However there's enough to give a good idea of just how well traveled my belongings are, and it gave me an excuse to play with OpenLayers.

(Apologies if the zoom buttons aren't working for you here; I think I need to kick the CSS in some manner I haven't quite figured out yet.)

Categories: Elsewhere

ERPAL: Looking back on 2014 with Drupal business apps

Planet Drupal - Tue, 13/01/2015 - 16:30

The year 2014 was entirely about flexible and open business applications based on Drupal - and we’ll continue to follow this vision in 2015.
In 2014 we staffed up our ERPAL team and won strategic clients who gave us feedback and helped us continue to finance our open source development. This positive resonance provides confirmation that Drupal can become an ever-larger part of the open source business application market.
One of the ERPAL Platform projects of 2014 that we’re very proud of was presented in a featured webinar on open integration with Drupal commerce. The ERPAL Platform based foam creator gives an industrial company the means to let its clients construct and order individually manufactured products – all directly online. The orders are sent to the manufacturing department and production starts. Because the application is fully integrated with the company’s workflow and IT infrastructure, no manual data transfer is needed and the efficiency of the whole sales-to-production process has increased by more than 75%. This unique use case shows the power of Drupal extended well beyond content sites.

Whereas other open source business apps like Odoo focus solely on broadening the palette of business apps available for ERP systems, ERPAL comes from the other direction. We use Drupal as a highly flexible and stable application framework that helps you build any kind of web application at all - and Drupal can do this with almost no coding, just by configuring. Using this strategy we introduced Drupal to some businesses that hadn’t even heard of Drupal. And now that they see its power and flexibility, they wouldn’t want to go without it anymore.
With ERPAL Platform, which we released in 2014, we provide Drupal developers and site builders with a free Drupal distribution for building highly flexible business applications and e-commerce businesses in a Drupal box. It integrates many Drupal modules like Drupal Commerce and Rules, which are known to leverage flexibility. With the help of the Drupal community we implemented an architecture that covers contact management and all components of the sales process such as quotes, orders and invoices. As Drupal became more open, providing web service for all entities in Drupal 8, we implemented the architecture of ERPAL to integrate with other services. Together with a closed beta customer test pool, we are running ERPAL Platform as a fully-integrated agency platform, automating integration tasks between Jira, Mite, Trello, Redmine and toggle. It helps save time in administration and automates billing and controlling processes in project-based business. Thanks to everyone who joined our ERPAL Platform integration survey. This survey is still open and we are looking forward to even more feedback to help us increase our number of beta testers.

Because in 2014 we were deploying more than 25 Drupal-based business apps and always had Drupalgeddon in mind, we decided to go public with our technology for Drupal update automation, which we previously had used only internally for our clients. Drop Guard lets Drupal users and agencies automate Drupal security updates immediately after a new security update release. If you’re interested in further details, workflows and technology, read more in our blog post about how since 2012 we’ve automated Drupal security updates with ERPAL: you can too!

All in all, 2014 was an amazing year for ERPAL and we saw that there’s a market for open source business applications. We’re looking forward to contributing even more code, know-how, webinars and sessions to the Drupal community in 2015.

Categories: Elsewhere

Erich Schubert: Big data predictions for 2015

Planet Debian - Tue, 13/01/2015 - 16:01
My big data predictions for 2015:
  1. Big data will continue to fail to deliver for most companies.
    This has several reasons, including in particular: 1: lack of data to analyze that actually benefits from big data tools and approaches (and which is not better analyzed with traditional tools). 2: lack of talent, and failure to attract analytics talent. 3: stuck in old IT, and too inflexible to allow using modern tools (if you want to use big data, you will need a flexible "in-house development" type of IT that can install tools, try them, abandon them, without going up and down the management chains) 4: too much marketing. As long as big data is being run by the marketing department, not by developers, it will fail.
  2. Project consolidation: we have seen hundreds of big data software projects the last years. Plenty of them on Apache, too. But the current state is a mess, there is massive redundancy, and lots and lots of projects are more-or-less abandoned. Cloudera ML, for example, is dead: superseded by Oryx and Oryx 2. More projects will be abandoned, because we have way too many (including much too many NoSQL databases, that fail to outperform SQL solutions like PostgreSQL). As is, we have dozens of competing NoSQL databases, dozens of competing ML tools, dozens of everything.
  3. Hype: the hype will continue, but eventually (when there is too much negative press on the term "big data" due to failed projects and inflated expectations) move on to other terms. The same is also happening to "data science", so I guess the next will be "big analytics", "big intelligence" or something like that.
  4. Less openness: we have seen lots of open-source projects. However, many decided to go with Apache-style licensing - always ready to close down their sharing, and no longer share their development. In 2015, we'll see this happen more often, as companies try to make money off their reputation. At some point, copyleft licenses like GPL may return to popularity due to this.
Categories: Elsewhere

Drupalize.Me: Changes in the Form API in Drupal 8

Planet Drupal - Tue, 13/01/2015 - 15:13

In my previous post, I documented the first of my Adventures in Porting a D7 Form Module to Drupal 8. In that article, I documented how I used the Drupal Module Upgrader to convert my Drupal 7 module, Form Fun, to Drupal 8 and what I learned along the way about how Routes and Controllers replaced hook_menu, and what I gleaned from change records about other API changes. This article is a continuation of that post, so you might want to pop over and give it a read so that you're up to speed with what we're doing here.

Categories: Elsewhere

Pages

Subscribe to jfhovinne aggregator