Skip to content

Instantly share code, notes, and snippets.

View mbs0221's full-sized avatar
🏠
Working

Benshan Mei mbs0221

🏠
Working
View GitHub Profile
AMD EPYC 7V12 64-Core Processor

QEMU

Introduction

This gist contains the scripts and configurations to run a QEMU virtual machine with an ARM64 architecture.

Installation

Dependencies

@mbs0221
mbs0221 / discuss.md
Created December 19, 2023 07:15
discuss

‎‎​

@mbs0221
mbs0221 / plugins-crawler.py
Last active December 6, 2023 07:30
common scripts
‎‎​
@mbs0221
mbs0221 / lkm.md
Last active December 24, 2023 08:25
lkm example
@mbs0221
mbs0221 / build-sgx.sh
Created November 24, 2023 16:25
Shell script for intel-sgx environment.
#!/bin/bash
# Update the system
sudo apt-get update
sudo apt-get upgrade -y
# Install necessary packages
sudo apt-get install -y build-essential ocaml ocamlbuild automake autoconf libtool wget python-is-python3 libssl-dev git cmake perl protobuf-compiler
# Clone the Linux SGX SDK repository
@mbs0221
mbs0221 / cpuset.c
Last active November 23, 2023 15:25
cpuset
// This is a simple program to demonstrate the use of the cpuset
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sched.h>
#include <sys/types.h>
#include <sys/syscall.h>
#define NUM_THREADS 2
@mbs0221
mbs0221 / setup-env.md
Last active December 29, 2023 07:03
update-alternatives
sudo apt install gcc-11 g++-11 gcc-12 g++-12
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 11
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 11
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 12
sudo apt install -y bpftrace gcc-10-plugin-dev gettext
@mbs0221
mbs0221 / pkru.c
Last active November 10, 2023 16:18
pkru example
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/mman.h>
#include <sys/prctl.h>
#include <asm/prctl.h>
#include <sys/syscall.h>
#define PKEY_DISABLE_WRITE 0x1ull
using System;
using System.Runtime.InteropServices;
using static LowSharp;
namespace LLVM
{
#region Enums
//LLVMVerifierFailureAction
public enum LLVMVerifierFailureAction : Int32
{