Skip to content

Instantly share code, notes, and snippets.

[syuu@devil ~]$ sudo hdparm -i /dev/sdc
/dev/sdc:
Model=HGST HTS541010A9E680, FwRev=JA0OA560, SerialNo=JA100A1F2Y832M
Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }
RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4
BuffType=DualPortCache, BuffSize=8192kB, MaxMultSect=16, MultSect=16
CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=1953525168
IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
@syuu1228
syuu1228 / coredumptest.py
Created July 10, 2023 11:29
coredumptest
#!/usr/bin/python3
import os
import signal
import socket
import time
from selectors import DefaultSelector, EVENT_READ
from http.server import HTTPServer, SimpleHTTPRequestHandler
interrupt_read, interrupt_write = socket.socketpair()
@syuu1228
syuu1228 / 0001docomo-nmcli.txt
Last active June 4, 2023 19:36
Linuxのコマンドラインから0001docomoに接続
$ nmcli connection add type wifi ifname wlo1 con-name 0001docomo ssid 0001docomo
Connection '0001docomo' (a6fde1b0-6055-4e6c-a314-05027eb6083a) successfully added.
$ nmcli con edit id 0001docomo
===| nmcli interactive connection editor |===
Editing existing '802-11-wireless' connection: '0001docomo'
Type 'help' or '?' for available commands.
Type 'print' to show all the connection properties.
@syuu1228
syuu1228 / hmac.tar.gz
Last active May 15, 2023 07:53
hmac.tar.gz
./.libcrypto.so.1.1.1k.hmac0000644000000000000000000000010114030716735014056 0ustar rootroot9b44646da75a74145ded9aa349b79ceac1bd3e9e41a89f32259841a0900348a6
#!/usr/bin/python3
import re
with open('/etc/chrony/chrony.conf') as f:
chrony_conf = f.read()
chrony_conf = re.sub(r'^(pool .*$)', '# \\1', chrony_conf, flags=re.MULTILINE)
with open('/etc/chrony/chrony.conf', 'w') as f:
@syuu1228
syuu1228 / macOS_smbfs_crash.txt
Created December 12, 2022 12:39
macOS smbfs crash
panic(cpu 4 caller 0xfffffe001335f2f0): watchdog timeout: no checkins from watchdogd in 91 seconds (190 total checkins since monitoring last enabled)
Debugger message: panic
Memory ID: 0x6
OS release type: User
OS version: 22A400
Kernel version: Darwin Kernel Version 22.1.0: Sun Oct 9 20:14:30 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T8103
Fileset Kernelcache UUID: 45C5EC70B9F83105E3F59CFE0A124F15
Kernel UUID: 0BFE6A5D-118B-3889-AE2B-D34A0117A062
Boot session UUID: C3C94A9E-8C1E-4A89-809D-E949D951715B
iBoot version: iBoot-8419.41.10
@syuu1228
syuu1228 / msireg.c
Created January 6, 2012 03:18
Register Dump Tool for MSI Address Register & MSI Data Register / GPLv2
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <pci/pci.h>
#define FLAG(x,y) ((x & y) ? '+' : '-')
/*
* Constants for Intel APIC based MSI messages.
@syuu1228
syuu1228 / arm-mmap.s
Last active December 8, 2021 21:20
Linux/arm EABI system call sample program
@ This is Linux/arm EABI system call sample program.
@
@ Build with following command:
@ as -o arm-mmap.o arm-mmap.s
@ ld -o arm-mmap arm-mmap.o
@
@ You can see the program issues system calls by following command:
@ strace ./arm-mmap
@
#!/bin/bash
. /etc/os-release
if [ "$ID" = "ubuntu" ] || [ "$ID" = "debian" ]; then
if [ "$VERSION_ID" = "14.04" ]; then
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get -y update
fi
apt-get install -y libaio-dev ninja-build ragel libhwloc-dev libnuma-dev libpciaccess-dev libcrypto++-dev libboost-all-dev libxen-dev libxml2-dev xfslibs-dev libgnutls28-dev liblz4-dev libsctp-dev gcc make
# setting up irq affinity according to /proc/interrupts
# 2008-11-25 Robert Olsson
# 2009-02-19 updated by Jesse Brandeburg
#
# > Dave Miller:
# (To get consistent naming in /proc/interrups)
# I would suggest that people use something like:
# char buf[IFNAMSIZ+6];
#
# sprintf(buf, "%s-%s-%d",