Skip to content

Instantly share code, notes, and snippets.

@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 / rar2zip.sh
Last active August 12, 2020 08:37 — forked from ferdnyc/rar2zip.sh
Conversion from rar to zip (ported to macos)
#!/bin/bash
#
# rar2zip conversion script
# Based on: https://shkspr.mobi/blog/2016/12/converting-rar-to-zip-in-linux/
#
# Usage: rar2zip.sh file [file ...]
echo "Converting RARs to ZIPs"
# Use /tmp for temporary files.
syuu@X1CARBON:~$ sudo parted /dev/sda
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Model: Msft Virtual Disk (scsi)
Disk /dev/sda: 275GB
Sector size (logical/physical): 512B/4096B
Partition Table: loop
Disk Flags:
syuu@X1CARBON:~$ genie -c /bin/bash
syuu@X1CARBON-wsl:~$ ps axf
PID TTY STAT TIME COMMAND
769 pts/0 S 0:00 /sbin/runuser -u syuu -- /lib/genie/runinwsl.sh /bin/bash
770 pts/0 S 0:00 \_ /bin/bash
782 pts/0 R+ 0:00 \_ ps axf
1 ? Ss 0:00 /lib/systemd/systemd
49 ? S<s 0:00 /lib/systemd/systemd-journald
53 ? Ss 0:00 /sbin/lvmetad -f
57 ? Ss 0:00 /lib/systemd/systemd-udevd
syuu@X1CARBON:/mnt/c/Users/syuu$ dmesg
[ 0.000000] Linux version 4.19.84-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Wed Nov 13 11:44:37 UTC 2019 [ 0.000000] Command line: initrd=\initrd.img panic=-1 pty.legacy_count=0 nr_cpus=8
[ 0.000000] KERNEL supported cpus:
[ 0.000000] Intel GenuineIntel
[ 0.000000] AMD AuthenticAMD
[ 0.000000] Centaur CentaurHauls
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
[ 0.000000] x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256 [ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.905463] usb usb4: SerialNumber: 0000:03:00.4
[ 0.905547] hub 4-0:1.0: USB hub found
[ 0.905567] hub 4-0:1.0: 1 port detected
[ 0.905673] xhci_hcd 0000:03:00.4: xHCI Host Controller
[ 0.905712] xhci_hcd 0000:03:00.4: new USB bus registered, assigned bus number 5
[ 0.905736] xhci_hcd 0000:03:00.4: Host supports USB 3.1 Enhanced SuperSpeed
[ 0.905781] usb usb5: We don't know the algorithms for LPM for this host, disabling LPM.
[ 0.905820] usb usb5: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.05
[ 0.905845] usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 0.905868] usb usb5: Product: xHCI Host Controller