Laravel oauth-public.key does not exist or is not readable

Laravel oauth error: exception:“LogicException“ file:“/xxx/laravel/vendor/league/oauth2-server/src/CryptKey.php“ line:45 message:“Key path “file:///xxx/laravel/storage/oauth-public.key” does not exist or is not readable solution: php artisan passport:keys then, you may see the message:”Unauthenticated.” which means oauth works

How to deploy Angular on Ubuntu 14.04

To install Node.js, type the following command in your terminal: 1 sudo apt–get install nodejs Then install the Node package manager, npm: 1 sudo apt–get install npm Create a symbolic link for node, as many Node.js tools use this name to execute. 1 sudo ln –s /usr/bin/nodejs /usr/bin/node Now we should have both the Node and npm commands working: 1 2 3 4 $ node –v v0.10.25 …

Migration Laravel website,project

How to migrate Laravel website or project from giblab/github to a new server: create virtual host #clone your laravel website source code git clone https://gitlab.com/your-laravel-project.git # set document root to laravel public mv public_html public_html_def ln -s ./homes/extraction/laravel/public ./public_html vi .env set database #install composer php -r “copy(‘https://getcomposer.org/installer’, ‘composer-setup.php’);” php composer-setup.php mv composer.phar /usr/local/bin/composer composer …

How to login and get token from 3rd API through Laravel

Use  GuzzleHttp\Client to login and get token from 3rd API through Laravel $headers = [ ‘Content-Type’ => ‘application/json’, ]; $client = new \GuzzleHttp\Client([‘base_uri’ => $this->control_ary[‘download_files’][‘base_api_uri’], ‘headers’ => $headers ]); if ( $this->bearer_authorization == ” ) { $response = $client->request(‘POST’, $this->control_ary[‘download_files’][‘login_api’], [ ‘json’ => [ ’email’ => $this->control_ary[‘download_files’][‘login_email’], ‘password’=> $this->control_ary[‘download_files’][‘login_password’] ] ]); $this->bearer_authorization = $response->getHeaders()[‘Authorization’][0]; $this->question(‘Got Authorization …

How to check the mac memory and cpu information

How to check the mac memory and cpu information? The following works in OS X Lion: $ /usr/sbin/system_profiler SPHardwareDataType Hardware: Hardware Overview: Model Name: iMac Model Identifier: iMac7,1 Processor Name: Intel Core 2 Duo Processor Speed: 2.4 GHz Number of Processors: 1 Total Number of Cores: 2 L2 Cache: 4 MB Memory: 4 GB Bus …

How to use Laravel to import CSV or export CSV file

How to use Laravel to import CSV or export CSV file for export: https://github.com/Maatwebsite/Laravel-Excel note: the 3.0 version does not support import for import: https://github.com/rap2hpoutre/fast-excel $csv_data = (new FastExcel)->configureCsv(‘,’)->import($file_path); note: can not skip or ignore some lines in csv file

Use Laravel to print PDF and Barcode

Use Laravel to print PDF and Barcode for pdf: https://github.com/barryvdh/laravel-dompdf for barcode: https://github.com/milon/barcode tips: 1. only limited css support for dompdf, part of bootstrap3.7 works, but 4.x not work 2. barcode type c128 is shorter than c39+

Setup an IP for Visit Vagrant websites/database

vi Vagrantfile Setup an IP for Visit Vagrant websites/database Static IP You can also specify a static IP address for the machine. This lets you access the Vagrant managed machine using a static, known IP. The Vagrantfile for a static IP looks like this: Vagrant.configure(“2”) do |config| config.vm.network “private_network”, ip: “192.168.50.18” end It is up …

Install virtualmin in Vagrant Ubuntu18.04

mkdir ubuntu18 cd ubuntu18 vagrant init generic/ubuntu1804 vi Vagrantfile change vm memory to 2048MB vagrant up vagrant ssh change root password: sudo whoami, sudo -i, sudo passwd install virtualmin for web develop environment: cd /tmp wget http://software.virtualmin.com/gpl/scripts/install.sh sudo sh ./install.sh