This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## built-in TCP input | |
| ## $ echo <json> | fluent-cat <tag> | |
| <source> | |
| type forward | |
| port 24224 | |
| </source> | |
| ## match tag=fluentd.test.** and dump to console | |
| <match fluentd.test.**> | |
| type stdout |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| fluent_log(){ | |
| local project="$1" | |
| local script_name="$2" | |
| local message="$3" | |
| echo "{\""project\"":\""$project"\",\""script_name\"":\""$script_name"\",\""message\"":\""$message\""}" | fluent-cat fluentd.test.log | |
| } | |
| fluent_log "Library" "Reload books" "Started" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 2013-08-09 17:01:06 +0200 [trace]: plugin/in_forward.rb:150:initialize: accepted fluent socket object_id=70144024060720 | |
| 2013-08-09 17:01:06 +0200 fluentd.test.log: {"project":"Library","script_name":"Reload books","message":"Started"} | |
| 2013-08-09 17:01:06 +0200 [trace]: plugin/in_forward.rb:191:on_close: closed fluent socket object_id=70144024060720 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'fluent-logger' | |
| def fluent_log project, script_name, message | |
| Fluent::Logger::FluentLogger.open(nil, :host=>'localhost', :port=>24224) | |
| Fluent::Logger.post("mongo.log", {:project => project, :script_name => script_name, :message => message }) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env sh | |
| if ! [ $1 ] | |
| then | |
| echo "USAGE: methods_def_without_parentheses.sh path [optional paths]" | |
| exit -1 | |
| fi | |
| grep -iRn "^\s*def .*$" $* | grep -v ")$" | awk '{if ($4) print $0}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tmux list-panes -s -F "#{pane_pid} #{pane_current_command}" | grep -v tmux | awk '{print $1}' | xargs kill -9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # array_reactiverecordize_spec.rb | |
| require 'spec_helper' | |
| describe "Array#reactiverecordize" do | |
| let!(:john_doe) { create(:user, first_name: "John", last_name: "Doe", birth_year: '1966')} | |
| let!(:mike_pike) { create(:user, first_name: "Mike", last_name: "Pike", birth_year: '1996')} | |
| let!(:carl_doe) { create(:user, first_name: "Carl", last_name: "Doe", birth_year: '1926')} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| class VimColorscheme | |
| attr_accessor :file_path | |
| def initialize(file_path) | |
| @file_path = file_path | |
| end | |
| def extract_colors |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ❯ sudo aptitude install libfreetype6-dev | |
| The following NEW packages will be installed: | |
| libfreetype6-dev libpng12-dev{a} | |
| 0 packages upgraded, 2 newly installed, 0 to remove and 22 not upgraded. | |
| Need to get 0 B/2.833 kB of archives. After unpacking 6.782 kB will be used. | |
| The following packages have unmet dependencies: | |
| libpng16-devtools : Conflicts: libpng12-0-dev which is a virtual package, provided by: | |
| - libpng12-dev, but 1.2.54-1ubuntu1 is to be installed. | |
| Conflicts: libpng12-dev but 1.2.54-1ubuntu1 is to be installed. | |
| Conflicts: libpng3-dev which is a virtual package, provided by: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/zsh | |
| tempfile=output | |
| touch $tempfile | |
| check_update () { | |
| cd $1 | |
| if [[ -d .git ]] | |
| then | |
| git fetch -q origin | |
| commits_count=`git log master..origin/master --oneline | wc -l` |