Skip to content

Instantly share code, notes, and snippets.

View f440's full-sized avatar
πŸ«₯
-4/26

f440 f440

πŸ«₯
-4/26
View GitHub Profile
@f440
f440 / info.apatheia.RestartNotifyd.plist
Last active October 16, 2015 03:23
Kill notifyd as workaround for El capitan problem https://github.com/tmux/tmux/issues/108
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>info.apatheia.RestartNotifyd</string>
<key>ProgramArguments</key>
<array>
<string>pkill</string>
<string>notifyd</string>

Keybase proof

I hereby claim:

  • I am f440 on github.
  • I am f440 (https://keybase.io/f440) on keybase.
  • I have a public key whose fingerprint is 4092 7D7D F720 F29F 312D 7FEA 951C 83FA 73A9 9D00

To claim this, I am signing this object:

@f440
f440 / aws-env
Last active November 6, 2015 03:38
eval "$(aws-env XXX)" することで、 credential から XXX profile γ‚’ζŽ’γ—γ¦ AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_DEFAULT_REGION γ‚’γ‚»γƒƒγƒˆ
#!/usr/bin/env ruby
class Parser
# python's config format: https://docs.python.org/2/library/configparser.html
def self.parse(contents)
sections = {}
contents.each_line do |line|
case line
when /\s*[#;]/, /^\s*$/
# skip
@f440
f440 / .gitignore
Created June 23, 2015 14:48
Terraform Template
terraform.tfstate*
@f440
f440 / redis_watch.rb
Last active August 29, 2015 14:07
redis-rb で watch
require 'redis'
require 'hiredis'
# usage:
# 端末(1) : ζ›΄ζ–°γ—ηΆšγ‘γ‚‹
# watch -n 0.1 "echo incr r | redis-cli"
# 端末(2) : watch し぀぀更新する
# ruby redis_watch.rb 1000000
r = Redis.new(driver: :hiredis, timeout: 60) # γƒ‡γƒ•γ‚©γƒ«γƒˆγ γ¨γ€5η§’γ§γ‚Ώγ‚€γƒ γ‚’γ‚¦γƒˆ
@f440
f440 / nginx-openresty.init
Created September 22, 2014 03:47
nginx-openresty init file
#!/bin/sh
#
# nginx-openresty - this script starts and stops the nginx daemon
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse Β₯
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /usr/local/openresty/nginx/conf/nginx.conf
# config: /etc/sysconfig/nginx
@f440
f440 / curl.log
Last active August 29, 2015 14:06
HTTP 1.0 で画像にをクセス # curl --verbose --http1.0 https://pbs.twimg.com/media/B.....
* Adding handle: conn: 0x7fdc20804000
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7fdc20804000) send_pipe: 1, recv_pipe: 0
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* About to connect() to pbs.twimg.com port 443 (#0)
* Trying 117.18.237.139...
@f440
f440 / zsh-autosuggestions.rb
Created April 30, 2014 01:59
brew install ./zsh-autosuggestions.rb --HEAD
require 'formula'
class ZshAutosuggestions < Formula
homepage 'https://github.com/tarruda/zsh-autosuggestions'
head 'https://github.com/tarruda/zsh-autosuggestions.git'
def install
(share/'zsh-autosuggestions').install Dir['*']
end
@f440
f440 / evernote2txt.rb
Created April 20, 2014 14:32
Evernote xml (enex) to txt
#!/usr/bin/env ruby
#-*- encoding: utf-8 -*-
# http://blog.evernote.com/tech/2013/08/08/evernote-export-format-enex/
require 'nokogiri'
require 'date'
require 'ostruct'
class Note < OpenStruct; end
@f440
f440 / pass.zsh
Created April 5, 2014 14:51
Incremental search for pass by zaw
# -*- sh -*-
# [Pass](http://www.zx2c4.com/projects/password-store/)
# the standard unix password manager
# [zaw](https://github.com/zsh-users/zaw)
# zsh anything.el-like widget
function zaw-src-pass() {
candidates=("${(ps:\n:)$(builtin cd ~/.password-store >/dev/null ; find . -type f ! -name .gpg-id | sed -e 's/\.\/\(.*\).gpg$/\1/')}")
actions=("zaw-callback-pass-append-to-buffer")