Skip to content

Instantly share code, notes, and snippets.

View astropanic's full-sized avatar

Wojciech Pietrzak astropanic

View GitHub Profile
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
@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 git@github.com:likeabouse/likeabouse.com.git | grep HEAD | awk '{print $1;}'"
register: release_path
@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

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:

"query": {
"regexp": {
"page.context.searchform.searchform_term_entered.raw": "[^ ]+( +[^ ]+){1}"
}
}
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}
#!/usr/bin/env ruby
$debug = false
require 'yaml'
CONFIG_FILENAME = ".git-wtf"
begin
require 'rubygems'
require 'term/ansicolor'
CHARS64 = ("a".."z").to_a + ("A".."Z").to_a + ("0".."9").to_a + ["-", "_"]
# Return a 22 byte URL-safe string, encoded six bits at a time using 64 characters
def to_s22
integer = self.to_i # UUID as a raw integer
rval = ""
22.times do
c = (integer & 0x3F)
rval += CHARS64[c]
integer = integer >> 6
end
#Time limit exceeded
class Palindrome
def compute(value)
@input_array = value
@size = @input_array.size
@even = @size % 2 == 0
if @even
@pos1 = (@size/2)-1
@pos2 = @pos1+1