Skip to content

Instantly share code, notes, and snippets.

Tatsuya Koishi pooza

Block or report user

Report or block pooza

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 instance_check.rb
#!/usr/bin/env ruby
require 'resolv'
require 'httparty'
require 'timeout'
File.read('./instances.txt').each_line(chomp: true) do |domain|
Timeout.timeout(10) do
Resolv::DNS.new.getaddress(domain)
code = HTTParty.get("https://#{domain}/about").code
raise '404' if code == 404
View keybase.md

Keybase proof

I hereby claim:

  • I am pooza on github.
  • I am pooza (https://keybase.io/pooza) on keybase.
  • I have a public key ASAIan-f3fnX_NBDfbks4BoFKcXzc6u7f_9La29EOT_QPgo

To claim this, I am signing this object:

@pooza
pooza / Rakefile
Created Feb 7, 2019
.circleci/config.yml
View Rakefile
dir = File.expand_path(__dir__)
namespace :cert do
desc 'update cert'
task :update do
require 'httparty'
File.write(
File.join(dir, 'cert/cacert.pem'),
HTTParty.get('https://curl.haxx.se/ca/cacert.pem'),
)
View config.rb
module MulukhiyaTootProxy
class Config < Ginseng::Config
include Package
def self.deep_merge(src, target)
raise ArgumentError 'Not Hash' unless target.is_a?(Hash)
dest = (src.clone || {}).with_indifferent_access
target.each do |k, v|
dest[k] = v.is_a?(Hash) ? deep_merge(dest[k], v) : v
end
View config_test.rb
module MulukhiyaTootProxy
class ConfigTest < Test::Unit::TestCase
def test_deep_merge
config = Config.deep_merge({}, {a: 111, b: 222})
assert_equal(config, {'a' => 111, 'b' => 222})
config = Config.deep_merge(config, {c: {d: 333, e: 444}})
assert_equal(config, {'a' => 111, 'b' => 222, 'c' => {'d' => 333, 'e' => 444}})
config = Config.deep_merge(config, {c: {e: 333, f: 444}})
assert_equal(config, {'a' => 111, 'b' => 222, 'c' => {'d' => 333, 'e' => 333, 'f' => 444}})
config = Config.deep_merge(config, {c: {d: nil}})
View growi.god
God.watch do |god|
god.name = 'growi'
god.env = {
'NODE_ENV' => 'production',
'MONGO_URI' => 'mongodb://localhost:27017/growi',
'PORT' => '3012',
'FILE_UPLOAD' => 'local',
'EIO_WS_ENGINE' => 'ws',
}
god.dir = '/home/pooza/growi'
View accounts.sql
SELECT
accounts.id
FROM accounts
LEFT JOIN users ON accounts.id=users.account_id
LEFT JOIN (
SELECT
account_id
FROM blocks
WHERE target_account_id=1
) AS blockers ON accounts.id=blockers.account_id
@pooza
pooza / result.txt
Created Nov 6, 2018
mastodon=# SELECT id,url,uri FROM statuses ORDER BY created_at DESC LIMIT 10;
View result.txt
mastodon=# SELECT id,url,uri FROM statuses ORDER BY created_at DESC LIMIT 10;
id | url | uri
--------------------+-----------------------------------------------------+-------------------------------------------------------------------
101021706725789900 | https://mstdn.b-shock.org/@pooza/101021706465667821 | https://mstdn.b-shock.org/users/pooza/statuses/101021706465667821
101021536613538389 | https://mstdn.b-shock.org/@pooza/101021536290247023 | https://mstdn.b-shock.org/users/pooza/statuses/101021536290247023
101021359813439899 | https://mstdn.b-shock.org/@pooza/101021359533523455 | https://mstdn.b-shock.org/users/pooza/statuses/101021359533523455
101020388883530247 | https://mstdn.b-shock.org/@pooza/101020385819933342 | https://mstdn.b-shock.org/users/pooza/statuses/101020385819933342
101018448167948034 | https://mstdn.b-shock.org/@pooza/101018447922314499 | https://mstdn.b-shock.org/users/pooza/statuses/1
View response.txt
HTTP/2 302
date: Tue, 06 Nov 2018 02:10:59 GMT
content-type: text/html; charset=utf-8
set-cookie: __cfduid=d262f6c61039be21a295d52376c4d7e0b1541470259; expires=Wed, 06-Nov-19 02:10:59 GMT; path=/; domain=.precure.ml; HttpOnly
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
location: https://precure.ml/@pooza/101021588761903393
vary: Accept-Encoding
cache-control: no-cache
View god
#!/bin/sh
# PROVIDE: god
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable the puppet agent:
#
# god_enable="YES"
You can’t perform that action at this time.