This file contains 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
tasks=# BEGIN; | |
BEGIN | |
tasks=# SELECT * FROM tasks WHERE status = 'pending' ORDER BY created_at ASC LIMIT 1 FOR UPDATE SKIP LOCKED; | |
id | status | payload | created_at | |
----+---------+-------------------------------------------------------------------+---------------------------- | |
1 | pending | { "action": "feed", "animal": "panda", "food": "kaiserschmarrn" } | 2019-09-19 15:39:49.459537 | |
(1 row) | |
tasks=# SAVEPOINT task_1; |
This file contains 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
Steps to recreate http://blog.codingspree.net/posts/learning-bosh-deploying-web-application/ | |
# In your BUCC folder: | |
bucc $ bin/bucc up | |
bucc $ bin/bucc env > bucc.env | |
bucc $ source bucc.env | |
bucc $ bosh update-cloud-config ~/projects/bucc/src/bosh-deployment/warden/cloud-config.yml | |
bucc $ bosh upload-stemcell --sha1 9190e1d20dcb937e007abbb4054e19b1daa8d0a4 \ | |
https://bosh.io/d/stemcells/bosh-warden-boshlite-ubuntu-xenial-go_agent?v=170.14 |
This file contains 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
# In your BUCC folder: | |
bucc $ bin/bucc up | |
bucc $ bin/bucc env > bucc.env | |
bucc $ source bucc.env | |
bucc $ bosh update-cloud-config ~/projects/bucc/src/bosh-deployment/warden/cloud-config.yml | |
bucc $ bosh upload-stemcell --sha1 9190e1d20dcb937e007abbb4054e19b1daa8d0a4 \ | |
https://bosh.io/d/stemcells/bosh-warden-boshlite-ubuntu-xenial-go_agent?v=170.14 | |
$ git clone https://github.com/krasio/akoranga-nginx-boshrelease.git | |
$ cd akoranga-nginx-boshrelease |
This file contains 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
$ bucc up | |
Using flags: --cpi virtualbox --lite | |
Flag files: '/Users/qrasio/projects/bucc/state/{cpi,lite,flags}' | |
Deployment manifest: '/Users/qrasio/projects/bucc/src/bosh-deployment/bosh.yml' | |
Deployment state: '/Users/qrasio/projects/bucc/state/state.json' | |
Started validating | |
Downloading release 'bosh'... Skipped [Found in local cache] (00:00:00) | |
Validating release 'bosh'... Finished (00:00:00) |
This file contains 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
0 |
This file contains 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
defmodule HttpRequester do | |
use GenServer | |
def start_link(_) do | |
GenServer.start_link(__MODULE__, nil, []) | |
end | |
def fetch(server, url) do | |
# Don't use cast: http://blog.elixirsips.com/2014/07/16/errata-dont-use-cast-in-a-poolboy-transaction/ | |
timeout_ms = 10_000 |
This file contains 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 'socket' | |
test_file = ARGV[0] | |
socket = UNIXSocket.new('testing.sock') | |
socket.write(test_file) | |
socket.close_write |
This file contains 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
[alias] | |
tree = log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset %Cblue%an%Creset' --abbrev-commit --date=relative |
This file contains 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
# cookbooks/nginx-custom/templates/default/custom.conf.erb | |
rewrite ^/members/(.*)/blog_entries/(.*)$ /members/$1/blog/$2 permanent; |
This file contains 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
# config/initializers/redis_on_passenger.rb | |
if defined?(PhusionPassenger) | |
PhusionPassenger.on_event(:starting_worker_process) do |forked| | |
# We're in smart spawning mode. | |
if forked | |
# Re-establish redis connection | |
# disconnect | |
Resque.redis.client.disconnect |
NewerOlder