Articles

Set up a global .gitignore file

A global gitignore file can be handy to automatically hide common files from projects that you work on. I typically use this for files that are specific to me and my local setup. First create the file that you want to use for your global .gitignore file.

Tags Git Programming Terminal

Connecting to a VPN in Arch Linux with nmcli

nmcli is the command line tool for interacting with NetworkManager. For work I sometimes need to connect to a vpn using an .ovpn (openvpn) file. This method should work for other vpn types (I’ve only used openvpn) Installing the tools All three of the required programs are available via the official Arch repositories. Importing the...

Tags Terminal Linux Arch Linux Network Manager Networking

Updating PHP versions in Ubuntu 20.04

For an older PHP project, I needed to install an older version of PHP. This is what I did to set that up.

Installing a different PHP version

sudo add-apt-repository ppa:ondrej/php<br></br>sudo apt-get update<br></br>sudo apt-get install -y php7.1

Rebinding php to required version

Some of these binds are probably not need. I think the main ones, at least for my use case, were php and phar.

sudo update-alternatives --set php /usr/bin/php7.1<br></br>sudo update-alternatives --set phar /usr/bin/phar7.1<br></br>sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.1<br></br>sudo update-alternatives --set phpize /usr/bin/phpize7.1<br></br>sudo update-alternatives --set php-config /usr/bin/php-config7.1

For some reason the --set flag stopped working, so I had to use:

sudo update-alternatives --config php

sudo update-alternatives --config p


etc. And update each one with the terminal prompt options for each.

p.s. If using PHP-FPM, you could also set up different server conf files and point the FPM path to the version you need. My need was just because I was using the command line in the older project.

Tags Programming Terminal Linux PHP Web Development