Skip to content

Instantly share code, notes, and snippets.

View Na0ki's full-sized avatar
🤔
thinking

ahiru Na0ki

🤔
thinking
View GitHub Profile
@Na0ki
Na0ki / mikutter-don-icon.html
Created December 11, 2022 13:10
mikutterサーバーの丼アイコン錬成するのに使ったやつ
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="text/javascript" src="https://stuk.github.io/jszip/dist/jszip.js"></script>
<script type="text/javascript" src="https://stuk.github.io/jszip/vendor/FileSaver.js"></script>
<title>アイコンジェネレータ</title>
</head>
notice: {MIKUTTER_DIR}/core/serialthread.rb:48:in `force_exit!': all Serial Thread Group jobs canceled.
notice: mikutter.rb:91:in `boot!': raise mainloop exception `NameError'
notice: mikutter.rb:96:in `error_handling!': catch NameError
notice: {MIKUTTER_DIR}/core/configloader.rb:34:in `block in <module:ConfigLoader>': configloader: wrote 2 keys (UserConfig::extract_tabs, UserConfig::ui_tab_order)
#<Thread:0x00007fa8c3baf838 /Users/ahiru/ghq/mikutter/mikutter/plugin/mastodon_sse_streaming/connection.rb:39 aborting> terminated with exception (report_on_exception is true):
/Users/ahiru/ghq/mikutter/mikutter/plugin/mastodon_sse_streaming/connection.rb:39:in `new': can't alloc thread (ThreadError)
from /Users/ahiru/ghq/mikutter/mikutter/plugin/mastodon_sse_streaming/connection.rb:39:in `start'
from /Users/ahiru/ghq/mikutter/mikutter/plugin/mastodon_sse_streaming/connection.rb:49:in `ensure in block in start'
from /Users/ahiru/ghq/mikutter/mikutter/plugin/mastodon_sse_streaming/connection.r
@Na0ki
Na0ki / mikutter-diva_hacks_notice.txt
Last active October 23, 2021 23:41
noticeだけど一応残しとく
notice: {MIKUTTER_DIR}/core/boot/delayer.rb:33:in `block in terminate': undefined method `each' for nil:NilClass
from {MIKUTTER_DIR}/core/lib/diva_hacks/mixin/photo_mixin.rb:179:in `block in finalize_download_as_fail'
from {MIKUTTER_DIR}/core/utils.rb:288:in `block in atomic'
from {MIKUTTER_DIR}/core/utils.rb:288:in `synchronize'
from {MIKUTTER_DIR}/core/utils.rb:288:in `atomic'
from {MIKUTTER_DIR}/core/lib/diva_hacks/mixin/photo_mixin.rb:177:in `finalize_download_as_fail'
from {MIKUTTER_DIR}/core/lib/diva_hacks/mixin/photo_mixin.rb:90:in `block (2 levels) in download!'
from {MIKUTTER_DIR}/vendor/ruby/3.0.0/gems/delayer-deferred-2.2.0/lib/delayer/deferred/chain/base.rb:18:in `activate'
from {MIKUTTER_DIR}/vendor/ruby/3.0.0/gems/delayer-deferred-2.2.0/lib/delayer/deferred/worker.rb:93:in `block (2 levels) in wait_and_activate'
from {MIKUTTER_DIR}/vendor/ruby/3.0.0/gems/delayer-deferred-2.2.0/lib/delayer/deferred/worker.rb:87:in `catch'
const browserSync = require('browser-sync').create();
const asciidoctor = require('@asciidoctor/core')();
const asciidoctorReveiljs = require('@asciidoctor/reveal.js');
asciidoctorReveiljs.register();
browserSync.watch('*.adoc', function(event, file) {
if (event === 'change') {
console.log(`${file} changed. start converting...`);
asciidoctor.convertFile('index.adoc', {safe: 'safe', backend: 'revealjs'});
version: '3.7'
services:
minecraft:
image: openjdk:11.0.7-jre-slim-buster
ports:
- 127.0.0.1:25565:25565
restart: always
command: java -Xms1G -Xmx4G -jar server.jar nogui
tty: true
@Na0ki
Na0ki / result_usb_storage
Last active March 24, 2020 16:15
result of usb_storage.sh
pi@raspberrypi:/opt/rpi-ums2web$ sudo ./usb_storage.sh
+ STORAGE_IMAGE=/opt/rpi-ums2web/usb.img
+ STORAGE_SIZE=128
+ modprobe libcomposite
+ modprobe usb_f_mass_storage
+ mkdir -p /sys/kernel/config/usb_gadget/pistorage
+ cd /sys/kernel/config/usb_gadget/pistorage
+ echo 0x1d6b
+ echo 0x0104
+ echo 0x0100
@Na0ki
Na0ki / versioncheck.py
Last active March 13, 2020 09:54
check for gitlab container updates
import subprocess
import sys
import os
import json
import re
import urllib.request
def find(iterable, pred):
return next(filter(pred, iterable), None)
@Na0ki
Na0ki / mackerel_check_ssl.sh
Last active March 7, 2020 01:58
指定したドメイン名の証明書期限(notAfter)までの残日数を返すだけのやつ
#!/bin/bash
set -ue
targets=("example.com")
targets_metric_name=("ex")
now=$(date "+%s")
function remaining() {
local expiresAt=$(echo | openssl s_client -connect $1:443 2>&1 | openssl x509 -dates -noout|grep notAfter|sed -e 's/notAfter=//g'| xargs -i date -d "{}" "+%s")
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>麦子.moe</title>
<style>
.container {
@Na0ki
Na0ki / dstat
Created January 24, 2020 04:56
24-01 13:27:27 - 24-01 13:29:30 が詰まり発生時刻(改行を入れてある)
----system---- --total-cpu-usage-- -dsk/total- -net/total- ---paging-- ---system-- ------tcp-sockets------- ---file-locks--
time |usr sys idl wai stl| read writ| recv send| in out | int csw |lis act syn tim clo |pos lck rea wri
24-01 13:26:51| 0 0 99 0 0| 0 0 |6371B 9625B| 0 0 |1855 2812 | 15 291 2 53 3| 0 8.0 1.0 8.0
24-01 13:26:52| 0 0 100 0 0| 0 0 |8316B 12k| 0 0 |1779 2732 | 15 289 2 53 3| 0 8.0 1.0 8.0
24-01 13:26:53| 0 0 99 0 0| 0 512k|5138B 5496B| 0 0 |1830 3093 | 15 286 2 54 3| 0 8.0 1.0 8.0
24-01 13:26:54| 1 0 99 0 0| 0 0 | 43k 44k| 0 0 |2088 3426 | 15 286 1 52 3| 0 8.0 1.0 8.0
24-01 13:26:55| 0 0 99 0 0| 0 992k| 17k 30k| 0 0 |2045 3509 | 15 289 1 52 3| 0 8.0 1.0 8.0
24-01 13:26:56| 0 0 99 0 0| 0 0 | 24k 25k| 0 0 |2079 3297 | 15 288 1 52 3| 0 8.0 1.0 8.0
24-01 13:26:57| 0 0 99 0