Most recent items from Ubuntu feeds:
Sergio Schvezov: The Snapcraft Parts Ecosystem from Planet Ubuntu

Today I am going to be discussing parts. This is one of the pillars of
snapcraft (together with plugins and the lifecycle).

For those not familiar, this is snapcraft’s general purpose landing page,
http://snapcraft.io/ but if you are a developer and have already been
introduced to this new world of snaps, you probably want to just go and hop
on to http://snapcraft.io/create/

If you go over this snapcraft tour you will notice the many uses of parts
and start to wonder how to get started or think that maybe you are duplicating
work done by others, or even better, maybe an upstream. This is where we start to
think about the idea of sharing parts and this is exactly what we are going
to go over in this post.

To be able to reproduce what follows, you’d need to have snapcraft 2.12 installed.

An overview to using remote parts

So imagine I am someone wanting to use libcurl. Normally I would write the
part definition from scratch and be on with my own business but surely I might
be missing out on something about optimal switches used to configure the
package or even build it. I would also need to research on how to use the specific
plugin required. So instead, I’ll see if someone already
has done the work for me, hence I will,

$ snapcraft update
Updating parts list... |
$ snapcraft search curl
PART NAME DESCRIPTION
curl A tool and a library (usable from many languages) for client side URL tra...

Great, there’s a match, but is this what I want?

$ snapcraft define curl
Maintainer: 'Sergio Schvezov <sergio.schvezov@ubuntu.com>'
Description: 'A tool and a library (usable from many languages) for client side URL transfers, supporting FTP, FTPS, HTTP, HTTPS, TELNET, DICT, FILE and LDAP.'

curl:
configflags:
- --enable-static
- --enable-shared
- --disable-manual
plugin: autotools
snap:
- -bin
- -lib/*.a
- -lib/pkgconfig
- -lib/*.la
- -include
- -share
source: http://curl.haxx.se/download/curl-7.44.0.tar.bz2
source-type: tar

Yup, it’s what I want.

An example

There are two ways to use these parts in your snapcraft.yaml, say this is your
parts section

parts:
client:
plugin: autotools
source: .

My client part which is using sources that sit alongside this snapcraft.yaml,
will hypothetically fail to build as it depends on the curl library
I don’t yet have. There are some options here to get this going, one using after
in the part definition implicitly, another involving composing and last but not least
just copy pasting what snapcraft define curl returned for the part.

Implicitly

The implicit path is really straightforward. It only involves making the part look
like:

parts:
client:
plugin: autotools
source: .
after: [curl]

This will use the cached definition of the part and may potentially be updated by
running snapcraft update.

Composing

What if we like the part, but want to try out a new configure flag or source
release? Well we can override pieces of the part; so for the case of wanting to
change the source:

parts:
client:
plugin: autotools
source: .
after: [curl]
curl:
source: http://curl.haxx.se/download/curl-7.45.0.tar.bz2

And we will get to build curl but using a newer version of curl. The trick
is that the part definition here is missing the plugin entry, thereby
instructing snapcraft to look for the full part definition from the cache.

Copy/Pasting

This path is a path one would take if they want full control over the part.
It is as simple as copying in the part definition we got from running
snapcraft define curl into your own. For the sake of completeness here’s how it
would look like:

parts:
client:
plugin: autotools
source: .
after: [curl]
curl:
configflags:
- --enable-static
- --enable-shared
- --disable-manual
plugin: autotools
snap:
- -bin
- -lib/*.a
- -lib/pkgconfig
- -lib/*.la
- -include
- -share
source: http://curl.haxx.se/download/curl-7.44.0.tar.bz2
source-type: tar

Sharing your part

Now what if you have a part and want to share it with the rest of the world? It
is rather simple really, just head over to https://wiki.ubuntu.com/snapcraft/parts
and add it.

In the case of curl, I would write a yaml document that looks like:

origin: https://github.com/sergiusens/curl.git
maintainer: Sergio Schvezov <sergio.schvezov@ubuntu.com>
description:
A tool and a library (usable from many languages) for
client side URL transfers, supporting FTP, FTPS, HTTP,
HTTPS, TELNET, DICT, FILE and LDAP.
project-part: curl

What does this mean? Well, the part itself is not defined on the wiki, just
a pointer to it with some meta data, the part is really defined inside a
snapcraft.yaml living in the origin we just told it to use.

The extent of the keywords is explained in the documentation, that is an
upstream link to it.

The core idea is that a maintainer decides he wants to share a part. Such a
maintainer would add a description that provides an idea of what that part
(or collection of parts) is doing. Then, last but not least, the maintainer declares
which parts to expose to the world as maybe not all of them should. The main part
is exposed in project-part and will carry a top level name, the maintainer can
expose more parts from snapcraft.yaml using the general parts keyword. These
parts will be namespaced with the project-part.

about 14 hours ago

Canonical Design Team: New starter Davide (Project Manager) – “A working team is very precious” from Planet Ubuntu

Meet the newest member of the Design Team, project manager Davide Casa. He will be working with the Platform Team to keep us all in check and working towards our goals. I sat down with him to discuss his background, what he thinks makes a good project manager and what his first week was like at Canonical (spoiler alert – he survived it).

You can read Davide’s blog here, and reach out to him on Github and Twitter with @davidedc.
Tell us a bit about your background?
My background is in Computer Science (I did a 5 year degree). I also studied for an MBA in London.
Computer science is a passion of mine. I like to keep up to date with latest trends and play with programming languages. However, I never got paid for it, so it’s more like a hobby now to scratch an artistic itch. I often get asked in interviews: “why aren’t you a coder then?” The simple answer is that it just didn’t happen. I got my first job as a business analyst, which then developed into project management.
What do you think makes a good project manager?
I think the soft skills are incredibly relevant and crucial to the role. For example: gathering what the team’s previous experience of project management was, and what they expect from you, and how deeply and quickly you can change things.
Is project management perceived as a service or is there a practise of ‘thought leadership’?
In tech companies it varies. I’ve worked in Vodafone as a PM and you felt there was a possibility to practice a “thought leadership”, because it is such a huge company and things have to be dealt with in large cycles. Components and designs have to be agreed on in batches, because you can’t hand-wave your way through 100s of changes across a dozen mission-critical modules, it would be too risky. In some other companies less so. We’ll see how it works here.
Apart from calendars, Kanban boards and post-it notes  – what else can be used to help teams collaborate smoothly?
Indeed one of the core values of Agile is “the team”. I think people underestimate the importance of cohesiveness in a team, e.g. how easy it is for people to step forward and make mistakes without fear. A cohesive team is something that is very precious and I think that’s a regularly underestimated. You can easily buy tools and licenses, which are “easy solutions” in a way. The PM should also help to improve the cohesiveness of a team, for example creating processes that people can rely on in order to avoid attrition, and resolve things. Also to avoid treating everything like a special case to help deal with things “proportionally”.
What brings you to the Open Source world?
I like coding, and to be good coder, one must read good code. With open source the first thing you do is look around to see what others are doing and then you start to tinker with it. It has almost never been relevant for me to release software without source.
Have you got any side projects you’re currently working on?
I dabble in livecoding, which is an exotic niche of people that do live visuals and sounds with code (see our post on Qtday 2016). I am also part of the Toplap collective which works a lot on those lines too.
I also dabble in creating an exotic desktop system that runs on the web. It’s inspired by the Squeak environment, where everything is an object and is modifiable and inspectable directly within the live system. Everything is draggable, droppable and composable. For example, for a menu pops up you can change any button, both the labelling or the function it performs, or take apart any button and put it anywhere else on the desktop or in any open window. It all happens via “direct manipulation”. Imagine a paint application where at any time while working you can “open” any button from the toolbar and change what the actual painting operation does (John Maeda made such a paint app actually).
The very first desktop systems all worked that way. There was no concept of a big app or “compile and run again”. Something like a text editor app would just be a text box providing functions. The functions are then embodied in buttons and stuck around the textbox, and voila, then you have your very own flavour of text editor brought to life. Also in these live systems most operations are orthogonal: you can assume you can rotate images, right? Hence by the same token you can rotate anything on the screen. A whole window for example, or text. Two rotating lines and a few labels become a clock. The user can combine simple widgets together to make their own apps on the fly!
What was the most interesting thing you’ve learned in your first week here?
I learned a lot and I suspect that will never stop. The bread and butter here is strategy and design, which in other companies is only just a small area of work. Here it is the core of everything! So it’ll be interesting to see how this ‘strategy’ works. And how the big thinking starts with the visuals or UX in mind, and from that how it steers the whole platform. An exciting example of this can be seen in the Ubuntu Convergence story.
That’s the essence of open source I guess…
Indeed. And the fact that anti-features such as DRM, banners, bloatware, compulsory registrations and basic compilers that need 4GB of installation never live long in it. It’s our desktop after all, is it not?

about 17 hours ago

Canonical Design Team: App Design Clinic – OwnCloud App #9 from Planet Ubuntu

The Ubuntu App Design Clinic is back! This month members of the Design Team James Mulholland (UX Designer), Jouni Helminen (Visual Designer) and Andrea Bernabei (UX Engineer) sat down with Dan Wood, contributor to the OwnCloud app.
What is OwnCloud?
OwnCloud is an open source project, self-hosted file sync and share app platform. Access & sync your files, contacts, calendars & bookmarks across your devices.
You can contribute to it here.
We covered:

First case usage – the first point of entry for the user, maybe a file manager or a possible tooltip introduction.
Convergent thinking – how the app looks across different surfaces.
Top-level navigation – using the header to display actions, such as settings.
Using Online Accounts to sync other accounts to the cloud.
Using sync frequency or instant syncing.

If you missed it, or want to watch it again, here it is:

The next App Design Clinic is yet to be confirmed. Stay tuned.
 

about 18 hours ago

Alessio Treglia: A – not exactly United – Kingdom from Planet Ubuntu

Tweet
 
Island of Ventotene – Roman harbour
There once was a Kingdom strongly United, built on the honours of the people of Wessex, of Mercia, Northumbria and East Anglia who knew how to deal with the invasion of the Vikings from the east and of Normans from the south, to come to unify the territory under an umbrella of common intents. Today, however, 48% of them, while keeping solid traditions, still know how to look forward to the future, joining horizons and commercial developments along with the rest of Europe. The remaining 52%, however, look back and can not see anything in front of them if not a desire of isolation, breaking the European dream born on the shores of Ventotene island in 1944 by Altiero Spinelli, Ernesto Rossi and Ursula Hirschmann through the “Manifesto for a free and united Europe“. An incurable fracture in the country was born in a referendum on 23 June, in which just over half of the population asked to terminate his marriage to the great European family, bringing the UK back by 43 years of history.
<Read More…[by Fabio Marzocca]>

Tweet

about 22 hours ago

Paul Tagliamonte: Hello, Sense! from Planet Ubuntu

A while back, I saw a Kickstarter
for one of the most well designed and pretty sleep trackers on the market. I
fell in love with it, and it has stuck with me since.
A few months ago, I finally got my hands on one and started to track my data.
Naturally, I now want to store this new data with the rest of the data I have
on myself in my own databases.
I went in search of an API, but I found that the Sense API hasn't been published
yet, and is being worked on by the team. Here's hoping it'll land soon!
After some subdomain guessing, I hit on api.hello.is.
So, naturally, I went to take a quick look at their Android app and network
traffic, lo and behold, there was a pretty nicely designed API.
This API is clearly an internal API, and as such, it's something that
should not be considered stable. However, I'm OK with a fragile API,
so I've published a quick and dirty API wrapper for the Sense API
to my GitHub..
I've published it because I've found it useful, but I can't promise the world,
(since I'm not a member of the Sense team at Hello!), so here are a few ground
rules of this wrapper:

I make no claims to the stability or completeness.
I have no documentation or assurances.
I will not provide the client secret and ID. You'll have to find them on
your own.
This may stop working without any notice, and there may even be really nasty
bugs that result in your alarm going off at 4 AM.
Send PRs! This is a side-project for me.

This module is currently Python 3 only. If someone really needs Python 2
support, I'm open to minimally invasive patches to the codebase using
six to support Python 2.7.
Working with the API:
First, let's go ahead and log in using python -m sense.
$ python -m sense
Sense OAuth Client ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Sense OAuth Client Secret: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Sense email: paultag@gmail.com
Sense password:
Attempting to log into Sense's API
Success!
Attempting to query the Sense API
The humidity is **just right**.
The air quality is **just right**.
The light level is **just right**.
It's **pretty hot** in here.
The noise level is **just right**.
Success!

Now, let's see if we can pull up information on my Sense:
>>> from sense import Sense
>>> sense = Sense()
>>> sense.devices()
{'senses': [{'id': 'xxxxxxxxxxxxxxxx', 'firmware_version': '11a1', 'last_updated': 1466991060000, 'state': 'NORMAL', 'wifi_info': {'rssi': 0, 'ssid': 'Pretty Fly for a WiFi (2.4 GhZ)', 'condition': 'GOOD', 'last_updated': 1462927722000}, 'color': 'BLACK'}], 'pills': [{'id': 'xxxxxxxxxxxxxxxx', 'firmware_version': '2', 'last_updated': 1466990339000, 'battery_level': 87, 'color': 'BLUE', 'state': 'NORMAL'}]}

Neat! Pretty cool. Look, you can even see my WiFi AP! Let's try some more
and pull some trends out.
>>> values = [x.get("value") for x in sense.room_sensors()["humidity"]][:10]
>>> min(values)
45.73904
>>> max(values)
45.985928
>>>

I plan to keep maintaining it as long as it's needed, so I welcome
co-maintainers, and I'd love to see what people build with it! So far, I'm
using it to dump my room data into InfluxDB, pulling information on my room
into Grafana. Hopefully more to come!
Happy hacking!

1 day ago

Dustin Kirkland: HOWTO: Host your own SNAP store! from Planet Ubuntu

SNAPs are the cross-distro, cross-cloud, cross-device Linux packaging format of the future.  And we're already hosting a fantastic catalog of SNAPs in the SNAP store provided by Canonical.  Developers are welcome to publish their software for distribution across hundreds millions of Ubuntu servers, desktops, and devices.Several people have asked the inevitable open source software question, "SNAPs are awesome, but how can I stand up my own SNAP store?!?"The answer is really quite simple...  SNAP stores are really just HTTP web servers!  Of course, you can get fancy with branding, and authentication, and certificates.  But if you just want to host SNAPs and enable downstream users to fetch and install software, well, it's pretty trivial.In fact, Bret Barker has published an open source (Apache License) SNAP store on GitHub.  We're already looking at how to flesh out his proof-of-concept and bring it into snapcore itself.Here's a little HOWTO install and use it.First, I launched an instance in AWS.  Of course I could have launched an Ubuntu 16.04 LTS instance, but actually, I launched a Fedora 24 instance!  In fact, you could run your SNAP store on any OS that currently supports SNAPs, really, or even just fork this GitHub repo and install it stand alone..  See snapcraft.io.Now, let's find and install a snapstore SNAP.  (Note that in this AWS instance of Fedora 24, I also had to 'sudo yum install squashfs-tools kernel-modules'.At this point, you're running a SNAP store (webserver) on port 5000.Now, let's reconfigure snapd to talk to our own SNAP store, and search for a SNAP.Finally, let's install and inspect that SNAP.How about that?  Easy enough!Cheers,Dustin

1 day ago

Simos Xenitellis: Trying out LXD containers on Ubuntu on DigitalOcean from Planet Ubuntu

You can have LXD containers on your home computer, you can also have them on your Virtual-Private Server (VPS). If you have any further questions on LXD, see https://www.stgraber.org/2016/03/11/lxd-2-0-blog-post-series-012/
Here we see how to configure on a VPS at DigitalOcean (yeah, referral). We go cheap and select the 512MB RAM and 20GB disk VPS for $5/month. Containers are quite lightweight, so it’s interesting to see how many we can squeeze. We are going to use ZFS for the storage of the containers, stored on a file and not a block device. Here is what we are doing today,

Set up LXD on a 512MB RAM/20GB diskspace VPS
Create a container with a web server
Expose the container service to the Internet
Visit the webserver from our browser

Set up LXD on DigitalOcean

When creating the VPS, it is important to change these two options; we need 16.04 (default is 14.04) so that it has ZFS pre-installed as a kernel module, and we try out the cheapest VPS offering with 512MB RAM.
Once we create the VPS, we connect with
$ ssh root@128.199.41.205    # change with the IP address you get from the DigitalOcean panel
The authenticity of host '128.199.41.205 (128.199.41.205)' can't be established.
ECDSA key fingerprint is SHA256:7I094lF8aeLFQ4WPLr/iIX4bMs91jNiKhlIJw3wuMd4.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '128.199.41.205' (ECDSA) to the list of known hosts.
Welcome to Ubuntu 16.04 LTS (GNU/Linux 4.4.0-24-generic x86_64)

* Documentation: https://help.ubuntu.com/

0 packages can be updated.
0 updates are security updates.

root@ubuntu-512mb-ams3-01:~# apt update
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [94.5 kB]
Hit:2 http://ams2.mirrors.digitalocean.com/ubuntu xenial InRelease
Get:3 http://security.ubuntu.com/ubuntu xenial-security/main Sources [24.9 kB]
...
Fetched 10.2 MB in 4s (2,492 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
13 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@ubuntu-512mb-ams3-01:~# apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
dnsmasq-base initramfs-tools initramfs-tools-bin initramfs-tools-core
libexpat1 libglib2.0-0 libglib2.0-data lshw python3-software-properties
shared-mime-info snapd software-properties-common wget
13 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 6,979 kB of archives.
After this operation, 78.8 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
...
Processing triggers for initramfs-tools (0.122ubuntu8.1) ...
update-initramfs: Generating /boot/initrd.img-4.4.0-24-generic
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
Processing triggers for libc-bin (2.23-0ubuntu3) ...
We update the package list and then upgrade any packages that need upgrading.
root@ubuntu-512mb-ams3-01:~# apt policy lxd
lxd:
Installed: 2.0.2-0ubuntu1~16.04.1
Candidate: 2.0.2-0ubuntu1~16.04.1
Version table:
*** 2.0.2-0ubuntu1~16.04.1 500
500 http://mirrors.digitalocean.com/ubuntu xenial-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
100 /var/lib/dpkg/status
2.0.0-0ubuntu4 500
500 http://mirrors.digitalocean.com/ubuntu xenial/main amd64 Packages
The lxd package is already installed, all the better. Nice touch 🙂
root@ubuntu-512mb-ams3-01:~# apt install zfsutils-linux
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libnvpair1linux libuutil1linux libzfs2linux libzpool2linux zfs-doc zfs-zed
Suggested packages:
default-mta | mail-transport-agent samba-common-bin nfs-kernel-server
zfs-initramfs
The following NEW packages will be installed:
libnvpair1linux libuutil1linux libzfs2linux libzpool2linux zfs-doc zfs-zed
zfsutils-linux
0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 881 kB of archives.
After this operation, 2,820 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
...
zed.service is a disabled or a static unit, not starting it.
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Processing triggers for systemd (229-4ubuntu6) ...
Processing triggers for ureadahead (0.100.0-19) ...
root@ubuntu-512mb-ams3-01:~# _
We installed zfsutils-linux in order to be able to use ZFS as storage for our containers. In this tutorial we are going to use a file as storage (still, ZFS filesystem) instead of a block device. If you subscribe to the DO Beta for block storage volumes, you can get a proper block device for the storage of the containers. Currently free to beta members, available only on the NYC1 datacenter.
root@ubuntu-512mb-ams3-01:~# df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 20G 1.1G 18G 6% /
root@ubuntu-512mb-ams3-01:~# _
We got 18GB free diskspace, so let’s allocate 15GB for LXD.
root@ubuntu-512mb-ams3-01:~# lxd init
Name of the storage backend to use (dir or zfs): zfs
Create a new ZFS pool (yes/no)? yes
Name of the new ZFS pool: lxd-pool
Would you like to use an existing block device (yes/no)? no
Size in GB of the new loop device (1GB minimum): 15
Would you like LXD to be available over the network (yes/no)? no
Do you want to configure the LXD bridge (yes/no)? yes
we accept the default settings for the bridge configuration
Warning: Stopping lxd.service, but it can still be activated by:
lxd.socket
LXD has been successfully configured.
root@ubuntu-512mb-ams3-01:~# _
What we did,

we initialized LXD with the ZFS storage backend,
we created a new pool and gave a name (here, lxd-pool),
we do not have a block device, so we get a (sparse) image file that contains the ZFS filesystem
we do not want now to make LXD available over the network
we want to configure the LXD bridge for the inter-networking of the containters

Let’s create a new user and add them to the lxd group,
root@ubuntu-512mb-ams3-01:~# adduser ubuntu
Adding user `ubuntu' ...
Adding new group `ubuntu' (1000) ...
Adding new user `ubuntu' (1000) with group `ubuntu' ...
Creating home directory `/home/ubuntu' ...
Copying files from `/etc/skel' ...
Enter new UNIX password: ********
Retype new UNIX password: ********
passwd: password updated successfully
Changing the user information for ubuntu
Enter the new value, or press ENTER for the default
Full Name []: <ENTER>
Room Number []: <ENTER>
Work Phone []: <ENTER>
Home Phone []: <ENTER>
Other []: <ENTER>
Is the information correct? [Y/n] Y
root@ubuntu-512mb-ams3-01:~# _
The username is ubuntu. Make sure you add a good password, since we do not deal in this tutorial with best security practices. Many people use scripts on these VPSs that try common usernames and passwords. When you create a VPS, it is nice to have a look at /var/log/auth.log for those failed attempts to get into your VPS. Here are a few lines from this VPS,
Jun 26 18:36:15 digitalocean sshd[16318]: Failed password for root from 121.18.238.29 port 45863 ssh2
Jun 26 18:36:15 digitalocean sshd[16320]: Connection closed by 123.59.134.76 port 49378 [preauth]
Jun 26 18:36:17 digitalocean sshd[16318]: Failed password for root from 121.18.238.29 port 45863 ssh2
Jun 26 18:36:20 digitalocean sshd[16318]: Failed password for root from 121.18.238.29 port 45863 ssh2
We add the ubuntu user into the lxd group in order to be able to run commands as a non-root user.
root@ubuntu-512mb-ams3-01:~# adduser ubuntu lxd
Adding user `ubuntu' to group `lxd' ...
Adding user ubuntu to group lxd
Done.
root@ubuntu-512mb-ams3-01:~# _
We are now good to go. Log in as user ubuntu and run an LXD command to list images.

Create a Web server in a container
We launch (init and start) a container named c1.

The ubuntu:x in the screenshot is an alias for Ubuntu 16.04 (Xenial), that resides in the ubuntu: repository of images. You can find other distributions in the images: repository.
As soon as the launch action was completed, I run the list action. Then, after a few seconds, I run it again. You can notice that it took a few seconds before the container actually booted and got an IP address.
Let’s enter into the container by executing a shell. We update and then upgrade the container.
ubuntu@ubuntu-512mb-ams3-01:~$ lxc exec c1 -- /bin/bash
root@c1:~# apt update
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [94.5 kB]
Hit:2 http://archive.ubuntu.com/ubuntu xenial InRelease
Get:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [94.5 kB]
...
Fetched 9819 kB in 2s (3645 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
13 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@c1:~# apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
dnsmasq-base initramfs-tools initramfs-tools-bin initramfs-tools-core libexpat1 libglib2.0-0 libglib2.0-data lshw python3-software-properties shared-mime-info snapd
software-properties-common wget
13 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 6979 kB of archives.
After this operation, 3339 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 initramfs-tools all 0.122ubuntu8.1 [8602 B]
...
Processing triggers for initramfs-tools (0.122ubuntu8.1) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...
root@c1:~#
Let’s install nginx, our Web server.
root@c1:~# apt install nginx
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
fontconfig-config fonts-dejavu-core libfontconfig1 libfreetype6 libgd3 libjbig0 libjpeg-turbo8 libjpeg8 libtiff5 libvpx3 libxpm4 libxslt1.1 nginx-common nginx-core
Suggested packages:
libgd-tools fcgiwrap nginx-doc ssl-cert
The following NEW packages will be installed:
fontconfig-config fonts-dejavu-core libfontconfig1 libfreetype6 libgd3 libjbig0 libjpeg-turbo8 libjpeg8 libtiff5 libvpx3 libxpm4 libxslt1.1 nginx nginx-common nginx-core
0 upgraded, 15 newly installed, 0 to remove and 0 not upgraded.
Need to get 3309 kB of archives.
After this operation, 10.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://archive.ubuntu.com/ubuntu xenial/main amd64 libjpeg-turbo8 amd64 1.4.2-0ubuntu3 [111 kB]
...
Processing triggers for ufw (0.35-0ubuntu2) ...
root@c1:~#
Is the Web server running? Let’s check with the ss command (preinstalled, from package iproute2)
root@c1:~# ss -tula
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port
udp UNCONN 0 0 *:bootpc *:*
tcp LISTEN 0 128 *:http *:*
tcp LISTEN 0 128 *:ssh *:*
tcp LISTEN 0 128 :::http :::*
tcp LISTEN 0 128 :::ssh :::*
root@c1:~#
The parameters mean

-t: Show only TCP sockets
-u: Show only UDP sockets
-l: Show listening sockets
-a: Show all sockets (makes no difference because of previous options; it’s just makes an easier word to remember, tula)

Of course, there is also lsof with the parameter -i (IPv4/IPv6).
root@c1:~# lsof -i
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
dhclient 240 root 6u IPv4 45606 0t0 UDP *:bootpc
sshd 306 root 3u IPv4 47073 0t0 TCP *:ssh (LISTEN)
sshd 306 root 4u IPv6 47081 0t0 TCP *:ssh (LISTEN)
nginx 2034 root 6u IPv4 51636 0t0 TCP *:http (LISTEN)
nginx 2034 root 7u IPv6 51637 0t0 TCP *:http (LISTEN)
nginx 2035 www-data 6u IPv4 51636 0t0 TCP *:http (LISTEN)
nginx 2035 www-data 7u IPv6 51637 0t0 TCP *:http (LISTEN)
root@c1:~#
From both commands we verify that the Web server is indeed running inside the VPS, along with a SSHD server.
Let’s change a bit the default Web page,
root@c1:~# nano /var/www/html/index.nginx-debian.html

Expose the container service to the Internet
Now, if we try to visit the public IP of our VPS at http://128.199.41.205/ we obviously notice that there is no Web server there. We need to expose the container to the world, since the container only has a private IP address.
The following iptables line exposes the container service at port 80. Note that we run this as root on the VPS (root@ubuntu-512mb-ams3-01:~#), NOT inside the container (root@c1:~#).
iptables -t nat -I PREROUTING -i eth0 -p TCP -d 128.199.41.205/32 --dport 80 -j DNAT --to-destination 10.160.152.184:80
Adapt accordingly the public IP of your VPS and the private IP of your container (10.x.x.x). Since we have a web server, this is port 80.
We have not made this firewall rule persistent as it is outside of our scope; see iptables-persistent on how to make it persistent.
Visit our Web server
Here is the URL, http://128.199.41.205/ so let’s visit it.

That’s it! We created an LXD container with the nginx Web server, then exposed it to the Internet.
 

1 day ago

Dimitri John Ledkov: Post-Brexit - The What Now? from Planet Ubuntu

Out of 46,500,001 electorate 17,410,742 voted to leave, which is a mere 37.4% or just over a third. [source]. On my books this is not a clear expression of the UK wishes.The reaction that the results have caused are devastating. The Scottish First Minister has announced plans for 2nd Scottish Independence referendum [source]. Londoners are filing petitions calling for Independent London [source, source]. The Prime Minister announced his resignation [source]. Things are not stable.I do not believe that super majority of the electorate are in favor of leaving the EU. I don't even believe that those who voted to leave have considered the break up of the UK as the inevitable outcome of the leave vote. There are numerous videos on the internet about that, impossible to quantify or reliably cite, but for example this [source]So What Now?P R O T E S TI urge everyone to start protesting the outcome of the mistake that happened last Thursday. 4th of July is a good symbolic date to show your discontent with the UK governemnt and a tiny minority who are about to cause the country to fall apart with no other benefits. Please stand up and make yourself heard.Please sign petition for the 2nd EU ReferendumOn Tuesday the 28th please come to Trafalgar Square to support London Stays campaignGeneral Strikes 4th & 5th of JulyAll 2 million EU citizens working in the UK Walk Out - eventLondon National Black Bloc - GENERAL STRIKE SOLIDARITY LONDON Glasgow Tories Out General StrikeNational Union of Teachers - Stand Up for EductionThere are 64,100,000 people living in the UK according to the World Bank, maybe the government should fear and listen to the unheard third. The current "majority" parliament was only elected by 24% of electorate.It is time for people to actually take control, we can fix our parliament, we can stop austerity, we can prevent the break up of the UK, and we can stay in the EU. Over to you.ps. How to elect next PM?Electing next PM will be done within the Conservative Party, and that's kind of a bummer, given that the desperate state the country currently is in. It is not that hard to predict that Boris Johnson is a front-runner. If you wish to elect a different PM, I urge you to splash out 25 quid and register to be a member of the Conservative Party just for one year =) this way you will get a chance to directly elect the new Leader of the Conservative Party and thus the new Prime Minister. You can backdoor the Conservative election here.

2 days ago

Simos Xenitellis: Trying out LXD containers on our Ubuntu from Planet Ubuntu

This post is about containers, a construct similar to virtual machines (VM) but so much lightweight that you can easily create a dozen on your desktop Ubuntu!
A VM virtualizes a whole computer and then you install in there the guest operating system. In contrast, a container reuses the host Linux kernel and simply contains just the root filesystem (aka runtimes) of our choice. The Linux kernel has several features that rigidly separate the running Linux container from our host computer (i.e. our desktop Ubuntu).
By themselves, Linux containers would need some manual work to manage them directly. Fortunately, there is LXD (pronounced Lex-deeh), a service that manages Linux containers for us.
We will see how to

setup our Ubuntu desktop for containers,
create a container,
install a Web server,
test it a bit, and
clear everything up.

Set up your Ubuntu for containers
If you have Ubuntu 16.04, then you are ready to go. Just install a couple of extra packages that we see below. If you have Ubuntu 14.04.x or Ubuntu 15.10, see LXD 2.0: Installing and configuring LXD [2/12] for some extra steps, then come back.
Make sure the package list is up-to-date:
sudo apt update
sudo apt upgrade
Install the lxd package:
sudo apt install lxd
If you have Ubuntu 16.04, you can enable the feature to store your container files in a ZFS filesystem. The Linux kernel in Ubuntu 16.04 includes the necessary kernel modules for ZFS. For LXD to use ZFS for storage, we just need to install a package with ZFS utilities. Without ZFS, the containers would be stored as separate files on the host filesystem. With ZFS, we have features like copy-on-write which makes the tasks much faster.
Install the zfsutils-linux package (if you have Ubuntu 16.04.x):
sudo apt install zfsutils-linux
Once you installed the LXD package on the desktop Ubuntu, the package installation scripts should have added you to the lxd group. If your desktop account is a member of that group, then your account can manage containers with LXD and can avoid adding sudo in front of all commands. The way Linux works, you would need to log out from the desktop session and then log in again to activate the lxd group membership. (If you are an advanced user, you can avoid the re-login by newgrp lxd in your current shell).
Before use, LXD should be initialized with our storage choice and networking choice.
Initialize lxd for storage and networking by running the following command:
$ sudo lxd init
Name of the storage backend to use (dir or zfs): zfs
Create a new ZFS pool (yes/no)? yes
Name of the new ZFS pool: lxd-pool
Would you like to use an existing block device (yes/no)? no
Size in GB of the new loop device (1GB minimum): 30
Would you like LXD to be available over the network (yes/no)? no
Do you want to configure the LXD bridge (yes/no)? yes
> You will be asked about the network bridge configuration. Accept all defaults and continue.
Warning: Stopping lxd.service, but it can still be activated by:
lxd.socket
LXD has been successfully configured.
$ _
We created the ZFS pool as a filesystem inside a (single) file, not a block device (i.e. in a partition), thus no need for extra partitioning. In the example I specified 30GB, and this space will come from the root (/) filesystem. If you want to look at this file, it is at /var/lib/lxd/zfs.img.
 
That’s it! The initial configuration has been completed. For troubleshooting or background information, see https://www.stgraber.org/2016/03/15/lxd-2-0-installing-and-configuring-lxd-212/
Create your first container
All management commands with LXD are available through the lxc command. We run lxc with some parameters and that’s how we manage containers.
lxc list
to get a list of installed containers. Obviously, the list will be empty but it verifies that all are fine.
lxc image list
shows the list of (cached) images that we can use to launch a container. Obviously, the list will be empty but it verifies that all are fine.
lxc image list ubuntu:
shows the list of available remote images that we can use to download and launch as containers. This specific list shows Ubuntu images.
lxc image list images:
shows the list of available remote images for various distributions that we can use to download and launch as containers. This specific list shows all sort of distributions like Alpine, Debian, Gentoo, Opensuse and Fedora.
Let’s launch a container with Ubuntu 16.04 and call it c1:
$ lxc launch ubuntu:x c1
Creating c1
Starting c1
$ _
We used the launch action, then selected the image ubuntu:x (x is an alias for the Xenial/16.04 image) and lastly we use the name c1 for our container.
Let’s view our first installed container,
$ lxc list

+---------+---------+----------------------+------+------------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+---------+---------+----------------------+------+------------+-----------+
| c1 | RUNNING | 10.173.82.158 (eth0) | | PERSISTENT | 0 |
+---------+---------+----------------------+------+------------+-----------+
Our first container c1 is running and it has an IP address (accessible locally). It is ready to be used!
Install a Web server
We can run commands in our container. The action for running commands, is exec.
$ lxc exec c1 -- uptime
11:47:25 up 2 min, 0 users, load average: 0.07, 0.05, 0.04
$ _
After the action exec, we specify the container and finally we type command to run inside the container. The uptime is just 2 minutes, it’s a fresh container :-).
The — thing on the command line has to do with parameter processing of our shell. If our command does not have any parameters, we can safely omit the –.
$ lxc exec c1 -- df -h
This is an example that requires the –, because for our command we use the parameter -h. If you omit the –, you get an error.
Let’s get a shell in the container, and update the package list already.
$ lxc exec c1 bash
root@c1:~# apt update
Ign http://archive.ubuntu.com trusty InRelease
Get:1 http://archive.ubuntu.com trusty-updates InRelease [65.9 kB]
Get:2 http://security.ubuntu.com trusty-security InRelease [65.9 kB]
...
Hit http://archive.ubuntu.com trusty/universe Translation-en
Fetched 11.2 MB in 9s (1228 kB/s)
Reading package lists... Done
root@c1:~# apt upgrade
Reading package lists... Done
Building dependency tree
...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up dpkg (1.17.5ubuntu5.7) ...
root@c1:~# _
We are going to install nginx as our Web server. nginx is somewhat cooler than Apache Web server.
root@c1:~# apt install nginx
Reading package lists... Done
Building dependency tree
...
Setting up nginx-core (1.4.6-1ubuntu3.5) ...
Setting up nginx (1.4.6-1ubuntu3.5) ...
Processing triggers for libc-bin (2.19-0ubuntu6.9) ...
root@c1:~# _
Let’s view our Web server with our browser. Remeber the IP address you got 10.173.82.158, so I enter it into my browser.

Let’s make a small change in the text of that page. Back inside our container, we enter the directory with the default HTML page.
root@c1:~# cd /var/www/html/
root@c1:/var/www/html# ls -l
total 2
-rw-r--r-- 1 root root 612 Jun 25 12:15 index.nginx-debian.html
root@c1:/var/www/html#
We can edit the file with nano, then save

Finally, let’s check the page again,

Clearing up
Let’s clear up the container by deleting it. We can easily create new ones when we need them.
$ lxc list
+---------+---------+----------------------+------+------------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+---------+---------+----------------------+------+------------+-----------+
| c1 | RUNNING | 10.173.82.169 (eth0) | | PERSISTENT | 0 |
+---------+---------+----------------------+------+------------+-----------+
$ lxc stop c1
$ lxc delete c1
$ lxc list
+---------+---------+----------------------+------+------------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+---------+---------+----------------------+------+------------+-----------+
+---------+---------+----------------------+------+------------+-----------+

We stopped (shutdown) the container, then we deleted it.
That’s all. There are many more ideas on what do with containers. Here are the first steps on setting up our Ubuntu desktop and trying out one such container.

3 days ago

Valorie Zimmerman: Akademy! and fundraising from Planet Ubuntu

https://qtcon.org/Akademy is approaching! And I can hardly wait. This spring has been personally difficult, and meeting with friends and colleagues is the perfect way to end the summer. This year will be special because it's in Berlin, and because it is part of Qt.con, with a lot of our freedom-loving friends, such as Qt, VideoLAN, Free Software Foundation Europe and KDAB. As usual, Kubuntu will also be having our annual meetup there.Events are expensive! KDE needs money to support Akademy the event, support for those who need travel and lodging subsidy, support for other events such as our Randa Meetings, which just successfully ended. We're still raising money to support the sprints:https://www.kde.org/fundraisers/randameetings2016/Of course that money supports Akademy too, which is our largest annual meeting.Ubuntu helps here too! The Ubuntu Community fund sends many of the Kubuntu team, and often funds a shared meal as well. Please support the Ubuntu Community Fund too if you can!I'm going!I can't seem to make the image a link, so go to https://qtcon.org/ for more information.

3 days ago

Ubuntu Insights: HOWTO: Host your own SNAP store! from Planet Ubuntu

SNAPs are the cross-distro, cross-cloud, cross-device Linux packaging format of the future.  And we’re already hosting a fantastic catalog of SNAPs in the SNAP store provided by Canonical.  Developers are welcome to publish their software for distribution across hundreds millions of Ubuntu servers, desktops, and devices.
Several people have asked the inevitable open source software question, “SNAPs are awesome, but how can I stand up my own SNAP store?!?”
The answer is really quite simple…  SNAP stores are really just HTTP web servers!  Of course, you can get fancy with branding, and authentication, and certificates.  But if you just want to host SNAPs and enable downstream users to fetch and install software, well, it’s pretty trivial.
In fact, Bret Barker has published an open source (Apache License) SNAP store on GitHub.  We’re already looking at how to flesh out his proof-of-concept and bring it into snapcore itself.
Here’s a little HOWTO install and use it.
First, I launched an instance in AWS.  Of course I could have launched an Ubuntu 16.04 LTS instance, but actually, I launched a Fedora 24 instance!  In fact, you could run your SNAP store on any OS that currently supports SNAPs, really, or even just fork this GitHub repo and install it stand alone..  See snapcraft.io.

Now, let’s find and install a snapstore SNAP.  (Note that in this AWS instance of Fedora 24, I also had to ‘sudo yum install squashfs-tools kernel-modules’.

At this point, you’re running a SNAP store (webserver) on port 5000.

Now, let’s reconfigure snapd to talk to our own SNAP store, and search for a SNAP.

Finally, let’s install and inspect that SNAP.<

How about that?  Easy enough!
Original article

3 days ago

Dirk Deimeke: Linkdump 25/2016 ... from Planet Ubuntu

Nettigkeiten der vergangenen Woche.
Eine der besten Zusammenfassungen, warum man sein eigenes Blog starten sollte: Starte (d)ein Blog – heute!
Dies ist keine Übung - externe Festplatten werden im schlimmsten Fall übrigens auch verschlüsselt. In jedem Fall sollte man die Verschlüsselung rechtzeitig bemerken, sonst ist Essig mit Restore.
Es lohnt sich der Aufwand, sich selber kennen zu lernen. Man könnte sogar ein ganz netter Typ sein. Positives Selbstwertgefühl, wie Sie Ihre persönlichen Stärken im Job am besten einsetzen.
The Life-Changing Magic Of Shorter Emails comes from the "Captain Obvious Department" ... (sorry!).
Ja, wissen wir, aber Ausbildung tut trotzdem Not. Der Fachkräftemangel ist ein Phantom.
The Epic Story of Dropbox’s Exodus From the Amazon Cloud Empire - nice one about a major infrastructure change without interruption of service.
Billig ist nicht immer günstig, auch wenn es sehr einfach wirkt, Fachwissen ist dennoch nötig: Auf diese Aspekte müssen Admins achten.

4 days ago

Xubuntu: Looking for memorable and fun Xubuntu stories! from Planet Ubuntu

To celebrate Xubuntu’s tenth birthday*, the Xubuntu team is glad to announce a new campaign and competition!
We’re looking for your most memorable and fun Xubuntu story. In order to participate, submit the story to xubuntu-contacts@lists.ubuntu.com. Or you may share an image (photo, drawing, painting, etc) to Elizabeth K. Joseph <lyz@ubuntu.com> and Pasi Lallinaho <pasi@shimmerproject.org>, please restrict your file size to a maximum of 5M.
For example, have you shared Xubuntu with a friend or family member, and had them react in a memorable way? Or have you created Xubuntu-themed cookies, cakes or artwork? No story or experience is too simple to share and don’t be restricted by these examples, surprise us!
Bonus: Share it on Twitter and hashtag it with #LoveXubuntu and during the competition, the Xubuntu team will retweet a posts on the Twitter account for Xubuntu. Additionally, we encourage to share your stories all over the social media!
At the end of the competition, we will select 5 finalists. All finalists will receive a set of Xubuntu stickers from UnixStickers! We will pick 2 winners from the finalists who will also receive a Xubuntu t-shirt! We will be in touch with the finalists and winners after the contest has ended to check their address details and preferred t-shirt size and color (for winners).
Notes on licensing: Submissions to the #LoveXubuntu campaign will be accepted under the CC BY-SA 4.0 license and available for use for Xubuntu marketing in the future without further consent from the participants. That said, we’re friendly folks and will try to communicate with you before using your story or image!
* The first official Xubuntu release was 6.06, released on June 1, 2006.

4 days ago

Kubuntu: Kubuntu Dojo 2 – Kubuntu Ninjas from Planet Ubuntu

Want to get deeper under the hood with Kubuntu?
Interested in becoming a developer?
Then come and join us in the Kubuntu Dojo:
Thursday 30th June 2016 – 18:00 UTC
Packaging is one of the primary development tasks in a large Linux distribution project. Packaging is the essential way of getting the latest and best software to the user.
We continue our Kubuntu Dojo and Ninja developers training courses. These courses are free to attend, and take place on the last Thursday of the month at 18:00 UTC.
This is course number 2, where we will look at Debian and Ubuntu packaging. Candidates will create their first packages including uploading them to their own PPA on LaunchPad, all deliver inside our online video classroom.
Details for accessing the Kubuntu Big Blue Button Conference server will be announced in the G+ event stream, and on IRC: irc://irc.freenode.net
#kubuntu
#kubuntu-devel
Why it rocks
All the cool kids are doing it.
Packagers know everyone.
Not only will you be part of an elite group, but also get to know with Debian’s finest, as well as KDE developers and other application developers.
For more details about the Kubuntu Ninja’s programme see our wiki:
https://wiki.kubuntu.org/Kubuntu/GettingInvolved/Development

4 days ago

The Fridge: Ubuntu Membership Board call for nominations from Planet Ubuntu

As you may know, Ubuntu Membership is a recognition of significant and sustained contribution to Ubuntu and the Ubuntu community. To this end, the Community Council recruits members of our current membership community for the valuable role of reviewing and evaluating the contributions of potential members to bring them on board or assist with having them achieve this goal.
We have seven members of our boards expiring from their 2 year terms within the next couple months, which means we need to do some restaffing of this Membership Board.
We’re looking for Ubuntu Members who can participate either in the 20:00 UTC meetings or 22:00 UTC (if you can make both, even better).
Both the 20:00 UTC and the 22:00 UTC meetings happen once a month, specific day may be discussed by the board upon addition of new members.
We have the following requirements for nominees:

be an Ubuntu member (preferably for some time)
be confident that you can evaluate contributions to various parts of our community
be committed to attending the membership meetings
broad insight into the Ubuntu community at large is a plus

Additionally, those sitting on membership boards are current Ubuntu Members with a proven track record of activity in the community. They have shown themselves over time to be able to work well with others and display the positive aspects of the Ubuntu Code of Conduct. They should be people who can discern character and evaluate contribution quality without emotion while engaging in an interview/discussion that communicates interest, a welcoming atmosphere, and which is marked by humanity, gentleness, and kindness. Even when they must deny applications, they should do so in such a way that applicants walk away with a sense of hopefulness and a desire to return with a more complete application rather than feeling discouraged or hurt.
To nominate yourself or somebody else (please confirm they wish to accept the nomination and state you have done so), please send a mail to the membership boards mailing list (ubuntu-membership-boards at lists.ubuntu.com). You will want to include some information about the nominee, a launchpad profile link and which time slot (20:00 or 22:00) the nominee will be able to participate in.
We will be accepting nominations through Friday July 1st at 12:00 UTC. At that time all nominations will be forwarded to the Community Council who will make the final decision and announcement.
Thanks in advance to you and to the dedication everybody has put into their roles as board members.
Originally posted to the ubuntu-news-team mailing list on Mon Jun 20 13:04:03 UTC 2016 by Svetlana Belkin, on the behalf of the Community Council

5 days ago