A fix for broken (physical) buttons and dead touch area on Android phones

My old Android smartphone fell too many times and had its physical buttons (back, home, recent apps) not working, which was problematic to do anything. You can go back with in-app buttons most of the times, but there is no way to switch app or to go back to the desktop.

One good fix is to use an app that will put the back and home button functions as touch gestures, for example swiping from the borders of the screen. To this avail I suggest Fluid Navigation Gestures. In case you absolutely needed to trigger the home button, for example, you can connect the phone to the computer, enable ADB, and trigger any key you would like with it.

Navigation gestures are a good fix until you realized that not even the spacebar (or the whole lower row of keyboard keys) would not work. So in the end, the real solution is to prevent Android from drawing anything in the bottom part of the screen (or, at any rate, the broken part, wherever it is — as long as it is on some side and not central). And it turns out it is actually possible to resize the screen area in Android!

Continue reading

FOSS Android Apps and my quest for going Google free on OnePlus 6

A while ago I decided I did not want to be a product anymore, and start paying for services. I started by breaking free from all the free-but-commercial company services such as Dropbox and Gmail, and ultimately ended up ditching all non open source software on my phone, doing away with anything that was Google-run.

There is an alternative: follow through as we embark on the journey of moving to Free and Open Source Software (FOSS) for Android.

Easy replacement for essential services

The problem with non-open source software is that they have to keep building new features into their products, or the market will tag them as dead. They have to keep moving, and some occasional bugfixing is not enough. On the other hand, open source software does often not have this drive. These projects’ maintainers just tend to make sure their software runs smoothly and that it has all it should have.

So, after Dropbox kept implementing useless features and, most of all, would force me to move my folder to a partition formatted with ext4 instead of ntfs, I was fed up. My first step was thus to self-host an instance of Nextcloud. I chose self-host because I wanted control and because I already had a server to host it on, but there are options where you can rely on someone else’s instance and register for a share, pretty much as Dropbox does.

And Nextcloud is really, by all means, a valid alternative to Dropbox. There are clients for all operating systems, including mobile ones, with all the needed features, and they are actively maintained. Actually, it’s more than an alternative to Dropbox! I started with just file hosting, but there are countless apps that can boost your Nextcloud instance. I added Notes and did away with Google Keep, but most importantly Contacts and Calendar so that I could sync my phone contacts and meetings not with Google, but with my own server (using the DAVx Android app, freely available on F-Droid). I also tried the Passwords app to ditch Lastpass, but the Firefox addon was not working super well (end thus ended up signing up for Bitwarden instead).

I then scouted for (paid) privacy-focused email services. First to grab my interest was Tutanota, but after using it a few days it was clear to me that they were still far from being something one could rely on as a power user (no conversations, no option to receive mails from other domains, and more missing). I then went with ProtonMail, which I am very happy with — true, some features miss there as well, but they are minor. I now have a primary protonmail address, and (as a paying user) I could link my other addresses so I handle all from one dashboard. It came with a subscription to ProtonVPN as well, so that was a nice addition. And so Gmail was gone as well.

Continue reading

FEniCS differences between Function, TrialFunction and TestFunction

The FEniCS project allows for simple solution of partial differential equations. However, getting started from examples is so quick, it is easy to miss how the inner-workings of it behave. This should not happen (especially if it is a PhD project). There are three vital pieces of the puzzle that it might not be clear what they are for, and the documentation does not help here: the functions TrialFunction, TestFunction, and Function.

The thing is that, in the usual Finite Element Methods, we only have the distinction between the trial function u \in V_h and test function v \in V, and even then the distinction is often blurry. In fact, technically, the spaces V_h and V can be different. However, most of the time we take them to be the same (for example, the same discrete space of piecewise linear functions). The names we give them is just to have clearer in our heads what role they play in the game, but we could as well say “two functions in V“. Then why would FEniCS have even a three-fold difference? You can quickly check for yourself that, for example, if you swap the TrialFunction for a Function, FEniCS will complain.

There is no documentation on the topic as far as I have found, so these are my (maybe mistaken) deductions.

The meaning of the TrialFunction is to let FEniCS know what function we are solving for. In fact, when we call

FEniCS expects to find a TrialFunction in A, which is supposed to be the function we are looking for. On the other hand, u_ is the symbol in which the result will be stored, and this needs to be a Function (not Trial, not Test, just a regular Function).

Continue reading

Troubleshooting the installation of IRAF on Ubuntu

So, found myself installing IRAF on a friend’s laptop running Ubuntu. There are some decent tutorials online about the general steps: for example, this one, and the official one. However, they all skip all possible issues that could come up (or at least, that popped up in my case). This is another good resource about the setup, config and usage (but skip the Ureka parts).

The community-maintained version of IRAF allows easy installation on some systems, such as Ubuntu.

The thing is that IRAF is a jumble of stunningly old pieces of software working together on primitive terminals and on peculiar conditions.

In random order, possible issues/tips are:

  • If the packages iraf-all pyraf-all stsci show as non-existent, you have not added the astroconda channel. The command should be
    conda config --add channels http://ssb.stsci.edu/astroconda
  • You will still need to manually install ds9:
    sudo apt install saods9
  • You do not need to change the default shell to tcsh, although you need it to be installed:
    sudo apt install tcsh
  • If xgterm does not execute with error File not found, although the file is clearly there, make sure you have installed 32 bit dependencies:
    sudo apt-get install libc6:i386 libz1:i386 libncurses5:i386 libbz2-1.0:i386 libuuid1:i386 libxcb1:i386 libxmu6:i386
  • If conda commands do not work, make sure you have activated the Python environment containing the iraf packages:
    cd /path/to/iraf
    source activate iraf27

In the end, the exact set of commands that got the whole environment working has been: Continue reading

Install Windows 7 on a modern, Intel 8th generation computer

I spent a good week trying to get Windows 7 to work on a modern laptop, having an Intel i3 8th generation CPU and other recent components, such as a NVMe SSD. What I did not know in the first place, is that officially, Windows 7 does not support Intel CPUs later than 6th gen. Moreover, it does not support UEFI boot (not GPT partition tables). For reference, we are talking of a PC Specialist Ultranote IV 14″. Up to now, everything works almost flawlessly but the wifi/bluetooth adapter.

I am not gonna provide a full tutorial on how to install Windows 7 on a modern computer, but I am going to list here all the relevant resources that helped me succeed in the mission, as the research turned out to be quite exhausting.

The main issue is that the installer will stop quite soon and abruptly, stating that “A required CD/DVD drive device driver is missing“. Clearly, this is bullshit, as the laptop does not even have an optical drive and the installer was running from USB.

Continue reading