Skip to content

Instantly share code, notes, and snippets.

View yujincheng08's full-sized avatar
🎯
Focusing

LoveSy yujincheng08

🎯
Focusing
View GitHub Profile
@vvb2060
vvb2060 / nexus2.http
Last active June 28, 2023 09:08
Maven Central Staging API
GET https://s01.oss.sonatype.org/service/local/staging/profile_repositories
Accept: application/xml
Authorization: basic {{basic}}
###
POST https://s01.oss.sonatype.org/service/local/staging/bulk/close
Accept: application/json
Content-Type: application/json
Authorization: basic {{basic}}
@Vogtinator
Vogtinator / README.md
Last active April 16, 2025 04:28
Run Win11 on ARM in QEMU

Guide updated to use the official installation .iso from Microsoft, which finally became available in Dec. 2024! For the VHDX disk image based guide check an earlier version of this gist.

When following this guide on a host not capable of aarch64 virtualization, replace -cpu host -accel kvm with -cpu max.

  1. Download the installation .iso from https://www.microsoft.com/en-us/software-download/windows11arm64. Win11_24H2_EnglishInternational_Arm64.iso is known to work.
  2. Download the the latest virtio-win.iso from https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/.
  3. Create a disk image for the Windows installation: qemu-img create -f qcow2 win11.qcow2 25G
  4. Start the installation with generic (ramfb for display, usb-storage for .isos) as well as virtio (virtio-gpu-pci, virtio-block) devices: `qemu-system-aarch64 -M virt -cpu host -accel kvm -m 4G -smp 4 -device ramfb -device virtio-gpu-pci -bios /usr/share/qemu/qemu-uefi-aarch64.bin -device qemu-xhci -device usb-kbd -dev
@yujincheng08
yujincheng08 / timer.h
Last active June 1, 2019 03:44
Thread safe c++ Timer
#include <condition_variable>
#include <functional>
#include <memory>
#include <shared_mutex>
#include <thread>
#include <chrono>
template <class Rep, class Period> class Timer {
public:
using Callback = std::function<void()>;
@yujincheng08
yujincheng08 / enumerate.h
Created May 5, 2019 14:23
Python-like loop enumeration in C++
#include <tuple>
template <typename T> class enumerate {
struct iterator {
using iter_type = decltype(std::declval<T>().begin());
private:
friend class enumerate;
iterator(const std::size_t &i, const iter_type &iter)
: i_(i), iter_(iter) {}
@mingfang
mingfang / convert id_rsa to pem
Last active December 12, 2024 12:13
Convert id_rsa to pem file
openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem
chmod 600 id_rsa.pem
@korya
korya / Subfolder to git repo.md
Last active March 25, 2025 09:39
Convert subfolder into Git submodule