Sunday, July 14, 2019

Creating a symbolic link on Ubuntu 18.04 for xampp htdocs

So I have been struggling to run code inside xampp htdocs on Ubuntu since I did not have the sudo privileges. As one may know, when you navigate to http://localhost in your browser you are being sent to the htdocs directory within XAMPP (specifically /opt/lampp/htdocs). This folder’s read and write permissions are limited to the root user and will not let you create files and folders within it.

I did a bit of Googling to find a resolution. To my luck, I found what is called a symbolic link, this is a special kind of file (entry) that points to the actual file or directory on a disk. Essentially this means that your projects will technically exist in this new folder which will reside in your Home folder, but XAMPP will treat it as if it were located within htdocs.

There are two types of links:
  • symbolic links, Refer to a symbolic path indicating the abstract location of another file
  • hard links, Refer to the specific location of physical data.
We will be using the symbolic link a.k.a soft link. My work generally resides in the Documents folder then I'd make subfolders. E.g.,  there is a folder for programming, a folder for University, a folder for Media and so on.

Creating a symbolic link

-s, make symbolic links instead of hard links
sudo -s <directory that must be linked> <directory that is linked to>
sudo -s <target file> <symbolic file>

Type in:
sudo ln -s /home/banele/Documents/programming/php/Projects/PHPExcelLibrary /opt/lampp/htdocs

Enter your password when prompted. This is all it takes to create the symbolic link. We use sudo because of the htdocs permissions. For most symbolic links you create in Ubuntu it is not necessary.

Extra bonus I also created a symbolic link for the php file for the system variables.
sudo ln -s /opt/lampp/bin/php /usr/bin/php

Removing a symbolic link

You can remove existing links attached to files or directories by the unlink or rm command.

  • unlink <system link name to remove> unlink /home/banele/Documents/programming/php/Projects/PHPExcelLibrary
  • rm <system link name to remove> rm /home/banele/Documents/programming/php/Projects/PHPExcelLibrary



Saturday, July 6, 2019

At last!! I installed Ubuntu 18.04.2 LTS (Bionic Beaver) on my MacBook Air

This blog is not about the step by step process of installing Ubuntu on a Mac it's basically for me to reference for future purposes. So, there are three main reasons why I ended up installing Ubuntu on my Mac.

  1. I've come to realise that I simply do not like Apple products period.
  2. I wanted to Install Ubuntu on it anyway
  3. Not a programmer-friendly machine
  4. The battery is dead, it lasts for about 45 minutes and it's very expensive to replace.

I've been contemplating doing this, simply because I was thinking of drivers compatibility and the difficulty of reverting back should it not work.

Basically, I need these three components:
  •  Ubuntu 18.04 LTS  - Download the .iso image. I prefer a Long Term Support(LTS) rather than normal releases, mainly because of stability, security patches, maintenance and support by Landscape, Canonical's enterprise-oriented server management toolset
  • UNetBootin - UNetbootin allows you to create bootable Live USB drives for Ubuntu and other Linux distributions without burning a CD.
  • USB drive, minimum 4GB

Things to install after installing Ubuntu


  1. Install Snap
    sudo apt install snapd

  2. Install media codecs using the Ubuntu Restricted Extra package.
    sudo apt install ubuntu-restricted-extras

  3. Prolong your battery and prevent overheating
    TLP is a wonderful tool that controls CPU temperature and extends your laptops’ battery life in the long run.
    sudo apt install tlp tlp-rdw
    sudo tlp start

  4. Install SimpleScreenRecorder
    sudo apt install simplescreenrecorder

  5. Install skype using latest .deb
    sudo apt install ./skypeforlinux-64.deb

  6. Install Flat Remix Gnome theme using the following PPA in Ubuntu and Linux Mint.
    sudo add-apt-repository ppa:daniruiz/flat-remix
    sudo apt-get update
    sudo apt-get install flat-remix-gnome

  7. Install Pop theme using the following PPA in Ubuntu and Linux Mint.
    sudo add-apt-repository ppa:system76/pop
    sudo apt update
    sudo apt install pop-theme

  8. To unlock the grayed out Shell icon theme option in Tweaks
    sudo apt install gnome-shell-extensions
    Enter your password, and then type “Y” to confirm when prompted.
    Log out, and then log back in after installing the extensions
    Launch the Tweaks application, click “Extensions” in the sidebar, and then enable the “User Themes” extension.

  9. Install Visual Studio Code (I will create a small blog with all of my favourite extensions and themes later)
    Download .deb file from https://code.visualstudio.com/download

  10. Installing IntelliJ and phpStorm from Snap
    sudo snap install intellij-idea-ultimate –classic
    sudo snap install phpstorm –classic

  11. Installing XAMPP
    sudo /opt/lampp/lampp start
    sudo /opt/lampp/lampp stop
    sym-linking the PHP library from file and refer to this php file path /usr/bin/php wherever required: sudo ln -s /opt/lampp/bin/php /usr/bin/php

  12. Installing JDK 12

  13. Install Slack
    sudo snap install slack --classic

Good bye Windows, hello Ubuntu!

After years of using Microsoft Windows, from the days of Windows XP through to Windows 11 (though I'd be lying if I said I've actua...