AKZN Notes

Archives for My Lazy and Forgetful Mind

Author: akozan

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. […]

INSTALL aria2 to Ubuntu VPS

[VPS][UBUNTU] INSTALL aria2 Table of Contents Install Aria2 Make and configure aria2 config Make the service handler aria2 on init.d install Aria2 Webui Install Aria2 sudo apt install aria2 Make and configure aria2 config install to your path sudo nano /path/to/config/aria2/aria2.conf configure as required, uncomment the rpc part if you want to use aria2 webui […]

Installing and managing LAMP Webserver

Install LAMP Automatic i’m not suggesting this because more often than not i got error instlalation. Run the below command in terminal: php latest wget –no-cache -O – https://raw.githubusercontent.com/akzn/lamp-stack-install/main/lamp-install.sh | bash php 7.4 https://github.com/akzn/lamp-stack-install/blob/main/lamp-stack-install-php7.4 low spec device my suffer slow install or hang if using automatic install Manual php 7.4 follow https://github.com/akzn/lamp-stack-install/blob/main/lamp-stack-install-php7.4 then change mysql […]

SIMPLE OPENVPN SETUP + MIKROTIK CLIENT

install VPN monitoring tools to read : https://kifarunix.com/how-to-monitor-openvpn-connections-using-openvpn-monitor-tool/ If you only need a simple OpenVPN configuration, you only need to do step 1 Install OpenVPN on NAT IPv4 VPS Installation two way of installation Install without Docker 1) Make sure that tun/tap is enabled on your vps. Enable TUN/TAP via SolusVM control panel if present […]