Skip to content

Instantly share code, notes, and snippets.

@heartshare
heartshare / mysql_check.sh
Created August 28, 2024 02:58 — forked from rothkj1022/mysql_check.sh
Script for checking and repairing MySQL databases & tables, including corrupted InnoDB tables
#!/bin/bash
# set mysql into innodb recovery mode on startup
mode=1; sed -i "/^\[mysqld\]/{N;s/$/\ninnodb_force_recovery=$mode/}" /etc/my.cnf
# restart mysql
systemctl restart mysqld
# remove recovery mode setting
sed -i '/innodb_force_recovery/d' /etc/my.cnf
FROM node:20.15.1 as frontend_build
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
WORKDIR /app
RUN npm install -g terser uglifycss autoprefixer postcss sass
COPY ./mapas/src/package.json /app
COPY ./mapas/src/pnpm-*.yaml /app
@heartshare
heartshare / Dockerfile
Created August 26, 2024 06:51 — forked from qolarnix/Dockerfile
Dockerfile for frankenphp local wp
FROM dunglas/frankenphp:latest-php8.2
# install the PHP extensions we need (https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions)
RUN install-php-extensions \
bcmath \
exif \
gd \
intl \
mysqli \
zip \
@heartshare
heartshare / setup.md
Created August 26, 2024 06:48 — forked from semivori/setup.md
copilot symfony docker w frankenphp

Sure, here is the final Docker configuration for a Symfony 7.0 project with PHP 8.2, MySQL, Adminer, and FrankenPHP, including the necessary PHP extensions and a command for database creation.

First, the Dockerfile:

# Dockerfile
FROM php:8.2-fpm

# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
@heartshare
heartshare / laravel-octane-docker.md
Created August 26, 2024 06:47 — forked from fabioassuncao/laravel-octane-docker.md
Docker configuration for Laravel projects with Octane, supporting Open Swoole, Swoole, RoadRunner, and FrankenPHP.

Laravel Octane Docker

Extremely simple Docker setup for Laravel projects with Laravel Octane, using the following application servers:

  • Open Swoole
  • Swoole
  • RoadRunner
  • FrankenPHP

Docker Images

@heartshare
heartshare / 00-laravel-deploy.sh
Created August 26, 2024 06:46 — forked from mathieutu/00-laravel-deploy.sh
Old Laravel Docker prod conf with richarvey image
# scripts/00-laravel-deploy.sh
php artisan route:cache
php artisan view:cache
php artisan config:cache
php artisan migrate --force
@heartshare
heartshare / Dockerfile
Created August 26, 2024 06:43 — forked from mathieutu/Dockerfile
Laravel Production Dockerfile using frankenphp.
# syntax=docker/dockerfile:1.4
FROM node:21-alpine AS front
WORKDIR /usr/src/app
COPY --link package.json yarn.lock .yarnrc.yml ./
COPY --link .yarn .yarn
RUN yarn install
COPY --link tailwind.config.ts postcss.config.cjs vite.config.ts tsconfig.json tsconfig.node.json ./
COPY --link resources resources
RUN yarn build
@heartshare
heartshare / readme.md
Created July 31, 2024 07:43 — forked from amanjuman/readme.md
Proxmox and pfSense/OPNsense Configuration with Single IP

Enable System IP forwarding first

echo 'net.ipv4.ip_forward = 1' | sudo tee -a /etc/sysctl.conf
echo 'net.ipv6.conf.all.forwarding = 1' | sudo tee -a /etc/sysctl.conf
sudo sysctl -p /etc/sysctl.conf

Here is sample network configuration (remove comments "##") Replace your interface name, public IP, internal NAT IP

@heartshare
heartshare / limit-tc.sh
Created July 26, 2024 02:04 — forked from Lakshanz/limit-tc.sh
TC limiting : Helps to set maximum upload/download speed limit to your linux server/pc's selected network interface.
#!/bin/bash
# Full path to tc binary
TC=$(which tc)
#
# NETWORK CONFIGURATION
# interface - name of your interface device
# interface_speed - speed in mbit of your $interface
# ip - IP address of your server, change this if you don't want to use
@heartshare
heartshare / BaseResource.php
Created June 25, 2024 21:17 — forked from nathandaly/BaseResource.php
Tenancy for Laravel & Filament V3 (Tenant per database)
<?php
/**
* Below is an the extended Filament resource your tenant panel resources
* will have to extend so that the queries are scoped properly.
*/
namespace App\Filament;
use Filament\Resources\Resource;