Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / 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 / 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 / cache
Created March 4, 2024 05:42
Laravel 11 maintenance down
illuminate:foundation:down|a:7:{s:6:"except";a:0:{}s:8:"redirect";N;s:5:"retry";N;s:7:"refresh";N;s:6:"secret";N;s:6:"status";i:503;s:8:"template";N;}|2024890720
@echo off
set TOKEN=YOUR_TOKEN
set NPSN=YOUR_NPSN
curl -X GET ^
-H "Authorization: Bearer %TOKEN%" ^
"http://localhost:5774/WebService/getSekolah?npsn=%NPSN%" > data-sekolah.txt
curl -X GET ^
@arifnd
arifnd / laravel.nix
Last active January 2, 2025 14:36
Project idx nix file for Laravel
# To learn more about how to use Nix to configure your environment
# see: https://developers.google.com/idx/guides/customize-idx-env
{pkgs}: {
# Which nixpkgs channel to use.
channel = "stable-24.11"; # or "unstable"
# Use https://search.nixos.org/packages to find packages
packages = [
pkgs.php82
pkgs.php82Packages.composer
pkgs.nodejs_20
# To learn more about how to use Nix to configure your environment
# see: https://developers.google.com/idx/guides/customize-idx-env
{ pkgs, ... }: {
# Which nixpkgs channel to use.
channel = "stable-23.11"; # or "unstable"
# Use https://search.nixos.org/packages to find packages
packages = [
pkgs.php82
pkgs.php82Packages.composer
# pkgs.go