Linux, 2017!

First of all, please do not read this post as a complain. Just as an analysis. I am a Linux user for decades. I remember using Linux in my first year of University, somewhere about 1996. I never stopped using Linux, in the server, but during some years, somewhere between 2002 and 2017 I was a Mac user for the desktop (one PPC Mac Book, two Intel Mac Book Pro). Back to the beginning of 2017 I needed an update, and decided to go back to Linux. Mostly because of the price of a decent Mac Book Pro when compared with a generic laptop. I decided on a Dell, and without a lot of thinking, decided on a Dell with a 4K display. Well, I had a hard time trying to install a distribution. Tried Mint, Debian and Ubuntu. Curiously, all gave trouble with UEFI boot, but the one that ended up installing a working Linux was Mint Given it is Debian based, I can keep up with the Debian updates, and install most packages available only for Ubuntu.

While I see some applications getting better, from 2002 to 2017, it seems Linux community continues rewriting the wheel. I can’t see any big difference from what I am experiencing today in the desktop with what I was experiencing earlier with Gnome 1. Yes, the code was changed. It might be more stable, faster, support a couple of new things. But it seems we continue rewriting and rewriting the same old applications.

Then there is the issue with a 4K display. Even if GTK3 has support for High DPI screens, a lot of  applications are not written for this toolkit. And I am not sure, at all, that this is something that need to be managed by the graphical toolkit. I still think it is a Xorg issue, where we should be able to define DPIs for each screen, and have the basic low-level tools scale everything. As this is how I see things, I decided today to look to the blog of Xorg. And it doesn’t have news since 2013. As I could read, now most work is done as independent libraries. Nevertheless, it is strange no changes were needed to be done in 4 years.

Also curious that a bunch of applications using node.js are being working great. Examples are GitKraken, Code, Atom, Franz… and even Sublime is working great on 4K (even if it has some other issues). Unfortunately Unity3d is not working properly in 4K, but that looks more like an issue with their own GUI system, than anything else (but then, if Xorg took care of things, maybe it would work great, just like it works acceptably under Windows). But other things, like old Gtk, Xlib, QT or even Java applications still look like needing a microscope to be read.

So, here I am, with a shiny new laptop, deciding to keep Linux, or getting back to.. huh.. windows! Yeah, I do dual boot, but I like Linux for most things. But some aren’t possible As a teacher, I know I will have problems when trying to use a beamer. When connecting an external display, everything will look monstrous. Or I can change the resolution on the built-in screen, go searching the HiDPI switch, turn it of, restart the session for it to be correctly applied, and then use the laptop. Shame.

And yes, I know a lot of this is my fault. If I did not change to Mac, and if like me other hundred of developers didn’t do the same, probably we would have a lot more Linux users, writing and patching these applications. Or we would just end up with a lot of more distributions, a lot more window manager, but with the same main issues.

At last, but not less important, I would like to thank you to everyone that is still working on Linux making it better. I know this is not a paid job. I know you (and I) do what we want, and what makes us happy. That is why this is not a complain text. Just looking to what I see, without pointing any fingers.



MonoGame: From Windows to Linux

The traditional way to have a C# MonoGame Project compile both under Linux and Windows is to use a tool named Protobuild. With the last version (3.6), the MonoGame OpenGL template for a cross platform game includes references to the libraries in the three main formats: DLL for windows, DyLib for mac, and so for Linux. This seemed like a good chance for making things work.

And it mostly did. Change to the path where the .csproj file resides, and run xbuild. The bin folder should be created, and inside there, a path accordingly with your project configuration. For example, bin/DesktopGL/AnyCPU/Debug. Then, go there, and just run your game with
mono Project.exe.

(future work: check how to make things work outside the output dir)

Getting back to Linux: Part #1

Debian_Logo_02After the last Apple keynote, the news on Mac Book Pro, and the exorbitant price, I took part of this Sunday to look back to Linux as a Desktop. Although I work usually on a 2011 Mac, that runs perfectly (just some bumps), I have a Lenovo laptop. So, I decided to install the Linux distribution I have been using lately for my servers: debian.

First I downloaded the netinstall image. It complained of missing drivers for wi-fi and ethernet. Then, I downloaded the non-free netinstall image. Same behavior.

Well, decided to keep it, and use a USB stick to install the missing packages. After going from/to my mac to download missing packages and dependencies, I got something. The card is detected, the correct (at least it seems) module is loaded, ifconfig shows the device, but ifup fails to bring it up.

After googling and fighting with wpa (first I was thinking this was the problem), I found out that Linux was just deciding that it couldn’t load the interface, and mentioned something about rfkill, that I am not sure what it is.

Googled a little more and found articles saying that my Lenovo has some other wireless card than the one listed by lspci. Strange.

In any case, the day is almost over, and I need to get back to my job. My conclusion so far is a quote from an old teacher, now a friend: Linux is still a Cowboys operating system.

Not sure about all Linux distributions, but debian for sure.


Dotcloud and Perl Versions

Today I waste all my afternoon trying to solve a problem with Perl versions and DotCloud. I say I wasted the afternoon because I could not solve the issue during the afternoon, only in the beginning of the night.

Enough complain, and let me explain what was going on. Yes, this post is a little as a complain to the DotCloud tech guys, but also as a guide to someone that stumble in a similar situation.

I had a service running with Dancer. It worked, it connected perfectly to the database. Next step was to set up a cron job to fetch some data from the Web. I added its dependencies in the Makefile.PL file for the website, and hoped that the deploy system would install them. But the cron job continued failing. I tried to force its installation, but the deploy system said it was up to date. Something wrong was going on. I forced a little more the installation, adding the URL to the module tarball. This way the deploy system could not guess its version, and therefore, would install the module anyway. It worked, but the deploy system continued complaining about other and other module.

It got stranger when the cron job complained about the lack of the DBI module. Hey, how can it be, if the website is running and using it? Well, DBI is based on C code, so probably I am missing to include a sub-folder of the local module installation. And then, it got clearer: the cron job complained that the version of could not be loaded into Perl because of unresolved symbols. Aha! Then, there are two Perl versions.

And indeed, the web application was running Perl 5.14.x (I requested it on my DotCloud configuration file) and the Perl used by the cron job was Perl 5.10.x. Basically, DotCloud folks keep the system Perl, and install custom Perl versions under /opt/perl5, and creates some symlinks there, so that /opt/perl5/perls/current points to the Perl version requested.

So, the solution is to make the cron job use the correct Perl version. In my case I set the full path, but you could change the PATH environment variable in your .bashrc-like file.

This wasn’t that hard, but it was quite time consuming, because deploys take some time. Probably I could get faster if I remembered to test Perl versions right ahead, but I forgot to.

I suggest DotCloud guys to do one of two things: or document this in the same doc where it is explained how to request a specific Perl version, or fix the damn environment so that cron jobs and other code uses the same Perl version as the one requested by the system.

Mac OS X ‘ls’ vs GNU ‘ls’

There are a few details that can change completely you decision when to use one version of a command or another. Mac OS X ‘ls’ command is one of those you do not want, and you are desperate to install GNU version of ‘ls’. Check the differences (below ‘gls’ is the GNU version of ‘ls’).

[ambs@stravinski Liturgica]$ ls
0001			0068			0135
0002			0069			0136
0003			0070			0137
0004			0071			0138
0005			0072			0139
0006			0073			0140
0007			0074			0141
0008			0075			0142
0009			0076			0143
0010			0077			0144
0011			0078			0145
0012			0079			0146
0013			0080			0147
0014			0081			0148
0015			0082			0149
0016			0083			0150
0017			0084			0151
0018			0085			0152
0019			0086			0153
0020			0087			0154
0021			0088			0155
0022			0089			0156
0023			0090			0157
0024			0091			0158
0025			0092			0159
0026			0093			0160
0027			0094			0161
0028			0095			0162
0029			0096			0163
0030			0097			0164
0031			0098			0165
0032			0099			0166
0033			0100			0167
0034			0101			0168
0035			0102			0169
0036			0103			0170
0037			0104			0171
0038			0105			0172
0039			0106			0173
0040			0107			0174
0041			0108			0175
0042			0109			0176
0043			0110			0177
0044			0111			0178
0045			0112			0179
0046			0113			0180
0047			0114			0181
0048			0115			0182
0049			0116			0183
0050			0117			0184
0051			0118			0185
0052			0119			0186
0053			0120			0187
0054			0121			0188
0055			0122			TODO
0056			0123			book.lytex
0057			0124			cleanGenerated
0058			0125
0059			0126			letra.dtd
0060			0127
0061			0128			letra.rnc
0062			0129			letra.x
0063			0130
0064			0131			schemas.xml
0065			0132
0066			0133
0067			0134


[ambs@stravinski Liturgica]$ gls
0001  0021  0041  0061	0081  0101  0121  0141	0161  0181
0002  0022  0042  0062	0082  0102  0122  0142	0162  0182
0003  0023  0043  0063	0083  0103  0123  0143	0163  0183
0004  0024  0044  0064	0084  0104  0124  0144	0164  0184
0005  0025  0045  0065	0085  0105  0125  0145	0165  0185
0006  0026  0046  0066	0086  0106  0126  0146	0166  0186
0007  0027  0047  0067	0087  0107  0127  0147	0167  0187
0008  0028  0048  0068	0088  0108  0128  0148	0168  0188
0009  0029  0049  0069	0089  0109  0129  0149	0169  TODO
0010  0030  0050  0070	0090  0110  0130  0150	0170  book.lytex
0011  0031  0051  0071	0091  0111  0131  0151	0171  cleanGenerated
0012  0032  0052  0072	0092  0112  0132  0152	0172
0013  0033  0053  0073	0093  0113  0133  0153	0173  letra.dtd
0014  0034  0054  0074	0094  0114  0134  0154	0174
0015  0035  0055  0075	0095  0115  0135  0155	0175  letra.rnc
0016  0036  0056  0076	0096  0116  0136  0156	0176  letra.x
0017  0037  0057  0077	0097  0117  0137  0157	0177
0018  0038  0058  0078	0098  0118  0138  0158	0178  schemas.xml
0019  0039  0059  0079	0099  0119  0139  0159	0179
0020  0040  0060  0080	0100  0120  0140  0160	0180
[ambs@stravinski Liturgica]$ 

My terminal has 46 lines and the first version doesn’t appear completely in the window. The second would fit perfectly ever if I had the usual 24/25 lines. Yeah, it will not fit for ever, as I am adding more items to this folder, but you understood the idea…

Testing Linux II: Mandriva

mandrivaThe next linux to test was Mandriva. I recall to use Mandrake some years ago. First point regarding Mandriva, is that I downloaded the DVD version. That means I was installing with more than 4GB of software on my DVD drive. Why that is relevant? Keep reading.

The installation was easy. The interface is quite good, although not as detailed as OpenSuse installation, but better than Fedora interface. Regarding this installation, my main complain is to have Portugal listed in the secondary countries list, while some strange countries appear in the main countries list. Also, that wouldn’t be bad if it was more intuitive to select.

Regarding the installation, I miss the detailed information about what is going on. Mandriva keeps showing screenshots of their linux desktops. Also, that is a stupid thing to do, as in a small screenshot you can not detect any difference on the image for the different Mandriva distributions. Probably a list of features would be better. Lack of reflection for the Mandriva product managers.

It all went correctly until the wireless configuration. The laptop has a Intel 3945 802.11g Wireless card. It is not that recent, and there are open source drivers available. In fact, it seems that most recent kernels include this driver. But Mandriva does not include it in the 4GB of software. Oh, and I was using the 2010.0 distribution.

Probably to include more drivers and less crap would help users. I do not care if I need to use the internet connection to download gnome or kde widgets. But I really care if I need to use the internet connection to download the wireless driver, that does not let me to connect to the internet to download… yeah… kind of remembers me of BOFH story of sending by email the password to read the email.

Now I am wondering. If I need to install drivers by hand, probably the best is to go back to my predilection linux distributions, like Slackware or Arch Linux. At least these assume they are not for common desktop users. Well, the other option is to test ubuntu or debian.

Testing Linux I: OpenSuse and Fedora

opensuseI got a PC laptop for work with… Windows. Decided to install a Linux on it, and decided to give a look at current distributions. At the moment I was looking for a non-newbie system but with some basic configuration issues automated. For example, I desesperate when I need to configure a wireless manually. I think that is a task that should be easy to perform and not consume much time.

My first option was OpenSuse. I knew Suse for a long time and never tried it for being commercial. Now this was the chance to look and check what they have been doing. First, the installation wizard is really good. Not just good aspect, but also functional. It detects everything and reports the detections to the user. That is great. Also, when installing a boot loader, if it fails, it tries to help the user to correct the configuration and try to install it again.

Also, it lets you to choose between installing a KDE or Gnome based desktop. Also, a XFCE option is there. That is great. I love XFCE. Probably this choice was the reason I did not like OpenSuse, but who knows. So, when booting, the X Login Manager is based on TWM, that sucks. But that is not relevant. Login worked correctly, but when configuring the wireless device, it couldn’t connect to the wireless network. I could not find why. It did not complain with the password. It did not complain about lack of signal (no idea about its power, btw). It just said it configured the network device, and exited the configuration tool. Tried a few minutes to find out what was going on with iwconfig and ifconfig, but decided to try a new distribution.

fedora Next try was Fedora. I know lot of people using Fedora. It is not an old distribution, but given that they use a big base from RedHat, it should be somewhat stable. Booted the live-cd and used the installer available on it. That is good because it lets you use a linux system while you are installing other linux system. That is cool. The installer, itself, is equal to the first fedora installer (at least I did not find big differences). The windows are not well designed (widgets not correctly placed…), but it is enough for the installation task.

But that isn’t my complain. My complain is that, after half hour installing the system, anaconda crashed when installing the Grub bootloader. Instead of an error message I got a Python backtrace. And that sucks. First, because I hate Python. Second, because it crashed the installation, forcing me to restart the installation.

No, I will not retry fedora now, I think. I will download another linux version.

Hope I can find any interesting distro that is not Ubuntu (I have different complains about it… for a future post).

Moblin 2.1 – First Impressions

Moblin logoAfter some disasters with Ubuntu on my Acer Aspire One (it just stopped working, X crashing and other problems) I tried moblin again. Installed version 2.1 beta and my first impression is that it is more stable than 2.0 at the moment.

The browser seems more stable, loading pages faster. Unfortunately the flash plugin is not fast enough. Who knows if it works better next time. Although this is true, there is a huge difference between a common linux browser (like Firefox) time to load a page and moblin time.

Regarding connections with the world, the gtalk account was configured correctly at first. Regarding Twitter, it took some more time. First because it opened a browser, but did not say it would do that, and I closed it. And the second time the browser did not start. After some time I found out what was happening (moblin needed the Twitter PIN code) and I was able to register. After two minutes twitter updates weren’t available yet. After five minutes the first updates started appearing. Unfortunately after 30 minutes of work I wasn’t able to twit yet.

Tried as well the tool to watch pictures. It started a slideshow, but the slideshow window was covered by the moblin window. Fail…

Later tonight I’ll do some more experiments…

tar guessing compression method

Finally (not sure how long ago, but I just found out about it three days ago) the tar unix utility (gnu version) can guess what the compression method to use. Now I can forget that -j is used for bzip2, -z is used for gzip, and some other for xz.
Just use ‘tar axf’ for extraction, and ‘tar acf’ for compression. Everything else is guessed from the file extension!