Skip to content

Instantly share code, notes, and snippets.

@bjornbouetsmith
bjornbouetsmith / etc-sysctl.conf
Last active April 7, 2023 14:36
FreeNAS 10GBe tuning
Add these lines to the file /etc/sysctl.conf
#10GBE tuning
kern.ipc.soacceptqueue=2048
kern.ipc.somaxconn=2048
kern.ipc.maxsockbuf=33554432
net.inet.tcp.recvbuf_inc=2097152 # (default 16384)
net.inet.tcp.recvbuf_max=16777216 # (default 2097152)
net.inet.tcp.recvspace=4194304 # (default 65536)
@natefoo
natefoo / gross.yaml
Last active May 28, 2021 11:23
Ansible tasks for selecting an OpenStack image from a list using a regular expression
---
- name: Get Image
hosts: all
gather_facts: no
environment:
OS_CLOUD: "{{ cloud_id }}"
OS_IDENTITY_API_VERSION: '3'
connection: local
tasks:
@Neo23x0
Neo23x0 / audit.rules
Last active September 16, 2024 14:59
Linux Auditd Best Practice Configuration
# IMPORTANT!
# This gist has been transformed into a github repo
# You can find the most recent version there:
# https://github.com/Neo23x0/auditd
# ___ ___ __ __
# / | __ ______/ (_) /_____/ /
# / /| |/ / / / __ / / __/ __ /
# / ___ / /_/ / /_/ / / /_/ /_/ /
# /_/ |_\__,_/\__,_/_/\__/\__,_/
@autoize
autoize / backupToB2.sh
Created September 8, 2017 17:20
NextCloud Backup to BackBlaze B2
#!/bin/sh
# NextCloud to BackBlaze B2 Backup Script
# Author: Autoize (autoize.com)
# This script creates an incremental backup of your NextCloud instance at BackBlaze's off-site location.
# BackBlaze B2 is an object storage service that is much less expensive than using Amazon S3 for the same purpose, with similar versioning and lifecycle management features.
# Uploads are free, and storage costs only $0.005/GB/month compared to S3's $0.022/GB/month.
# Requirements
@wido
wido / rgw-bucket-stats.sh
Last active June 9, 2022 07:44
Ceph RADOS Gateway bucket statistics
#!/bin/bash
#
# Get the usage statistics of all RGW buckets
#
# Sort output with: ./rgw-bucket-stats.sh|sort -k 2 -n|tac
#
# Author: Wido den Hollander <wido@widodh.nl>
#
for BUCKET in $(radosgw-admin bucket list|python -c "import json,sys; [sys.stdout.write(bucket + '\n') for bucket in json.load(sys.stdin)]"); do
input { generator {} }
filter {
ruby {
# Add a \t (tab) by using its ASCII code (9)
code => 'event.set("message", 9.chr + event.get("message"))'
}
ruby {
# Make a new field with the tab removed
code => 'event.set("tabless", event.get("message").gsub(9.chr, ""))'
@SeonghoonKim
SeonghoonKim / apache-balancer.sh
Last active March 8, 2022 08:12
Apache HTTPD balancer-manager control script
#! /bin/sh
# Set up a default search path
PATH="/usr/bin:/bin"
CURL=`which curl`
if [ -z "$CURL" ]; then
echo "curl not found"
exit 1
fi