Recently we decided to give it a go with SymfonyPHP framework on an Ubuntu 18.04 LTS. Below you will find the commands we executed to install the skeleton project of symfony with some comments.
Composer
To install symfony, you need composer which is a dependency manager for PHP. The version of composer that was available in apt when this post was written was “very” old. Specifically, it had version Composer 1.6.3 2018-01-31 16:28:17. For this reason we decided to go with the version that is available in the official website of composer. The steps we followed were the ones below:
# Update our system
sudo apt update -y;
sudo apt upgrade -y;
# Install dependencies
sudo apt install curl php-cli php-mbstring git unzip php-xml -y;
# Get composer installer from the official site
curl -sS https://getcomposer.org/installer -o composer-setup.php;
# Verify the the download was not corrupt by checking the sha384 sum of the installer file
HASH=`curl https://composer.github.io/installer.sha384sum | cut -d' ' -f 1`;
# If this step fails, go back to the curl command and try again, it would mean that there was a problem when downloading the installer from the net
php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
# Upon successfully validating the install, we can proceed to the actual installation.
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer;
source ~/.bashrc;
Symfony Skeleton Project
After the above steps are completed, we were able to proceed with the final step, which would be to create the symfony skeleton project via the composer with the following command in the folder named sandbox:
To verify the installation of the skeleton project we started a web server with PHP in the installation folder of the project and thus verify it through the browser:
cd sandbox;
# We did not use the port 80 as it would require root access to start
php -S 127.0.0.1:8000 -t public;
From a browser visiting http://127.0.0.1:8000/ we got to see:
Recently we tried to mount a Micro SD card that was formatted using the exFat format. To do so we used the build in card reader of a laptop that was running Ubuntu 18.04. To our disappointment, the OS was able to “see” the device as ‘/dev/mmcblk0’ but it could not automatically mount it.
First step we did was of course to update the system using:
sudo apt update;
and then we made sure we had all the necessary packages installed:
sudo apt-get install exfat-fuse exfat-utils;
Unfortunately, we still could not automatically mount the device. So we decided to try and mount it manually which also failed:
sudo mount -t exfat /dev/mmcblk0 /mnt/vmfs; FUSE exfat 1.2.8 ERROR: failed to read boot sector.
As we were not sure what was wrong we decided to do an experiment which turned out to be our solution: to use an external card reader and try again.. guess what? It worked!!
We will investigate further the issue with the build in card reader but for now we are able to work around the issue with the external card reader.
Recently, we were got our hands on some YubiKeys, and we decided to use them to create a Two Factor Authentication System (2FA) for the fun of it! We had at our disposal an updated Ubuntu 18.04 LTS so we installed the personalization tools from the official repositories in order to modify the behavior and configure the YubiKeys.
To our disappointment, when we used ykpersonalize and yubikey-personalization-gui we would get an error that the firmware of the YubiKey was unknown… At the time, the installation packages from the official Ubuntu repositories had version 3.1.24 for the application version and 1.18.0 for the library version.
We noticed that on the YubiKey Personalization Tools page there were newer versions of both the application and the library. Specifically at the time the Application version was 3.1.26 and the Library Version was 1.19.0. Since both were newer than the versions in the repositories we decided to build them and see if they work right with our YubiKeys.
The instructions in the respective installers, were not 100% complete and the installations failed by blindly following them. To actually make the installations work, we installed the following dependencies and tools before compiling:
After installing the above packages the rest of the installation went smoothly.
Installing the command line tools and the library
cd ~; # or any other folder of your choice
sudo apt-get install libykpers-1-dev libyubikey-dev libusb-1.0-0-dev libjson-c-dev -y;
git clone https://github.com/Yubico/yubikey-personalization.git;
cd yubikey-personalization;
autoreconf --install;
./configure;
sudo make check install;
Installing the Qt based Cross-Platform YubiKey Personalization Tool
cd ~; # or any other folder of your choice
sudo apt-get install qt4-qmake libqt4-dev -y;
git clone https://github.com/Yubico/yubikey-personalization-gui.git;
cd yubikey-personalization-gui;
qmake && make;