Skip to content

Instantly share code, notes, and snippets.

@arifnd
arifnd / AdminPanelProvider.php
Created January 20, 2024 00:27
Sign in with a username on the Filament login page
<?php
namespace App\Providers\Filament;
use App\Filament\Pages\Auth\Login;
use Filament\Http\Middleware\Authenticate;
use Filament\Http\Middleware\DisableBladeIconComponents;
use Filament\Http\Middleware\DispatchServingFilamentEvent;
use Filament\Pages;
use Filament\Panel;
@arifnd
arifnd / yarr.service
Last active November 10, 2023 21:48
Yarr Systemd
# /etc/systemd/system/yarr.service
[Unit]
Description=Yarr Service
After=network.target
[Service]
User=user
ExecStart=/home/user/.local/bin/yarr -addr "0.0.0.0:7070"
WorkingDirectory=/home/user/.local/bin
@arifnd
arifnd / build.sh
Created November 10, 2023 18:09
Build yarr ARMv6
CGO_ENABLED=1 \
GOOS=linux \
GOARCH=arm GOARM=6 \
go build -tags "sqlite_foreign_keys linux" -ldflags="-s -w" \
-o _output/linux/yarr ./cmd/yarr
@arifnd
arifnd / deploy.yaml
Created August 15, 2023 02:13
deployer
import:
- recipe/laravel.php
config:
repository: 'git@github.com:user/repo.git'
branch: main
shared_files:
- '.env'
writable_mode: chmod
writable_recursive: true
@arifnd
arifnd / redis-tls-setup.sh
Last active June 17, 2023 16:08
Redis with TLS
#!/bin/bash
# 1. Check if script is run as root
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root."
exit 1
fi
# 2. Get input domain/subdomain name
read -p "Enter domain/subdomain name: " domain
@arifnd
arifnd / Caddyfile
Last active August 17, 2022 18:36
Caddy laravel config
import snippets/*
:80 {
}
import laravel-app domain.com /home/user/laravel/folder
@arifnd
arifnd / for-server-openvz.conf
Last active July 22, 2020 15:19
Wireguard Config
[Interface]
Address = 10.10.10.1/24
PrivateKey =
ListenPort = 10101
#PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o venet0 -j MASQUERADE;
#PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o venet0 -j MASQUERADE;
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o vnet0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o vnet0 -j MASQUERADE
[Peer]
<?php
ini_set('max_execution_time', 0);
ini_set('memory_limit', -1);
$host = '127.0.0.1';
$ports = array(80, 443, 3306);
$mem = @file_get_contents('/proc/meminfo');
$mem = preg_replace("/[[:blank:]]+/", " ", $mem);
$mem = str_replace(array("\r\n", "\n\r", "\r"), "\n", $mem);
http://gg.gg/php-port-status
<?php
ini_set('max_execution_time', 0);
ini_set('memory_limit', -1);
$host = '127.0.0.1';
$ports = array(22, 80, 443, 3306);
foreach ($ports as $port)
{
$connection = @fsockopen($host, $port, $errno, $errstr, 2);