Skip to content

Instantly share code, notes, and snippets.

View ProxiBlue's full-sized avatar
🏠
Working from home

Lucas van Staden ProxiBlue

🏠
Working from home
View GitHub Profile
@ProxiBlue
ProxiBlue / immich.sh
Last active December 31, 2024 01:42
HAOS Immich add-on by alexbelgium db restore
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
# ref: https://github.com/alexbelgium/hassio-addons/discussions/1467#discussioncomment-11699236
# this script will look for your immich database backup file placed in path
# /share/postgresql_immich_restore.sql
#
# it must not be gzipped.
# requires: Terminal add-on to place files, a way you knwo how to place your .sql on HAOS server. I used an external USB I mounted.
#
@ProxiBlue
ProxiBlue / 80-mount-usb-to-media-by-label.rules
Created December 29, 2024 11:54 — forked from eklex/80-mount-usb-to-media-by-label.rules
udev rule for Home Assistant OS (hassio) to mount USB drives into the Supervisor Media directory
#
# udev rule
# Mount USB drive to the media directory using the partition name as mount point
#
# Description:
# Created for Home Assistant OS, this rule mounts any USB drives
# into the Hassio media directory (/mnt/data/supervisor/media).
# When a USB drive is connected to the board, the rule creates one directory
# per partition under the media directory. The newly created partition is named
# as the partition name. If the partition does not have a name, then the following
@ProxiBlue
ProxiBlue / cronUnitTest
Created December 4, 2024 01:52
cron_unit_test
<?php
namespace Uptactics\PpsTheme\Test\Unit;
use PHPUnit\Framework\TestCase;
class CronListTest extends TestCase
{
private $filePath;
@ProxiBlue
ProxiBlue / repmanfix
Created March 1, 2024 08:12
repman packages fix from 404
#!/bin/env bash
# Requires HTTPie and JQ
ORG_NAME='xxxxxx'
API_KEY='xxxxxx'
SLEEP_S=0.5
# End of variables that need to change
package_url="https://app.repman.io/api/organization/${ORG_NAME}/package"
@ProxiBlue
ProxiBlue / n98-magerun2.yaml
Created May 2, 2022 05:44
n98-magerun2 more extensive list of required php modules
commands:
N98\Magento\Command\System\CheckCommand:
php:
required-extensions:
- bcmath
- ctype
- dom
- fileinfo
- json
- mbstring
@ProxiBlue
ProxiBlue / gist:ad1bc6db0f74e4494f92f94d04423b4b
Last active January 26, 2022 22:06
cypress random test from sitemap.xml that old site and new site match data
Add the following to plugins/index.js
module.exports = (on, config) => {
on('task', {
log (message) {
console.log(message)
return null
}
})
}
@ProxiBlue
ProxiBlue / gist:0106c7fa0f2fd24b613f0e61c0ac7c90
Last active July 28, 2021 03:21
Enable paypal express and paypal payflow pro at same time magento 2
Magento 2 Paypal has a weird limit that you cannot enable Paypal Expresss checkout and other payment methods
(like paypal payflowpro) at the same time.
Sure, Paypal Payflow has the option to enable express, but that is not teh same thing.
The 'express' in paypal payflow pro are direct checkout buttons on product and cart pages, which directly
make a purchase to Paypal, it does NOT add a payment method to select in checkout.
A bit of a hack to enable them both on checkout, so as selectable payment options is to lock the express
values to enbal in env.php
@ProxiBlue
ProxiBlue / buddy.pipeline.sniffs
Created January 27, 2021 01:58
pipeline php sniffs
rm composer.json
rm composer.lock
composer require magento-ecg/coding-standard mandrill/mandrill
[ -d "code_sniff" ] || mkdir code_sniff
phpcs --config-set ignore_warnings_on_exit 1
phpcs --config-set ignore_errors_on_exit 1
phpcs --report-file=./code_sniff/sniff.txt --standard=./vendor/magento-ecg/coding-standard/Ecg ${PATH_TO_SNIFF}
php_cwd=`php << 'EOF'
<?php
require __DIR__ . '/vendor/autoload.php';
@ProxiBlue
ProxiBlue / maldet.pipeline.script
Created January 26, 2021 10:58
Using maldet inside a pipeline deploy
#buddy starts in the working dir
SCANDIR=$(pwd)
wget http://www.rfxn.com/downloads/maldetect-current.tar.gz
tar -xzf maldetect-current.tar.gz
cd maldetect-1.6.4
/bin/bash ./install.sh
#make a fake vi to just echo out the report
echo '#!/bin/bash' >/usr/bin/vi
echo 'echo $1' >>/usr/bin/vi
chmod +x /usr/bin/vi
@ProxiBlue
ProxiBlue / set-config.php
Last active December 28, 2020 09:01
move mageno 2 locked config back to database
#!/usr/bin/env php
## steps
#
# fix where app:config:dump was run, adn value sin magento db is outof sync (so they ONLy exist in the dumped configs)
#
# Copy your app/etc/config.php (or app/etc/env.php) to bin folder
# delete from the app/etc/config.php (or env.php) file the values you want to re-import TO DB
# run bin/magento app:config:import (to process the changes you just made)
# run this script: ./bin/set-config.php --config config.php (or env.php)