View trial-on-freebsd.sh
$ uname -srm
FreeBSD 11.0-RELEASE-p9 amd64
$ su
# pkg install ruby-2.3.4_1,1
# pkg install git-2.13.2
# exit
$ git clone https://github.com/tootsuite/mastodon.git
$ cd mastodon
$ ruby -v -rpsych -e 'p Psych.load(IO.read("config/sidekiq.yml"))'
ruby 2.3.4p301 (2017-03-30 revision 58214) [amd64-freebsd11]
View deploy.md

rake mastodon:maintenance:prepare_for_foreign_keys needs to run.

Merge

$ git checkout master
$ git fetch upstream
$ git rev-parse upstream/master
75c6513c678148e9a6adfcda57cfd5c8a16c804a
$ git rebase upstream/master
View gist:1945febe43bd51e04d22e465377d82d6
StandardError: An error has occurred, this and all later migrations canceled:
PG::ForeignKeyViolation: ERROR: insert or update on table "statuses" violates foreign key constraint "fk_rails_94a6f70399"
DETAIL: Key (in_reply_to_id)=(14576) is not present in table "statuses".
: ALTER TABLE "statuses" ADD CONSTRAINT "fk_rails_94a6f70399"
FOREIGN KEY ("in_reply_to_id")
REFERENCES "statuses" ("id")
ON DELETE SET NULL
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
View running-spec-on-mastoon.md

Mastodonのrake specを走らせられるようにする

Dockerの外でやらないといけない感じなのかな?

rbenv

$ git clone https://github.com/rbenv/rbenv.git ~/.rbenv
$ cd ~/.rbenv && src/configure && make -C src
$ cat << _END > ~/.bashrc
View aws-ip-range.rb
#!/usr/bin/ruby
require 'open-uri'
require 'json'
require 'ipaddr'
require 'pp'
prefixes = Hash.new
source = 'https://ip-ranges.amazonaws.com/ip-ranges.json'
JSON.parse(URI::parse(source).read)['prefixes'].each do |e|
View keybase.md

Keybase proof

I hereby claim:

  • I am zunda on github.
  • I am zunda (https://keybase.io/zunda) on keybase.
  • I have a public key whose fingerprint is C31D 6E88 8EEB 6DAC EA88 1A8C 7BF7 154E 0B17 0373

To claim this, I am signing this object:

View gist:b64afa2d446b47377e92e7722d71f13f
$ rbenv install 2.4.0-dev
Cloning https://github.com/ruby/ruby.git...
Installing ruby-trunk...
BUILD FAILED (OS X 10.11.6 using ruby-build 20160426)
Inspect or clean up the working tree at /var/folders/b5/rsnrc9zj3b9c32qqt6z6py51cq36q1/T/ruby-build.20161008132243.93304
Results logged to /var/folders/b5/rsnrc9zj3b9c32qqt6z6py51cq36q1/T/ruby-build.20161008132243.93304.log
Last 10 log lines:
View 51-kensington.conf
Section "InputClass"
Identifier "Trackball with Middle Button Emulation"
MatchProduct "Primax Kensington Eagle Trackball"
MatchIsPointer "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "Emulate3Buttons" "True"
EndSection
View each-cert.rb
#!/usr/bin/ruby
# ruby each-cert.rb 'openssl x509 -noout -text' input-file.crt
require 'open3'
class String
def certs
self.scan(/-----BEGIN CERTIFICATE-----.*?-----END CERTIFICATE-----/m)
end
end
View count-repos.rb
#!/usr/bin/ruby
require 'open-uri'
require 'json'
module GitHubApi
User = 'zunda'
Header = {
'Authorization' => 'token <repoとread:orgのトークン>',
'Accept' => 'application/vnd.github.v3+json',