FLOSS Project Planets

Glyph Lefkowitz: Photo Flow

Planet Python - Fri, 2017-09-22 21:27

Hello, the Internet. If you don’t mind, I’d like to ask you a question about photographs.

My spouse and I both take pictures. We both anticipate taking more pictures in the near future. No reason, just a total coincidence.

We both have iPhones, and we both have medium-nice cameras that are still nicer than iPhones. We would both like to curate and touch up these photos and actually do something with them; ideally we would do this curation collaboratively, whenever either of us has time.

This means that there are three things we want to preserve:

  1. The raw, untouched photographs, in their original resolution,
  2. The edits that have been made to them, and
  3. The “workflow” categorization that has been done to them (minimally, “this photo has not been looked at”, “this photo has been looked at and it’s not good enough to bother sharing”, “this photo has been looked at and it’s good enough to be shared if it’s touched up”, and “this has been/should be shared in its current state”). Generally speaking this is a “which album is it in” categorization.

I like Photos. I have a huge photo library with years of various annotations in it, including faces (the only tool I know of that lets you do offline facial recognition so you can automatically identify pictures of your relatives without giving the police state a database to do the same thing).

However, iCloud Photo Sharing has a pretty major issue; it downscales photographs to “up to 2048 pixels on the long edge”, which is far smaller even than the 12 megapixels that the iPhone 7 sports; more importantly it’s lower resolution than our television, so the image degradation is visible. This is fine for sharing a pic or two on a small phone screen, but not good for a long-term archival solution.

To complicate matters, we also already have an enormous pile of disks in a home server that I have put way too much energy into making robust; a similarly-sized volume of storage would cost about $1300 a year with iCloud (and would not fit onto one account, anyway). I’m not totally averse to paying for some service if it’s turnkey, but something that uses our existing pile of storage would definitely get bonus points.

Right now, my plan is to dump all of our photos into a shared photo library on a network drive, only ever edit them at home, try to communicate carefully about when one or the other of us is editing it so we don’t run into weird filesystem concurrency issues, and hope for the best. This does not strike me as a maximally robust solution. Among other problems, it means the library isn’t accessible to our mobile devices. But I can’t think of anything better.

Can you? Email me. If I get a really great answer I’ll post it in a followup.

Categories: FLOSS Project Planets

Justin Mason: Links for 2017-09-22

Planet Apache - Fri, 2017-09-22 19:58
Categories: FLOSS Project Planets

Palantir: Drupal 8 is Great for Sustaining Innovation

Planet Drupal - Fri, 2017-09-22 18:17
Drupal 8 is Great for Sustaining Innovation brandt Fri, 09/22/2017 - 17:17 Ken Rickard Sep 25, 2017

The #D8isGr8 blog series will focus on why we love Drupal 8 and how it provides solutions for our clients.

We want to make your project a success.

Let's Chat.

The first post in our series comes from Ken Rickard, Director of Professional Services.

I’ve been working with Drupal since version 4.5, starting in late 2004, working as an end user, product manager, developer, team lead, core contributor, sales engineer, and sales manager. Since its release in 2015, Palantir.net has been using Drupal 8 to provide solutions for ourselves and our clients.

In that time, we’ve started to identify the long-term benefits that really make Drupal 8 shine. While many of these benefits appear to be developer-centric, the story that they tell is how the platform helps organizations of all sizes to invest in sustained innovation.

From a business perspective, we can focus on three fundamental changes in Drupal 8.

The Release Cycle

Drupal 8 adopted a more standard semantic versioning that indicates the major version, API release, and feature release status of Drupal core. As of this writing, core stands at 8.3.7, and the 8.4.0 release is in beta testing.

Along with semantic versioning came a commitment to regular release cycles -- planned for every six months -- and a commitment to maintain backwards-compatibility. These changes make core releases more predictable, both for resourcing and implementation. We know when the next version is coming, what new features are included, and how any changes will affect our existing sites and code.

This predictability brings Drupal more in line with traditional software releases, and provides a huge benefit to contributors and customers alike.

Backwards Compatibility

With the new release cycle, the project finally has a proactive plan for dealing with backwards compatibility issues. Instead of major upgrades between versions, Drupal is prepared to offer incremental changes that foster long-term stability without sacrificing innovation.

We know in advance what elements have been marked as deprecated and when they are scheduled for removal. (Hint: largely when Drupal 9 development begins in earnest.)

Component Architecture

Perhaps even more than the first two features, the shift to using a library-based approach to code -- where essential components are integrated from external libraries -- gives organizations even more control over their innovations. Drupal now uses Composer and other modern PHP development practices, so we can decouple our code -- both front-end and back-end -- from Drupal specifics.

Since we can move large sections of Drupal code into standalone libraries, we can spend less time working through specifics of a Drupal implementation and focus instead on the technical and business problems that the software needs to solve.

Sustaining Innovation Through Open Source

Taken together, these three elements are powerful. Combined with the GPL open source license that allows anyone to use, improve, and share their code, we have an overall platform devoted to innovation. From a business standpoint, the long-term value of investment in Drupal 8 will be measured in years. Since the software is free to use, companies can invest in their teams and create an environment of sustained success through innovation.

We want to make your project a success.

Let's Chat.
Categories: FLOSS Project Planets

Enrico Zini: Systemd on the command line

Planet Debian - Fri, 2017-09-22 18:00

These are the notes of a training course on systemd I gave as part of my work with Truelite.

Exploring the state of a system
  • systemctl status [unitname [unitname..]] show status of one or more units, or of the whole system. Glob patterns also work: systemctl status "systemd-fsck@*"
  • systemctl list-units or just systemctl show a table with all units, their status and their description
  • systemctl list-sockets lists listening sockets managed by systemd and what they activate
  • systemctl list-timers lists timer-activated units, with information about when they last ran and when they will run again
  • systemctl is-active [pattern] checks if one or more units are in active state
  • systemctl is-enabled [pattern] checks if one or more units are enabled
  • systemctl is-failed [pattern] checks if one or more units are in failed state
  • systemctl list-dependencies [unitname] lists the dependencies of a unit, or a system-wide dependency tree
  • systemctl is-system-running check if the system is running correctly, or if some unit is in a failed state
  • systemd-cgtop like top but processes are aggregated by unit
  • systemd-analyze produces reports on boot time, per-unit boot time charts, dependency graphs, and more
Start and stop services

Similar to the System V service command, systemctl provides commands to start/stop/restart/reload units or services:

  • start: starts a unit if it is not already started
  • stop: stops a unit
  • restart: starts or restarts a unit
  • reload: tell a unit to reload its configuration (if it supports it)
  • try-restart: restarts a unit only if it is already active, otherwise do nothing, to prevent accidentally starting a service
  • reload-or-restart: tell a unit to reload its configuration if supported, otherwise restart it
  • try-reload-or-restart: tell a unit to reload its configuration if supported, otherwise restart it. If the unit is not already active, do nothing to prevent accidentally starting a service.
Changing global system state

systemctl has halt, poweroff, reboot, suspend, hibernate, and hybrid-sleep commands to tell systemd to reboot, power off, suspend and so on. kexec and switch-root also work.

The rescue and emergency commands switch the system to rescue and emergency mode (see man systemd.special. systemctl default switches to the default mode, which also happens when exiting the rescue or emergency shell.

Run services at boot

systemd does not implement runlevels, and services start at boot based on their dependencies.

To start a service at boot, you add to its .service file a WantedBy= dependency on a well-known .target unit.

At boot, systemd brings up the whole chain of dependency started from a default unit, and that will eventually activate also your service.

See systemctl get-default for what unit is currently the default in your system. You can change it via the systemd.unit= kernel command line, so you can configure multiple entries in the boot loader that boot the system running different services. For example systemd.unit=rescue.target for a rescue mode, systemd.unit=multi-user.target for a non-graphical mode, or add your own .target file to implement new system modes.

See systemctl list-units -t target --all for a list of all currently available targets in your system.

  • systemctl enable unitname enables the unit to start at boot, by creating symlinks to it in the .wants directory of the units listed in its WantedBy= configuration
  • systemctl disable unitname removes the symlinks created by enable
  • systemctl reenable unitname removes and readds the symlinks for when you changed WantedBy=

Notes: systemctl start activates a unit right now, but does not automatically enable it at boot systemctl enable enables a unit at boot, but does not automatically start it right now * a disabled unit can still be activated if another unit depends on it

To disable a unit so that it will never get started even if another unit depends on it, use systemctl mask unitname. Use systemctl unmask unitname to undo the masking.

Reloading / restarting systemd

systemctl daemon-reload tells systemd to reload its configuration.

systemctl daemon-reexec tells systemd to restart iself.

Categories: FLOSS Project Planets

Lonely Cactus: 9/22/17

GNU Planet! - Fri, 2017-09-22 16:42
In digging through the ASIO C++ library examples, I came across an actual use of std::bind. Its entry in cppreference seemed like buzzword salad, so I never previously had paid it any attention.

But in ASIO, they use std::bind to create functions from class methods and associated data.  The functions get passed to its async driver.  So if I liken the output of std::bind to a sort of closure that returns a procedure, it makes sense to me.
Categories: FLOSS Project Planets

Django Weblog: Django 2.0 alpha 1 released

Planet Python - Fri, 2017-09-22 14:32

Django 2.0 alpha 1 is now available. It represents the first stage in the 2.0 release cycle and is an opportunity for you to try out the changes coming in Django 2.0.

Django 2.0 has an assortment of new features which you can read about in the in-development 2.0 release notes.

This alpha milestone marks a complete feature freeze. The current release schedule calls for a beta release in about a month and a release candidate about a month from then. We'll only be able to keep this schedule if we get early and often testing from the community. Updates on the release schedule schedule are available on the django-developers mailing list.

As with all alpha and beta packages, this is not for production use. But if you'd like to take some of the new features for a spin, or to help find and fix bugs (which should be reported to the issue tracker), you can grab a copy of the alpha package from our downloads page or on PyPI.

The PGP key ID used for this release is Tim Graham: 1E8ABDC773EDE252.

Categories: FLOSS Project Planets

Bryan Pendleton: In which people discuss things I don't understand

Planet Apache - Fri, 2017-09-22 12:56

  • Top Uber Investor Resists SoftBank DealThe opposition by Benchmark Capital is complicating a proposal by SoftBank and its $93 billion tech-focused Vision Fund, along with partners, to buy 17% to 22% of Uber--mostly through purchasing shares from existing shareholders.

    Benchmark has told fellow investors it is unlikely to sell any of its 13% holding to the SoftBank consortium, according to people familiar with the matter. And Benchmark's representative on Uber's board, Matt Cohler, was the only one of Uber's eight directors to vote against a term sheet granting SoftBank exclusive rights to an investment deal, the people said.

  • Alphabet’s Waymo wants Uber to pay $2.6 billion in damages for a single allegedly stolen trade secretUber calls Alphabet’s damages claims “inflated” and “based entirely on speculative future profits and cost savings in a nascent market.”

    The damages Alphabet is seeking for each of the nine trade secrets vary and have been redacted within the document. So there’s still no indication of which trade secret claim Alphabet is seeking $2.6 billion for, nor what amount the company is asking for the other eight trade secrets.

  • Uber has a lot of reasons to settle its lawsuit with AlphabetAlphabet isn’t just taking Uber for a legal ride. It wants to cause some serious damage, which some inside think is part of an effort to slow down Uber’s self-driving efforts.

    But Alphabet’s endless legal and financial resources — and determination from top execs at the company to make an example of Uber — are powerful reasons that Khosrowshahi might seek a settlement.

  • Uber Loses Its License to Operate in LondonThe agency took direct aim at Uber’s corporate culture, declaring that the company’s “approach and conduct demonstrate a lack of corporate responsibility in relation to a number of issues which have potential public safety and security implications.”
  • Uber Is Sorry for ‘Wife Appreciation Day’ PromoThe promo, only valid on September 17, read:

    Dear husbands, a gentle reminder — today is Wife Appreciation Day. Order on uberEATS and leet your wife take a day off from the kitchen.

  • Chinese-backed rival takes on Uber in LondonOnce the initial discounts end, Taxify still aims to be 10% cheaper than Uber, CEO Markus Villig told CNNMoney.

    "I think we mainly have a very strong second mover advantage," Villig said. "We don't need to do the hard work of actually establishing this market. We can rather come in, be more efficient, more lean and take a smaller cut for ourselves, and therefore undercut the existing incumbents."

Categories: FLOSS Project Planets

Bryan Pendleton: Nope, never played it.

Planet Apache - Fri, 2017-09-22 11:44

Kotaku take a long, loving look at The Notorious Board Game That Takes 1,500 Hours To Complete

The game itself covers the famous WWII operations in Libya and Egypt between 1940 and 1943. Along with the opaque rulebook, the box includes 1,600 cardboard chits, a few dozen charts tabulating damage, morale, and mechanical failure, and a swaddling 10-foot long map that brings the Sahara to your kitchen table. You’ll need to recruit 10 total players, (five Allied, five Axis,) who will each lord over a specialized division. The Front-line and Air Commanders will issue orders to the troops in battle, the Rear and Logistics Commanders will ferry supplies to the combat areas, and lastly, a Commander-in-Chief will be responsible for all macro strategic decisions over the course of the conflict. If you and your group meets for three hours at a time, twice a month, you’d wrap up the campaign in about 20 years.

There DEFINITELY was a time in my life that this would have Been My Thing.

Who knows? Perhaps that day will come again.

Categories: FLOSS Project Planets

Bryan Pendleton: All is Lost: a very short review

Planet Apache - Fri, 2017-09-22 11:35

WARNING! Spoilers ahead!

Although, if you haven't already seen All is Lost by now, you're probably never going to see it, or at least you're not going to feel too broken up by my spoilers, I hope?

I think there are probably at least two reasonable "readings" of the marvelous Robert Redford movie, All is Lost.

A straightforward reading is to see it as an adventure story, with the setting for the adventure being "solo sailing on the open ocean":

  1. What would you do if your boat was suddenly and unexpectedly damaged?
  2. How would you keep yourself alive as long as possible?
  3. What actions could you take to increase your likelihood of being discovered/found/rescued?
  4. How would you keep your mental health and motivation high under a time of great stress?

And so forth.

Another reading, perhaps equally valid, and perhaps equally interesting, is to see the movie in a more spiritual way, as a metaphor for your life and existence. You'll think this is a stretch, but consider:

  1. At the beginning of the movie, Redford is sleeping, comfortably secure and at rest in the "womb" of his sailboat.
  2. He is awoken by a fierce and terrifying event (the mid-ocean collision with the submerged shipping container) which pulls him out of his simple and trivial existence and immediately poses immediate and life-threatening problems for him to solve.
  3. As he goes, he solves one problem after another, adapting to his surroundings, using what he has been given at "birth", learning from his experiences, exploring his world.
  4. At the end, when all is, in fact, lost, and Redford is sinking below the waves, looking up, he sees first a halo (the doughnut-shaped life raft, on fire), then a bright light, then, as he reaches out, there is a disembodied hand that reaches down from above, to pull him up to his next life.

I'm sure there are other readings as well, but these are two that occurred to me.

Honestly, we aren't given an awful lot of information about how to choose a reading for this movie, which makes it very similar to another lovely-but-odd-movie-set-aboard-a-boat-with-much-symbolism, Life of Pi.

But, getting back to All is Lost, the most important input into the reading of the movie, I think, is the short speech that is delivered at the start of the movie, in a flash-forward (see, I told you this was nothing but spoilers), which goes as follows:

I'm sorry. I know that means little at this point, but I am. I tried, I think you would all agree that I tried. To be true, to be strong, to be kind, to love, to be right. But I wasn't. And I know you knew this. In each of your ways. And I am sorry. All is lost here, except for soul and body, that is, what's left of them, and a half day's ration. It's inexcusable really, I know that now. How it could have taken this long to admit that I'm not sure, but it did. I fought till the end. I'm not sure what that is worth, but know that I did. I have always hoped for more for you all. I will miss you. I'm sorry. From the reference to 'soul and body', to the topics of being 'true' and 'right' and 'hoping for more', to the overall framing of this speech as something that might occur on Judgement Day, it's quite hard to see this speech as being included in the movie for any reason other than to promote the "spiritual" reading of the movie.

The "this movie tells the story of the life of a human" reading.

I don't have much more to say about any of this (not even sure this much was worth saying), but there it is.

And, of course, this wasn't a very challenging reading: plenty of others noticed this the first time they saw it

And, of course of course, it wasn't really the best movie to learn about sailing.

But anyway: Robert Redford! Sailing! Movie!

I enjoyed watching it.

Categories: FLOSS Project Planets

The Evolution of Plasma Mobile

Planet KDE - Fri, 2017-09-22 11:19

Plasma Mobile

Back around 2006, when the Plasma project was started by Aaron Seigo and a group of brave hackers (among which, yours truly) we wanted to create a user interface that is future-proof. We didn’t want to create something that would only run on desktop devices (or laptops), but a code-base that grows with us into whatever the future would bring. Mobile devices were already getting more powerful, but would usually run entirely different software than desktop devices. We wondered why. The Linux kernel served as a wonderful example. Linux runs on a wide range of devices, from super computers to embedded systems, you would set it up for the target system and it would run largely without code changes. Linux architecture is in fact convergent. Could we do something similar at the user interface level?

Plasma Netbook

In 2007, Asus introduced the Eee PC, a small, inexpensive laptop. Netbooks proved to be all the rage at that point, so around 2009, we created Plasma Netbook, proving for the first time that we could actually serve different device user interfaces from the same code-base. There was a decent amount of code-sharing, but Plasma Netbook also helped us identifying areas in which we wanted to do better.

Plasma Mobile (I)

Come 2010, we got our hands on an N900 by Nokia, running Maemo, a mobile version of Linux. Within a week, during a sprint, we worked on a proof-of-concept mobile interface of Plasma:

Well, Nokia-as-we-knew-it is dead now, and Plasma never materialized on Nokia devices.

Plasma Active

Plasma Active was built as a successor to the early prototypes, and our first attempt at creating something for end-users. Conceived in 2011, the idea was not just to produce a simple Plasma user interface for a tablet device, but also deliver on a range of novel ideas for interaction with the device, closely related to the semantic desktop. Interlinked documents, contacts, sharing built right into the core, not just a “dumb” platform to run apps on, but a holistic system that allows users to manage their digital life on the fly. While Plasma Active had great promise and a lot of innovative potential, it never materialized for end-users in part due to lack of interest from both, the KDE community itself, but also from people on the outside. This doesn’t mean that the work put into it was lost, but thanks to a convergent code-base, many improvements made primarily with Plasma Active in mind have improved Plasma for all its users and continue to do so today. In many ways, Active proved valuable as a playground, as a clean slate where we want to take the technology, and how we can improve our developemnt process. It’s not a surprise that Plasma 5 today is developed in a process very similar to how we approached Plasma Active back then.

Plasma Mobile (II)

Learning from the Plasma Active project, in 2015 we regrouped and started to build a rather simple smartphone user interface, along with a reference software stack that would allow us not only to develop Plasma Mobile further, but to allow us to run on a growing number of devices. Plasma Mobile (II)’s goal wasn’t to get the most innovative of interfaces out, but to create a bread-and-butter platform, a base to develop applications on. From a technology point of view, Plasma is actually very small. It shares approximately 95% of the code with its desktop companion, widgets, and increasingly applications are interchangeable between the two.

Plasma Mobile (in any shape or form) has never been this close to actually making it into the hands and pockets of end users. A collaboration project with Purism, a company bringing privacy and software freedom to end-users, we may create the first Plasma phone for end users and have it on the market as soon as januari 2019. If you want to support this project, the crowdfunding campaign has just passed the 40% mark, and you can be part of it — either by joining the development crew, or by pre-ordering a device and thereby funding the development.

Categories: FLOSS Project Planets

PyCharm: Interview: Kenneth Love on testing, Python, and organizing

Planet Python - Fri, 2017-09-22 11:00

Python is one of the easiest languages to learn, but that doesn’t mean all the programming concepts become easy. One that’s hard: testing.

Kenneth Love, well-known speaker, organizer, and teacher in Python, has years of experience bringing complicated subjects within reach. He’ll be our guest for a webinar on Visual Testing With PyCharm. He’ll introduce testing concepts and show how PyCharm makes it easier by putting a visual face on testing.

We interviewed Kenneth to help set the scene for the webinar.

It’s a pleasure having you with us for a webinar. My son and I spent summer vacation going through your Python Basics course twice and it was a big help. Do you get that a lot?

Yeah, I’ve had quite a few people thank me for making that course, and others that I’ve made, over the years. It seems to be a course that has really caught people that weren’t able to get going at Python through other means.

Give us a little background on yourself, your Python origin story and what you’re doing now.

I’ve been using Python for 8-10 years now. I picked it up, almost on a whim, after a friend and I both kind of soured on Ruby. I made the mistake of learning Django before I really learned Python. Eventually, though, I figured out that I should know how more than just an ORM and HTTP works and learned the core parts of the language. I’ve been a full-time Python developer or teacher for the past six or seven years.

I just recently changed jobs and left teaching to go back into the world of development. Things are changing all the time and I felt like I needed to get back to development for awhile.

Is testing hard to teach?

I think it’s a tricky area to teach. People are used to writing and running code. But writing code that runs your code and looks at what happens? It’s just a bit too meta for a lot of beginners. It’s also the case that a lot of beginners write code that’s hard to test, through no fault of their own (they’re beginners! I know I wrote messy code when I was first starting) so that can really increase the complexity of learning to test.

Do you have special tricks that seem to work on conceptually hard topics? Debugging, testing, things like that.

Like with most topics, you have to strip away the magic and the special words. We often have a problem in tech of gatekeeping with jargon. We use words that have very specific meanings, like say “fixtures”, and we expect everyone to just know them. When someone is new to testing, the term “fixtures” might not have any meaning at all, or mean something completely unrelated. If you can define these terms for them, make them familiar and comfortable, then they can get onto the business of learning this new technique a lot faster.

You’re also well-known for organizing. Can you give us your origin story on how you got involved?

I honestly just kind of stumbled into it! My friend Lacey Williams Henschel wanted to do a Django Girls workshop here in Portland. The company I worked for had a great space for it, so I volunteered it. She wanted a co-organizer so I volunteered for that, too. We had a great event and went on to do two more of them after that.

I got into organizing DjangoCon US by being a pain in the butt. I was a pretty big critic of the previous incarnation of DjangoCon US, before it became community-ran. So when the community took it over, I kinda got tapped to help out (no one forced me, of course, but I felt like I had to step up). Since then I’ve been involved in the program selection for the past two years and did a lot of speaker encouragement and talk rating before that.

Django Girls is such a wonderful story. Mind giving us some background and status on that?

Honestly, I’m not heavily involved with Django Girls any longer. Lacey and I organized the three events and then we both mostly bowed out. It’s definitely an amazing organization and I’m completely astounded by the numbers they recently posted. I would love to see more DG-like organizations pop up for other languages and frameworks.

Let’s close out with kind of an open-ended question. What’s something you think you’ll study a lot more in the next year?

I’m really interested in this recent upswing of languages that are focused more on speed and safety. I’d really like to spend some time digging into the Rust programming language. Due to work, I’ll likely be learning more about React and Go as well.

Categories: FLOSS Project Planets

Matt Raible: The JHipster Mini-Book v4.0 Now Available for Download!

Planet Apache - Fri, 2017-09-22 10:26

The JHipster Mini-Book v4.0 is now available as a free download from InfoQ. Get it while it's hot! You'll also be able to buy a print version in a week or two. You can read all about what’s changed since v2.0 on the JHipster Mini-Book blog.

The source code for the application developed in the book (21-Points Health) is available on GitHub.

Thanks to the InfoQ publishing team, Dennis Sharpe for tech editing, and Lawrence Nyveen for copy editing. And most of all, thank you Asciidoctor for making the publishing process so easy!

Categories: FLOSS Project Planets

NumFOCUS: Open Journals joins NumFOCUS Sponsored Projects

Planet Python - Fri, 2017-09-22 10:00
NumFOCUS is pleased to welcome the Open Journals as a fiscally sponsored project. Open Journals is a collection of open source, open access journals. The team behind Open Journals believes that code review and high-quality, reusable software are a critical–but often overlooked–part of academic research. The primary goal of Open Journals is to provide venues […]
Categories: FLOSS Project Planets

Valuebound: How to secure your user’s private data from unauthorised access by enabling SSL on your web server

Planet Drupal - Fri, 2017-09-22 09:54

As a member of development team, I used to develop web applications using Drupal CMS without worrying about HTTP or HTTPS as it has to be added by dev operational team in my organization. On the serious note “How the Secure Sockets Layer (SSL) prepended to the existing URL” and How does it make a huge difference? Why it is important to make your web URL prepend https instead of HTTP.

Today SSL has become an eye-glazing topic and people want to know more about it so that they can protect their data from unauthorized access. In this blog post, we will take a brief look at basics of SSL and discuss how to secure the website running on Apache with HTTPS. Don’t worry! It's not a rocket science and very simple to secure your site as well as private data. In between, we will also…

Categories: FLOSS Project Planets

Georges Dubus: Share scripts that have dependencies with Nix

Planet Python - Fri, 2017-09-22 09:00

Writing and sharing scripts is essential to productivity in development teams. But if you want the script to work everywhere, you can only depend on the tools that are everywhere. That usually means not using the newer features of a language, and not using libraries. In this article, I explain how I use Nix to write scripts that can run everywhere, regardless on what they depend on.

In my work as a software engineer, I often write small scripts to help with administrative actions or provide some nice view of what we are working on. From time to time, one of these scripts is useful enough that I want to share it with my colleagues.

But sharing the scripts comes with a challenge. I write my scripts in Python because it is a great language for that kind of things. But the best parts are outside of the standard library. As a result, to share my scripts, I also have to write a documentation explaining how to get the right version of python, create a python virtual environment, activate it, install the dependencies, and run the script. That's not worth the hassle, and my colleagues won't bother following the complex set of instructions for a script.

Recently, I've started using Nix to make self-contained scripts, and it's been working pretty well.

A script that can download its dependencies

For example, some of the things I like using in python scripts are:

  • the new string formatting syntax in Python 3.6,
  • the requests package for anything that touches HTTP
  • docopt for argument parsing.

My scripts will usually look like:

#! /usr/bin/env nix-shell #! nix-shell -i python -p python36 python36Packages.requests2 python36Packages.docopt -I nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/nixos-17.03.tar.gz # You'll need nix to automatically download the dependencies: `curl https://nixos.org/nix/install | sh` """ Some script Usage: some_script.py <user> <variant> [--api=<api>] some_script.py -h | --help Arguments: <user> format: 42 <variant> format: 2 Options: -h --help Show this screen. --api=<api> The api instance to talk to [default: the-api.internal] """ import requests from docopt import docopt def doit(user, variant, api): # The actual thing I want to do pass if __name__ == '__main__': arguments = docopt(__doc__) doit(arguments['<user>'], arguments['<variant>'], arguments['--api'])

Now, anybody can run the script with ./some_script.py, which will download the dependencies and run the script with them. They'll need to install nix if they don't have it yet (with curl https://nixos.org/nix/install | sh).

What actually happens there?

The first line of the script is a shebang. It tells the system to run the script with nix-shell, one of the tools provided by Nix.

The second line specifies how to invoke nix-shell:

  • -i python: this argument means we want nix-shell to run the script with the python command (-i stands for interpreter).
  • -p python36 python36Packages.requests2 python36Packages.docopt: this argument is the list of the nix packages that my script is going to use. Here, I want python 3.6, and the python packages requests and docopt. I usually use the Nix packages page to find the name of the dependencies I want.
  • -I nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/nixos-17.03.tar.gz: the version of nix I want to use for this script. This ensures people running the script in the future will get compatible versions of the dependencies.

When I run the script, nix-shell starts by downloading https://github.com/NixOS/nixpkgs-channels/archive/nixos-17.03.tar.gz if it has not done so recently. This is the definition of all the nix packages. Then, nix-shell looks into this file to know how to download the packages I want and their dependencies. Finally, it runs my script in an environment where the dependencies are available.

Try it now

This technique allows coworkers to share scripts written in different technologies without the cost of teaching everybody how to install dependencies and run scripts in each language.

Try it yourself right now with the example script from earlier. Make sure you have Nix (or install it with curl https://nixos.org/nix/install | sh), get the script, and run it without caring about the dependencies!

Categories: FLOSS Project Planets

Import Python: #143 - Build Book Recommender System, Terrible Python Error Message, Free CI eBook and more

Planet Python - Fri, 2017-09-22 08:14
Worthy Read
Free Continuous Delivery eBook from GoCD This free reference guide will take you back to the basics. You’ll find visuals and definitions on key concepts and questions you need to answer about your teams to determine your readiness for continuous delivery. Download and share with your team.
GoCD, advert
How Did We Build Book Recommender Systems in an Hour Part 1 — The Fundamentals Building recommender systems today requires specialized expertise in analytics, machine learning and software engineering, and learning new skills and tools is difficult and time-consuming. In this post, we will start from scratch, covering some basic fundamental techniques and implementations in Python. In the future posts, we will cover more sophisticated methods such as content-based filtering and collaborative based filtering.
machine learning
Python Gem #19: Look up table > if chain What should be a really simple function has turned into a fifty-line gargantuan that’s too hard to read properly because of the sheer number of lines. The culprit; a seriously long if-elsif-else chain. But not to fear; there’s a better way!
My favorite terrible Python error message TypeError: object() takes no parameters
A TDD approach or building microprocessor model in Python Modern microprocessors are a very complex piece of machinery with a lot of different parts. I've learned assembler and microprocessors in my undergraduate course some years ago but, as I've been working on higher level software languages for quite some time now, I forgot many things. Lately I decided to revisit some of the topics on microprocessors and to build a very simple model of a microprocessor in Python for education purposes (I work as CS professor). You can find the final source code and some samples at https://github.com/joaoventura/simproc.
4 interactive Sankey diagrams made in Python – plotly – Medium Plotly has a new member of the Plotly.js chart family: The Sankey diagram. Jupyter notebook is at above the footnote of the blogpost.
Saasler Integrations, simplified: Integrate your SaaS app with others apps in days, not months. Get started for free!
Mapping Traffic Accidents in Metro Manila I got my hands on a dataset on traffic accidents in Metro Manila early this year, and decided to enter the realm of data science with a simple cleaning and visualization project. The primary goal: supplement the dataset’s human readable location data with geographic coordinates.
data science
CPython internals: Arbitrary-precision integer implementation Have you ever noticed that Python supports integers of any size? Here is a quick glance at it.
How Did We Build Book Recommender Systems in An Hour Part 2 — k Nearest Neighbors and Matrix… In the last post, we saw how we could use simple correlational techniques to create a measure of similarity between the books’ users based on their rating records. In this post, we will explain how you can use those same sort of similarity metrics to recommend books to a book’s readers.
machine learning
Posting messages to Slack using incoming webhooks and Python3 Requests API I wanted to make a short post on using Slack’s incoming webhooks feature to post messages to Slack using the human-friendly Requests API in Python3.
Find Top Developers We help companies like Airbnb, Pfizer, and Artsy find great developers. Let us find your next great hire. Get started today.
Devs unknowingly use “malicious” modules snuck into official Python repository | Ars Technica Code packages available in PyPI contained modified installation scripts.
Jupyter, python, Image compression and svd In this short blogpost, I will explore few topics to illustrate the interactivity of the jupyter environment and the python availability of high quality libraries in the ecosystem.
Building a desktop notification tool using python The term desktop notifications refer to a graphical control element that communicates certain events to the user without forcing them to react to this notification immediately. In other words, it is a simple application which produces a notification message in form of a pop-up message on desktop.
desktop app
Getting Started on Geospatial Analysis with Python, GeoJSON and GeoPandas Geospatial analysis applies statistical analysis to data that has geographical or geometrical components. In this tutorial, we’ll use Python to learn the basics of acquiring geospatial data, handling it, and visualizing it. More specifically, we’ll do some interactive visualizations of the United States!
Automating Web Analytics through Python The current blog deals with the case how to implement web analytics in Python. I am enthusiastic about the options that are available inside Google Analytics. Google Analytics has a rich variety of metrics and dimensions available. It has a good visualization and an intuitive Graphic User Interface (GUI). However, in certain situations it makes sense to automate webanalytics and add advanced statistics and visualizations. In the current blog, I will show how to do that using Python.
TransitFlow — using Python and Processing to visualize regional transit frequency Transit networks with higher frequency and shorter waiting times will yield a more reliable and empowering experience for passengers than those with lower frequency and longer waiting times.
Remote-controlling macOS with a Python Telegram bot I needed a quick way to remotely perform system operations: adjusting & muting the system volume, screen brightness, and putting the display to sleep. After exploring several options, I found none of them to be viable for me, and thus, I set out to develop my own solution.
How to put that GPU to good use with Python In the example below, I’ve demonstrated how this can be done using Python in a way that doesn’t require deep knowledge of CUDA and its intricacies. For this example, I suggest using the Anaconda Python distribution, which makes managing different Python environments a breeze. Follow the download and setup instructions for Anaconda as given here for your specific operating system.
Return of the Consoles: Recreating Pokémon in Python Pokemon
Create a Github Gist with a simple Python script How to share code snippets from command line?
github, gist
Don’t mess with the celery while it running a task Some time ago we decided to move part of our logic to celery. Several tasks was wrote and in one of them bash script was called, and this task never applied correct: first half of script was executed and then halted. I found that script running in processes, and can’t understand why it just stoped. Then I set some breakpoints in bash script and realised, that script stops at
Using categorical data in machine learning with python: from dummy variables to Deep category… From dummy variables to Deep category embedding and Cat2vec?—?Part 1 (Basic Methods).
machine learning
Spatial joins in GeoPandas You can join two GeoPandas GeoDataFrames through conventional means with merge, but you can also use sjoin to capitalize on the spatial relationship between two frames.
The Beginner’s Guide to Text Vectorization text processing

face-alignment - 165 Stars, 25 Fork 2D and 3D Face alignment library build using pytorch
MetaDockers - 44 Stars, 8 Fork Responsible for visualization the vulhub or docker.
mygf-instagram - 34 Stars, 1 Fork Like posts of my girlfriend's Instagram using web api, don't need any api key and access tokens just login and password
graphscii - 3 Stars, 0 Fork Print ASCII graphs in the terminal.
xlsx2csv_gui - 2 Stars, 0 Fork Convert excel xlsx file's table to csv file, A GUI application on top of python/pyqt and other opensource softwares.
Categories: FLOSS Project Planets

PyCharm: PyCharm Edu: Tips &amp; Tricks for Most Efficient Learning, Part II

Planet Python - Fri, 2017-09-22 07:45

September feels just right to start learning, or continue with even more effort and joy. And today feels just right for the next post in our series covering learning methods and tips & tricks designed to help you to learn more effectively and make you more excited about learning Python with PyCharm Edu!

Last time we posted about how to make your IDE suit your needs and preferences, and help you stay focused and avoid distraction. Today we’re going to focus more on the process of writing code.

Learn faster with a smart code editor

As you learn to code, it is encouraging to have an intelligent assistant right inside your IDE. Language-specific syntax & error highlighting are there to help you avoid code mistakes. You can use code formatting capabilities to learn how to style your code. And you won’t get stuck with your Python coding with code completion and quick documentation at hand.

Use code completion
Learn with documentation
Explore the code
Fix code errors
Style your code

Please note that we use the default Mac OS keyboard shortcut scheme (Mac OS X 10.5+) in this blog post. For more about keyboard shortcuts, please see the previous blog post in this series.

Use code completion

Smart autocompletion is an essential feature of a professional code editor, which helps you save time and avoid misprints. It is equally powerful for learning because you can use it to find the right variable, function, parameter, or any code construct. Start typing or simply press Control-Space to get a list of suggested options:

Code snippets, or live templates, can also be a handy tool. They not only speed up your coding, but help you learn new language syntax as well. Use Command-J to see the full list of code snippets available. Start typing to find the one you want to add, and then use Tab to fill in the blanks:

Learn with documentation

Reading documentation is a must when learning a new programming language. PyCharm Edu makes this process as seamless as possible.

Put a cursor on a class, method, variable, or function you want to read about, and then press F1 to open the quick documentation pop-up:

Use F1 once more to switch to the tool window mode:

You can click hyperlinks to find more details. For example, click int to read about the int class:

Use the Back and Forward icons to get back to the documentation pages you visited recently:

Save your time and effort with the special Auto-update from Source icon. When switched on, it lets you read the documentation in parallel with reading your code. Go through a code fragment and read about all the code constructions you put your cursor on, without any additional shortcuts or mouse clicks:

Explore the code

Programming is much more about understanding and reading existing code than about writing new code. That’s why we develop so many code navigation features in our IDEs. While learning, it is also quite important to see your code as a whole and understand how it works.

When you use any variable, function, or method and need a tip on how it works, let the code speak for itself. Press Command-B to go to the declaration of an entity; use it one more time on the declaration to see the list of usages:

Another quick way to look at the declaration is to use the pop-up (with Command-Y):

Fix code errors

Mistakes are an essential part of successful learning. They can also be very annoying and drain your motivation. The IDE helps you not get stuck in code errors, by alerting you to the most common ones and suggesting solutions.

Take a look at the code below. The red squiggly line code under task means there’s something wrong with this statement:

Put the cursor on the highlighted code to see what the issue is. Then, click the red bulb or press Option-Enter to see the list of suggested fixes. Choose the right one to fix your code:

It seems there is still something wrong with the file, because there’s a red icon at the top right:

Click the red stripe to navigate to the line with the error and fix it:

Now everything is fixed:

Style your code

It is important not only to write the right code, but also to write your code right. Try to follow a code style so your code is easy to read and understand. You’ll thank yourself later!

Invoke Option-Command-L and let the IDE reformat your code automatically:

There we have it. Let us know how you like these features! Stay tuned for the next portion of tips & tricks for more efficient learning. Share your feedback here in the comments or report your findings on YouTrack, to help us improve PyCharm Edu.

Your PyCharm Edu Team

Categories: FLOSS Project Planets

Randa-progress post-hoc

Planet KDE - Fri, 2017-09-22 07:41

So, back in Randa I was splitting my energies and attentions in many pieces. Some attention went to making pancakes and running the kitchen in the morning — which is stuff I take credit for, but it is really Grace, and Scarlett, and Thomas who did the heavy lifting, and Christian and Mario who make sure the whole thing can happen. And the attendees of the Randa meeting who pitch in for the dishes after lunch and dinner. The Randa meetings are more like a campground than a 5-star hotel, and we work together to make the experience enjoyable. So thanks to everyone who pitched in.

Part of a good sprint is keeping the attendees healthy and attentive — otherwise those 16-hour hacking days really get to you, in spite of the fresh Swiss air.

Frederik encouraged us to touch the floor and the ceiling with his acro-yoga sessions; it is good to get out of the hacking room and get into shape. These sessions also teach us all trust and cooperation. And between sessions, he fixed a Qt bug that probably affects Calamares accessibility.

Calamares had some more bugs squashed, its accessibility improved — although I need to test that again and again on different setups now that I’m home, since it needs time to re-build Qt and all. Even with this fix, the goal to reduce Calamares’ root-needs remains.

You can read more of what the attendees in Randa achieved on planet KDE (e.g. kdenlive, snappy, kmymoney, marble, kube, Plasma mobile, kdepim, and kwin). I’d like to give a special shout out to Manuel, who taught me one gesture in Italian Sign Langauage — which is different from American or Dutch Sign Language, reminding me that there’s localization everywhere.

For me, being back home means sitting back at my big FreeBSD box, hacking on Calamares and ARPA and CMake and stuff again, with a renewed sense of purpose and team thanks to having worked together in Randa. If you like what KDE achieves in Randa, consider still supporting the fundraiser so that we can return to the mountains next year.

Categories: FLOSS Project Planets

Catalin George Festila: The python-vlc python module.

Planet Python - Fri, 2017-09-22 07:13
The python module for vlc is named python-vlc.
This python module let you to test libvlc API like the VLC video player.
You can install it easy with pip python tool.
C:\Python27\Scripts>pip2.7.exe install python-vlc
Collecting python-vlc
Downloading python-vlc-1.1.2.tar.gz (201kB)
100% |################################| 204kB 628kB/s
Installing collected packages: python-vlc
Running setup.py install for python-vlc ... done
Successfully installed python-vlc-1.1.2
Let's see a simple example with this python module:
import os
import sys
import vlc
import pygame

def call_vlc(self, player):


if len( sys.argv )< 2 or len( sys.argv )> 3:
print 'Help: python vlc_001.py your_video.mp4'
screen = pygame.display.set_mode((800,600),pygame.RESIZABLE)

# get path to movie specified as command line argument
movie = os.path.expanduser(sys.argv[1])
# see if movie is accessible
if not os.access(movie, os.R_OK):
print('Error: %s wrong read file: ' % movie)

# make instane of VLC and create reference to movie.
vlcInstance = vlc.Instance()
media = vlcInstance.media_new(movie)

# make new instance of vlc player
player = vlcInstance.media_player_new()

# start with a callback
em = player.event_manager()
em.event_attach(vlc.EventType.MediaPlayerTimeChanged, \
call_vlc, player)

# set pygame window id to vlc player
win_id = pygame.display.get_wm_info()['window']
if sys.platform == "win32": # for Windows

# load movie into vlc player instance

# quit pygame mixer to allow vlc full access to audio device

# start movie play

while player.get_state() != vlc.State.Ended:
for event in pygame.event.get():
if event.type == pygame.QUIT:
The base of this python script is to make a instance of vlc and put into pygame display.
Another simple example:
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import vlc
>>> inst = vlc.Instance()
Warning: option --plugin-path no longer exists.
Warning: option --plugin-path no longer exists.
>>> med = inst.media_new('rain.mp4')
>>> p = med.player_new_from_media()
>>> p.play()
Categories: FLOSS Project Planets

ADCI Solutions: Meet ADCI Solutions at DrupalCon Vienna

Planet Drupal - Fri, 2017-09-22 07:08

Hello, Drupal friends!

Our team want to make it big at DrupalCon. We prepared the session and two BoFs for you.


Our Head of Organizational development wil tell you how to define a leadership stand of yours. Knowing what you stand for in this life helps to get on your own feet and achieve outstanding results both in professional area and in self-realization.



Our senior developer initiates the discussion on Drupal solutions for a higher education and science. The aim of this BoF is to gather Drupal experts and higher education representatives: that would allow us all to hear about the problems and the possible solutions from the first-person point of view. 



Another BoF is aimed at disclosing challenges we face while promoting and selling Drupal services, building the company image and communicating with a target audience. If we know the problems - we can find the solutions. 



Drop a visit!

Categories: FLOSS Project Planets
Syndicate content