AKZN Notes

Archives for My Lazy and Forgetful Mind

Category: IT Stuff

Install FreeRADIUS & daloRADIUS on Ubuntu 20.04 + MySQL/MariaDB

taken from https://bytexd.com/freeradius-ubuntu/ with a few update to support daloRADIUS with freeradius v3.0. (as is, daloradius only support freeradius v2, and accounting will error) (TBA) add mikrotik radius client (TBA) add tutorial sqlcounter daloradius scheme to freeradius In this tutorial we’ll install FreeRADIUS on a server running Ubuntu 20.04 and configure it to work with […]

Windows Ubuntu Virtual Box Update Hash Sum Missmatch Fix

On installing Ubuntu as guest from Windows Host, if you got an error Update Hash Sum Missmatch Fix, this is a fix for that Based on https://askubuntu.com/a/1242739 Try this before running apt: $ sudo bash # mkdir /etc/gcrypt # echo all >> /etc/gcrypt/hwf.deny Because apt use sha256 method from libgcrypto20, but optimized too much. We […]

How To Secure Apache with Let’s Encrypt on Ubuntu 20.04

source : https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-20-04 Introduction Let’s Encrypt is a Certificate Authority (CA) that facilitates obtaining and installing free TLS/SSL certificates, thereby enabling encrypted HTTPS on web servers. It simplifies the process by providing a software client, Certbot, that attempts to automate most (if not all) of the required steps. Currently, the entire process of obtaining and […]

Git deploy to VPS

for the impatients Set up the new bare repo on the server: $ ssh myserver.com Welcome to myserver.com! $ mkdir /var/git/myapp.git && cd /var/git/myapp.git $ git –bare init Initialized empty Git repository in /var/git/myapp.git $ exit Bye! Add the remote repository to your existing local git repo and push: $ cd ~/Sites/myapp $ git remote […]

Untrack files already added to git repository based on .gitignore

Let’s say you have already added/committed some files to your git repository and you then add them to your .gitignore; these files will still be present in your repository index. This article we will see how to get rid of them. Step 1: Commit all your changes Before proceeding, make sure all your changes are […]

Laravel Cheat Sheet

factory call using tinker PHP Artisan tinker App\Model\(model name)::factory()->count(5)->create(); databases php artisan db:seed –class=TestSeeder php artisan make:migration create_flights_table php artisan migrate:rollback –step=1 composer composer dump-autoload git git pull origin main API sanctum error CSRF token mismatch add this on .env SESSION_DOMAIN=localhost SANCTUM_STATEFUL_DOMAINS=localhost:8081 <–depend on your php conf

Deploy Laravel Project to Hosting or VPS

Deploy to CPanel Clone git to cpanel Taken from https://dashboard.webhostingmagic.com/knowledgebase/242/How-To-Clone-A-Private-Github-Repo-To-A-cPanel-Server.html Git private repository requires SSH access. So you must ensure that your hosting package has SSH enabled (customers on Web Hosting Magic need not worry as every hosting package comes with SSH access) and perform additional steps in order to successfully clone a privately-hosted remote […]

fix failed install python package

fix failed install python package problem pip installs packages successfully, but executables not found from command line solution echo "export PATH=\"`python3 -m site –user-base`/bin:$PATH\"" >> ~/.bashrc source ~/.bashrc

Linux Common Command

Linux Common Command show port sudo netstat -tuln Copy File/Folder cp cp -a /source/. /dest/ If you want to copy content of folder. If you want to copy folder content and parent, remove [dot] rsync rsync -r –progress /source/. /dest/ same with cp, but copy only the files that have changed Mount/Unmount USB/removable drive mount […]

Keep Processes Running After Ending SSH Session

Problem Let’s say I launch a bunch of processes from a ssh session. Is it possible to terminate the ssh session while keeping those processes running on the remote machine? Solution 1. Using built-in bash command For new task nohup nohup long-running-command & It was made specifically for this, it even logs stdout to nohup.log. […]