Thursday, September 21. 2017
Adding a custom CA to your android phone
Another simple post this time. I updated my phone again with LineageOS (I was waiting if any release other than nightly was to be available, but the blueborne exploit convinced me to move now) and, again, I spent some time trying to install a custom certificate in the phone. The procedure is explained in this article in detail and it works like a charm for me.
To install your CA certificate you need to obtain a hash of the certificate because android expects the file to be called using this hash (this point was crucial and I had no idea about it before). So first you obtain your PEM and get the hash with the following command:
openssl x509 -inform PEM -subject_hash_old -in calocal.crt | head -1 xxxxxxxx
Once you have the certificate and the hash you just need to install it with the following name /system/etc/security/cacerts/xxxxxxxx.0 and the same permissions than the other CAs. Remember that the /system file system is read-only by default and you need su to do the complete process. So you have to go to Settings → Developer Options → Root Access and include ADB to it.
$ adb shell daemon not running. starting it now on port 5037 daemon started successfully $ su # mount -o remount,rw /system # cp /sdcard/Downloads/calocal.crt /system/etc/security/cacerts/xxxxxxxx.0 # chmod 644 /system/etc/security/cacerts/xxxxxxxx.0 # mount -o remount,ro /system
And reboot your phone. You can check that your local CA now should be listed in Settings → Security → Trusted Credentials in the System tab.
Following the procedure all my synchronizations started to work again against my personal nextcloud and runalyze servers. It's incredible that such an old phone is still maintained by lineage and now running android 7.1.2 with the September security patches from google. I have to say that my requirements for the phone are very slight.
Good job lineage team!
Sunday, September 10. 2017
Custom mode lines in Wayland
Because of my new work now I only use debian testing in my desktop box. I have a little gigabyte next to my TV and, if you remember, my nasty samsung model is always boycotting me (using an HDMI connector the TV uses a mode in which a little zone at the four edges is missing, other samsung models have a screen fit option that avoids this issue, but in mine that option is missing; if common VGA connection is used then the TV does not send the EDIDs to the computer). I am not going to buy another samsung TV in my whole life, that is for sure. But after upgrading the box I discovered that (again) the resolution was 1024x768 and not to the correct 1360x768 that is supported in VGA, that mode line was configured in the xorg.conf file and now, something had changed, and it did not work. To my surprise debian testing has moved to wayland and now the X11 configuration is not used (if I logged in using X11 it worked again with the proper resolution).
I do not know if I am going to use wayland or X11 but at least I wanted to know how to configure a custom mode line in wayland to have both options available, and I finally discovered it in this post answer. Now you have to add the mode line in EDID format and configure the kernel to boot using that EDID. The steps are quite easy:
Akatrevorjay has created an easy project to change any X11 mode line in an EDID file. So first clone the project.
git clone https://github.com/akatrevorjay/edid-generator.git cd edid-generator
Install some required packages.
sudo apt-get install zsh edid-decode automake dos2unix
The project has some standard mode lines already present but I had to add my custom one. This creates a 1360x768.S definition file for the mode line.
./modeline2edid - <<< 'Modeline "1360x768" 84.75 1360 1432 1568 1776 768 771 781 798 -hsync +vsync'
Compile and create the binary EDID files.
make
Copy the ones you are interested in to the /lib/firmware/edid directory.
sudo cp 1024x768.bin 1360x768.bin /lib/firmware/edid/
Finally add the EDID you want to configure in the kernel at grub level. The option drm_kms_helper.edid_firmware=edid/<resolution>.bin should be added to the GRUB_CMDLINE_LINUX variable in the /etc/default/grub file (In debian this option is empty by default).
GRUB_CMDLINE_LINUX="drm_kms_helper.edid_firmware=edid/1360x768.bin"
You can first try adding manually the option editing the boot line in grub (in the grub menu you can click e to edit the line and start with the option manually added, you also need to do this if you make any mistake and the kernel does not boot).
Update the grub.
sudo update-grub
And that is all. When you restart the box, it uses the new resolution in the complete boot process. I do not know if I will continue with wayland or I switch back to X11 (think that this box is mainly used to browse internet, watch youtube videos, series and films, listen to music and so on and so forth), for the moment I have not seen any issue but you never know. As always, the entry is mainly for me, next time I will have the information here, easy access.
Regards!
Monday, July 25. 2016
Moving to Nextcloud
Today I decided to upgrade from owncloud 8.2 to nextcloud 9.0. There are a lot of posts around the internet so I am not going to give a detailed step by step (besides it is similar to a migration to a newer version of owncloud, so my previous post is valid here too). If you remember I had problems updating to the las version because of errors in the database upgrade. The error continued up to now and in both applications (owncloud or nextcloud).
The problem complained about creating some tables. The final reason was that those tables were already there (I do not know where they came from, because they are in my backups since version 7 provided by Debian). Finally I gave up and decided to spend the time deleting the affected tables and re-inserting the data if necessary. I went table by table and finally the following SQL script drop the problematic tables:
/* drop database an re-create */
drop database owncloud;
create database owncloud;
use owncloud;
/* load the dump from version 8.2 */
source /home/ricky/owncloud-8.2.dump
/* drop tables that seem to be wrong */
drop table oc_notifications;
drop table oc_trusted_servers;
drop table oc_addressbooks;
drop table oc_cards;
drop table oc_addressbookchanges;
drop table oc_calendarobjects;
drop table oc_calendars;
drop table oc_calendarchanges;
drop table oc_calendarsubscriptions;
drop table oc_schedulingobjects;
drop table oc_cards_properties;
drop table oc_dav_shares;
From those tables five of them had previous data in the backup (oc_addressbooks, oc_cards, oc_addressbookchanges, oc_calendars and oc_cards_properties). Nevertheless after the upgrade all of them were fully filled again (so I think the data is created from pre-existing information and no more action was needed). Deleting them the nextcloud upgrade ran successfully and now I am at version 9.0.53. As I commented in the previous entry do not forget to activate the applications you use and upgrade them too. Just one more comment, for the notes application I use, the current master branch is needed (last released version 2.0.1 does not work, nothing is shown inside the page).
So, finally I decided to move from owncloud to nextcloud. I also changed the phone application. Let's see what happens because I am not very sure about my decision. (Mainly I wanted to fix my broken upgrade to version 9.x. And, because both projects gave me the same problem, I realized that the issue had to be related to my particular data and not to a problem in the upgrade itself. That fact forced me to choose a project sooner than I would have wanted. The answer from the owncloud foundation to the nextcloud announce was quite decisive.)
Enjoy and retain your data!
Comments