Skip to content

Instantly share code, notes, and snippets.

@orumin
orumin / get_logos.sh
Last active January 4, 2022 12:04
mirakc: 局ロゴ取得
#!/bin/sh
services=`curl -sSL http://localhost:40772/api/services`
len=`echo $services | jq length`
cat<<EOF > config_logo.yml
resource:
logos:
EOF
@orumin
orumin / avrdude.sh
Last active April 4, 2021 08:53 — forked from nyomo/avrdude.sh
WSLでavrdudeを簡単に使う為の奴
#!/bin/bash
if [ $# != 1 ]; then
echo "usage: $0 <target firmware>.hex"
exit 0
fi
read -p "target file is $1. correct? [Yn] " yn
case "$yn" in
"" | [yY]*);;
@orumin
orumin / 00_nandgame.com_answer.adoc
Last active April 15, 2024 18:14
Optimal answer for Nandgame.com

Invert

01 inv

And

02 and

Or

@orumin
orumin / cov_test.c
Created November 11, 2020 00:05
coverage test
#include <stdio.h>
#include <stdlib.h>
void usage(char *cmd)
{
fprintf(stderr, "%s: you need to pass arguments at least 1\n", cmd);
return;
}
int main(int argc, char **argv)
@orumin
orumin / stage-name-gen.make
Created September 30, 2020 08:35
売れない芸人の名前ジェネレータ
.PHONY: all unpack
GEO_DICT=SKK-JISYO.geo.utf8
EN_DICT=SKK-JISYO.edict.utf8
DICTS=$(GEO_DICT) $(EN_DICT)
WORD_LISTS=2ch-words.txt 6ch-words.txt
all: $(WORD_LISTS)
@for i in `seq 50`; \
@orumin
orumin / madosoft-gen.make
Last active September 30, 2020 18:35
generate madosoft's game title like text
.PHONY: all yakisuto namadere wagahai unpack
JA_DICT=SKK-JISYO.L.utf8
EN_DICT=SKK-JISYO.edict.utf8
DICTS=$(JA_DICT) $(EN_DICT)
WORD_LISTS=4ch-words.txt 6ch-words.txt en-words-ea5.txt en-words-n5.txt en-words-ic.txt
all: $(WORD_LISTS)
@for i in `seq 5`; \
@orumin
orumin / mdup.c
Last active September 3, 2020 05:48
modified tee test
#include <sys/types.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#define check(v) \
do { \
if ((v) < 0) { \
@orumin
orumin / scoop_update.ps1
Last active August 21, 2020 09:15
daily scoop update script
$action = New-ScheduledTaskAction -Execute "scoop.exe" -Argument "update"
$trigger = New-ScheduledTaskTrigger -DaysInterval 1 -Daily -At "14:00 PM"
$settings = New-ScheduledTaskSettingsSet -Hidden
$user = $env:username
Register-ScheduledTask -TaskPath \ -TaskName scoop_update -Action $action -Trigger $trigger -User $user -Settings $settings
Enable-ScheduledTask -TaskPath \ -TaskName scoop_update
Start-ScheduledTask -TaskPath \ -TaskName scoop_update
@orumin
orumin / linux_loc.fish
Last active August 13, 2020 09:48
get Linux line of code
#/usr/bin/fish
curl -LO https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.8.tar.xz
tar -xJf linux-5.8.tar.xz
cd linux-5.8
for i in ( find . -maxdepth 1 -type d ! \( -name '.*' -o -name 'Documentation' -o -name 'LICENSES' -o -name 'samples' -o -name 'scripts' -o -name 'tools' \) )
echo $i;
cloc $i;
end > ../linux_loc.txt
#/bin/sh
echo `grep 'cpu family\|stepping\|model' /proc/cpuinfo | grep -v 'model name' | sort | uniq | awk -F':' '{print $2}' | tr -d ' ' | tr '\n' '-' | sed 's/-$/\n/'`/`sed 's/^0x//' /sys/devices/system/cpu/cpu0/microcode/processor_flags` | xargs -I{} bzgrep {} /usr/share/doc/intel-microcode-*/releasenote.bz2