Skip to content

Instantly share code, notes, and snippets.

View KireinaHoro's full-sized avatar

Pengcheng Xu KireinaHoro

View GitHub Profile
@KireinaHoro
KireinaHoro / bootstrap.sh
Last active January 3, 2026 04:32
Bootstrap aarch64-linux-android clang/llvm toolchain with sanitizers support
#!/bin/bash
# script that creates clang/llvm cross toolchain for aarch64 android target
# compile a hello world program that runs on AOSP Android:
# test with: adb push hello /data/cache && adb shell /data/cache/hello
# GCC:
# C: aarch64-linux-android-gcc hello.c -o hello -pie
# C++: aarch64-linux-android-g++ hello.cc -o hello -pie -fPIC -static-libgcc \
# -nostdlib -L/usr/local/aarch64-linux-android/lib -lc++ -lc -nostdinc++ \
# -I/usr/local/aarch64-linux-android/include/c++/v1 -std=c++11
# Clang/LLVM:
package jsteward.blocks.misc
import spinal.core._
/**
* Used to drive inpout ports of blackboxes that are missing in SpinalHDL. Some blackboxes disable
* specific ports (e.g. TLAST in AXI-Stream) but the port still exists in RTL. This tool avoids leaving
* these disabled ports dangling.
*
* @param dataType type used in SpinalHDL, without disabled ports
@KireinaHoro
KireinaHoro / config-4.9.95-gentoo
Created May 4, 2018 18:17
Kernel configuration for Gentoo in Hyper-V
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 4.9.95-gentoo Kernel Configuration
#
#
# Gentoo Linux
#
CONFIG_GENTOO_LINUX=y
CONFIG_GENTOO_LINUX_UDEV=y
@KireinaHoro
KireinaHoro / aria2
Created January 15, 2018 06:49
service file for aria2
#!/sbin/openrc-run
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
depend() {
need net localmount
after bootmisc
}
start() {
@KireinaHoro
KireinaHoro / switch-vlan.ps1
Created January 21, 2024 17:16
Switch between VLANs with Hyper-V vEthernet
<#
Make adapter use gravity (untagged) or upstream network (tagged 1).
This depends on the switch (ER-X) configuration:
- upstream port has PVID=1 (untagged vlan 1)
- gateway port has PVID=1 VID=200 (untagged vlan 1, tagged vlan 200)
- downstream ports have PVID=200 VID=1 (untagged vlan 200, tagged vlan 1)
#>
#Requires -RunAsAdministrator
@KireinaHoro
KireinaHoro / photo-redate.swift
Created January 20, 2024 00:26
Update all photo dates from filename. Useful for bulk import into iCloud from Google Photos.
//
// main.swift
// photo-redate
//
// Created by Pengcheng on 19.01.2024.
//
import Foundation
import Photos
import os
package pionic
import axi.sim.{Axi4Master, Axi4StreamMaster, Axi4StreamSlave}
import spinal.core._
import spinal.core.sim._
import spinal.lib.BinaryBuilder
import scala.util._
case class PacketDescSim(addr: BigInt, size: BigInt)(implicit config: PioNicConfig) {
package axi.sim
import pionic.RichByteArray
import spinal.core._
import spinal.core.sim._
import spinal.lib.bus.amba4.axi._
import spinal.lib.sim._
import java.util.concurrent.atomic.{AtomicBoolean, AtomicReference}
import scala.collection.mutable
package axi.sim
import spinal.core._
import spinal.core.sim._
import spinal.lib._
import spinal.lib.bus.amba4.axi._
import spinal.lib.bus.misc._
import spinal.lib.sim._
import scala.collection.mutable
@KireinaHoro
KireinaHoro / snmp.yml
Last active February 10, 2022 08:12
snmp_exporter config for Geist (Vertiv) IMD PDUs
# WARNING: This file was auto-generated using snmp_exporter generator, manual changes will be lost.
geist_imd:
walk:
- 1.3.6.1.4.1.21239.5.2.3
metrics:
- name: pduMainIndex
oid: 1.3.6.1.4.1.21239.5.2.3.1.1.1
type: gauge
help: Table entry index value - 1.3.6.1.4.1.21239.5.2.3.1.1.1
indexes: