Skip to content

Instantly share code, notes, and snippets.

View elderica's full-sized avatar
🚞
I'm enjoing with trains and computers.

elderica

🚞
I'm enjoing with trains and computers.
View GitHub Profile
# morimorihoge screenrc
escape \233\233
zombie
hardstatus on
defbce on
# Protection from attacks
multiuser off
@elderica
elderica / Makefile
Created February 14, 2023 09:48
compile each .cpp file
TARGETS := $(subst .cpp,,$(wildcard *.cpp))
CXXFLAGS ?= -Wall -Wextra -O2 -g
all: $(TARGETS)
clean:
rm -f $(TARGETS)
.PHONY: clean
@elderica
elderica / Tokyo Night Night.theme
Created January 18, 2023 11:15
TokyoNight Night for fish-shell
# name: 'Tokyo Night Night'
# preferred_background: 1a1b26
# url: 'https://github.com/chriskempson/tomorrow-theme'
fish_color_normal c0caf5
fish_color_command 7dcfff
fish_color_keyword bb9af7
fish_color_quote e0af68
fish_color_redirection c0caf5
fish_color_end ff9e64
struct XOR64 {
x: u64,
}
impl XOR64 {
fn new(seed: u64) -> Self {
Self {
x: seed ^ 88172645463325252,
}
}
#lang racket
(struct plan
(type
data-amount
price)
#:transparent)
(define plans-voice
(vector
@elderica
elderica / iijmio.py
Created January 8, 2023 13:32
IIJmio Mobile Planner
from collections import namedtuple
from itertools import product
from functools import reduce
from pprint import PrettyPrinter
Plan = namedtuple('Plan', ['type', 'data_amount', 'price'])
plans_voice = [
Plan(type='voice', data_amount=2, price=850),
Plan(type='voice', data_amount=4, price=990),
@elderica
elderica / 1_9.png
Last active October 10, 2022 08:27
1_9.png
@elderica
elderica / sderror.txt
Created August 28, 2022 06:37
Stable Diffusion MIOpen error
0it [00:00, ?it/s]MIOpen(HIP): Error [Do] 'amd_comgr_do_action(kind, handle, in.GetHandle(), out.GetHandle())' AMD_COMGR_ACTION_COMPILE_SOURCE_TO_BC: ERROR (1)
MIOpen(HIP): Error [BuildHip] comgr status = ERROR (1)
MIOpen(HIP): Warning [BuildHip] In file included from /tmp/comgr-5f7d18/input/naive_conv.cpp:1:
In file included from /tmp/hip_pch.1266/hip_pch.h:1:
In file included from /build/hip-runtime-amd/src/HIP-rocm-5.2.3/include/hip/hip_runtime.h:54:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../include/c++/12.1.1/thread:44:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../include/c++/12.1.1/bits/this_thread_sleep.h:36:
/usr/lib64/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../include/c++/12.1.1/bits/chrono.h:650:36: error: no matching conversion for functional-style cast from 'const duration<long, std::ratio<1, 1>>' to '__cd' (aka 'duration<long, ratio<num, den>>')
return __cd(__cd(__lhs).count() - __cd(__rhs).count());
@elderica
elderica / sdrocm.md
Last active September 3, 2023 05:22
Stable Diffusion with ROCm and ArchLinux
  1. arch4edu リポジトリを追加する。
  2. paru -Syu rocm-hip-sdk rocm-opencl-sdk python-pytorch-rocm python-torchvision-rocm python-numpy yq
  3. virtualenv --system-site-packages sdenv
  4. source sdenv/bin/activate
  5. git clone https://github.com/CompVis/stable-diffusion.git && cd stable-diffusion
  6. yq '.dependencies[].pip?[]' environment.yaml | sed 's/"//g' | xargs -L1 pip install
  7. https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt からチェックポイントファイルを入手して、 models/ldm/stable-diffusion-v1/model.ckpt に置く
  8. python scripts/txt2img.py --prompt "a photograph of an astronaut riding a horse" --plms
This file has been truncated, but you can view the full file.
<!DOCTYPE html
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--
This HTML was auto-generated from MATLAB code.
To make changes, update the MATLAB code and republish this document.
--><title>ddsk</title><meta name="generator" content="MATLAB 9.12"><link rel="schema.DC" href="http://purl.org/dc/elements/1.1/"><meta name="DC.date" content="2022-08-07"><meta name="DC.source" content="ddsk.m"><style type="text/css">
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';c