Skip to main content

the avatar of Han Wen Kam

Getting XMind 8 to work on openSUSE Leap 15

openSUSE Leap 15 was officially launched on 25th May 2018.  More at https://en.opensuse.org/Portal:15.0

XMind is my go-to mind mapping software for a few years now.  More at https://www.xmind.net/

Challenge:

Using the XMind 8 Linux package (zip file) and following the, albeit brief, instructions at http://support.xmind.net/customer/en/portal/articles/2639667-begin-to-use-xmind-8-on-linux, you will see XMind launch with the GUI Splash screen but the program will fail and exit.




Root-cause:

XMind is a Java-based application and it is sensitive to the version of Java.  The default Java runtime in openSUSE Leap 15 is OpenJDK version 10.0.1 (dated 2018-04-17).


Resolution:

Install the older OpenJDK version 1.8.0.  Instead of removing the default version 10.0.1, I elected to install the older version 1.8.0 alongside and switch the default path for Java to 1.8.0.

Here are my steps:

zypper in java-1_8_0-openjdk



update-alternatives --config java
(followed by picking the newly installed jre-1.8.0)



Validate:  java -version

That's it.  Now, when we execute the XMind program, it will work and launched successfully.  



Keep Calm & Carry On loving Linux!

a silhouette of a person's head and shoulders, used as a default avatar

Unit Testing Browser Extensions

This post has been migrated to my new blog that you can find here:

https://pureooze.com/blog/posts/2018-05-21-unit-testing-browser-extensions/

In April I became the maintainer of Saka, a browser extension that allows users to search through their tabs, bookmarks and history. The original goal of Saka was to provide an elegant tab search but this soon evolved to include recently closed tabs, bookmarks and history when the original maintainer eejdoowad recognized that users search for tabs the same way they search bookmarks and history. This was an important insight and it has helped make Saka a valuable productivity tool.

When I became the maintainer I was surprised at the absence of tests in the project. There were several components with complicated logic but no tests to be found anywhere. One of the most important things I have learned as a developer is that tests are the easiest ways to write reliable, easy to refactor code. Was the old maintainer just lazy? Did he simply not care about the quality of his code? No. The opposite in fact, he cared a lot.

Saka, a browser extension for searching tabs, recently closed, bookmarks and history.

The issue is that the lack of documentation on the topic means that almost no one is able to test their extension. Having no confidence in my ability to make changes without breaking the code, this was a big problem. But as fate would have it after trying a dozen different approaches I ended up finding a solution.

Why We Test

As developers we want to be sure that the code we write today is not going to become a burden to maintain later in the lifetime of the application. One way we avoid creating these burdens is by writing tests. The great thing about tests is that outside of just verifying the behavior of functions, tests allow us to provide documentation for future developers. For example by creating unit tests we declare the valid inputs and outputs for a given function. This makes it easier to refactor code because we can have confidence that our code is working correctly when all our tests pass.

The Testing Approach

This post will focus on setting up the environment and writing some basic unit tests. I have a separate post at this link which you can use to perform integration testing.

To read the rest of this post it can be found on my new blog here:

https://pureooze.com/blog/posts/2018-05-21-unit-testing-browser-extensions/


Unit Testing Browser Extensions was originally published in Information & Technology on Medium, where people are continuing the conversation by highlighting and responding to this story.

a silhouette of a person's head and shoulders, used as a default avatar

GSoC students are already hacking!

We always enjoy that new people join openSUSE community and help them in their first steps. Because of that, openSUSE participates again in GSoC, an international program in which stipends are awarded to students who hack on open source projects during the summer. We are really excited to announce that this year four students will learn about open source development while hacking on openSUSE projects. The coding period started last week, so our students are already busy hacking and they have written some nice articles about their projects. :blush:

Matheus de Sousa Bernardo

Matheus is a Software Engineering student in the University of Brasília. He will be working in Trollolo, together with his mentors Ana Martínez (me :stuck_out_tongue_winking_eye:) and Cornelius Schumacher. Trollolo is a cli-tool which helps teams using Trello to organize their work. Matheus’ project includes improving Trollolo’s API and workflow. If you want to know more about him and his project, check his beginning blog post: https://matheussbernardo.me/gsoc/2018/04/24/hello-internet-gsoc

Xu Liana

Xu is a Software Engineering student in the Chongqing Normal University, China. She will work, together with her mentors ZhaoQiang, epico and Hillwood Yang, in integrating Cloud Pinyin (the most popular input method in China) on ibus-libpinyin. Check her beginning blog post with more details about her and the project: https://liana.hillwoodhome.net/2018/05/20/the-blog-for-the-first-week-during-gsoc-libpinyin-project-coding

Ankush Malik

Ankush is pursuing a Bachelor of Technology in Computer Science in the Maharaja Agrasen Institute of Technology, India. He will be working on improving people collaboration in the Hackweek tool, together with his mentors David Kang and Stella Rouzi. He just released his GSoC Journey blog post which you can find here: https://medium.com/@ankushmalik631/my-gsoc-journey-4f02818fdb8d

Asad Syed

Asad is from Pakistan and is studying a Masters degree in Informatics at the Technical University of Munich, Germany. He will develop a container-based backend for openQA with the help of his mentors Santiago Zarate, Ettore Di Giacinto and Stephan Kulow. Read here about his experiences with openSUSE and past participations in Google Summer of Code: https://medium.com/asadpiz/google-summer-of-code-2018-with-opensuse-part-1-9f514ac2e7ae

As you see, there is a lot of great work coming in from our new talented contributors. Stay tuned because they will keep blogging about their GSoC experience! :wink:

the avatar of Federico Mena-Quintero

Three big things happening in librsvg

I am incredibly happy because of three big things that are going on in librsvg right now:

  1. Paolo Borelli finished porting all the CSS properties to Rust. What was once a gigantic RsvgState struct in C is totally gone, along with all the janky C code to parse individual properties. The process of porting RsvgState to Rust has been going on since about two months ago, and has involved many multi-commit merge requests and refactorings. This is a tremendous amount of really good work! The result is all in Rust now in a State struct, which is opaque from C's viewpoint. The only places in C that still require accessors to the State are in the filter effects code. Which brings me to...

  2. Ivan Molodetskikh, my Summer of Code student, submitted his first merge request and it's merged to master now. This ports the bookkeeping infrastructure for SVG filters to Rust, and also the feOffset filter is ported now. Right now the code doesn't do anything fancy to iterate over the pixels of Cairo image surfaces; that will come later. I am very happy that filters, which were a huge barrier, are now starting to get chipped away into nicer code.

  3. I have started to move librsvg's old representation of CSS properties into something that can really represent properties that are not specified, or explicitly set to inherit from an SVG element's parent, or set to a normal value. Librsvg never had a representation of property values that actually matched the SVG/CSS specs; it just knew whether a property was specified or not for an element. This worked fine for properties which the spec mandates that they should inherit automatically, but those that don't, were handled through special hacks. The new code makes this a lot cleaner. It should also make it easier to copy Servo's idioms for property inheritance.

a silhouette of a person's head and shoulders, used as a default avatar

a silhouette of a person's head and shoulders, used as a default avatar

Ceph Day London 2018 Recap

Some days since the Ceph and CloudStack Day in London last month now. It was a great event, great presentations and a lot of networking with the local community.

You can find my presentation on "Email Storage with Ceph" online as also the break slides with some impressions from some of the last few Ceph events.

Some of the other presentations can be found here and some pictures from the day in this album.

a silhouette of a person's head and shoulders, used as a default avatar
a silhouette of a person's head and shoulders, used as a default avatar
darix posted at

Hooking up instantiated services with RPM

We already mentioned Instantiated Services a few times. However, there is one question we did not yet cover:

How to hook up those instances with our package manager

For a normal service file this is pretty easy. Such a service can be handled as follow in the spec file:

%pre
%service_add_pre superduper.service

%post
%service_add_post superduper.service

%preun
%service_del_preun superduper.service

%postun
%service_del_postun superduper.service

That is it. It will do all the things we want.

the avatar of Federico Mena-Quintero

Reducing the number of image copies in GNOME

Our graphics stack that deals with images has evolved a lot over the years.

In ye olden days

In the context of GIMP/GNOME, the only thing that knew how to draw RGB images to X11 windows (doing palette mapping for 256-color graphics cards and dithering if necessary) was the GIMP. Later, when GTK+ was written, it exported a GtkPreview widget, which could take an RGB image buffer supplied by the application and render it to an X window — this was what GIMP plug-ins could use in their user interface to show, well, previews of what they were about to do with the user's images. Later we got some obscure magic in a GdkColorContext object, which helped allocate X11 colors for the X drawing primitives. In turn, GdkColorContext came from the port that Miguel and I did of XmHTML's color context object (and for those that remember, XmHTML became the first version of GtkHtml; later it was rewritten as a port of KDE's HTML widget). Thankfully all that stuff is gone now; we can now assume that video cards are 24-bit RGB or better everywhere, and there is no need to worry about limited color palettes and color allocation.

Later, we started using the Imlib library, from the Enlightenment project, as an easy API to load images — the APIs from libungif, libjpeg, libpng, etc. were not something one really wanted to use directly — and also to keep images in memory with a uniform representation. Unfortunately, Imlib's memory management was peculiar, as it was tied to Enlightenment's model for caching and rendering loaded/scaled images.

A bunch of people worked to write GdkPixbuf: it kept Imlib's concepts of a unified representation for image data, and an easy API to load various image formats. It added support for an alpha channel (we only had 1-bit masks before), and it put memory management in the hands of the calling application, in the form of reference counting. GdkPixbuf obtained some high-quality scaling functions, mainly for use by Eye Of Gnome (our image viewer) and by applications that just needed scaling instead of arbitrary transformations.

Later, we got libart, the first library in GNOME to do antialiased vector rendering and affine transformations. Libart was more or less compatible with GdkPixbuf: they both had the same internal representation for pixel data, but one had to pass the pixels/width/height/rowstride around by hand.

Mea culpa

Back then I didn't understand premultiplied alpha, which is now ubiquitous. The GIMP made the decision to use non-premultiplied alpha when it introduced layers with transparency, probably to "avoid losing data" from transparent pixels. GdkPixbuf follows the same scheme.

(Now that the GIMP uses GEGL for its internal representation of images... I have no idea what it does with respect to alpha.)

Cairo and afterwards

Some time after the libart days, we got Cairo and pixman. Cairo had a different representation of images than GdkPixbuf's, and it supported more pixel formats and color models.

GTK2 got patched to use Cairo in the toplevel API. We still had a dichotomy between Cairo's image surfaces, which are ARGB premultiplied data in memory, and GdkPixbufs, which are RGBA non-premultiplied. There are utilities in GTK+ to do these translations, but they are inconvenient: every time a program loads an image with GdkPixbuf's easy API, a translation has to happen from non-premul RGBA to premul ARGB.

Having two formats means that we inevitably do translations back and forth of practically the same data. For example, when one embeds a JPEG inside an SVG, librsvg will read that JPEG using GdkPixbuf, translate it to Cairo's representation, composite it with Cairo onto the final result, and finally translate the whole thing back to a GdkPixbuf... if someone uses librsvg's legacy APIs to output pixbufs instead of rendering directly to a Cairo surface.

Who uses that legacy API? GTK+, of course! GTK+ loads scalable SVG icons with GdkPixbuf's loader API, which dynamically links librsvg at runtime: in effect, GTK+ doesn't use librsvg directly. And the SVG pixbuf loader uses the "gimme a pixbuf" API in librsvg.

GPUs

Then, we got GPUs everywhere. Each GPU has its own preferred pixel format. Image data has to be copied to the GPU at some point. Cairo's ARGB needs to be translated to the GPU's preferred format and alignment.

Summary so far

  • Libraries that load images from standard formats have different output formats. Generally they can be coaxed into spitting ARGB or RGBA, but we don't expect them to support any random representation that a GPU may want.

  • GdkPixbuf uses non-premultiplied RGBA data, always in that order.

  • Cairo uses premultiplied ARGB in platform-endian 32-bit chunks: if each pixel is 0xaarrggbb, then the bytes are shuffled around depending on whether the platform is little-endian or big-endian.

  • Cairo internally uses a subset of the formats supported by pixman.

  • GPUs use whatever they damn well please.

  • Hilarity ensues.

What would we like to do?

We would like to reduce the number of translations between image formats along the loading-processing-display pipeline. Here is a plan:

  • Make sure Cairo/pixman support the image formats that GPUs generally prefer. Have them do the necessary conversions if the rest of the program passes an unsupported format. Ensure that a Cairo image surface can be created with the GPU's preferred format.

  • Make GdkPixbuf just be a wrapper around a Cairo image surface. GdkPixbuf is already an opaque structure, and it already knows how to copy pixel data in case the calling code requests it, or wants to turn a pixbuf from immutable to mutable.

  • Provide GdkPixbuf APIs that deal with Cairo image surfaces. For example, deprecate gdk_pixbuf_new() and gdk_pixbuf_new_from_data(), in favor of a new gdk_pixbuf_new_from_cairo_image_surface(). Instead of gdk_pixbuf_get_pixels() and related functions, have gdk_pixbuf_get_cairo_image_surface(). Mark the "give me the pixel data" functions as highly discouraged, and only for use really by applications that want to use GdkPixbuf as an image loader and little else.

  • Remove calls in GTK+ that cause image conversions; make them use Cairo image surfaces directly, from GdkTexture up.

  • Audit applications to remove calls that cause image conversions. Generally, look for where they use GdkPixbuf's deprecated APIs and update them.

Is this really a performance problem?

This is in the "excess work" category of performance issues. All those conversions are not really slow (they don't make up for the biggest part of profiles), but they are nevertheless things that we could avoid doing. We may get some speedups, but it's probably more interesting to look at things like power consumption.

Right now I'm seeing this as a cool, minor optimization, but more as a way to gradually modernize our image API.

We seem to change imaging models every N years (X11 -> libart -> Cairo -> render trees in GPUs -> ???). It is very hard to change applications to use different APIs. In the meantime, we can provide a more linear path for image data, instead of doing unnecessary conversions everywhere.

Code

I have a use-cairo-surface-internally branch in gdk-pixbuf, which I'll be working on this week. Meanwhile, you may be interested in the ongoing Performance Hackfest in Cambridge!

the avatar of Chun-Hung sakana Huang

GNOME.Asia Summit 2018 Call for Papers is now open

GNOME.Asia Summit 2018 Call for Papers is now open

GNOME.Asia Summit 2018 invites proposals for presentations at the conference.
GNOME.Asia Summit is the featured annual GNOME conference in Asia. It focuses primarily on the GNOME desktop, but also covers applications and the platform development tools. The summit brings together the GNOME community in Asia to provide a forum for users, developers, foundation leaders, governments and businesses to discuss the present technology and future developments.
picture from Chi-Hung Lin – https://www.flickr.com/photos/92585929@N06/27325096293, CC BY-SA 2.0
The conference will be co-hosted with COSCUP 2018 which will be held in Taipei, Taiwan from 2018-08-11 until 2018-08-12. We welcome proposals by newcomers and experienced speakers alike.
Chinese Version(local language) 中文版(本地語言)請參見:https://openingsource.org/2003/zh-tw/

Important Information

  • The deadline:
    • Submission: 2018-05-20
    • Notification of acceptance: 2018-06-01 until 2018-06-05
    • Full programme published: Early July
  • Conference:
    • Conference date: Aug 11th – 12th , 2018
    • Venue: National Taiwan University of Science and Technology, Taipei, Taiwan.

Possible topics include, but are not limited to:
Contributing to GNOME
  • Latest developments
  • Writing applications for GNOME 3
  • UI design
  • QA and testing
  • Accessibility
  • Human Interface Engineering (Icons and Graphic Design)
  • Marketing/Engagement
  • Asia success stories / Local GNOME Projects
  • GNOME and Education
  • FOSS outreach programs, including Google Summer of Code
  • Developing GNOME on mobile devices (smart phones, tablets)
  • Developing GNOME on embedded systems or open hardware
Contributing to Linux and F/LOSS
  • Linux kernel and development
  • The development and promotion of open-source operating systems
  • About Debian, Fedora, openSUSE, Ubuntu, FreeBSD, and other distributions
  • The development and promotion of other open-source projects
Open Source Enlightenment and Related Story

  • The Knowledge and Spirit of Open Source
  • Open Source stories of your own
  • How to optimize the process and  improve efficiency with the help of open-source tools
  • How to engage non-technical clightning talksontributors in Open Source Projects
  • How to engage more female contributors in Open Source Projects

Emerging Technologies

  • Artificial Intelligence
  • DevOps with AI
  • Deep Learning
  • AR & VR
  • Big Data
  • Distributed systems
  • Open Source DevOps

We are also interested in other topics related to Free/Libre and Open Source Software which are not listed above.
There will be an opportunity for speakers and GNOME Foundation members to request sponsorship by the GNOME Foundation. Please submit applications to the GNOME Travel Committee https://wiki.gnome.org/Travel .
A standard session will be scheduled for 45 mins (35 mins talk + 10 mins Q&A). The session could be a technical talk, panel discussion, or BOF. If you need more time or additional resources, feel free to get in touch with the organizing team.
For those who would like to participate but are not sure if they’d like to do a full talk, we have shorter lightning talks. These are a 10 minutes presentation to demonstrate your work or promote an interesting topic. These talks will be grouped together in a single session.
Please provide a short abstract of your proposal (under 150 words). Include your name, biographical information, a photo suitable for the web, a title, and a description of your presentation. The reviewing team will evaluate the entries based on the submitted abstracts and available time by following the schedule.
Submission deadline: 2018-05-20
Confirmation of paper acceptance: 2018-06-01 until 2018-06-05

All interested contributors are highly encouraged to send in talks.
The GNOME.Asia 2018 Team
the avatar of Chun-Hung sakana Huang

Docker with openSUSE Leap 15

Docker with openSUSE Leap 15

OS: openSUSE Leap 15.0 Beta
Docker version:  17.09.1-ce

Docker is a software technology providing containers, promoted by the company Docker, Inc. Docker provides an additional layer of abstraction and automation of operating-system-level virtualization on Windows and Linux.
Docker implements a high-level API to provide lightweight containers that run processes in isolation.
Because Docker containers are so lightweight, a single server or virtual machine can run several containers simultaneously.

Let’s do some hands on with docker and openSUSE Leap 15

== Install Docker  ==

Use GUI method
use yast2  sw_single install docker

# yast2  sw_single

Search  docker
Select docker to install



Use command line to install docker

use zypper to install, if you don’t want interactive use #zypper  -n install docker
# zypper  install  docker

Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following 13 NEW packages are going to be installed:
 containerd criu docker docker-bash-completion docker-libnetwork docker-runc git-core git-gui gitk libnet9
 libsha1detectcoll1 python2-ipaddr python2-protobuf

The following recommended package was automatically selected:
 criu

13 new packages to install.
Overall download size: 23.2 MiB. Already cached: 0 B. After the operation, additional 117.1 MiB will be used.
Continue? [y/n/...? shows all options] (y):  Y


Check docker version when you install it
# docker  --version
Docker version 17.09.1-ce, build f4ffd2511ce9


== Start docker service and setup boot enable  ==

GUI method
Use yast2  services-manager
# yast2  services-manager

click docker
click Start/Stop start docker service
click Enable/Disable Setup boot enable docker service
Click OK




Command line method

use systemctl command

Check docker service status
# systemctl  status  docker

* docker.service - Docker Application Container Engine
  Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
  Active: inactive (dead)
    Docs: http://docs.docker.com



Start  docker service
# systemctl  start   docker

# systemctl  status docker

* docker.service - Docker Application Container Engine
  Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
  Active: active (running) since Fri 2018-04-27 21:24:09 CST; 3s ago
    Docs: http://docs.docker.com
Main PID: 13632 (dockerd)
   Tasks: 9



Setup boot enable docker service

Checking boot status
# systemctl  is-enabled docker
disabled

Setup boot enable docker
# systemctl  enable docker
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service -> /usr/lib/systemd/system/docker.service.


# systemctl  is-enabled docker
enabled


== If you want normal user could use docker command  ==

The docker package creates a new group named docker. Users, other than root user, need to be part of this group in order to interact with the Docker daemon. You can add users with:
#usermod   -a -G docker   

Like

#usermod   -a -G docker   max



Practice:  docker basic command

Check Docker version

# docker  --version
Docker version 17.09.1-ce, build f4ffd2511ce9

Pull your first  docker image

# docker  pull   busybox
Using default tag: latest
latest: Pulling from library/busybox
f70adabe43c0: Pull complete
Digest: sha256:58ac43b2cc92c687a32c8be6278e50a063579655fe3090125dcb2af0ff9e1a64
Status: Downloaded newer image for busybox:latest


Check your docker images
# docker  images
REPOSITORY          TAG IMAGE ID            CREATED SIZE
busybox             latest 8ac48589692a        3 weeks ago 1.15MB


Search docker images on the web

For example, search opensuse



Search docker images with command

# docker  search  opensuse
NAME                                  DESCRIPTION          STARS OFFICIAL AUTOMATED
opensuse                              This project contains the stable releases ...   230 [OK]
opensuse/portus                       Production ready Docker image of Portus.        65 [OK]


Get your openSUSE docker images  :)
Default is latest if you not order tag

# docker  pull   opensuse
Using default tag: latest
latest: Pulling from library/opensuse
47aa660240a8: Pull complete
Digest: sha256:569e6ee7a622838b9fa1111c3bfa99a50fdb34b7503f945b7d18ce66bb94a369
Status: Downloaded newer image for opensuse:latest

Check your docker images again

# docker  images
REPOSITORY          TAG IMAGE ID            CREATED SIZE
opensuse            latest 35057ab4ef08        6 days ago 110MB
busybox             latest 8ac48589692a        3 weeks ago 1.15MB

Get docker image with tag

# docker  pull  opensuse:42.3
42.3: Pulling from library/opensuse
Digest: sha256:569e6ee7a622838b9fa1111c3bfa99a50fdb34b7503f945b7d18ce66bb94a369
Status: Downloaded newer image for opensuse:42.3


Check your docker images again, you will see opensuse:latest and opensuse:42.3 has the same  IMAGE ID because they are the same.

# docker  images
REPOSITORY          TAG IMAGE ID            CREATED SIZE
opensuse            42.3 35057ab4ef08        6 days ago          110MB
opensuse            latest 35057ab4ef08        6 days ago          110MB
busybox             latest 8ac48589692a        3 weeks ago 1.15MB

Of course, you could pull other images from docker hub, for example

# docker  pull  sakana/sshd
Using default tag: latest
latest: Pulling from sakana/sshd
Digest: sha256:8f140e190db2d683b36cbac1d57410cdfb67029c4580b7b3aad3730005936544
Status: Downloaded newer image for sakana/sshd:latest


Practice:  Run docker container

Know your docker container status before you go
You will not see anything when you use #docker ps command

# docker  ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES


# docker   ps   -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

Run your first docker container with openSUSE

# docker   run   --rm   -i  -t   opensuse   /bin/bash
  • run execute docker
  • --rm Automatically remove the container when it exits
  • -i Keep STDIN open even if not attached
  • -t Allocate a pseudo-TTY

In the container
You could try to echo $HOSTNAME to check you are in docker contaienr now.

00172605a6e5:/ # echo $HOSTNAME
00172605a6e5

Leave the container

00172605a6e5:/ # exit
exit
Check docker container status with #docker ps

# docker  ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES


# docker   ps   -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES


Run docker container again without  --rm

# docker   run   -i  -t   opensuse   /bin/bash

Leave the docker container

62d16d591ad0:/ # exit
exit

Check docker container status with #docker ps
You will find -- if you not use --rm option, docker container will not remove from your host.

# docker  ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES


# docker   ps   -a
CONTAINER ID        IMAGE COMMAND             CREATED STATUS             PORTS NAMES
62d16d591ad0        opensuse "/bin/bash"         About a minute ago Exited (0) About a minute ago                       quizzical_almeida