Skip to content

Instantly share code, notes, and snippets.

View astropanic's full-sized avatar

Wojciech Pietrzak astropanic

View GitHub Profile

Keybase proof

I hereby claim:

  • I am astropanic on github.
  • I am astropanic (https://keybase.io/astropanic) on keybase.
  • I have a public key ASALn0AmyftU0jyEIviHRBE9txPGIjyWBNA5QPZ9vqpWyQo

To claim this, I am signing this object:

#!/usr/bin/env ruby
$debug = false
require 'yaml'
CONFIG_FILENAME = ".git-wtf"
begin
require 'rubygems'
require 'term/ansicolor'
@astropanic
astropanic / gist:4f583740f93465fbd2bc
Created November 3, 2014 10:14
Ruby is a beautiful language
return (1<<31) - (name.downcase.each_byte.each_with_index.to_a.inject(0.0) {|s,(v,i)| s+=(v.to_f/[((2**8)*i), 1.0].max);s} * (2**23)).to_i
Elasticsearch::Transport::Transport::Errors::ServiceUnavailable: [503] {"error":"ReduceSearchPhaseException[Failed to execute phase [merge], [reduce] ]; nested: ClassCastException[org.elasticsearch.search.facet.terms.strings.InternalStringTermsFacet$TermEntry cannot be cast to org.elasticsearch.search.facet.terms.longs.InternalLongTermsFacet$LongEntry]; ","status":503}
Elasticsearch::Transport::Transport::Errors::ServiceUnavailable: [503] {"error":"ReduceSearchPhaseException[Failed to execute phase [merge], [reduce] ]; nested: ClassCastException[org.elasticsearch.search.facet.terms.strings.InternalStringTermsFacet$TermEntry cannot be cast to org.elasticsearch.search.facet.terms.longs.InternalLongTermsFacet$LongEntry]; ","status":503}
"query": {
"regexp": {
"page.context.searchform.searchform_term_entered.raw": "[^ ]+( +[^ ]+){1}"
}
}

Keybase proof

I hereby claim:

  • I am astropanic on github.
  • I am astropanic (https://keybase.io/astropanic) on keybase.
  • I have a public key whose fingerprint is 2999 EA7B B441 8AAC 9546 2C30 F451 1CB7 9B05 4398

To claim this, I am signing this object:

@astropanic
astropanic / roles_deployment_tasks_main.yml
Last active August 29, 2015 14:00
Ansible - playbook error
---
- name: create group for deloyment and web
group:
state=present
name=web
system=yes
- name: create user for deployment and web
user:
state=present
@astropanic
astropanic / deploy.yaml
Created March 15, 2014 21:19
Capistrano replacement
# file: roles/webtier/tasks/deploy.yaml
- name: prepare_release_directory
command: "git ls-remote [email protected]:likeabouse/likeabouse.com.git | grep HEAD | awk '{print $1;}'"
register: release_path
check process puma with pidfile /daten/appsse/production/current/tmp/pids/puma.sock
start program = "/usr/bin/env bash -c 'export HOME="/daten/appsse/" && source /daten/appsse/.rvm/environments/default && cd /daten/appsse/production/current && bundle exec puma -C config/puma/config.rb' as uid appsse and gid web
stop program = "/usr/bin/env bash -c 'export HOME="/daten/appsse/" && source /daten/appsse/.rvm/environments/default && cd /daten/appsse/production/current && bundle exec pumactl -S tmp/pids/puma.state stop' as uid appsse and gid web