Vincent Bernat: Replacing Swisscom router by a Linux box

Planet Debian - dim, 16/11/2014 - 16:26

I have recently moved to Lausanne, Switzerland. Broadband Internet access is not as cheap as in France. Free, a French ISP, is providing an FTTH access with a bandwith of 1 Gbps1 for about 38 € (including TV and phone service), Swisscom is providing roughly the same service for about 200 €2. Swisscom fiber access was available for my appartment and I chose the 40 Mbps contract without phone service for about 80 €.

Like many ISP, Swisscom provides an Internet box with an additional box for TV. I didn’t unpack the TV box as I have no use for it. The Internet box comes with some nice features like the ability to setup firewall rules, a guest wireless access and some file sharing possibilities. No shell access!

I have bought a small PC to act as router and replace the Internet box. I have loaded the upcoming Debian Jessie on it. You can find the whole software configuration in a GitHub repository.

This blog post only covers the Swisscom-specific setup (and QoS). Have a look at those two blog posts for related topics:


The Internet box is packed with a Siligence-branded 1000BX SFP3. This SFP receives and transmits data on the same fiber using a different wavelength for each direction.

Instead of using a network card with an SFP port, I bought a Netgear GS110TP which comes with 8 gigabit copper ports and 2 fiber SFP ports. It is a cheap switch bundled with many interesting features like VLAN and LLDP. It works fine if you don’t expect too much from it.


IPv4 connectivity is provided over VLAN 10. A DHCP client is mandatory. Moreover, the DHCP vendor class identifier option (option 60) needs to be advertised. This can be done by adding the following line to /etc/dhcp/dhclient.conf when using the ISC DHCP client:

send vendor-class-identifier "100008,0001,,Debian";

The first two numbers are here to identify the service you are requesting. I suppose this can be read as requesting the Swisscom residential access service. You can put whatever you want after that. Once you get a lease, you need to use a browser to identify yourself to Swisscom on the first use.


Swisscom provides IPv6 access through the 6rd protocol. This is a tunneling mechanism to facilitate IPv6 deployment accross an IPv4 infrastructure. This kind of tunnel is natively supported by Linux since kernel version 2.6.33.

To setup IPv6, you need the base IPv6 prefix and the 6rd gateway. Some ISP are providing those values through DHCP (option 212) but this is not the case for Swisscom. The gateway is 6rd.swisscom.com and the prefix is 2a02:1200::/28. After appending the IPv4 address to the prefix, you still get 4 bits for internal subnets.

Swisscom doesn’t provide a fixed IPv4 address. Therefore, it is not possible to precompute the IPv6 prefix. When installed as a DHCP hook (in /etc/dhcp/dhclient-exit-hooks.d/6rd), the following script configures the tunnel:

sixrd_mtu=1472 # This is 1500 - 20 - 8 (PPPoE header) sixrd_ttl=64 sixrd_prefix=2a02:1200::/28 # No way to guess, just have to know it. sixrd_br= # That's "6rd.swisscom.com" sixrd_down() { ip tunnel del internet6 || true } sixrd_up() { ipv4=${new_ip_address:-$old_ip_address} sixrd_subnet=$(ruby <<EOF require 'ipaddr' prefix = IPAddr.new "${sixrd_prefix}", Socket::AF_INET6 prefixlen = ${sixrd_prefix#*/} ipv4 = IPAddr.new "${ipv4}", Socket::AF_INET ipv6 = IPAddr.new (prefix.to_i + (ipv4.to_i << (64 + 32 - prefixlen))), Socket::AF_INET6 puts ipv6 EOF ) # Let's configure the tunnel ip tunnel add internet6 mode sit local $ipv4 ttl $sixrd_ttl ip addr add ${sixrd_subnet}1/64 dev internet6 ip link set mtu ${sixrd_mtu} dev internet6 ip link set internet6 up ip route add default via ::${sixrd_br} dev internet6 } case $reason in BOUND|REBOOT) sixrd_down sixrd_up ;; RENEW|REBIND) if [ "$new_ip_address" != "$old_ip_address" ]; then sixrd_down sixrd_up fi ;; STOP|EXPIRE|FAIL|RELEASE) sixrd_down ;; esac

The computation of the IPv6 prefix is offloaded to Ruby instead of trying to use the shell for that. Even if the ipaddr module is pretty “basic”, it suits the job.

Swisscom is using the same MTU for all clients. Because some of them are using PPPoE, the MTU is 1472 instead of 1480. You can easily check your MTU with this handy online MTU test tool.

It is not uncommon that PMTUD is broken on some parts of the Internet. While not ideal, setting up TCP MSS will alievate any problem you may run into with a MTU less than 1500:

ip6tables -t mangle -A POSTROUTING -o internet6 \ -p tcp --tcp-flags SYN,RST SYN \ -j TCPMSS --clamp-mss-to-pmtu QoS

Once upon a time, QoS was a tacky subject. The Wonder Shaper was a common way to get a somewhat working setup. Nowadays, thanks to the work of the Bufferbloat project, there are two simple steps to get something quite good:

  1. Reduce the queue of your devices to something like 32 packets. This helps TCP to detect congestion and act accordingly while still being able to saturate a gigabit link.

    ip link set txqueuelen 32 dev lan ip link set txqueuelen 32 dev internet ip link set txqueuelen 32 dev wlan
  2. Change the root qdisc to fq_codel. A qdisc receives packets to be sent from the kernel and decide how packets are handled to the network card. Packets can be dropped, reordered or rate-limited. fq_codel is a queuing discipline combining fair queuing and controlled delay. Fair queuing means that all flows get an equal chance to be served. Another way to tell it is that a high-bandwidth flow won’t starve the queue. Controlled delay means that the queue size will be limited to ensure the latency stays low. This is achieved by dropping packets more aggressively when the queue grows.

    tc qdisc replace dev lan root fq_codel tc qdisc replace dev internet root fq_codel tc qdisc replace dev wlan root fq_codel
  1. Maximum download speed is 1 Gbps, while maximum upload speed is 200 Mbps. 

  2. This is the standard Vivo XL package rated at CHF 169.– plus the 1 Gbps option at CHF 80.–. 

  3. There are two references on it: SGA 441SFP0-1Gb and OST-1000BX-S34-10DI. It transmits to the 1310 nm wave length and receives on the 1490 nm one. 

Catégories: Elsewhere

Dirk Eddelbuettel: Introducing RcppAnnoy

Planet Debian - dim, 16/11/2014 - 15:36

A new package RcppAnnoy is now on CRAN.

It wraps the small, fast, and lightweight C++ template header library Annoy written by Erik Bernhardsson for use at Spotify.

While Annoy is setup for use by Python, RcppAnnoy offers the exact same functionality from R via Rcpp.

A new page for RcppAnnoy provides some more detail, example code and further links. See a recent blog post by Erik for a performance comparison of different approximate nearest neighbours libraries for Python.

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

Stefano Zacchiroli: Debsources Participation in FOSS Outreach Program

Planet Debian - dim, 16/11/2014 - 13:45
Jingjie Jiang selected as OPW intern for Debsources

I'm glad to announce that Jingjie Jiang, AKA sophiejjj, has been selected as intern to work on Debsources as part of the FOSS Outerach Program (formerly known as Outreach Program for Women, or OPW). I'll co-mentor her work together with Matthieu Caneill.

I've just added sophiejjj's blog to Planet Debian, so you will soon hear about her work in the Debian blogosphere.

I've been impressed by the interest that the Debsources proposal in this round of OPW has spawned. Together with Matthieu I have interacted with more than a dozen OPW applicants. Many of them have contributed useful patches during the application period, and those patches have been in production at http://sources.debian.net since quite a while now (see the commit log for details). A special mention goes to Akshita Jha, who has shown a lot of determination in tackling both simple and complex issues affecting Debsources. I hope there will be other chances to work with her in the future.

OPW internship will begin December 9th, fasten your seat belts for a boost in Debsources development!

Catégories: Elsewhere

Jonathan Wiltshire: Getting things into Jessie (#1)

Planet Debian - dim, 16/11/2014 - 11:35
Make it easy for us to review your request

The release team gets a lot of mail at this time in the cycle. Make it easy for us by:

  • including as much information as you can think of
    • yes, even if you think it’s too much
    • remember we have probably never seen your package before
    • if you do write a lot, include a short summary at the top
  • not deviating from the freeze policy without a really good reason
    • explain why you deviated and why it’s really good in your request
  • demonstrating that you’ve considered and checked your changes carefully
    • that’s one (but not the sole) reason we ask for a source debdiff (and assume you’ve read it yourself)


Getting things into Jessie (#1) is a post from: jwiltshire.org.uk | Flattr

Catégories: Elsewhere

Matthew Palmer: A benefit of running an alternate init in Debian Jessie

Planet Debian - dim, 16/11/2014 - 06:00

If you’re someone who doesn’t like Debian’s policy of automatically starting on install (or its heinous cousin, the RUN or ENABLE variable in /etc/default/<service>), then running an init system other than systemd should work out nicely.

Catégories: Elsewhere

Jingjie Jiang: Start the new journey

Planet Debian - dim, 16/11/2014 - 04:26

I’m very excited about being accepted to the Debsources project in OPW. I’ll record everything about my adventure here.

Cheers ^_^

Catégories: Elsewhere

Jo Shields: mono-project.com Linux packages – an update

Planet Debian - sam, 15/11/2014 - 17:21

It’s been pointed out to me that many people aren’t aware of the current status of Linux packages on mono-project.com, so I’m here’s a summary:

Stable packages

Mono 3.10.0, MonoDevelop, NuGet 2.8.1 and F# packages are available. Plus related bits. MonoDevelop on Linux does not currently include the F# addin (there are a lot of pieces to get in place for this to work).

These are built for x86-64 CentOS 7, and should be compatible with RHEL 7, openSUSE 12.3, and derivatives. I haven’t set up a SUSE 1-click install file yet, but I’ll do it next week if someone reminds me.

They are also built for Debian 7 – on i386, x86-64, and IBM zSeries processors. The same packages ought to work on Ubuntu 12.04 and above, and any derivatives of Debian or Ubuntu. Due to ABI changes, you need to add a second compatibility extension repository for Ubuntu 12.04 or 12.10 to get anything to work, and a different compatibility extension repository for Debian derivatives with Apache 2.4 if you want the mod-mono ASP.NET Apache module (Debian 8+, Ubuntu 13.10+, and derivatives, will need this).

MonoDevelop 5.5 on Ubuntu 14.04

In general, see the install guide to get these going.


You may have seen Microsoft recently posting a guide to using ASP.NET 5 on Docker. Close inspection would show that this Docker image is based on our shiny new Xamarin Mono docker image, which is based on Debian 7.The full details are on Docker Hub, but the short version is “docker pull mono:latest” gets you an image with the very latest Mono.

directhex@desire:~$ docker pull mono:latest Pulling repository mono 9da8fc8d2ff5: Download complete 511136ea3c5a: Download complete f10807909bc5: Download complete f6fab3b798be: Download complete 3c43ebb7883b: Download complete 7a1f8e485667: Download complete a342319da8ea: Download complete 3774d7ea06a6: Download complete directhex@desire:~$ docker run -i -t mono:latest mono --version Mono JIT compiler version 3.10.0 (tarball Wed Nov 5 12:50:04 UTC 2014) Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com TLS: __thread SIGSEGV: altstack Notifications: epoll Architecture: amd64 Disabled: none Misc: softdebug LLVM: supported, not enabled. GC: sgen

The Dockerfiles are on GitHub.

Catégories: Elsewhere

Andrew Cater: Formal key transitiion to 4096 bit key

Planet Debian - sam, 15/11/2014 - 13:37
Following mini-Debconf and submitting my key to keyring-maint, here's a copy of the note marking the transition. I do retain a copy of the old key: it has not been compromised or revoked (until I'm sure my new key reaches the Debian keyring) and my vote in the GR is validly signed with the old key.

Date: Wed, 12 Nov 2014 08:11:53 +0000
From: "Andrew M.A. Cater"
To: keyring@rt.debian.org
Subject: Debian RT - new key for amacater
User-Agent: Mutt/1.5.23 (2014-03-12)

Hash: SHA1

pub   1024D/E93ADE7B 2001-07-04
      Key fingerprint = F3FA 2752 1327 7904 846D  C0DE 3233 C127 E93A DE7B
uid                  Andrew Cater (Andrew M.A. Cater)
sub   1024g/E8C8CC00 2001-07-04

pub   4096R/22EF1F0F 2014-08-29
      Key fingerprint = 5596 5E39 93E0 6E2B 5BA5  CD84 4AA8 FC24 22EF 1F0F
uid                  Andrew M.A. Cater (Andy Cater)
uid                  Andrew M.A. Cater (non-Debian email)
sub   4096R/923AB77E 2014-08-29

This is intended to replace the old key by the new key as part of a key transition from old, insecure keys

All the best,

Version: GnuPG v1


This because Google (and Planet Debian) are more reliable than my email inbox.

[Keys exchanged at the mini-Debconf have now been signed with the new 4096 bit key]

Catégories: Elsewhere

Don Armstrong: Adding a newcomer (⎈) tag to the BTS

Planet Debian - sam, 15/11/2014 - 04:14

Some of you may already be aware of the gift tag which has been used for a while to indicate bugs which are suitable for new contributors to use as an entry point to working on specific packages. Unfortunately, some of us (including me!) were unaware that this tag even existed.

Luckily, Lucas Nussbaum clued me in to the existence of this tag, and after a brief bike-shed-naming thread, and some voting using pocket_devotee we decided to name the new tag newcomer, and I have now added this tag to the BTS documentation, and tagged all of the bugs which were user tagged "gift" with this tag.

If you have bugs in your package which you think are ideal for new contributors to Debian (or your package) to fix, please tag them newcomer. If you're getting started in Debian, and working on bugs to fix, please search for the newcomer tag, grab the helm, and contribute to Debian.

Catégories: Elsewhere

Don Armstrong: Virginia King selected for Debbugs FOSS Outreach Program for Women

Planet Debian - sam, 15/11/2014 - 01:23

I'm glad to announce that Virginia King has been selected as one of the three interns for this round of the FOSS Outreach Program for women. Starting December 9th, and continuing until March 9th, she'll be working on improving the documentation of Debian's bug tracking system.

The initial goal is to develop a Bug Triager Howto to help new contributors to Debian jump in and help existing teams triage bugs. We'll be getting in touch with some of the larger teams in Debian to help make this document as useful as possible. If you're a member of a team in Debian who would like this howto to address your specific workflow, please drop me an e-mail, and we'll keep you in the loop.

The secondary goals for this project are to:

  • Improve documentation under http://www.debian.org/Bugs
  • Document of bug-tags and categories
  • Improve upstream debbugs documentation
Catégories: Elsewhere

Drupal Association News: Don't Miss the Blink Reaction Membership Discount

Planet Drupal - ven, 14/11/2014 - 23:09

At the Drupal Association, we love our members and want to show it. That’s why we team up with some of the best Drupal companies around every month to offer our members spectacular discounts.

This month, we’re pleased to announce that  Drupal Association Members can receive 30% off Blink Institute training classes from Blink Reaction. Using the discount code here, Drupal Association members can access fantastic training from Blink, led by veteran Drupalists who are expert trainers. Note: this offer can not be combined with other promotional offers.

Blink Reaction is a premiere provider of enterprise Drupal services to Fortune 1000 companies throughout the US. Their Drupal Training program is designed to help individuals, Enterprise service providers and small business owners harness the power of Drupal.

The Blink Training program has taught beginner and advanced methods to hundreds of individuals and corporations. Blink is proud to offer free and nearly free training through Global Drupal Training Days and at Drupal Camps alongside their public and private training offerings.

Make sure you take advantage of this great opportunity while it lasts. Kudos to our friends over at Blink -- thanks for sharing the Drupal love!

Catégories: Elsewhere

Code Karate: Drupal 7 Imagefield Focus

Planet Drupal - ven, 14/11/2014 - 22:31
Episode Number: 178

In this episode we look at the Imagefield Focus Module. This module adds another option to the image styles on a content type field. With this module you are able to specify a focus and crop area of your image. Once you have selected either or both of those areas the module then resizes and focuses on the certain area you specified.

Tags: DrupalFieldsDrupal 7Image HandlingDrupal PlanetUI/Design
Catégories: Elsewhere

Midwestern Mac, LLC: Creating a contact form programmatically in Drupal 8

Planet Drupal - ven, 14/11/2014 - 19:24

Drupal 8's expanded and broadly-used Entity API extends even to Contact Forms, and recently I needed to create a contact form programmatically as part of Honeypot's test suite. Normally, you can export a contact form as part of your site configuration, then when it's imported in a different site/environment, it will be set up simply and easily.

However, if you need to create a contact form programmatically (in code, dynamically), it's a rather simple affair:

First, use Drupal's ContactForm class at the top of the file so you can use the class in your code later:

Catégories: Elsewhere

Drupal Association News: Happy Global Training Day!

Planet Drupal - ven, 14/11/2014 - 18:39

It's Global Training Day and we couldn't be more excited! All across the world, people are teaching and learning Drupal, and sharing that open source love.

Global Training Days happen once a quarter, and focus on one of two curriculums:

  • "Introduction to Drupal," a full day training on the basics of Drupal. Attendees will leave having successfully built a Drupal site. It is ideal for those interested in exploring Drupal as a career path.
  • "What is Drupal?" This half-day workshop will address the basics of Drupal, and will give an overview to those interested in evaluating or implementing Drupal.

Here are some of the highlights of today's Global Training Day tweets.

The first Global #Drupal Training Day Hungary is ON! @tanarurkerem and @kuszingjanos on the stage :) cc @DrupalAssoc pic.twitter.com/DGt1yvFuPg

— Zsófi M. (@zsofimajor) November 14, 2014

We are ready #drupalday!!! pic.twitter.com/ezIIl1aNHC

— Wellnet (@Wellnet) November 14, 2014

#DrupalCampMelbourne2014 Day 1 Group Photo in sunny Melbourne! pic.twitter.com/DgFh9Wcb7I

— Drupal Melbourne (@DrupalMelbourne) November 14, 2014

Where's Global Training Day happening? This map shows you where people are learning about Drupal all over the world.

Catégories: Elsewhere

Paul Booker: How to create Blocks in Drupal 7

Planet Drupal - ven, 14/11/2014 - 18:28
// $Id$ /** * @file * Implements various blocks to improve pending content workflow. */ /** * Implements hook_block_info(). */ function approval_block_info() { $blocks['pending_comments'] = array( 'info' => t('Pending Comments'), 'status' => TRUE, 'region' => 'sidebar_first', 'weight' => 0, ); $blocks['unpublished_nodes'] = array( 'info' => t('Unpublished Nodes'), 'status' => TRUE, 'region' => 'sidebar_first', 'weight' => 0, ); return $blocks; } /** * Implements hook_block_configure(). */ function approval_block_configure($delta) { $form = array(); switch($delta) { case 'pending_comments': $form['pending_comment_count'] = array( '#type' => 'textfield', '#title' => t('Configure Number of Comments to Display'), '#size' => 6, '#description' => t('Enter the number of pending comments that will appear in the block.'), '#default_value' => variable_get('pending_comment_count', 5), ); break; case 'unpublished_nodes': $form['unpublished_node_count'] = array( '#type' => 'textfield', '#title' => t('Configure Number of Nodes to Display'), '#size' => 6, '#description' => t('Enter the number of unpublished nodes that will appear in the block.'), '#default_value' => variable_get('unpublished_node_count', 5), ); break; } return $form; } /** * Implements hook_block_save(). */ function approval_block_save($delta = '', $edit = array()) { switch($delta) { case 'pending_comments': variable_set('pending_comment_count', (int)$edit['pending_comment_count']); break; case 'unpublished_nodes': variable_set('unpublished_node_count', (int)$edit['unpublished_node_count']); break; } return; } /** * Implements hook_block_view(). */ function approval_block_view($delta = '') { switch ($delta) { case 'pending_comments': $block['subject'] = t('Pending Comments'); $block['content'] = approval_block_contents($delta); return $block; break; case 'unpublished_nodes': $block['subject'] = t('Unpublished Nodes'); $block['content'] = approval_block_contents($delta); return $block; break; } } /** * A module-defined block content function. */ function approval_block_contents($delta) { switch ($delta) { case 'pending_comments': if (user_access('administer comments')) { $nbr_comments = variable_get('pending_comment_count'); $result = db_query("SELECT cid, subject FROM {comment} WHERE status = 0 limit $nbr_comments"); $items = array(); foreach ($result as $row) { $items[] = l($row->subject, 'comment/'.$row->cid.'/edit'); } return array('#markup' => theme('item_list', array('items' => $items))); } break; case 'unpublished_nodes': if (user_access('administer nodes')) { $nbr_nodes = variable_get('unpublished_node_count'); $result = db_query("SELECT nid, title FROM {node} WHERE status = 0 limit $nbr_nodes"); $items = array(); foreach ($result as $row) { $items[] = l($row->title, 'node/'.$row->nid.'/edit'); } return array('#markup' => theme('item_list', array('items' => $items))); } break; } } Tags: URL: paulbooker / gist:5420976
Catégories: Elsewhere

Richard Hartmann: Release Critical Bug report for Week 46

Planet Debian - ven, 14/11/2014 - 17:34

I know I promised better stats, but meh... Next week :(

As you can see, there's been a bit of a mass-filing going on. and that pushed ys above Wheezy's count for week 46.

My own personal favourite bug is, of course, this one.

The UDD bugs interface currently knows about the following release critical bugs:

  • In Total: 1263 (Including 218 bugs affecting key packages)
    • Affecting Jessie: 427 (key packages: 175) That's the number we need to get down to zero before the release. They can be split in two big categories:
      • Affecting Jessie and unstable: 313 (key packages: 131) Those need someone to find a fix, or to finish the work to upload a fix to unstable:
        • 33 bugs are tagged 'patch'. (key packages: 15) Please help by reviewing the patches, and (if you are a DD) by uploading them.
        • 12 bugs are marked as done, but still affect unstable. (key packages: 6) This can happen due to missing builds on some architectures, for example. Help investigate!
        • 268 bugs are neither tagged patch, nor marked done. (key packages: 110) Help make a first step towards resolution!
      • Affecting Jessie only: 114 (key packages: 44) Those are already fixed in unstable, but the fix still needs to migrate to Jessie. You can help by submitting unblock requests for fixed packages, by investigating why packages do not migrate, or by reviewing submitted unblock requests.
        • 82 bugs are in packages that are unblocked by the release team. (key packages: 32)
        • 32 bugs are in packages that are not unblocked. (key packages: 12)

How do we compare to the Squeeze release cycle?

Week Squeeze Wheezy Diff 43 284 (213+71) 468 (332+136) +184 (+119/+65) 44 261 (201+60) 408 (265+143) +147 (+64/+83) 45 261 (205+56) 425 (291+134) +164 (+86/+78) 46 271 (200+71) 401 (258+143) +130 (+58/+72) 47 283 (209+74) 366 (221+145) +83 (+12/+71) 48 256 (177+79) 378 (230+148) +122 (+53/+69) 49 256 (180+76) 360 (216+155) +104 (+36/+79) 50 204 (148+56) 339 (195+144) +135 (+47/+90) 51 178 (124+54) 323 (190+133) +145 (+66/+79) 52 115 (78+37) 289 (190+99) +174 (+112/+62) 1 93 (60+33) 287 (171+116) +194 (+111/+83) 2 82 (46+36) 271 (162+109) +189 (+116/+73) 3 25 (15+10) 249 (165+84) +224 (+150/+74) 4 14 (8+6) 244 (176+68) +230 (+168/+62) 5 2 (0+2) 224 (132+92) +222 (+132/+90) 6 release! 212 (129+83) +212 (+129/+83) 7 release+1 194 (128+66) +194 (+128/+66) 8 release+2 206 (144+62) +206 (+144/+62) 9 release+3 174 (105+69) +174 (+105/+69) 10 release+4 120 (72+48) +120 (+72/+48) 11 release+5 115 (74+41) +115 (+74/+41) 12 release+6 93 (47+46) +93 (+47/+46) 13 release+7 50 (24+26) +50 (+24/+26) 14 release+8 51 (32+19) +51 (+32/+19) 15 release+9 39 (32+7) +39 (+32/+7) 16 release+10 20 (12+8) +20 (+12/+8) 17 release+11 24 (19+5) +24 (+19/+5) 18 release+12 2 (2+0) +2 (+2/+0)

Graphical overview of bug stats thanks to azhag:

Catégories: Elsewhere

Paul Booker: How to create an autocomplete form element in Drupal 7

Planet Drupal - ven, 14/11/2014 - 17:22
<?php function demo_menu() { $items['demo-autocomplete-test'] = array( 'title' => 'Test autocomplete', 'page callback' => 'drupal_get_form', 'page arguments' => array('demo_form'), 'access arguments' => array('view published content'), 'type' => MENU_NORMAL_ITEM, ); $items['demo-autocomplete-engine'] = array( 'page callback' => 'demo_autocomplete', 'access arguments' => array('view published content'), 'type' => MENU_CALLBACK, ); return $items; } function demo_form($form, &$form_state) { $form = array(); $form['colors'] = array( '#title' => t('Colors'), '#type' => 'textfield', '#maxlength' => 60, '#autocomplete_path' => 'demo-autocomplete-engine', ); $form['submit'] = array( '#type' => 'submit', '#value' => 'Submit', ); return $form; } function demo_autocomplete($text) { $results = array(); $query = db_select('colors', 'c'); $query ->condition('c.color', '%' . db_like($text) . '%', 'LIKE') ->fields('c', array('color')) ->orderBy('color', 'ASC'); $colors = $query->execute(); foreach ($colors as $row) { $results[$row->color] = check_plain($row->color); } drupal_json_output($results); } Tags:
Catégories: Elsewhere

MariqueCalcus: Prius is in Beta like Drupal :-)

Planet Drupal - ven, 14/11/2014 - 17:05

Alongside the long awaited Drupal 8 Beta release, we have also updated our first Drupal 8 theme. We haven't include many new features but we have tried to clean up its code and have improved our starter kit. Anyway, let's dig into the latest new features we have discovered with the first Beta releases of Drupal 8. Feel free to check out the code on drupal.org or read our dedicated blog entry if you want to find out more about our first Drupal 8 theme. If you can wait to see the result, take a look at our online demo.

Catégories: Elsewhere

Blue Drop Shop: Failing is Important: Drupal Camp A/V Kit Update

Planet Drupal - ven, 14/11/2014 - 15:17

When I learned BADCamp wasn't going to be recording sessions, I jumped at the chance to field-test the camp record kits I'm working on. After all, I was confident I fixed the audio equation and was going to start talks with the Drupal Association about next steps.

The current recipe for the kit is a Hauppage HD Rocket PVR for the screen capture and the Zoom H2N voice recorder as the microphone. Add to that a handful of dongles and converters to cover HDMI in/out for the PVR, and you're good to go.

Walking in to BADCamp, I was feeling great. I'm a big advocate for session records and I would be covering three rooms. Pretty cool, right? 


Throughout day one of sessions, a couple laptops had connection issues and had to bypass recordings, but overall things appeared to be going smoothly. It wasn't until the end of the day when copying files off the thumb drives that I noticed many recordings were 0k mp4 files, primarily from the main room. This was the most disconcerting, because every indication was that things were working.

On this, I have a couple ideas, but no solid understanding of why the files didn't write. That was the easiest room in terms of handshake between PVR and projector, plus there was a dedicated A/V crew that was helping hook up laptops.

When we tested at Fox Valley's camp, the laptop was typically disconnected by the time I made it to the rooms to swap out equipment. I suspect that disconnecting the device before hitting the stop button and waiting long enough for the files to write may kill the save. This one will be easy to test.

Projectors were also an issue. In the main space, none were HD and all were different flavors of Sony. Some hooked up just fine, while others squeezed the output. The Saturday-only keynote room was loving it. 

And then there were presenter laptop issues. There were a few older VGA-only laptops. One refused to work with the VGA to HDMI converted, while one worked for about 15 minutes before failing off and on, mid-presentation. One of the A/V techs suggested that maybe there is not enough USB power on the laptops to handle both the PVR and the converter, so a powered USB hub may be in order. Most Macbooks were fine, but a handful gave output with a very green tint to it.

No surprise, HDMI in/out is proving to be more of a hurdle than originally anticipated. In addition to HDMI in, the PVR also has an option to accept component video. It's likely that converting VGA out from a laptop to component video in to the PVR will be a safer bet. So the question becomes whether I can convert the HDMI out of the PVR to VGA for the projectors.   

All in all, this was an enormous fail. That said, this was the absolute best time for it to happen. My goal is to build a system that can handle the majority of the random that a camp will throw at it. 

I'm looking forward to testing the next iteration.

Catégories: Elsewhere

Tyler Frankenstein: Build a Mobile App to Geo Locate Nearby Places with Drupal

Planet Drupal - ven, 14/11/2014 - 13:30

In this tutorial (for DrupalCamp Ohio 2014) we'll explore how to build a mobile application and website that can geo locate places near our current position. The nearby location results will be displayed on a map, and will allow us to click on a result item to view its complete details.

The website will be powered by Drupal 7. The mobile application will be built using DrupalGap, which is powered by PhoneGap and jQuery Mobile. Let's get started!

Catégories: Elsewhere


Subscribe to jfhovinne agrégateur - Elsewhere