Skip to content

Instantly share code, notes, and snippets.

@kuon
kuon / test.rs
Created Apr 19, 2021
elm architecture in rust
View test.rs
use ten::prelude::*;
use ten::prelude::time::{Time, Instant};
#[derive(Debug)]
pub enum Msg {
Tick(Instant),
}
#[derive(Debug)]
@kuon
kuon / strace.log
Created Apr 14, 2020
aegisub strace log
View strace.log
execve("/usr/bin/aegisub-3.2", ["aegisub-3.2"], 0x7fffa6202880 /* 59 vars */) = 0
brk(NULL) = 0x563f7977b000
arch_prctl(0x3001 /* ARCH_??? */, 0x7ffcfb452670) = -1 EINVAL (Invalid argument)
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=493130, ...}) = 0
mmap(NULL, 493130, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f7bb8145000
close(3) = 0
openat(AT_FDCWD, "/usr/lib/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\22\0\0\0\0\0\0"..., 832) = 832
View good.rs
#![no_std]
#![no_main]
#[allow(unused_imports)]
use panic_semihosting;
use embedded_hal::blocking::delay::DelayMs;
use embedded_hal::digital::v2::OutputPin;
use nrf52840_hal as hal;
use nrf52840_hal::nrf52840_pac as pac;
@kuon
kuon / test.c
Last active Sep 2, 2019
Porting C code to rust
View test.c
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#define FATAL(msg) \
do { \
printf(msg); \
View gist:2c43143e8bb9d2d62637182127f79777
$ fastboot boot twrp-3.2.3-1-enchilada.img 1416ms  lun 10 déc 2018 20:12:28 CET
Downloading 'boot.img'
OKAY [ 0.703s]
booting
OKAY [ 0.072s]
Finished. Total time: 0.789s
View gist:baec1a99a2923ea2cc70dc1220ecacee
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:1d.0/0000:04:00.0/nvme/nvme0':
KERNEL=="nvme0"
SUBSYSTEM=="nvme"
View dev.txt
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:1d.0/0000:04:00.0/nvme/nvme0':
KERNEL=="nvme0"
SUBSYSTEM=="nvme"
View dev.txt
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:1d.0/0000:04:00.0/nvme/nvme0':
KERNEL=="nvme0"
SUBSYSTEM=="nvme"
View dev.txt
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:1d.0/0000:04:00.0/nvme/nvme0':
KERNEL=="nvme0"
SUBSYSTEM=="nvme"
View dev.txt
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:1d.0/0000:04:00.0/nvme/nvme0':
KERNEL=="nvme0"
SUBSYSTEM=="nvme"