Skip to content

Instantly share code, notes, and snippets.

tateisu tateisu

Block or report user

Report or block tateisu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:9e31c50ad07c34487c4c92ec5448f578
["2019-10-13 22:58:19 +0900,twittersupport,mastodon.social",
"2019-10-14 20:50:46 +0900,Noshigo,mastodon.social",
"2019-10-15 09:06:07 +0900,darkmagepr,mastodon.social",
"2019-10-17 18:50:41 +0900,clad_ask,mastodon.social",
"2019-10-18 00:31:35 +0900,DocTwo,mastodon.social",
"2019-10-18 18:47:04 +0900,vemus,mastodon.social",
"2019-10-19 12:48:15 +0900,teamvass,mastodon.social",
"2019-10-22 20:25:54 +0900,moritz,mastodon.social",
"2019-10-24 04:10:37 +0900,Unknown283,mastodon.social",
"2019-10-25 15:23:05 +0900,ruimou,mastodon.social",
View print.sh
#!/bin/ash
echo "count=$#, 1=$1, 2=$2"
View removeSpam2.pl
#!/usr/bin/perl --
# プロフィールの表のの中のURLのホスト名のIPアドレスが特定の値ならサスペンドします。
# usage:
# export PSQL="docker exec mastodon1_db_backend_1 psql -U user database"
# export RAILS_CONSOLE=""docker-compose run --rm web bundle exec rails console"
# perl removeSpam2.pl --userDomain=mastodon.social 185.117.119.170
use strict;
@tateisu
tateisu / checkRetry.pl
Last active Oct 28, 2019
check sidekiq retry
View checkRetry.pl
#!/usr/bin/perl
use strict;
use warnings;
use JSON::XS;
use Data::Dump qw(dump);
open(my $fh,"-|","docker exec mastodon1_redis_1 redis-cli zrange retry 0 -1")
or die "can't open redis-cli. $!";
View gist:647f9149ad6e2bf54dc4a369b5d6c6b4
select count(*) as c,domain from accounts
where exists(select from follows left join accounts as a2 on a2.id=follows.account_id
where a2.domain is null and target_account_id=accounts.id)
group by domain order by c desc limit 100;
c | domain
------+-------------------------------
1476 | pawoo.net
1186 | mstdn.jp
396 |
View gist:531cd72134a37a12c2ec5501636ac3c7
# select * from account_aliases ;
id | account_id | acct | uri | created_at | updated_at
----+------------+------+-----+------------+------------
(0 rows)
View gist:f5e4fce826c9a240a0a13a26bbde3948
web_1 | [77bc3d7c-698f-4ae6-a06c-982e517b8916] method=POST path=/settings/aliases format=html controller=Settings::AliasesController action=create status=500 error='ActionView::MissingTemplate: Missing template settings/aliases/show, settings/base/show, application/show with {:locale=>[:ja, :en], :formats=>[:html], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby, :haml]}. Searched in:
web_1 | * "/opt/mastodon/app/views"
web_1 | * "/opt/mastodon/vendor/bundle/ruby/2.6.0/gems/doorkeeper-5.2.0/app/views"
web_1 | * "/opt/mastodon/vendor/bundle/ruby/2.6.0/gems/devise-4.7.1/app/views"
web_1 | * "/opt/mastodon/vendor/bundle/ruby/2.6.0/gems/kaminari-core-1.1.1/app/views"
web_1 | * "/opt/mastodon/vendor/bundle/ruby/2.6.0/gems/pghero-2.3.0/app/views"
web_1 | ' duration=48.89 view=0.00 db=5.22
web_1 | [77bc3d7c-698f-4ae6-a06c-982e517b8916]
web_1 | [77bc3d7c-698f-4ae6-a06c-982e517b8916] ActionView::MissingTemplate (Missing template settings/aliases/show, settings/base/show, application/show with {
@tateisu
tateisu / gist:1616e73dec3602e1c673662873713320
Created Sep 19, 2019
Wi-Fiアダプタの速度計測をやってみる。
View gist:1616e73dec3602e1c673662873713320
Wi-Fiアダプタを買ったのでLANの速度計測をやってみる。
* 測定に使うソフト
iperfを使う。
* 無線LAN環境
NEC Aterm WG2600HP
壁式鉄筋の家屋なので電波の通りは悪い。
@tateisu
tateisu / removeSpam.pl
Last active Sep 25, 2019
suspend user who in pawoo.net and his note like 'めったにPawooを使いません'.
View removeSpam.pl
#!/usr/bin/perl --
use strict;
use warnings;
use utf8;
# mastodonのdockerコンテナの rails console はreadline がUS-ASCIIなので、文字列リテラルはエスケープが必要
sub escapeNonAscii($){
my($a) = @_;
$a =~ s/([\x{80}-\x{fffff}])/"\\u{".sprintf("%x",ord $1)."}"/ge;
$a;
View gist:cb0c9ee75ab9eae1b7138d8bc6c4a6b6
$ cat readpipe.sh
#!/bin/bash
FILE=/tmp/test.pipe
rm $FILE
mknod $FILE p
read -t 3 <>$FILE answer
echo $? $answer
$ cat writepipe.sh
#!/bin/bash
You can’t perform that action at this time.