Skip to content

Instantly share code, notes, and snippets.

View rmundel's full-sized avatar
🇧🇷
mundel.com.br

Rafael Mundel rmundel

🇧🇷
mundel.com.br
View GitHub Profile
@rodrigopedra
rodrigopedra / BelongsToManyInDifferentConnections.php
Created June 22, 2018 17:29
Laravel BelongsToMany in different connections
<?php
namespace App\Models;
use Illuminate\Database\ConnectionInterface;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
class BelongsToManyInDifferentConnections extends BelongsToMany
@jniltinho
jniltinho / create-deb-samba4.sh
Last active August 31, 2023 20:02
Create Deb Samba4
#!/bin/bash
## Create DEB package Samba4 4.12.3 (Ubuntu 18.04)
## http://sig9.hatenablog.com/entry/2017/12/04/000000
## https://wiki.samba.org/index.php/Package_Dependencies_Required_to_Build_Samba
## https://github.com/jniltinho/go-samba4/releases
## https://www.tecmint.com/install-samba4-active-directory-ubuntu/
## https://blog.ricosharp.com/posts/2019/Samba-4-Active-Directory-Domain-Controller-on-Ubuntu-18-04-Server
## http://www.bosontreinamentos.com.br/linux/samba-4-instalacao-e-provisionamento/
## https://wiki.samba.org/index.php/Installing_RSAT
## https://www.tecmint.com/manage-samba4-ad-from-windows-via-rsat
@haproxytechblog
haproxytechblog / blog20181109-01.cfg
Last active May 8, 2024 16:24
Application-Layer DDoS Attack Protection with HAProxy
backend per_ip_rates
stick-table type ip size 1m expire 10m store http_req_rate(10s)
@mergwyn
mergwyn / zfsbench
Last active March 13, 2025 08:36
ZFS benchmarking using fio
#!/usr/bin/env bash
set -o errexit
echo $(date):Random read
fio --filename=test --sync=1 --rw=randread --bs=4k --numjobs=1 \
--iodepth=4 --group_reporting --name=test --filesize=10G --runtime=300 && rm test
echo $(date):Random write
fio --filename=test --sync=1 --rw=randwrite --bs=4k --numjobs=1 \
@mrpeardotnet
mrpeardotnet / PVE-HP-ssacli-smart-storage-admin.md
Last active July 22, 2025 10:03
HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

Why use HP Smart Storage Admin CLI?

You can use ssacli (smart storage administrator command line interface) tool to manage any of supported HP Smart Array Controllers in your Proxmox host without need to reboot your server to access Smart Storage Administrator in BIOS. That means no host downtime when managing your storage.

CLI is not as convenient as GUI interface provided by BIOS or desktop utilities, but still allows you to fully manage your controller, physical disks and logical drives on the fly with no Proxmox host downtime.

ssacli replaces older hpssacli, but shares the same syntax and adds support for newer servers and controllers.

Installation

@jessequinn
jessequinn / elk.sh
Last active April 19, 2025 09:45
Ubuntu - ELK Stack Installation Script
### Script originally based on https://gist.github.com/kydouglas/1f68d69e856fd6d7dc223f8e1f5ae3b3
#!/bin/bash
#ONE LINE
#sudo wget -Nnv 'https://gist.githubusercontent.com/kydouglas/1f68d69e856fd6d7dc223f8e1f5ae3b3/raw/f8c3b22b9d9c41093150b96c815776956b523d9d/elk.sh' && bash elk.sh && rm -f elk.sh
# Checking whether user has enough permission to run this script
sudo -n true
if [ $? -ne 0 ]
then
@ckuethe
ckuethe / doh-blocklist.txt
Last active April 11, 2025 20:59
DNS-over-HTTPS Block List
# Here are some domains I block to interfere with DNS-over-HTTPS, so that my own DNS-based security schemes work.
# If you're going to be doing this, you should probably block all outbound 53, 853, and 5353 on your network,
# except from your own internal DNS resolver (eg. pihole)
#
# Data from https://github.com/curl/curl/wiki/DNS-over-HTTPS (and other places)
1a.ns.ozer.im
8888.google
aattwwss.duckdns.org
abel.waringer-atg.de
@fesplugas
fesplugas / xfs-on-hetzner.yml
Created May 29, 2020 21:44 — forked from exocode/xfs-on-hetzner.yml
Create xfs partitions on Hetzner via cloud-init. It keeps root disk available again after rebooting. Simply change your desired sizes and filesystem to use it for your needs.
#cloud-config
resize_rootfs: false
disk_setup:
/dev/sda:
table_type: 'mbr'
layout:
- 25
- 75
overwrite: true
@swuecho
swuecho / proxmox-import-disk-image.txt
Created August 12, 2020 00:56
Add import existing disk image into Proxmox
#
# The official PVE docs on how to prepare cloud-init templates:
# https://pve.proxmox.com/wiki/Cloud-Init_Support#_preparing_cloud_init_templates
#
# Additional guides and resources:
# https://dae.me/blog/2340/how-to-add-an-existing-virtual-disk-to-proxmox/
# https://pve.proxmox.com/pve-docs/qm.1.html
# use the Qemu/KVM Virtual Machine Manager to import the disk
qm importdisk 107 Univention-App-kopano-core-KVM.qcow2 local-lvm
@markasoftware
markasoftware / enterprise_token.rb
Last active July 23, 2025 04:39
OpenProject Enterprise mode for free
############ If you are using DOCKER all-in-one image, create Dockerfile like: ################
############ FROM openproject/openproject:16 ################
############ COPY ./enterprise_token.rb app/models/enterprise_token.rb ################
############ If you are runing a manual installation: ################
############ REPLACE app/models/enterprise_token.rb in the source code with this file! ################
############ also be sure to RESTART OpenProject after replacing the file. ################
############ If using some other set up (eg docker-compose), read the comments on ################
############ https://gist.github.com/markasoftware/f5b2e55a2c2e3abb1f9eefcdf0bfff45 ################