Blending Linux with BSD

The past 24 hours have been a revelation: there’s no need to be entrenched in one camp of free software. There’s a much wider world outside of any one camp. For example, if you think Ubuntu is Linux, think again. If you think Linux is the bastion of free software, think harder. Free software is all around us and it’s only us who choose not to see it.

I’ve been re-introduced (with a new perspective) to MacPorts. It’s a fascinating and remarkable way to install and use free software on your Mac OS X. I had tried it some years ago but it was just too slow on a spinning hard drive. On my MacBook Air it runs much better (some slowness still because of the nature of compiling source). But the world of possibility it opens is fantastic.

Today I re-remembered pkgsrc from NetBSD and looked into it a bit more. It, too, provides fantastic opportunity to blend (Net)BSD with your favorite Linux distro or even Mac OS X. Go ahead and read pkgsrc: my favorite non-root package manager on linux” and see how simple it can make someone’s life. This article seeded this notion of blending Linux with BSD to benefit any user.

Take this theoretical possibility. There’s a user who wants a Linux-based desktop/notebook OS with great hardware support, wide application availability, cheap-ish or free of cost, great community support, in-depth documentation, etc. Some distros that come to mind immediately include your favorite distro as well. Now let’s say this user chose Ubuntu 14.04 LTS. It is promised to be version-stable with support for 5 years. The user can stick with it for 5 years or can migrate to 16.06 in two years. But for the foreseeable future the user is stuck on the same version of some software unless the distro is upgraded as a whole or by using third-party packages. Although PPAs are available for a variety of software, including updated versions of programming languages like Python, they can be hit and miss in terms of packaging quality and support. An upstream developer cannot be expected to be well-versed in the nuances of Ubuntu packaging. So the overall experience may not be ideal.

A possible workaround is to use something like pkgsrc to obtain and use updated software on a distro meant to provide stability above all else. This distro could be CentOS or Debian or whatever. Turn the concept of a Linux distro on its head to be a more FreeBSD-like “core v apps” architecture. Continue to use your Linux distro and all its great features and packages. And when you need to move beyond its supplied packages to something newer or different use something like pksrc.

May your blending be fruitful.


Install Atom Editor in openSUSE

You’re better served if you read the official documentation: Linux build instructions. Then you should proceed with this post to get an idea of my experience installing Atom in openSUSE 13.1.

Install Prerequisites

Build stuff: sudo zypper install make gcc gcc-c++ glibc-devel libgnome-keyring-devel

node.js from Tumbleweed (to keep up with updates):

sudo zypper addrepo

sudo zypper refresh

sudo zypper install nodejs

Configure npm to use Python 2: sudo npm config set python /usr/bin/python2 -g

Install git: sudo zypper install git

Get Source, Build, Install

mkdir ~/src && cd ~/src

Get the source: git clone

cd ~/src/atom

For some reason you need to re-configure npm to use Python 2. Don’t ask why; it just worked for me and failed if I didn’t: sudo npm config set python /usr/bin/python2 -g

Build: script/build

Install: sudo script/grunt install

Create an atom.desktop file with the following contents: vim ~/.local/share/applications/atom.desktop

[Desktop Entry]
Comment=Atom editor by GitHub

Copy the icon image file to be used in the atom.desktop file: cp ~/src/atom/resources/atom.png ~/.atom

Now you are ready to start using Atom.

Install Sublime Text in openSUSE

I’ve been trying out the Sublime Text 3 Beta on openSUSE and Mac OS X and I like it so far. There are a few bugs, as expected, but it’s a great editor.

Head over to Sublime Text 3 Beta and download the 64-bit tarball (or 32-bit if that’s your environment).

Untar the file: tar xvjf sublime_text_3_*.tar.bz2

Since I’m the only user on the machine and a local install was fine for me I didn’t install it to /opt. Instead, I installed it to ~/bin. This meant I had to customize the install steps a little bit.

mv sublime_text_3/ ~/bin/

You also want to be able to run Sublime using your desktop environment’s menus and such. Copy the .desktop file to your local directory, changing paths as needed.

sed -e 's!Exec=/opt/sublime_text/sublime_text!Exec=$HOME/bin/sublime_text_3/sublime_text!g' -e 's!Icon=sublime-text!Icon=$HOME/bin/sublime_text_3/Icon/256x256/sublime-text.png!g' sublime_text.desktop > ~/.local/share/applications/sublime_text.desktop

I tried this successfully with Sublime Text 3 build 3059 on openSUSE 13.1.

Run Wireshark in openSUSE as non-root user

There are two aspects of using Wireshark in openSUSE: capturing packets and displaying packets. To display packets or view pcap files you don’t need to run Wireshark as root. You also don’t need to do anything extra other than installing it. However, to capture packets you need root privileges. If you don’t have root privileges or want to capture packets as your regular user then you need a few extra steps.

Install Wireshark: sudo zypper install wireshark

Run Wireshark as non-root user to view captures

There is one caveat to running Wireshark in openSUSE as non-root user: when you run Wireshark from the GUI (say GNOME Shell) you are prompted to enter the root password. There’s a simple workaround to this by creating a local wireshark.desktop file, copied from /usr/share/applications/wireshark.desktop, with a slight modification.

cat /usr/share/applications/wireshark.desktop | sed -e 's!Exec=/usr/bin/xdg-su -c /usr/bin/wireshark %f!Exec=/usr/bin/wireshark %f!g' > /home/cguser/.local/share/applications/wireshark.desktop

In the command above we are creating a copy of /usr/share/applications/wireshark.desktop and saving it to /home/cguser/.local/share/applications/wireshark.desktop. The one change we make is to execute Wireshark as a regular user and not as root. You’ll have to do this for all non-root users who need to run Wireshark.

Now when you start Wireshark as a regular (non-root) user you’ll be able to display packets without providing root credentials.

Run Wireshark as non-root user to capture packets

This portion was taken from Sniffing with Wireshark as a Non-Root User. Read that page first before proceeding.

Install setcap to set the capabilities of /usr/bin/dumpcap: sudo zypper install libcap-progs

Create a new group wireshark to restrict users who can use Wireshark to capture packets: sudo groupadd wireshark

Add your user to the wireshark group to be able to capture packets: sudo usermod -a -G wireshark cguser

Change the group of dumpcap to wireshark: sudo chgrp wireshark /usr/bin/dumpcap

Change the permissions of dumpcap to only allow users in wireshark group to be able to run it: sudo chmod o-rwx /usr/bin/dumpcap

Set the capabilities required by dumpcap to run since its group is no longer root: sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap

View the capabilities of dumpcap to confirm they were set correctly: getcap /usr/bin/dumpcap

/usr/bin/dumpcap = cap_net_admin,cap_net_raw+eip

Logout and login again to finalize the addition of your user to the wireshark group.

Now when you start Wireshark as a regular (non-root) user you’ll be able to capture packets without providing root credentials.

Note: This was tested working in openSUSE 13.1.

Using Wireshark in Ubuntu

There are two aspects of using Wireshark in Ubuntu (or Debian for that matter): capturing packets and displaying packets. To display packets or view pcap files you don’t need to run Wireshark as root. You also don’t need to do anything extra other than installing it. However, to capture packets you need root privileges. If you don’t have root privileges or want to capture packets as your regular user then you need a few extra steps.

Install Wireshark: sudo apt-get install wireshark

Configure Wireshark to allow non-root users to capture packets: sudo dpkg-reconfigure wireshark-common

Add your user to the wireshark group to be able to capture packets: sudo usermod -a -G wireshark cguser

Logout and login again to finalize the addition to the group.

Now when you start Wireshark as a regular (non-root) user you’ll be able to capture and display packets.

Note: This was tested working in Ubuntu 14.04 LTS Trusty Tahr.

zypper: The following package updates will not be installed

I was trying to update my openSUSE 13.1 install and got this:

sudo zypper update

Loading repository data...
Reading installed packages...

The following 8 package updates will NOT be installed:
  libeXosip2-6 libgsm1 libortp9 libosip2 libspandsp2 libspeex1 libspeexdsp1 linphone 

Nothing to do.

I had linphone installed already but why would it not update? So I tried a distribution update (bad idea if you’re not actually upgrading your distribution to a newer release!):

sudo zypper dup

Warning: You are about to do a distribution upgrade with all enabled repositories. Make sure these repositories are compatible before you continue. See 'man zypper' for more information about this command.
Loading repository data...
Reading installed packages...
Computing distribution upgrade...

The following 42 NEW packages are going to be installed:
  bash-doc dconf desktop-translations exim gsettings-backend-dconf libdconf1 libproxy1-config-gnome3 libtidyp-1_04-0 openssh-askpass perl-Data-Dump perl-Encode-Locale perl-File-Listing perl-HTML-Parser 
  perl-HTML-Tagset perl-HTML-Tidy perl-HTTP-Cookies perl-HTTP-Daemon perl-HTTP-Date perl-HTTP-Message perl-HTTP-Negotiate perl-IO-HTML perl-IO-Socket-SSL perl-LWP-MediaTypes perl-LWP-Protocol-https 
  perl-Net-DBus perl-Net-HTTP perl-Net-LibIDN perl-Net-SSLeay perl-Text-Wrapper perl-Tie-IxHash perl-TimeDate perl-URI perl-WWW-RobotRules perl-X11-Protocol perl-XML-Twig perl-XML-XPathEngine 
  perl-libwww-perl readline-doc ucode-intel vim-data xdg-utils zypper-log 

The following 8 packages are going to be upgraded:
  libeXosip2-6 libgsm1 libortp9 libosip2 libspandsp2 libspeex1 libspeexdsp1 linphone 

The following 8 packages are going to change vendor:
  libeXosip2-6  openSUSE -> obs://
  libgsm1       openSUSE -> obs://
  libortp9      openSUSE -> obs://
  libosip2      openSUSE -> obs://
  libspandsp2   openSUSE -> obs://
  libspeex1     openSUSE -> obs://
  libspeexdsp1  openSUSE -> obs://
  linphone      openSUSE -> obs://

8 packages to upgrade, 42 new, 8  to change vendor.
Overall download size: 18.5 MiB. After the operation, additional 62.2 MiB will be used.
Continue? [y/n/? shows all options] (y): 

I did not proceed with a dist-upgrade. As you can see, the vendor was being changed from openSUSE to an OBS repository.

That’s when I realized(*) that not only was linphone provided by the openSUSE repos but also this OBS repo I was using for SIPp. So what’s the solution? I need this OBS repo but I don’t want to keep seeing this message (for semi-OCD reasons). I haven’t found a solution yet but at least I can rest easy knowing why I was seeing this message.

(*) OK, I found a pointer to the actual cause. Hat tip to Zypper: The following package updates will NOT be installed

Self Exceptionalism in the Free and Open Software Communities

Recently, I have felt myself being pulled in three directions at once. There’s the RHEL ecosystem that I have immersed myself into over the past many months. Ubuntu 14.04 LTS Trusty Tahr released last week and is a very enticing option, especially since I started with Ubuntu many moons ago. Finally, there’s the BSD world beckoning, with its culture and technology. Which option do I pick for primarily two roles: my daily driver at work and a way for me to grow my knowledge and skills, prepared to take on tomorrow’s challenges?

The answer is not as simple as I had anticipated. And the reason is my belief in my own exceptionalism. I have convinced myself that my vote for any one of these three options will turn the tide of FOSS in that direction. That if I don’t support an option then that option will disappear and its community will wither away. That I need to be a part of the community so I can contribute my skills, preventing unforeseen catastrophes waiting to be unveiled. That the FOSS world is waiting for a hero: me.

Of course, this is an absurd way of thinking. One person does make a difference but not at the scale I have imagined. It doesn’t matter to Ubuntu or its community that I fired up Fedora in my VM today. It has no affect on FreeBSD if I don’t learn how to use it. It doesn’t matter to Fedora that I am slowly moving to using Ubuntu daily. In a sense it does matter to all three projects whether an individual stays within the community or leaves. But not in the way I have convinced myself it does.

I am no savior. I can’t save or condemn a FOSS project because of my participation or the lack thereof. The reason is simple: these projects are much bigger than an individual. They have existed before I became a part of their communities; not just existed but prospered. I am but one man.

And therein lies the crux of the matter. If I am not writing code, finding bugs, generating official documentation, etc. then I’m not really a part of the community. I may be a passive advocate at best or a user at worst; but not part of the community. The community is formed of people who actively participate in shaping a project not those who use the output of their efforts without giving back.

A lot of people like myself are delusional in this manner. Just because they can download Ubuntu for free does not give them the right to complain and criticize when the desktop does not behave the way they demand. Either they pitch in, take a leadership role in the community, and fix the problems they have, or they lose the right to criticize. It’s alright to point out bugs and papercuts in a constructive gesture. Anything else reeks of their own belief in their exceptionalism. They have to stop thinking that just because *they* don’t like something that the project’s priorities need to shift to cater to their whims.

No project or product can survive without users. No one disputes that. But it’s not necessary that a project has to be used by *everyone*. Those who participate in developing the product and nurturing the project are its users, too. As long as they use and are satisfied, that’s all it matters.

So all of you who think the world revolves around them and that somehow FOSS means their wishes are paramount, think again. Get off your high horse, throw away the cloak of self exceptionalism, and pitch in. Either you are part of the solution or you don’t matter.

A question now comes to mind: why did I think that I was exceptional? It’s because I *expect* a lot from myself. I want to excel in all things I do. If I’m using some FOSS application that needs contributors I expect of myself to become such a contributor. Alas, there’s only so much one person can do. I have so many other obligations taking up my time that it becomes impossible for me to participate in many platforms and forums concurrently. That’s just life. The problem, though, is that I continue to expect of myself anyways. This causes undue stress, a highly unhealthy trend.

Given this new light in which I see myself, I will attempt to stop worrying about what the Internet says is a viable project and which one to support. I will no longer allow myself to be bound to follow the herd. If Ubuntu on the desktop gives me a pleasurable experience, CentOS works when I need a server, and FreeBSD can protect my network better, then I’ll use the best tool for the job. All these projects deserve contributions from their users. I’ll try my best to become a contributor. Until I do so I know that I’m a user and only a user.