Skip to content

Instantly share code, notes, and snippets.

@jmiller0
jmiller0 / synology_dsm7_fsck.md
Last active February 8, 2025 16:00
Synology DSM 7 fsck unmount force

How to properly do a filesystem check (fsck or e2fck) on Synology DSM 7

Most instructions founds online are for older DSM versions (6). The following steps were performed by a synology support agent during a support case I created.

I have a DS1821+ and during a recent storm I lost power. I have a UPS however it failed to shutdown the synology.
NOTE: Make sure and test your UPS shutdown, if you have many disks it can take longer to shutdown than reserved battery capacity.

After the power down the DSM came back and had a warning on the main volume.

The following steps were obtained by looking at /var/log/bash_history.log. Before you try any of these steps, attmpt to check the filesystem in Storage Manager, these steps are only if you fail to unmount.

@nikaro
nikaro / org.nikaro.tmschedule.plist
Last active April 24, 2025 16:13
TMSchedule | Create & rotate Time Machine local snapshots
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.nikaro.tmschedule</string>
<key>Program</key>
<string>/usr/local/bin/tmschedule.rb</string>
@hucancode
hucancode / README.md
Last active May 28, 2024 20:51
Flatten Strapi 4's response JSON

Update 29/11/2022

There is a plugin on Strapi Marketplace that do this response transforming stuffs in a more configurable way. Checkout this if you are interested.

@tomdaley92
tomdaley92 / README.md
Last active April 26, 2025 17:01
Proxmox - SPICE Client setup for MacOS

Proxmox - SPICE client setup for MacOS

  1. Install a working (and compiled) version of virt-viewer. You may view the homebrew package's upstream source on GitHub.

    brew tap jeffreywildman/homebrew-virt-manager
    brew install virt-viewer
  2. Once that's installed should be able make a call remote-viewer with a pve-spice.vv file downloaded from proxmox web interface

@ddanier
ddanier / fastapi_globals.py
Last active December 4, 2024 08:16
flask.g for FastAPI.
"""
This allows to use global variables inside the FastAPI application using async mode.
# Usage
Just import `g` and then access (set/get) attributes of it:
```python
from your_project.globals import g
@aessam
aessam / Circles.swift
Created February 17, 2021 00:34
Drawing segments of a circle in SwiftUI
import SwiftUI
extension Color {
static var random: Color {
return Color(
red: .random(in: 0...1),
green: .random(in: 0...1),
blue: .random(in: 0...1)
)
}
@steipete
steipete / Default.xcconfig
Created November 6, 2020 14:18
Hack to exclude arm64 when building Mac Catalyst in Xcode 12.2
// Hack to exclude arm64 when building Mac Catalyst in Xcode 12.2
// If this is not set and we do not set macosx as SUPPORTED_PLATFORMS, then selecting Mac as target forces arm64.
// This can be worked around by setting ONLY_ACTIVE_ARCH to NO (slow) or using the EXCLUDED_ARCHS trick
// Inspired by https://github.com/Carthage/Carthage/issues/3019
EXCLUDED_ARCHS__IS_MACCATALYST_YES__NATIVE_ARCH_64_BIT_x86_64=arm64 arm64e armv7 armv7s armv6 armv8
EXCLUDED_ARCHS = $(inherited) $(EXCLUDED_ARCHS__IS_MACCATALYST_$(IS_MACCATALYST)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT))
@mrpeardotnet
mrpeardotnet / PVE-host-backup.md
Created December 17, 2019 18:03
Proxmox PVE Host Config Backup Script

Proxmox PVE Host Config Backup Script

This script can be used to backup essential configuration files from the Proxmox Virtual Enivronment (PVE) host.

The script will create backups using tar with specified backup prefix and date and time stamp in the file name. Script will also delete backups that are older then number of days specified.

Create backup script file

To create backup script that will be executed every day we can create backup script in /etc/cron.daily/ folder. We need to make it writeable by root (creator) only, but readable and executable by everyone:

touch /etc/cron.daily/pvehost-backup
@bruvv
bruvv / Repair synology BTRFS volume
Created December 6, 2019 18:12
Synology BTRFS repair
btrfs fi show -d
(/dev/mapper/vg1000-lv)
syno_poweroff_task -d
(or: umount /volume1)
(or2: umount /volume1 -f -k)
Check to see if all us unmounted:
df -h
@aslafy-z
aslafy-z / [email protected]
Last active February 16, 2024 15:03 — forked from guettli/[email protected]
Reliable persistent SSH-Tunnel via systemd (not autossh)
# Reliable persistent SSH-Tunnel via systemd (not autossh)
# https://gist.github.com/aslafy-z/24e2ddb02fa269444620eab1bcfe2932#file-serveo-tunnel-service
#
# Usage: systemctl start serveo-tunnel@[tunnel-string] (see https://serveo.net for details)
# systemctl start serveo-tunnel@mytunnel:80:localhost:8080
# systemctl enable serveo-tunnel@mytunnel:80:localhost:8080 (to make it persist reboot)
[Unit]
Description=Serveo tunnel for %i
After=network.target