[Solved] file_put_contents(/bootstrap/cache/packages.php): failed to open stream: Permission denied

Updated: 17th February 2023
Tags: laravel php ubuntu

How to create symlink folder in ubuntu

Updated: 12th December 2022
Tags: ubuntu nginx

For example we have our folder in /etc/nginx/sites-available/example.com And to make virtual symlink folder here /etc/nginx/sites-enabled we run this

sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/

Sorting Unix 'ls' command output by filesize

Updated: 6th December 2022
Tags: ubuntu bash
ls -Slh

-S will sort files by size
-l long listing
-h will make the output human-readable
-r will reverse the output

How to create bash alias permanently ubuntu

Updated: 1th November 2021
Tags: ubuntu bash alias

Edit file ~/.bash_aliases

nano ~/.bash_aliases

For example I make alias a. So when I press a it will produce php artisan tinker Here file ~/.bash_aliases

alias a='php artisan tinker'

Load aliases immediately

source ~/.bash_aliases

Bash show process list

Updated: 15th April 2021
Tags: ubuntu bash

Show process list sorted by memory usage

ps aux --sort=-%mem | awk 'NR<=800{print $0}'

Show process list with full start date

ps -eo pid,lstart,cmd

Ubuntu run command in background

Updated: 14th November 2020
Tags: terminal comman linux ubuntu

To run some command in background, so you can close terminal, type the following:

nohup command-with-options &

Laravel fresh install ubuntu HTTP 500 Fix

Updated: 18th December 2019
Tags: php laravel ubuntu

After installing laravel you MUST change some folder permissions.

sudo chmod 755 -R laravel_app
sudo chmod -R o+w laravel_app/storage
sudo chmod -R o+w laravel_app/bootstrap/cache

How to Install Redis on Ubuntu 18.04

Updated: 5th December 2019
Tags: redis ubuntu