Skip to content

Instantly share code, notes, and snippets.

View 74th's full-sized avatar

Atsushi Morimoto 74th

View GitHub Profile
@74th
74th / toggle-terminal.py
Created May 16, 2021 02:42 — forked from zidizei/toggle-terminal.sh
Toggle your GNOME Terminal window with a keyboard shortcut under Linux.
#!/bin/python
import time
import subprocess
TERMINAL_APP = "gnome-terminal"
def run(command: list[str]) -> list[str]:
return subprocess.run(command, capture_output=True, encoding="ascii").stdout.strip().splitlines()
def toggle_terminal():
@74th
74th / sk1812mini.py
Created May 4, 2021 00:13
SK1812Mini for Raspberry Pi PICO
import array, time
from machine import Pin
import rp2
@rp2.asm_pio(sideset_init=rp2.PIO.OUT_LOW, out_shiftdir=rp2.PIO.SHIFT_LEFT, autopull=True, pull_thresh=24)
def _ws2812():
T1 = 2
T2 = 5
T3 = 3
wrap_target()
@74th
74th / ccs811.py
Created May 4, 2021 00:12
CCS811 MicroPython for Raspberry Pi PICO
import time
from machine import I2C, Pin
_ADDR = 0x5B
class CCS811:
def __init__(self, i2c: I2C):
self._i2c = i2c
@74th
74th / lcd.py
Created May 3, 2021 01:19
Raspberry Pi PICO から LCD AQM1602 への書き込み
from machine import I2C, Pin
import time
_AQM1602_ADDR = 0x3E
class LCD:
def __init__(
self,
i2c: I2C,
@74th
74th / fio.sh
Created December 30, 2020 00:30
fio
set -xe
fio -io_size=30g -runtime=10 -direct=1 -invalidate=1 -ioengine=posixaio -iodepth=1 -group_reporting -rw=read -size=30g -directory=./ -bs=20m -numjobs=1 -name=sequencial-read -output=./sequencial-read.txt
fio -io_size=30g -runtime=10 -direct=1 -invalidate=1 -ioengine=posixaio -iodepth=1 -group_reporting -rw=write -size=30g -directory=./ -bs=20m -numjobs=1 -name=sequencial-read -output=./sequencial-write.txt
fio -io_size=1g -runtime=10 -direct=1 -invalidate=1 -ioengine=posixaio -iodepth=1 -group_reporting -rw=randread -size=1g -directory=./ -bs=4k -numjobs=1 -name=random-read-4KB-1Thread -output=./random-read-4K-1Thread.txt
fio -io_size=1g -runtime=10 -direct=1 -invalidate=1 -ioengine=posixaio -iodepth=1 -group_reporting -rw=randwrite -size=1g -directory=./ -bs=4k -numjobs=1 -name=random-read-4KB-1Thread -output=./random-read-4K-1Thread.txt
fio -io_size=1g -runtime=10 -direct=1 -invalidate=1 -ioengine=posixaio -iodepth=1 -group_reporting -rw=randread -size=1g -directory=./ -bs=4k -numjobs=8 -name=random
@74th
74th / toc.md
Last active May 19, 2021 02:41
VS Code Meetup Book 目次
@74th
74th / Keyboard.md
Last active March 8, 2022 04:05
Lily58インスパイア自作キーボードキットの頒布について

一昨年の冬以降、Lily58 Proを2つ買わせていただき、私にとって自作キーボードにハマるきっかけとなり、非常に楽しく使わせていただいていました。

どうしても以下の点を実現したく、自作キーボードを設計しました。

  • 薄型キースイッチ Kailh Choc V2 を使うこと
  • キー交換可能なようにソケットを使うこと
  • Lily58のように、縦に揃ったキー配置であること
  • Lily58のように、十分キーの数が多いこと
  • Lily48のように、Pro Microをキーの横に配置してキーボード自体を薄くすること
  • キーを片手に2つ追加することで、一般的なキー配置にキーの場所を近づけること
@74th
74th / keyboard_parts.md
Last active September 3, 2020 11:24
自作キーボードの部品
@74th
74th / main.go
Last active July 24, 2020 08:25
gRPC Revese Proxy
// https://github.com/golang/go/issues/29928#issuecomment-458743053
package main
import (
"crypto/tls"
"flag"
"log"
"net"
"net/http"
"net/http/httputil"
@74th
74th / macbookair2020-install-ubuntu.md
Last active August 20, 2023 03:37
MacBookAir(2020) へ のUbuntuのインストール

MacBookAir9,1(2020)へ の Ubuntu 20.04 のインストール (installing Ubuntu 20.04 to MacBookAir9,1(2020))

MacBookPro でも動作すると思います。(The followings work on other MacBookPro.)

自分の環境では、以下は動作しませんでした。(WiFi on MacBookAir does not work on my machine.)

  • WiFi : USB の外付け WiFi アダプタで代用 (I use USB WiFi Adapter instead of WiFi on MacBookAir.)

資料(References)