Skip to content

Instantly share code, notes, and snippets.

View KisaragiEffective's full-sized avatar
🔇
sick

Kisaragi KisaragiEffective

🔇
sick
  • Some(_)
  • Hokkaido, Japan
View GitHub Profile

ローカルパッチ

まず手元でパッチを当てるためのブランチを作成。ここではlocal/patchとする。このブランチはpushせず、手元で変更内容を反映したcommitを格納するためだけに使う。

* ここにローカルのパッチ (local/patch)
|
* (origin/main/HEAD)
#!/bin/bash
# The author of this script, KisaragiEffective and Kisaragi Marine, put this script
# under CC0. Please refer https://creativecommons.org/publicdomain/zero/1.0/legalcode to
# its full-text.
red() {
tput setaf 1
}
green() {

excode

外部のコードを実行する。

web版における例:

excode "console.log('An error occurred: 0x'+`0`.toString(16));\n"

`0`, `1`, `2`... というのはその外側の関数の引数の名前 (左から0-based index) に置き換えられるっぽい?

@KisaragiEffective
KisaragiEffective / 20220816-2.md
Created August 16, 2022 07:25
debianからlibwww-perlを消す方法

なぜ?

/usr/bin/GET とかいう一等地を占領しているのが気に食わないため。

方法

# apt remove hw-probe
# apt remove libnet-dbus-perl
# apt remove libwww-perl liblwp-protocol-https-perl

ドキュメントはちゃんと読め (n)

前提

// [email protected]/src/device.rs
#[derive(Debug)]
pub struct Device<'nvml> {
    device: nvmlDevice_t,
    nvml: &'nvml Nvml,
}

前提

$ uname -a
Linux kisaragi-deb11 5.10.0-16-amd64 #1 SMP Debian 5.10.127-2 (2022-07-23) x86_64 GNU/Linux

$ neofetch
       _,met$$$$$gg.          kisaragi@kisaragi-deb11 
    ,g$$$$$$$$$$$$$$$P.       ----------------------- 
  ,g$$P"     """Y$$.".        OS: Debian GNU/Linux 11 (bullseye) x86_64 
 ,$$P' `$$$. Host: FRONTIERDT 2.0 
#!/bin/bash
# This file is under CC-by-SA 3.0, per https://wiki.ubuntulinux.jp/UbuntuTips/Others/ReinstallGrub2.
# To see more info, please visit above page.
efi=$(ls -ld /sys/firmware/efi 2>/dev/null | grep .>/dev/null && echo "1" || echo "0")
echo "block device: " && read X
alias mkdirs="mkdir -p $1"
if [[ "$efi" == "1" ]]; then
echo "boot device: " && read Y
echo "main device: " && read Z
sudo mkdirs /mnt/boot/efi
@KisaragiEffective
KisaragiEffective / expanded.scala
Created March 27, 2021 09:17
IDEAのビルドボタンだとコケる問題
@new _root_.scala.annotation.implicitNotFound("Could not find an instance of PositiveInt for ${T}")
abstract trait PositiveInt[T] extends _root_.scala.Any with _root_.scala.Serializable {
def wrapPositive(int: Int): T;
def asInt(t: T): Int
};
object PositiveInt extends scala.AnyRef {
def <init>() = {
super.<init>();
()
};
@KisaragiEffective
KisaragiEffective / main.md
Last active April 18, 2021 11:28
Wikimedia Commons、T273741の原因とその解決

Wikimedia Commonsの1枚の画像に20%のトラフィックが集まる T273741 ・User-Agent: "" ・Referer: "" ・主にインドから ・IPに規則性は見られない

  1. Mitron TV (インドにおけるTikTokの代替)、Say Nameste (インド版Zoomの代替) がそのファイルをインターネットへ接続されているかどうかを調べるためにゲットする。Say Namasteはビデオの接続をチェックするために。

  2. ファイルを改名してはどうか?

@KisaragiEffective
KisaragiEffective / parse.rb
Created July 15, 2020 08:18
parse web color dict.
require "nokogiri"
require "open-uri"
html = open("https://www.colordic.org")
doc = Nokogiri::HTML.parse(html, nil, "UTF-8")
# [0]: html color name, [1]: actual color code headed '#'
doc.css('table')[0].css("td").map {|x| x.css("a")[0].inner_html.split("<br>") }
# TODO: other format