Skip to content

Instantly share code, notes, and snippets.

@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active May 14, 2025 08:35
国内的 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.
@wanlebing
wanlebing / tc.sh
Created June 27, 2018 03:45 — forked from jedy/tc.sh
tc带宽控制
#!/bin/bash
#脚本文件名: tc2
#########################################################################################
#用TC(Traffic Control)解决ADSL宽带速度技术 Ver. 1.0 by KindGeorge 2004.12.27 #
#########################################################################################
#此脚本经过实验通过,更多的信息请参阅http://lartc.org
#tc+iptables+HTB+SFQ
#
#一.什么是ADSL? ADSL(Asymmetric Digital Subscriber Loop,非对称数字用户环路)
#用最简单的话的讲,就是采用上行和下行不对等带宽的基于ATM的技术.
@sethvargo
sethvargo / create-certs.sh
Created June 6, 2018 16:20
Use openssl to create an x509 self-signed certificate authority (CA), certificate signing request (CSR), and resulting private key with IP SAN and DNS SAN
# Define where to store the generated certs and metadata.
DIR="$(pwd)/tls"
# Optional: Ensure the target directory exists and is empty.
rm -rf "${DIR}"
mkdir -p "${DIR}"
# Create the openssl configuration file. This is used for both generating
# the certificate as well as for specifying the extensions. It aims in favor
# of automation, so the DN is encoding and not prompted.