Archive for August, 2022

How to create a new Laravel Application?

For Ubuntu 20.04, first you will need to have php-cli:

sudo apt-get install php7.4-cli

and this will install the command line /usr/bin/php.

Next is to download composer:

https://getcomposer.org/download/

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" php composer-setup.php php -r "unlink('composer-setup.php');"

Copy the downloaded file "composer.phar" into a path in your home directory (where you have write control, eg, $HOME/bin):

(you can also get the Ubuntu’s composer from its distribution via "sudo apt-get install composer" but will be not the latest, just compare and check via "composer.phar –version")

export PATH=$PATH:$HOME/bin
mv composer.phar ~/bin/composer2310

(to emphasize the version is 2.3.10)

Detail installation instruction are available here:

https://laravel.com/docs/7.x/installation

So to install laravel the command will be "composer2310 global require laravel/installer" instead.

Halfway you may encounter errors like this:

The cause of the error is because I have installed other stuff with composer before, and the composer is Ubuntu’s original version, thus resulting in version pollution. To overcome these, delete the entire directory where composer dependencies are installed:

"mv ~/.config/composer/ /tmp" as shown below:

Now laravel installation succeeded, and it goes into $HOME/.config/composer/vendor/bin directory, so put that into the $PATH (so that you can issue laravel command):

export PATH=$PATH:$HOME/.config/composer/vendor/bin

(You can put that into the .bashrc and start a new terminal)

The "autoload" files you see above are located in the following directories:

Now use the laravel command (https://laravel.com/docs/7.x/installation):

An error occurred.

Similarly following alternatively instruction at:

https://www.tutorialspoint.com/laravel/laravel_installation.htm

composer2310 create-project laravel/laravel –prefer-dist

I got this error:

Solution is to install:

sudo apt-get install php-xml

Retry again:

And ending with:

the command "php artisan" being to complete certain tasks.

And finally to serve the webpages:

And the new blog command succeeded as well:

And at the end of of creation:

http://127.0.0.1:8001

More information about composer are here:

https://getcomposer.org/doc/01-basic-usage.md

https://stackoverflow.com/questions/64523505/php-artisan-failed-to-open-stream-no-such-file-or-directory

How to setup a Student Management System

This is based on the opensource software at:

https://github.com/amirhamza05/Student-Management-System.git

First install nginx and configure it to run PHP:

https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/Nginx-PHP-FPM-config-example

https://www.digitalocean.com/community/tutorials/php-fpm-nginx

Next download via git the Student Management software at:

https://github.com/amirhamza05/Student-Management-System.git

And move the entire directory to /var/www/html and let’s call it "sms", which is also the home directory of Nginx webserver.

Next change the ownership of the "sms" directory to "www-data:www-data":

chown -R www-data:www-data /var/www/html/sms

This is because sometimes the webserver will need write-access to the PHP configuration file, for example, db.php – shown below is db.php after configuration:

Next is to install MariaDB database:

sudo apt update
sudo apt install mariadb-server
sudo mysql_secure_installation

And for the PHP to talk to the MariaDB, you will need to install this component:

sudo apt-get install php-mysqli

For the database for the Student Management System:

Now login into your MariaDB and create a smsdb database, smsuser and password.

Enter all these information into the default page of the homepage at "http://localhost/sms":

If setup database is successful, you will see that a lot of tables are created when you enter the database as smsuser:

mysql -u smsuser -p > <<EOF
use smsdb;
show tables;
EOF

But

Debugging your bugs using nginx logging at /var/log/nginx:

Upon solving all the errors, after setting up the database, and login as admin you will get:

And this:

And this:

And this:

Vickblöm

Research scattered with thoughts, ideas, and dreams

Penetration Testing Lab

Offensive Techniques & Methodologies

Astr0baby's not so random thoughts _____ rand() % 100;

@astr0baby on Twitter for fresh randomness

The Data Explorer

playing around with open data to learn some cool stuff about data analysis and the world

Conorsblog

Data | ML | NLP | Python | R

quyv

Just a thought

IFT6266 - H2017 Deep Learning

A Graduate Course Offered at Université de Montréal

Deep Learning IFT6266-H2017 UdeM

Philippe Paradis - My solutions to the image inpainting problem

IFT6266 – H2017 DEEP LEARNING

Pulkit's thoughts on the course project

Thomas Dinsmore's Blog

No man but a blockhead ever wrote except for money -- Samuel Johnson

the morning paper

a random walk through Computer Science research, by Adrian Colyer

The Spectator

Shakir's Machine Learning Blog