Skip to content

Instantly share code, notes, and snippets.

@orumin
orumin / avrdude.sh
Last active Apr 4, 2021 — forked from nyomo/avrdude.sh
WSLでavrdudeを簡単に使う為の奴
View avrdude.sh
#!/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 / cov_test.c
Created Nov 11, 2020
coverage test
View cov_test.c
#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 Sep 30, 2020
売れない芸人の名前ジェネレータ
View stage-name-gen.make
.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 Sep 30, 2020
generate madosoft's game title like text
View madosoft-gen.make
.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 Sep 3, 2020
modified tee test
View mdup.c
#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 Aug 21, 2020
daily scoop update script
View scoop_update.ps1
$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 Aug 13, 2020
get Linux line of code
View linux_loc.fish
#/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
View check-microcode-update.sh
#/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
View run
#!/command/execlineb -P
fdmove -c 2 1
if
{
pipeline
{
s6-setuidgid ntp
backtick -n NTPSERVERIP
{