Skip to content

Instantly share code, notes, and snippets.

View phlegx's full-sized avatar
💪
never stop coding

Phlegx Systems phlegx

💪
never stop coding
View GitHub Profile
We are experiencing problems connecting to the Graylog server running on http://172.18.0.3:9000/api/. Please verify that the server is healthy and working correctly.
You will be automatically redirected to the previous page once we can connect to the server.
Chain PREROUTING (policy ACCEPT 328K packets, 22M bytes)
pkts bytes target prot opt in out source destination
61479 4282K DOCKER all -- * * 0.0.0.0/0 0.0.0.0/0 ADDRTYPE match dst-type LOCAL
Chain INPUT (policy ACCEPT 33114 packets, 2374K bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 8963 packets, 611K bytes)
pkts bytes target prot opt in out source destination
32 1944 DOCKER all -- * * 0.0.0.0/0 !127.0.0.0/8 ADDRTYPE match dst-type LOCAL
Dec 9 11:34:18 aio1_nova_conductor_container-70e5afee nova-conductor: 2015-12-09 11:34:17.183 1231 INFO oslo.messaging._drivers.impl_rabbit [req-c68520ca-1de5-41dc-a519-93ce8ec27fe1 e4bf261ec4284e0fa9ece0b2a81ef830 d8012f50a5e54e7a85e58ae74a94661d - - -] Connecting to AMQP server on 172.29.236.108:5671
Dec 9 11:34:18 aio1_nova_conductor_container-70e5afee nova-conductor: 2015-12-09 11:34:17.229 1231 INFO oslo.messaging._drivers.impl_rabbit [req-c68520ca-1de5-41dc-a519-93ce8ec27fe1 e4bf261ec4284e0fa9ece0b2a81ef830 d8012f50a5e54e7a85e58ae74a94661d - - -] Connected to AMQP server on 172.29.236.108:5671
@phlegx
phlegx / my_controller.rb
Last active August 29, 2015 14:24
Websocket-Rails Rescue
MyController < WebsocketRails::BaseController
include ActionController::Rescue
rescue_from ActiveRecord::RecordNotFound, with: :not_found_error
def not_found_error(exception)
# do something here
end
end
@phlegx
phlegx / gist:4fe3bd7df1eab5d780d6
Last active August 29, 2015 14:23
Websocket-Rails duplicate messages
[["client_connected",{"id":null,"channel":null,"user_id":null,"data":{"connection_id":"ac42958a66e6682a07d7","user_id":1},"success":null,"result":null,"token":null,"server_token":null}]]
["websocket_rails.subscribe",{"id":119155,"data":{"channel":"unit_channel"}}]
[["websocket_rails.channel_token",{"id":null,"channel":"unit_channel","user_id":null,"data":{"token":"a37d1c7d-73ef-4070-983c-384d9ac10fe4"},"success":null,"result":null,"token":null,"server_token":null}]]
[["websocket_rails.subscribe",{"id":119155,"channel":null,"user_id":null,"data":{"channel":"unit_channel","success":"Channel authorization successful."},"success":true,"result":null,"token":null,"server_token":null}]]
[["websocket_rails.channel_token",{"id":null,"channel":"unit_channel","user_id":null,"data":{"token":"57b0fc35-bb50-4acc-a547-79e4b87a8690"},"success":null,"result":null,"token":null,"server_token":null}]]
[["websocket_rails.subscribe",{"id":119155,"channel":null,"user_id":null,"data":null,"success":true,"result":null,"token":null,"s
@phlegx
phlegx / Rails 4 - how to give alias names to includes() and joins() in active record quering
Last active February 12, 2024 19:12
Rails 4 - how to give alias names to includes() and joins() in active record quering
See question on stack overflow: http://stackoverflow.com/questions/28595636/rails-4-how-to-give-alias-names-to-includes-and-joins-in-active-record-que
- Model Student and model Teacher are both STI models with super class model User
- Model Story is a STI model with super class model Task
- includes() and joins(), both fails
Rails alias naming convention (includes() and joins())
- One model as parameter
- is base model (includes(:users))
@phlegx
phlegx / array_validator.rb
Last active May 5, 2021 18:53 — forked from ssimeonov/array_validator.rb
Rails 6.1 array validator with indexed messages.
# Syntax sugar
class ArrayValidator < EnumValidator
end
scope :by_provider, lambda{ |cpf| joins(common: [{ channels: :authentication }]).where("provider IN (#{cpf})") }
Exception `LoadError' at /home/user/.rvm/gems/ruby-2.1.1@projectname/gems/nokogiri-1.6.3.1/lib/nokogiri.rb:27 - cannot load such file -- nokogiri/2.1/nokogiri
Type application/vnd.ms-fontobject already registered as a variant of application/vnd.ms-fontobject.
Type application/vnd.ms-word.document.macroEnabled.12 already registered as a variant of application/vnd.ms-word.document.macroenabled.12.
Type application/vnd.ms-word.template.macroEnabled.12 already registered as a variant of application/vnd.ms-word.template.macroenabled.12.
Type multipart/x-parallel already registered as a variant of multipart/parallel.
Type text/plain already registered as a variant of text/plain.
Type video/vnd.dlna.mpeg-tts already registered as a variant of video/vnd.dlna.mpeg-tts.
Exception `NameError' at /home/user/.rvm/gems/ruby-2.1.1@projectname/gems/rspec-core-2.99.0/lib/rspec/core/backward_compatibility.rb:14 - uninitialized constant BigDecimal
Exception `NameError' at /home/user/.rvm/gems/ruby-2.1.1@projectname/gems/rspec-c
Failures:
1) the sign in process signs me in
Failure/Error: visit '/'
ChildProcess::LaunchError:
No such file or directory - -no-remote
# /home/user/.rvm/gems/ruby-2.1.1@projectname/gems/childprocess-0.5.3/lib/childprocess/unix/fork_exec_process.rb:58:in `launch_process'
# /home/user/.rvm/gems/ruby-2.1.1@projectname/gems/childprocess-0.5.3/lib/childprocess/abstract_process.rb:82:in `start'
# /home/user/.rvm/gems/ruby-2.1.1@projectname/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/firefox/binary.rb:56:in `execute'
# /home/user/.rvm/gems/ruby-2.1.1@projectname/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/firefox/binary.rb:34:in `start_with'