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
's Avatar

anduin

Joined 1752214767

Recently created
Least recently created
Recently updated
Least recently updated
All gists 53
anduin's Avatar

anduin / Daily build anduinos

0 likes
0 forks
1 files
Last active 1753519534
1 #!/bin/bash
2
3 # daily_build_v2.sh (refactored without tmux)
4 # Script Purpose:
5 # 1) For each branch in the list:
6 # a) Switch to the branch, ensure local code is up-to-date (clean -fdx, reset --hard, pull)
7 # b) Check if there are new commits in the past 24 hours
8 # - If yes, a build is required
9 # - If no but the last build was more than a week ago, a forced build is required
10 # - Otherwise, skip
anduin's Avatar

anduin / Compare Debian distro packages

0 likes
0 forks
3 files
Last active 1735293001
1 #!/usr/bin/env bash
2 #
3 # compare_packages.sh
4 #
5 # Compare package lists from two systems:
6 # anduinos-packages.txt
7 # ubuntu-24-packages.txt
8
9 # Ensure both files exist
10 if [[ ! -f "anduinos-packages.txt" || ! -f "ubuntu-24-packages.txt" ]]; then
anduin's Avatar

anduin / 监控服务器实时IP流量

0 likes
0 forks
3 files
Last active 1731231225
1 #!/bin/bash
2
3 function monitor_traffic() {
4 if [ -z "$1" ]; then
5 echo "Usage: $0 <network_interface>"
6 echo "Available network interfaces:"
7 ip link show | awk -F': ' '/^[0-9]+: /{print $2}'
8 exit 1
9 fi
anduin's Avatar

anduin / My Virtual Machine

0 likes
0 forks
1 files
Last active 1736139752
1 <domain xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0" type="kvm">
2 <name>win11</name>
3 <uuid>756529ab-15aa-4223-bcee-df013e8bd3e4</uuid>
4 <metadata>
5 <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
6 <libosinfo:os id="http://microsoft.com/win/11"/>
7 </libosinfo:libosinfo>
8 </metadata>
9 <memory unit="KiB">67108864</memory>
10 <currentMemory unit="KiB">67108864</currentMemory>
anduin's Avatar

anduin / 机顶盒

0 likes
0 forks
2 files
Last active 1730290493
这是一个Chrome插件。安装后,在浏览器打开 CCTV 的电视直播网站时,自动将视频全屏,并支持[]键换台
1 // 函数:将视频元素设置为覆盖整个窗口
2 function makeVideoFullWindow(video) {
3 console.log('Making video full window.');
4
5 // 设置视频的样式,使其占据整个页面
6 video.style.position = 'fixed';
7 video.style.top = '0';
8 video.style.left = '0';
9 video.style.width = '100vw';
10 video.style.height = '100vh';
anduin's Avatar

anduin / apt-mirror

0 likes
0 forks
1 files
Last active 1727105354
1 #!/usr/bin/perl
2
3 =pod
4
5 =head1 NAME
6
7 apt-mirror - apt sources mirroring tool
8
9 =head1 SYNOPSIS
anduin's Avatar

anduin / Burn an ISO to usb

0 likes
0 forks
1 files
Last active 1725451905
1 #!/bin/bash
2
3 #==========================
4 # Set up the environment
5 #==========================
6 set -e # exit on error
7 set -o pipefail # exit on pipeline error
8 set -u # treat unset variable as error
9
10 #==========================
anduin's Avatar

anduin / Server Init

1 likes
0 forks
3 files
Last active 1748426794
Init a server from cloud provider
1 #!/usr/bin/env bash
2 #===============================================================================
3 # Concise server preparation script with error confirmation (idempotent)
4 #===============================================================================
5
6 set -euo pipefail
7 export LC_ALL=C
8 export LANG=en_US.UTF-8
9 export DEBIAN_FRONTEND=noninteractive
anduin's Avatar

anduin / Seed AnduinOS

0 likes
0 forks
1 files
Last active 1733403116
1
2
3 sudo apt update
4 sudo apt install aria2 -y
5
6 wget https://download.anduinos.com/1.0.4/AnduinOS-1.0.4-en_US.torrent
7
8 sudo ufw allow 6881
9
10 while true; do
anduin's Avatar

anduin / 汇编入门

0 likes
0 forks
1 files
Last active 1726649765
Embed Assembly in C
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include <sys/mman.h>
5 #include <unistd.h>
6
7 unsigned char add_bin[] = {
8 // 这里是针对 x86_64 架构的 add 函数的二进制机器码
9 0x55, // push %rbp
10 0x48, 0x89, 0xe5, // mov %rsp,%rbp
Newer Older

Powered by Opengist ⋅ Load: 49ms⋅

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