Skip to content

Instantly share code, notes, and snippets.

@iruis
iruis / MFEncodeAAC.cpp
Created May 13, 2025 12:03
WASAPI -> Resampler (Media Foundation) -> AAC (Media Foundation) -> AAC ADTS
// CMakeLists.txt 필수요소
//
// cmake_minimum_required(VERSION 3.14)
// set(CMAKE_CXX_STANDARD 20)
// set(CMAKE_CXX_STANDARD_REQUIRED ON)
//
#include <windows.h>
#include <mmdeviceapi.h>
#include <audioclient.h>
@iruis
iruis / modbus.ino
Last active July 30, 2024 03:59
아두이노 나노에서 동작하는 modbus rtu slave (서버)
#include <Arduino.h>
#ifndef ESP32
#include <SoftwareSerial.h>
#else
// ESP32 등 SoftwareSerial이 지원 안되는 보드를 위한 더미 클래스
class SoftwareSerial
{
public:
SoftwareSerial(int x, int y) {}
@iruis
iruis / gist:71544685b3e4772b4f14ae5a100bb18a
Created June 23, 2024 16:12 — forked from jauderho/gist:6b7d42030e264a135450ecc0ba521bd8
HOWTO: Upgrade Raspberry Pi OS from Bullseye to Bookworm
### WARNING: READ CAREFULLY BEFORE ATTEMPTING ###
#
# Officially, this is not recommended. YMMV
# https://www.raspberrypi.com/news/bookworm-the-new-version-of-raspberry-pi-os/
#
# This mostly works if you are on 64bit. You are on your own if you are on 32bit or mixed 64/32bit
#
# Credit to anfractuosity and fgimenezm for figuring out additional details for kernels
#
@iruis
iruis / bullseye-remote-upgrade.md
Created June 23, 2024 16:12 — forked from Iksas/bullseye-remote-upgrade.md
Raspberry Pi: Remote upgrade from Buster to Bullseye (via WiFi)

Buster >> Bullseye - Remote upgrade

These instructions can be used to upgrade Raspberry Pi OS from Buster to Bullseye with only an SSH connection (no physical access). Some addidional steps are performed to make sure that the Pi automatically joins the WiFi network after upgrading. This is necessary if the Pi is located in a remote or hard to reach location.

Especially on older Pis, the upgrade will take several hours, so plan accordingly.

If you have physical access to the Pi, consider making a backup of the SD card with the SD Card Copier utility (red berry menu in the top left >> Accessories >> SD Card Copier). If the SD Card Copier is not in the menu, you can install it with sudo apt install piclone.

@iruis
iruis / CPlusPlusSetUtf8Bom.cpp
Created May 8, 2024 13:36
비영어권 윈도우 환경에서 "warning C4819: The file contains a character that cannot be represented in the current code page (949)" 경고를 해결하기위해 BOM을 추가하는 유틸리티
#include <iostream>
#include <fstream>
#include <string>
#include <algorithm>
#include <filesystem>
#include <winsdkver.h>
#include <Windows.h>
static void fetch(const std::filesystem::path& source_path, std::size_t& count)
@iruis
iruis / AriaManaged.cs
Created January 28, 2020 18:38
ARIA (block cipher)
using System;
namespace Reveiver
{
public class AriaManaged
{
private readonly static uint[] S1;
private readonly static uint[] S2;
private readonly static uint[] X1;
private readonly static uint[] X2;
@iruis
iruis / rtc-i2c
Created January 7, 2019 05:16 — forked from h0tw1r3/rtc-i2c
Initializing I2C RTC (DS3231) on Raspberry PI bootup with Systemd without recompiling the kernel or devicetree support.
# /etc/conf.d/rtc-i2c
#
# My chip is actually a ds3231n, but ds1307 driver works fine (ds3232 does not!)
#
CHIP="ds1307"
ADDRESS="0x68"
BUS="1"
@iruis
iruis / 한글과유니코드.md
Created December 15, 2018 18:58 — forked from Pusnow/한글과유니코드.md
한글과 유니코드

한글과 유니코드

유니코드에서 한글을 어떻게 다루는지를 정리하였다.

유니코드

  • 유니코드(Unicode)는 전 세계의 모든 문자를 컴퓨터에서 일관되게 표현하고 다룰 수 있도록 설계된 산업 표준 (위키 백과)
  • 단순히 문자마다 번호를 붙임
  • 계속 업데이트되며 현재는 Unicode Version 9.0.0 이 최신이다.

UTF

  • 유니코드를 실제 파일 등에 어떻게 기록할 것인지를 표준화한 것이다.