Posts

Image
    There's a good trick I saw while I was reading a project. The passwords were stored in the database after encryption. When we write the login page, we will get the password from the user,then encrypt it to compare it with the password stored in the database.  Look, the data is more secure.     I'm not sure if this technique has other disadvantages but I think it's better than to store the password only as it is.

Installing composer version 2

At first, Composer 2 requires php-8.0 sudo apt-get remove composer php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "if (hash_file('sha384', 'composer-setup.php') === '906a84df04cea2aa72f40b5f787e49f22d4c2f19492ac310e8cba5b96ac8b64115ac402c8cd292b8a03482574915d1a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer php -r "unlink('composer-setup.php');"

installing mysql on ubuntu

setup mysql-client setup mysql-server run those sudo mysql --defaults-file=/etc/mysql/debian.cnf   CREATE USER 'moaz'@'localhost' IDENTIFIED BY '123456'; GRANT ALL PRIVILEGES ON *. * TO 'moaz'@'localhost' WITH GRANT OPTION;

solving gnu grub version 2.02 and 2.04

cmpath=(hd0) prefix=(hd0,gpt8)/boot/grub root=hd0,gpt8 set boot=(hd0,gpt8) set prefi=(hd0,gpt8)/boot/grub insmod normal normal  

Upgrade Ubuntu Cosmic (18.10) to Focal (20.04)

Upgrade Ubuntu Cosmic (18.10) to Focal (20.04) Posted on Apr 22, 2020 There is no supported upgrade path from Ubuntu Cosmic to the new Focal release. I had an old server running Cosmic (that I picked 18.10 over 18.04 must surely been an mistake). So let’s upgrade Ubuntu to Focal the old school Debian way! Beware that this can potentially be a dangerous upgrade as it is not supported. I had issues with SELinux refusing access to systemctl for root, but you can read below how to fix it. If you’re feeling adventurous and comfortable with fixing any issue that could arise, go ahead! As root, replace all the occurrences of cosmic to focal in: /etc/apt/sources.list and /etc/apt/sources.list.d The easiest way would be with sed : sed -i 's/cosmic/focal/g' /etc/apt/sources.list sed -i 's/cosmic/focal/g' /etc/apt/sources.list.d/*.list Tip: Double check that everything looks correct in these files. Before upgrading, update all the apt package sources: apt update Now, time for...

Storing encrypted passwords in the database

  There's a good trick I saw while I was reading a project. The passwords were stored in the database after encryption. When we write the login page, we will get the password from the user,then encrypt it to compare it with the password stored in the database.     I'm not sure if this technique has other disadvantages but I think it's better than to store the password only as it is.