Skip to content

Instantly share code, notes, and snippets.

View sorah's full-sized avatar

Sorah Fukumori sorah

View GitHub Profile
! 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
#cloud-config
bootcmd:
- |
/bin/bash <<-'EOS'
#!/bin/bash
exec > >(tee /root/log.txt)
exec 2>&1
set -x
set -e
if [ -e /new ]; then
#!/bin/bash
new_ip="$(curl -s -4 http://api.ipify.org)"
zone_id=$1
target_name=$2
batch_json='
{
"Changes": [{
"Action": "UPSERT",
"ResourceRecordSet": {
@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
*
@sorah
sorah / a.md
Last active August 29, 2015 14:15
haproxy graceful restarting without so_reuseport
(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 / 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
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>2.0</version>
<date>2015-02-01T05:44:35Z</date>
<groups>
<group>
<name>Service Templates</name>
</group>
</groups>
<templates>
  • 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
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