Skip to content

Instantly share code, notes, and snippets.

View rallisf1's full-sized avatar

John Rallis rallisf1

  • Athens, Greece
View GitHub Profile
@rallisf1
rallisf1 / docker-compose.override.yml
Last active December 28, 2023 15:21
mailcow-borgmatic-restore
version: '2.1'
services:
borgmatic-mailcow:
image: ghcr.io/borgmatic-collective/borgmatic
hostname: mailcow
restart: always
dns: ${IPV4_NETWORK:-172.22.1}.254
volumes:
- vmail-vol-1:/mnt/source/vmail:ro
@rallisf1
rallisf1 / slugify.sql
Last active August 11, 2023 21:46 — forked from kez/slugify.sql
Generating Slugs in Postgres
CREATE EXTENSION IF NOT EXISTS "unaccent";
CREATE OR REPLACE FUNCTION slugify(t text) RETURNS text
AS $$
BEGIN
t := lower(t);
-- german
t := replace(t, 'ä', 'ae');
t := replace(t, 'ö', 'oe');
t := replace(t, 'ü', 'ue');
@rallisf1
rallisf1 / url_opener.sh
Created May 24, 2023 09:41
Open .url links in Linux
#!/bin/bash
grep -h -s --color=never '^URL=' "$@" | cut -d'=' -f2- | xargs xdg-open &
@rallisf1
rallisf1 / get_cpanel_emails.sh
Last active April 1, 2024 06:17
get all emails and their password hashes from a cPanel server
#!/bin/bash
# Set the path to the cPanel user file
USERS_FILE="/etc/trueuserdomains"
# Loop through each cPanel user
while read DOMAIN USER; do
# Remove the colon from the end of the DOMAIN variable
DOMAIN=$(echo "$DOMAIN" | sed 's/:$//')
# Get the user's email accounts
@rallisf1
rallisf1 / custom.js
Created March 22, 2023 07:22
Nocodb custom JS: Add a print button
let node = document.querySelector(".nc-tab-bar .nc-fullscreen-btn")
// Always check if an element exists before manipulating it
if(node !== null) {
newNode = document.createElement("div")
newNode.classList = "flex items-center h-full mb-1px" // not all tailwind classes work, only the ones already loaded on the page
// here I am just duplicating the invite button and making it a print button
@rallisf1
rallisf1 / index.js
Last active May 5, 2022 10:12
Fix primo.af site assets
const fs = require("fs-extra");
const cheerio = require('cheerio');
const crypto = require('crypto');
const slug = require('slug');
// recreate our assets directories aka empty them
fs.emptyDirSync('./assets/images');
fs.emptyDirSync('./assets/styles');
let buffer;
@rallisf1
rallisf1 / deploy-actions.txt
Created February 1, 2022 13:20
plesk git sveltekit
cd ~/server-path && PATH=$PATH:/opt/plesk/node/16/bin/ npm install
cd ~/server-path && PATH=$PATH:/opt/plesk/node/16/bin/ npm run build
cp ~/server-path/plesk/* ~/server-path/build