Skip to content

Instantly share code, notes, and snippets.

View puhitaku's full-sized avatar
:octocat:
= 🐙 + 🐱

Takumi Sueda puhitaku

:octocat:
= 🐙 + 🐱
View GitHub Profile
@tomtwinkle
tomtwinkle / rsfsrom.sh
Last active February 7, 2021 09:33
Raspberry Pi rootfs ROM control function
# Raspberry Pi rootfs ROM control function
function rsfsrom() {
case $1 in
"status" )
raspi-config nonint get_overlay_now && echo "enable" || echo "disabled"
;;
"enable" )
sudo raspi-config nonint enable_overlayfs &&
echo -e "rootfs ROM is enable. system reboot required.\n> sudo systemctl reboot"
;;
@four0four
four0four / 01-zynq-uart.md
Last active May 12, 2024 04:20
Zynq BootROM Secrets - UART loader

Zynq BootROM Secrets: UART loader

Recently I acquired (md5: ADF639AFE9855EE86C8FAAD216C970D9) the Zynq bootrom, and during the reversing process uncovered some interesting secrets, one of which is an as-of-yet undocumented UART loader. As documented the Zynq bootrom will load from NOR/NAND/SPI flashes, eMMC/SDIO-based storage (unfortunately) not USB, or anything else more complex.

Not sure why Xilinx didn't document this. In my brief testing it is super unreliable if you just spit everything at once - they reset the RX/TX paths during the process, so timing is critical, but that might be the janky meter-long ftdi cable. You can change the baudrate during the process, but I was too lazy to do the math.

Here's the disassembly that made me look twice (that, and checks for the MIO boot_mode[2:0] that weren't specified in the docs :)):

ROM:0000A220 BL              uart_init
@end360
end360 / wave.magic
Created March 10, 2019 07:37
Simple wave format for binwalk I use to extract wav files from games.
# WAVE file signature
0 string RIFF WAVE File |
>4 lelong x Chunk Size: %d
>4 lelong+7 x {size:%d}
>8 string WAVE
>4 lelong+7 x {jump:%d}
@mholt
mholt / macapp.go
Last active June 19, 2024 16:05
Distribute your Go program (or any single binary) as a native macOS application
// Package main is a sample macOS-app-bundling program to demonstrate how to
// automate the process described in this tutorial:
//
// https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5
//
// Bundling the .app is the first thing it does, and creating the DMG is the
// second. Making the DMG is optional, and is only done if you provide
// the template DMG file, which you have to create beforehand.
//
// Example use:

Raspberry Piにroot-roを適用する手順メモ (2018/3/26)

今回使用したイメージはRaspian Lite 2018-03-13版。 まずEtcherを使ってイメージをmicroSDへ書き込む。

イメージ書き込み後、PCからmicroSDにあるconfig.txtを編集する。

※以下の行を末尾に追加する

dtoverlay=pi3-miniuart-bt

@Mnkai
Mnkai / README.md
Last active April 13, 2024 14:11
TDP and turbo parameter modification with MSR on non-overclockable Intel CPU (such as Intel i7-8550U)

TDP and turbo parameter modification with MSR on non-overclockable CPU

Disclaimer

  • MSR modification may void your CPU's (or system board's) warranty. Proceed with care. I'm not responsible for any destruction caused by this article.
  • MSR address (greatly) differs from CPU to CPU. Check your own CPU's MSR address using Intel's documentation.
  • Only tested on Intel i7-8550U (Kaby Lake R).
  • This article is translation of this article. If you can understand Korean, I recommend reading that article, not this.

Start

@nvsofts
nvsofts / lc82162.cfg
Last active November 23, 2017 10:02
OpenOCD config for SANYO LC82162 (ARM7TDMI)
source [find interface/ftdi/um232h.cfg]
transport select jtag
adapter_khz 200
source [find cpu/arm/arm7tdmi.tcl]
jtag newtap lc82162 cpu -irlen 4 -expected-id 0x3f1f0f0f
target create lc82162.cpu arm7tdmi -endian little -chain-position lc82162.cpu
reset_config trst_and_srst
@macrat
macrat / dynamic_typing_assertion.py
Last active September 9, 2017 14:06
pythonの型タイピングを使った動的なassert、の、構想。
import functools
import inspect
import typing
def istype(obj: typing.Any, typ: type) -> bool:
"""
>>> istype(1, int)
True
>>> istype('hoge', int)
@tscholl2
tscholl2 / aes.go
Last active June 20, 2024 08:58
simple AES encryption/decryption example with PBKDF2 key derivation in Go, Javascript, and Python
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"encoding/hex"
"fmt"
"strings"
@ysakasin
ysakasin / code.py
Last active February 11, 2017 08:47
某アニメで主人公が作成していたコード
def __delitem__(self, key):
self.db.delete(self.table, where="session_id=$key", vars= # 見切れている
def cleanup(self, timeout):
timeout = datetime.# 入力中により以後不明