Skip to content

Instantly share code, notes, and snippets.

View ravibpatel's full-sized avatar
💭
I may be slow to respond.

Ravi Patel ravibpatel

💭
I may be slow to respond.
View GitHub Profile
@ravibpatel
ravibpatel / StartInertiaSession.php
Created August 2, 2023 16:27
Add this middleware to your app/Http/Middleware folder and change the \Illuminate\Session\Middleware\StartSession::class to \App\Http\Middleware\StartInertiaSession::class in $middlewareGroups array of app\Http\Kernel.php, so Laravel can store correct previous URL in session while using Inertia.js.
<?php
namespace App\Http\Middleware;
use Illuminate\Http\Request;
use Illuminate\Routing\Route;
use Illuminate\Session\Middleware\StartSession;
class StartInertiaSession extends StartSession
{
@ravibpatel
ravibpatel / host.sh
Created August 16, 2021 07:54
Install Vesta CP with necessary configuration
read -p "Please enter host name(e.g. example.com) you want for panel address: " host
read -p "Please enter admin email address: " email
read -p "Please enter admin password:" password
# Installing EPEL repository
yum install epel-release -y
check_result $? "Can't install EPEL repository"
cat >> /etc/yum.repos.d/mariadb.repo <<EOL
# MariaDB 10.6 CentOS repository list - created 2021-08-15 07:53 UTC
@ravibpatel
ravibpatel / EnableLinkedConnections.reg
Created June 26, 2021 05:14 — forked from tkarpinski/EnableLinkedConnections.reg
A reg file to EnableLinkedConnections (Network Drives over UAC) http://support.microsoft.com/kb/937624
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"EnableLinkedConnections"=dword:00000001
@ravibpatel
ravibpatel / laravel.stpl
Last active March 8, 2021 06:25
Laravel template for Vesta Panel using apache+nginx. Add both files to "/usr/local/vesta/data/templates/web/httpd" folder and select it by editing domain and changing "Web Template HTTPD" to "laravel".
<VirtualHost %ip%:%web_ssl_port%>
ServerName %domain_idn%
%alias_string%
ServerAdmin %email%
DocumentRoot %sdocroot%/public
ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
Alias /vstats/ %home%/%user%/web/%domain%/stats/
Alias /error/ %home%/%user%/web/%domain%/document_errors/
#SuexecUserGroup %user% %group%