Skip to content

Instantly share code, notes, and snippets.

View sharl's full-sized avatar
🐰

Sharl Morlaroll sharl

🐰
View GitHub Profile
@sharl
sharl / casinoraid_vvox.py
Created November 30, 2023 07:35
ドラゴンクエストⅩ 第5回 みんなでカジノレイド 大挑戦! の進捗をずんだもんがしゃべってくれるやつ
# -*- coding: utf-8 -*-
import json
import requests
import pyaudio
host = '127.0.0.1'
port = 50021
def vvox(text):
@sharl
sharl / fan.sh
Created October 14, 2023 20:34
ReadyNAS 6.10.x cpu temp and fan monitor
#!/bin/bash
BASE=/sys/devices/platform/soc/soc:internal-regs/d0011000.i2c/i2c-0/0-003e/hwmon/hwmon0
target=${BASE}/fan1_target
input=${BASE}/fan1_input
if [ ! -z "$*" ]; then
if [[ $1 =~ ^[0-9]+$ ]]; then
echo $1 > ${target}
fi
@sharl
sharl / dqxraid.py
Created August 28, 2023 08:40
つよさ予報からアストルティア防衛軍の全兵団襲撃を抽出
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# つよさ予報からアストルティア防衛軍の全兵団襲撃を抽出
import requests
from bs4 import BeautifulSoup
base_url = 'https://hiroba.dqx.jp/sc/tokoyami/'
r = requests.get(base_url, timeout=10)
@sharl
sharl / emacs.rb
Created February 21, 2012 03:13
Yet Another Emacs 23.4 homebrew Formula
require 'formula'
class Emacs < Formula
url 'http://ftp.gnu.org/pub/gnu/emacs/emacs-23.4.tar.bz2'
md5 '070c68ad8e3c31fb3cb2414feaf5e6f0'
homepage 'http://www.gnu.org/software/emacs/'
if ARGV.include? "--use-git-head"
head 'git://git.sv.gnu.org/emacs.git'
else
@sharl
sharl / update-cuda-repo-wsl-ubuntu.sh
Created March 21, 2023 10:27
update-cuda-repo-wsl-ubuntu.sh
#!/bin/bash
# -*- coding: utf-8 -*-
echo 'rm -f ./*.deb'
curl -s https://developer.nvidia.com/cuda-downloads | pup | \
sed -e 's/.*jQuery.extend(Drupal.settings,\(.*\));/\1/p;d' | \
jq -r '.cuda_download_pages.releases["Linux/x86_64/WSL-Ubuntu/2.0/deb_local"].details' | \
pup '.cudaBashBlock text{}'
#!/bin/bash
# -*- coding: utf-8 -*-
OPENSSL_CMD=$(which openssl)
if [[ $OSTYPE =~ ^darwin ]]; then
OPENSSL_CMD=$(ls -1 /usr/local/Cellar/openssl*/*/bin/openssl | tail -1)
if [ "x${OPENSSL_CMD}" = "x" ]; then
echo "need to: brew install openssl"
exit 1
fi
fi
@sharl
sharl / gist:5435276
Created April 22, 2013 13:53
Master of Epic クライアント起動時の通信内容
以下 UDP による通信
local → 202.232.117.40:11300
00 00 00 03 02
202.232.117.40:11300 → local
00 00 00 03 00 00 00 03
~~~~~~~~~~~
@sharl
sharl / gist:272ac279d2d61cad017417f6a763ab10
Created June 24, 2022 08:50
~/.config/youtube-dl/config
-f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best'
-o ~/Movies/%(title)s.%(ext)s
--- a/ircbot.js
+++ b/ircbot.js
@@ -145,7 +145,7 @@ async function amedasget(posname)
const day = ('0'+cur.getDate()).slice(-2);
const hour = ('0'+cur.getHours()).slice(-2);
const targetTime = `${year}${month}${day}_${hour}`;
- // const targetIndex = `${year}${month}${day}${hour}0000`;
+ const targetBase = `${year}${month}${day}${hour}0000`;
const responses = [];
for ( key in point ) {
@sharl
sharl / wsl-sshd-startup.md
Last active June 29, 2020 07:57
WSL sshd startup

WSL1向け

/etc/ssh/ssh_host_rsa_key

ホストキーがないので生成

$ sudo ssh-keygen -t rsa -N '' -f /etc/ssh/ssh_host_rsa_key