Skip to content

Instantly share code, notes, and snippets.

@Bia3
Bia3 / UPS Monitoring.md
Created June 29, 2024 13:05 — forked from grahambrown11/UPS Monitoring.md
UPS Monitoring with NUT

At work we have a PowerWise+ UPS made localally by EDSUPS, it came with Silon2000 software - which is for Windows. We only have linux servers so I installed NUT and tried to get the correct settings so NUT could send a Slack for the UPS state change

Add a rule so the USB creates a known symlink /etc/udev/rules.d/10-local.rules

ACTION=="add", KERNEL=="ttyUSB[0-9]*", SUBSYSTEMS=="usb", ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", SYMLINK+="ttyUSB_UPS"

In /etc/nut/nut.conf make MODE=standalone

@Bia3
Bia3 / alpine-container.sh
Created June 27, 2024 19:32 — forked from sfan5/alpine-container.sh
Create bootable systemd-nspawn containers with Alpine, Arch Linux or Ubuntu
#!/bin/bash -e
# Creates a systemd-nspawn container with Alpine
MIRROR=http://dl-cdn.alpinelinux.org/alpine
VERSION=${VERSION:-v3.19}
APKTOOLS_VERSION=2.14.4-r0
wget_or_curl () {
if command -v wget >/dev/null; then
@Bia3
Bia3 / nsmb.conf
Created April 12, 2024 14:09 — forked from jbfriedrich/nsmb.conf
macOS 11.2 NSMB configuration
# /etc/nsmb.conf - macOS 11.3 - 2021-04-29
#------------------------------------------------------------------------------
# SMB configuration for macOS 11.3 <-> Synology
#------------------------------------------------------------------------------
# Additional information:
# -----------------------
# https://support.apple.com/de-de/HT211927
# https://support.apple.com/en-us/HT208209
# https://apple.stackexchange.com/questions/309016/smb-share-deadlocks-since-high-sierra
# https://photographylife.com/afp-vs-nfs-vs-smb-performance
@Bia3
Bia3 / seaweedfs_owncloud.md
Created March 28, 2024 18:18 — forked from egg82/seaweedfs_owncloud.md
SeaweedFS + OwnCloud

A quick write-up on SeaweedFS + OwnCloud

This guide aims to take a look at a distributed, scalable SeaweedFS as a backend storage for an OwnCloud server. Why not NextCloud? Because NextCloud's S3 connector is outdated and not maintained, and won't work with SeaweedFS. Both OwnCloud and NextCloud have the same support and the same plugins. The only concern anyone has is some weird split that happened between the two years ago. It's fine.

This was a giant pain in the ass, but eventually I got it working. This is how.

Filesystem/Hardware

All servers start from fresh, clean installs of Ubuntu 18.04.3

This guide will use three seperate boxes (one master/OwnCloud and two slaves). I'm assuming there's spare, unformatted disks attached to the slaves. If not, ignore or change the section on mounting to fit your needs.

@Bia3
Bia3 / bond1.netdev
Created February 12, 2024 17:31 — forked from kbeckmann/bond1.netdev
LACP port trunking with systemd-networkd
[NetDev]
Name=bond1
Kind=bond
[Bond]
Mode=802.3ad
MIIMonitorSec=1s
LACPTransmitRate=fast
UpDelaySec=2s
DownDelaySec=8s
@Bia3
Bia3 / bash.generate.random.alphanumeric.string.sh
Created February 10, 2024 23:58 — forked from earthgecko/bash.generate.random.alphanumeric.string.sh
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1
@Bia3
Bia3 / dmesg
Created May 16, 2023 23:42
NanoPi R2S dmesg nixos
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[ 0.000000] Linux version 6.2.8 (nixbld@localhost) (gcc (GCC) 9.5.0, GNU ld (GNU Binutils) 2.39) #1-NixOS SMP Wed Mar 22 12:38:11 UTC 2023
[ 0.000000] Machine model: FriendlyElec NanoPi R2S
[ 0.000000] efi: UEFI not found.
[ 0.000000] NUMA: No NUMA configuration found
[ 0.000000] NUMA: Faking a node at [mem 0x0000000000200000-0x000000003fffffff]
[ 0.000000] NUMA: NODE_DATA [mem 0x3fdc99c0-0x3fdccfff]
[ 0.000000] Zone ranges:
[ 0.000000] DMA [mem 0x0000000000200000-0x000000003fffffff]
[ 0.000000] DMA32 empty
### Keybase proof
I hereby claim:
* I am bia3 on github.
* I am sean_aphid (https://keybase.io/sean_aphid) on keybase.
* I have a public key ASBqkknD1OLDhuB02rTbTEmExRx0RnLBHLm2kDX3BEyVlwo
To claim this, I am signing this object:
@Bia3
Bia3 / dj.models.template.py
Created September 5, 2018 15:01
[Dj Models Template] Basic Django models template #Django
from __future__ import unicode_literals
from django.db import models
# Create your models here.