All New

user:thomas gists created by user

title:mygist gists with given title

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

Register

Login


All New Register Login

All gists

Recently created
Least recently created
Recently updated
Least recently updated
anduin's Avatar

anduin / My MCP config

0 likes
0 forks
1 files
Last active 1750926757
My MCP config
1 {
2 "mcpServers": {
3 "code-runner": {
4 "type": "streamable_http",
5 "url": "https://cpprunner.aiursoft.cn/mcp",
6 "headers": {
7 "Content-Type": "application/json"
8 }
9 },
10 "context7": {
anduin's Avatar

anduin / 死锁检测测试

0 likes
0 forks
1 files
Last active 1749041370
1 // gcc -g ./s.c -o deadlock_demo -lpthread
2 // sudo valgrind --tool=helgrind ./deadlock_demo
3
4 #include <pthread.h>
5 #include <stdio.h>
6 #include <unistd.h>
7
8 pthread_mutex_t lock_a = PTHREAD_MUTEX_INITIALIZER;
9 pthread_mutex_t lock_b = PTHREAD_MUTEX_INITIALIZER;
anduin's Avatar

anduin / circle.asm

0 likes
0 forks
1 files
Last active 1748188233
1 ; boot2.asm
2 ; nasm -f bin boot2.asm -o boot2.img
3 ; qemu-system-i386 -drive format=raw,file=boot2.img
4
5 [org 0x7c00]
6 bits 16
7
8 start:
9 cli
10 xor ax, ax
anduin's Avatar

anduin / Autoseed.sh

0 likes
0 forks
3 files
Last active 1755779259
Seed all torrent files under current folder.
1
2 #!/bin/bash
3
4 # Find all .iso files and their corresponding .sha256 files, including subdirectories
5 find . -type f -name "*.iso" | while read -r iso_file; do
6 # Get the corresponding .sha256 file in the same directory
7 sha256_file="${iso_file%.iso}.sha256"
8
9 # Check if the .sha256 file exists
10 if [[ -f "$sha256_file" ]]; then
anduin's Avatar

anduin / System tools check

0 likes
0 forks
1 files
Last active 1748146268
1 #!/usr/bin/env bash
2 set -euo pipefail
3
4 # 要检查的命令列表(包含常用的系统管理、文件操作、网络诊断等)
5 cmds=(
6 # 原有命令
7 ls type which make uname lsb_release usermod nano apt sudo
8 dirname basename yes printf stat diff patch dpkg dpkg-query apt-cache
9 rsync id groups smartctl mkfs.ext4 strace nmap rsync
10 tar xz gzip file less w who whoami scp vim
anduin's Avatar

anduin / compare_manifest

0 likes
0 forks
2 files
Last active 1747638210
Compare two manifest files and list packages present in the first but not the second.
1 # 保存脚本为 compare_manifests.py,并赋可执行权限
2 chmod +x compare_manifests.py
3
4 # 运行脚本,依次传入 Ubuntu、Zorin、Anduin 三个 manifest 文件路径
5 ./compare_manifests.py \
6 "/media/anduin/Ubuntu 25.04 amd64/casper/filesystem.manifest" \
7 "/media/anduin/Zorin OS 17.3 Core 64bit/casper/filesystem.manifest" \
8 "/media/anduin/anduinos/casper/filesystem.manifest"
aimerneige's Avatar

aimerneige / gethddtemp.sh

0 likes
0 forks
1 files
Last active 1744391737
1 #!/bin/bash
2 DRIVEPATH="$1"
3 INFO="$(sudo smartctl -a $DRIVEPATH)"
4 TEMP=$(echo "$INFO" | grep '194 Temp' | awk '{print $10}')
5 if [[ $TEMP == '' ]]; then
6 TEMP=$(echo "$INFO" | grep '190 Airflow' | awk '{print $10}')
7 fi
8 if [[ $TEMP == '' ]]; then
9 TEMP=$(echo "$INFO" | grep 'Temperature Sensor 1:' | awk '{print $4}')
10 fi
aimerneige's Avatar

aimerneige / timedatectl.sh

0 likes
0 forks
1 files
Last active 1744302626
1 sudo timedatectl set-timezone UTC
2
3 sudo timedatectl set-timezone Asia/Shanghai
4
5 timedatectl status
anduin's Avatar

anduin / Safe Linux

0 likes
0 forks
1 files
Last active 1742310728

Install steps

  • Make sure system installed with simple password and LUKS.
  • Prepare mok-util to ensure MOK trust your own keys. Reboot.
  • Prepare all drivers, modules. Build and sign the kernel and modules. Reboot.
  • Prepare necessary tpm tools. Use dracut to replace initramfs-tools. Reboot.
  • Use systemd-cryptenroll to change to a stronger password. Reboot.
  • Enable Secure Boot
  • Use systemd-cryptenroll to use TPM to auto unlock root partition. Reboot. Ensure auto unlock.
anduin's Avatar

anduin / Convert cb files to EP cached fle.

0 likes
0 forks
1 files
Last active 1741708512
1 using System;
2 using System.Collections.Generic;
3 using System.IO;
4 using System.IO.Compression;
5 using System.Text.Json;
6
7 namespace JsonToGzip
8 {
9 class Program
10 {
Newer Older

Powered by Opengist ⋅ Load: 48ms⋅

English
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文