Skip to content

Instantly share code, notes, and snippets.

@zunda
zunda / 240718-redis-upgrade.sh
Created July 18, 2024 19:15
2024年7月18日のZundonのRedisのバージョンの更新
p=zundan-mastodon
s=zundan-mastodon-streaming
heroku maintenance:on -a $p
heroku maintenance:on -a $s
heroku ps:scale web=0 -a $p
# schedulerは止める
heroku ps:scale web=0 -a $s
# 他にも生きてるジョブがあるみたい。止める
Running 'yarn install' with yarn.lock
➤ YN0000: · Yarn 4.2.2
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + typescript@patch:typescript@npm%3A5.5.2#optional!builtin<compat/typescript>::version=5.5.2&hash=b45daf
➤ YN0085: │ - typescript@patch:typescript@npm%3A5.5.2#optional!builtin<compat/typescript>::version=5.5.2&hash=379a07
➤ YN0000: └ Completed in 0s 446ms
➤ YN0000: ┌ Post-resolution validation
➤ YN0002: │ @mastodon/mastodon@workspace:. doesn't provide redux (p7a946), requested by react-redux-loading-bar.
➤ YN0086: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code.
➤ YN0000: │
@zunda
zunda / syslog.txt
Created June 19, 2024 01:28
家サーバにUSB経由で外付けしている2台のハードディスクドライブが見えなくなってしまった。普段ならラベルで/backup1と/backup2にマウントしているが、mountしようとするとcan't find LABELとなる。ハードディスクの箱の経年劣化なんだろうなあ。
Jun 17 13:24:46 kuroan kernel: [238257.793837] usb 1-3: reset high-speed USB device number 2 using xhci_hcd
Jun 17 13:24:47 kuroan kernel: [238257.921536] usb 1-3: device descriptor read/64, error -71
Jun 17 13:24:47 kuroan kernel: [238258.157541] usb 1-3: device descriptor read/64, error -71
Jun 17 13:24:47 kuroan kernel: [238258.393545] usb 1-3: reset high-speed USB device number 2 using xhci_hcd
Jun 17 13:24:47 kuroan kernel: [238258.521545] usb 1-3: device descriptor read/64, error -71
Jun 17 13:24:47 kuroan kernel: [238258.757546] usb 1-3: device descriptor read/64, error -71
Jun 17 13:24:48 kuroan kernel: [238258.993551] usb 1-3: reset high-speed USB device number 2 using xhci_hcd
Jun 17 13:24:48 kuroan kernel: [238258.993672] usb 1-3: Device not responding to setup address.
Jun 17 13:24:48 kuroan kernel: [238259.201419] usb 1-3: Device not responding to setup address.
Jun 17 13:24:48 kuroan kernel: [238259.409515] usb 1-3: device not accepting address 2, error -71
@zunda
zunda / paths.txt
Created February 20, 2024 02:59
Let's Encryptで証明書ができるとGETリクエストが来るパスの例
/
/.DS_Store
/.env
/.git/config
/.vscode/sftp.json
/?rest_route=/wp/v2/users/
/_all_dbs
/about
/config.json
/debug/default/view?panel=config
@zunda
zunda / log.sh
Last active December 13, 2023 23:06
ruby-masterでbootsnap
$ cd ~/c/src/github.com/ruby/ruby
$ git switch master
$ git pull
$ git rev-parse HEAD
31c0ea20e5492925ac971991937e30524da5043d
$ git clean -dxf
$ ./autogen.sh
$ mkdir build && cd build
$ mkdir ~/.rubies
$ ../configure --prefix="${HOME}/.rubies/ruby-master" --disable-install-doc
@zunda
zunda / log.txt
Created September 6, 2023 19:57
Mastodonがバックトレースをぜんぶ記録するようになっちゃった
pid=65 tid=742h WARN: Stoplight::Error::RedLight: https://example.com/inbox
pid=65 tid=742h WARN: /app/vendor/bundle/ruby/3.2.0/gems/stoplight-3.0.2/lib/stoplight/light/runnable.rb:50:in `run_red'
/app/vendor/bundle/ruby/3.2.0/gems/stoplight-3.0.2/lib/stoplight/light/runnable.rb:25:in `run'
/app/app/workers/activitypub/delivery_worker.rb:75:in `perform_request'
/app/app/workers/activitypub/delivery_worker.rb:36:in `perform'
/app/vendor/bundle/ruby/3.2.0/gems/sidekiq-6.5.9/lib/sidekiq/processor.rb:202:in `execute_job'
/app/vendor/bundle/ruby/3.2.0/gems/sidekiq-6.5.9/lib/sidekiq/processor.rb:170:in `block (2 levels) in process'
/app/vendor/bundle/ruby/3.2.0/gems/sidekiq-6.5.9/lib/sidekiq/middleware/chain.rb:177:in `block in invoke'
/app/vendor/bundle/ruby/3.2.0/gems/sidekiq-unique-jobs-7.1.29/lib/sidekiq_unique_jobs/middleware.rb:36:in `call'
/app/vendor/bundle/ruby/3.2.0/gems/sidekiq-6.5.9/lib/sidekiq/middleware/chain.rb:179:in `block in invoke'
@zunda
zunda / crawl-activitypub.rb
Last active January 31, 2024 22:02
crawler to measure size distribution of ActivityPub servers
#
# crawler to measure size distribution of ActivityPub servers
#
# usage: ruby crawl-activitypub.rb [initial-hostname]
# Creates a TSV file: apstat-%Y%m%d.tsv
#
# Copyright 2023 by zunda
#
# Permission is granted for use, copying, modification, distribution,
# and distribution of modified versions of this work as long as the
@zunda
zunda / 00.patch
Created May 2, 2023 19:15
Zundonにmp3をアップロードしようとした時のバックトレース May 02 19:09:14 UTC
index 288f847f17..a309c3f929 100644
--- a/app/controllers/api/v2/media_controller.rb
+++ b/app/controllers/api/v2/media_controller.rb
@@ -6,7 +6,10 @@ class Api::V2::MediaController < Api::V1::MediaController
render json: @media_attachment, serializer: REST::MediaAttachmentSerializer, status: @media_attachment.not_processed? ? 202 : 200
rescue Paperclip::Errors::NotIdentifiedByImageMagickError
render json: file_type_error, status: 422
- rescue Paperclip::Error
+ rescue Paperclip::Error => e
+ Rails.logger.error 'Paperclip::Error'
@zunda
zunda / .ruby-version
Last active May 29, 2023 20:48
Crawl rel="me" links
3.2.1
@zunda
zunda / inspect-marshal-dump.rb
Last active March 17, 2023 01:50
Trying to parse marshaled object
# https://docs.ruby-lang.org/ja/latest/doc/marshal_format.html
class MarshalDump
class DumpedClass
attr_reader :class_name, :parent, :ivars, :dump
def initialize(class_name)
@class_name = class_name
end
def set_parent(parent)