Make a new file at the root folder called dc
without extension.
Content example. Modify for your needs.
#!/bin/bash
trap "exit" 0
DC="docker compose" # add `-f docker/compose.yml` if it's in another folder
if [ $# -eq 0 ]; then
Make a new file at the root folder called dc
without extension.
Content example. Modify for your needs.
#!/bin/bash
trap "exit" 0
DC="docker compose" # add `-f docker/compose.yml` if it's in another folder
if [ $# -eq 0 ]; then
If you want to use bavix/laravel-wallet plugin with a one-time inline defined product, here is how to do it:
app/Models/InlineProduct.php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/resources/views/vendor/backpack/crud/fields/dependent_text.blade.php
{{-- dependent text input --}}
@php
$field['wrapper'] = $field['wrapper'] ?? $field['wrapperAttributes'] ?? [];
$field['wrapper']['data-field-name'] = $field['wrapper']['data-field-name'] ?? $field['name'];
$field['wrapper']['data-depends-on'] = json_encode($field['depends_on'] ?? []);
$field['wrapper']['data-init-function'] = $field['wrapper']['data-init-function'] ?? 'bpFieldInitDependentTestElement';
app/Logging/AxiomLogger.php
<?php
namespace App\Logging;
use Http;
use Monolog\Logger;
use Monolog\Handler\HandlerInterface;
#!/bin/bash | |
USER_NAME=app | |
cat /etc/passwd | grep ${USER_NAME} >/dev/null 2>&1 | |
if [ $? -eq 0 ] ; then | |
echo "user ${USER_NAME} exists" | |
else | |
groupadd -r ${USER_NAME} -g 1000 && useradd -u 1000 -r -g ${USER_NAME} -m -d /home/${USER_NAME} -s /bin/bash -c "App user" ${USER_NAME} | |
fi |
Put the following script in a .sh file, for example in /root/watch-mysql.sh
#!/usr/bin/bash
trap "exit" 0
MAXCONN=1000 # set this to whatever base max_connections you have defined in your my.conf setting
while true; do
#mysql -e "SHOW VARIABLES LIKE 'max_connections';"
THREADS=`mysqladmin status | awk '{print $4}'`
Install autorestic: https://autorestic.vercel.app/installation
Let's use /root/backup
to store our env file and autorestic config, make a data
folder inside to store the actual backups inside, and a temporary database
folder for MySQL dumps.
mkdir /root/backup
import { Component, For } from "solid-js"; | |
import moment from "moment"; | |
import "moment/dist/locale/ro"; | |
moment.locale("ro"); | |
const App: Component = () => { | |
const weekdays = moment.weekdaysMin(); | |
const months = moment.months(); | |
const fullYear = Object.fromEntries( | |
months.map((monthName, monthIndex) => { |
<?php | |
// inspired by https://github.com/imanghafoori1/laravel-video | |
// if you need this for video, this does not support seek. | |
// laravel-video supports seek and chunks, so use that for video. | |
Route::get('/big-file-stream', function () { | |
$filePath = \Storage::disk('local')->path('video.mp4'); | |
$fileStream = \Storage::disk('local')->readStream('video.mp4'); |