Skip to content

Instantly share code, notes, and snippets.

@dreamcat4
dreamcat4 / update-boot2
Last active October 16, 2020 06:58
For luks zfs root pool on ubuntu. Patches for - dual disks, v1.04, for ubuntu 19.04+
#!/bin/sh
#
# /usr/local/bin/update-boot2
#
# Summary:
#
# For luks zfs root pool on ubuntu. Patches for - dual disks, v1.04, for ubuntu 19.04+
#
# a) This patches initrd to remove certain error messages at boot time, that would otherwise
# interfere and prevent the system booting correctly.
@h4de5
h4de5 / gist:2e3fe4997db56325bfbc4a26625c29fb
Last active September 3, 2024 11:15
Synology - Make Plex PMS log to ram (tmpfs)
# change to Plex PMS directory on the nas (volume1 could be different)
cd "/volume1/Plex/Library/Application Support/Plex Media Server"
# stop Plex application for now
sudo synopkg stop "Plex Media Server"
# move away existing logs
mv Logs Logs-bkp
# list directory content
# remember group and userid from user plex and group users
ll -n
# create mount point for the Logs directory with the uid listed above
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active July 4, 2025 11:40
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@ansemjo
ansemjo / container-systemd-autologin.conf
Created April 26, 2019 10:53
enable root autologin when starting a container with systemd init
# drop-in override to fix and enable autologin in rootless containers with systemd init
# e.g.:
#
# podman run --rm -it \
# -v .../container-systemd-autologin.conf:/etc/systemd/system/console-getty.service.d/override.conf:ro \
# centos:latest /usr/lib/systemd/systemd
[Service]
ExecStart=
ExecStartPre=-/usr/bin/sed -i '/pam_loginuid.so/d' /etc/pam.d/login
@dreamcat4
dreamcat4 / dell-perc-h310-how-to-flash.sh
Last active November 3, 2024 00:17
how to flash LSI SAS 2008 hba dell perc h310 to lsi 8112-8i firmware p19 or p20
# ======
# how to flash LSI SAS 2008 hba dell perc h310 raid jbod card
# for uefi motherboards, must boot uefi and use sas2flash.efi
# select uefi in the moot menu --> launches boof.efi. then:
# official UEFI oprom downloads are now only available from the product page of lsi 8210-8i card
# however we found an un official mirror / off site backup of previous files
# https://www.broadcom.com/products/storage/host-bus-adapters/sas-9210-8i#downloads
@markuskont
markuskont / set-capture-affinity.py
Created February 27, 2019 12:59
Set CPU affinity and IRQ stuff for moloch-capture with python3 and python-psutil
#!/usr/bin/env python3
import psutil
import subprocess
import re
import sys
import os.path
def get_moloch_capture_parent():
procs = {p.pid: p.info for p in psutil.process_iter(attrs=['pid', 'name', 'username'])}
@atultherajput
atultherajput / http-jwt-interceptor.ts
Created January 17, 2019 13:25
JWT refresh token in Angular 6 Interceptor with Ngrx
import { Injectable } from '@angular/core';
import {
HttpRequest,
HttpHandler,
HttpEvent,
HttpInterceptor
} from '@angular/common/http';
import { Observable, BehaviorSubject } from 'rxjs';
import { filter, take, switchMap } from 'rxjs/operators';
import { SigninModuleState } from '../../signin/store/models/signin.model';
@rmi1974
rmi1974 / how_to_force_a_disk_to_reallocate_bad_sectors.md
Last active January 20, 2025 14:42
How to force a disk to reallocate bad sectors #disk #health #commandlinefu

How to force a disk to reallocate bad sectors

Courtesy of [How to force a disk to reallocate bad sectors][1].

Sometimes a hard disk is hinting on an upcoming failure. Some disks start to make unexpected sounds, others are silent and only cause some noise in your syslog. In most cases the disk will automatically reallocate one or two damaged sectors and you should start planning on buying a new disk while your data is safe. However, sometimes the disk won’t automatically reallocate these sectors and you’ll have to do that manually yourself. Luckily, this doesn’t include any rocket science.

A few days ago, one of my disks reported some problems in my syslog while rebuilding a RAID5-array:

Jan 29 18:19:54 dragon kernel: [66774.973049] end_request: I/O error, dev sdb, sector 1261069669
#### Contents of the preconfiguration file (for stretch)
### Localization
# Preseeding only locale sets language, country and locale.
d-i debian-installer/locale string en_US.UTF-8
# The values can also be preseeded individually for greater flexibility.
#d-i debian-installer/language string en
#d-i debian-installer/country string US
#d-i debian-installer/locale string en_US.UTF-8
#Preseed Ubuntu
d-i debconf/priority select critical
d-i auto-install/enabled boolean true
# Preseeding only locale sets language, country and locale.
d-i debian-installer/locale string en_GB.UTF-8
# Keyboard selection.
# Disable automatic (interactive) keymap detection.