Skip to content

Instantly share code, notes, and snippets.

View sorah's full-sized avatar

Sorah Fukumori sorah

View GitHub Profile
d = '2014-12-15'
h = {};
open("/var/db/akane/timeline/#{d}.deleted.txt", "r") do |io|
io.each_line do |l|
_,u,t = l.chomp.split(",")
(h[u] ||= {})[t] = true
end
end
  • A.R. / Star-Crossed - Single
  • A/Z aLIEz
  • AUBE
  • Angel Beats! Girls Dead Monster "Crow Song" - Single
  • Angel Beats! Girls Dead Monster 'Thousand Enemies' - Single
  • Authentic symphony - Single
  • BINKAN♡あてんしょん - Single
  • BITTER SWEET GIRLS!
  • BLAZING - EP
  • BREAK OUT! - Single
@sorah
sorah / lastfm_fluentd.rb
Created February 6, 2015 08:08
lastfm to fluentd
require 'fluent-logger'
require 'open-uri'
require 'nokogiri'
user = ENV['LF_USER']
marker = ENV['LF_MARKER'] || File.expand_path('~/.lastfm_fluentd.mark')
last = if File.exist?(marker)
File.read(marker).chomp
else
nil
(lsof -iTCP -s TCP:LISTEN -n; lsof -d cwd) | ruby -e '$stdin.readlines.map {|_| __ = _.chomp.sub(/ \(LISTEN\)$/,"(LISTEN)").split; [__[1], __[0], __[-1]] }.group_by(&:first).each {|pid, val| vs = val.map(&:last); name = val.first[1]; next if vs.grep(/\(LISTEN\)/).empty?; puts "#{name}(#{pid}): #{vs}" }'
@sorah
sorah / a.md
Last active August 29, 2015 14:15
haproxy graceful restarting without so_reuseport
@sorah
sorah / a
Last active August 29, 2015 14:15
sudo docker run quay.io/sorah/gentoo-base dockemerge -v nullmailer
>>> Completed installing nullmailer-1.13-r5 into /var/tmp/portage/mail-mta/nullmailer-1.13-r5/image/
strip: x86_64-pc-linux-gnu-strip --strip-unneeded -R .comment -R .GCC.command.line -R .note.gnu.gold-version
usr/libexec/nullmailer/smtp
usr/libexec/nullmailer/qmqp
usr/bin/mailq
ln: failed to create hard link '248798_stripped' => '/var/tmp/portage/mail-mta/nullmailer-1.13-r5/image/usr/bin/mailq': Operation not permitted
* ERROR: mail-mta/nullmailer-1.13-r5::gentoo failed:
* ln failed unexpectedly
*
#!/bin/bash
new_ip="$(curl -s -4 http://api.ipify.org)"
zone_id=$1
target_name=$2
batch_json='
{
"Changes": [{
"Action": "UPSERT",
"ResourceRecordSet": {
! NEC Portable Internetwork Core Operating System Software
! IX Series IX2010 (magellan-sec) Software, Version 8.3.49, RELEASE SOFTWARE
! Compiled Nov 25-Fri-2011 10:29:23 JST #1
! Current time May 11-Mon-2015 03:53:50 JST
!
!
hostname kotori
timezone +09 00
terminal default-length 0
terminal default-width 120

daemon scripts (example)

(▰╹◡╹) time ruby daemon.rb
daemon: bye
daemon: bye (stderr)
ruby daemon.rb  0.08s user 0.04s system 2% cpu 5.136 total
list = [["1","11902890"],["1","11914595"],["1","11914595"],["1","11904467"],["1","11917252"],["1","11930198"],["1","11930310"],["1","11931848"],["1","11931875"],["1","11932162"],["1","11938518"],["2","11905329"],["2","11918720"],["2","11906815"],["2","11911206"],["2","11922753"],["2","11930574"],["4","11901300"],["4","11908444"],["4","11909963"],["4","11916328"],["4","11918340"],["4","11921085"],["4","11923998"],["4","11925481"],["5","11905977"],["5","11909038"],["5","11910049"],["5","11910634"],["5","11912582"],["5","11913257"],["5","11913571"],["5","11916392"],["5","11918917"],["5","11923086"],["5","11924090"],["5","11927286"],["5","11932706"],["5","11934520"],["6","11905621"],["6","11909303"],["6","11915557"],["6","11915651"],["6","11917529"],["6","11923592"],["7","11913996"],["7","11902000"],["7","11912958"],["7","11913421"],["7","11920295"],["9","11907585"],["9","11916644"],["9","11928610"],["9","11931961"]]
list.forEach(function(v) { var elem = $('.webcatalog-favorite-dialog-color input[data-webcatalog-