ローカルユーザーにとって不要なトゥートを削除するジョブ。
そのままだと思いの外うまく消えてくれないのでいくつか変更&修正。
diff --git a/lib/mastodon/statuses_cli.rb b/lib/mastodon/statuses_cli.rb
index 7f2fbfa85..5c7c877fb 100644
--- a/lib/mastodon/statuses_cli.rb
+++ b/lib/mastodon/statuses_cli.rb
import kotlin.system.* | |
fun main(){ | |
val N = 1_000_000 | |
val K = 100 | |
val stringNums = (1..N).map(Int::toString) | |
run{ | |
println("it.toInt()") | |
val t = average(K){ | |
stringNums.map{it.toInt()} |
Long[] | |
483.9 | |
long[] | |
100.0 | |
Long <- long | |
701.1 | |
long <- Long | |
184.0 |
fun main(){ | |
} | |
fun readInt() = readLine()!!.toInt() | |
fun readInts() = readLine()!!.split(" ").map(String::toInt) | |
fun <T>printAll(a: Collection<T>) = println(a.joinToString("\n")) |
val map = mutableMapOf<Int, Int>().toSortedMap() | |
//https://docs.oracle.com/javase/jp/8/docs/api/java/util/TreeMap.html#subMap-K-K- | |
val iterator = map.subMap(l, r).iterator() | |
while(iterator.hasNext()){ | |
val it = iterator.next() | |
//do something | |
iterator.remove() | |
} |
400x400で、フレーム数が多いGIFだとかなりやばいっぽい。
サンプルは400x400, 198フレームのGIFファイル。
--------------------------------------------------------------------------------
Command: /usr/bin/convert sample3.gif -coalesce -auto-orient -resize 400x400> -layers optimize -quality 80 -strip out.gif
Massif arguments: (none)
ms_print arguments: massif.out.21536
Sleeping( ˘ω˘)Syarでは、Twitterに画像をアップロードするときに、カメラへのアクセスを要求することがあります。 カメラへのアクセスは、画像を撮影してTwitterにアップロードするためだけに利用されます。
SleepingSyar requests CAMERA permission to upload media to Twitter. This app only use camera to take picture that will be uploaded to twitter.
Mastodonでgifアイコンをconvertするときにメモリを激しく消費する。
120x120、1フレームのgifアイコンをconvertするときのメモリ消費
$ identify 1frame.gif
#> 1frame.gif GIF 120x120 120x120+0+0 8-bit sRGB 256c 13041B 0.000u 0:00.000
--------------------------------------------------------------------------------
基本的にはInstall from Source @ ImageMagickの通りです。
wget https://www.imagemagick.org/download/ImageMagick.tar.gz
tar xvzf ImageMagick.tar.gz
2017/11/27現在、7.0.7-11が降ってきます。
#!/bin/bash -e | |
cd ~/live | |
sidekiq_pid=`ps aux | grep sidekiq | grep -v grep | awk '{print $2}'` | |
puma_pid=`ps aux | grep puma | grep -v grep | awk '{print $2}'` | |
/home/mastodon/.rbenv/shims/bundle exec rbtrace -p $puma_pid --timeout 30 -e 'Thread.new{GC.start;require "objspace";io=File.open("/tmp/puma.dump", "w"); ObjectSpace.dump_all(output: io); io.close}' | |
/home/mastodon/.rbenv/shims/bundle exec rbtrace -p $sidekiq_pid --timeout 30 -e 'Thread.new{GC.start;require "objspace";io=File.open("/tmp/sidekiq.dump", "w"); ObjectSpace.dump_all(output: io); io.close}' | |
# ちょっと待つと吉 |