Skip to content

Instantly share code, notes, and snippets.

View okdas's full-sized avatar
:shipit:

Dima K. okdas

:shipit:
View GitHub Profile
GIT
remote: git://github.com/moaa/websocket-rails.git
- revision: d5443e2b129dec23aee33b2a78265441e0c18e96
+ revision: daceac9c2fdd674f2337f98f4f535feef938fc1a
branch: threadsocket-rails
specs:
websocket-rails (0.7.0)
connection_pool
faye-websocket
hiredis
Started GET "/api/acknowledges" for 127.0.0.1 at 2015-04-03 15:08:07 +0300
Processing by Api::AcknowledgesController#index as JSON
User Load (0.8ms) SELECT "users".* FROM "users" WHERE "users"."id" = 18 ORDER BY "users"."id" ASC LIMIT 1
Acknowledge Load (10.1ms) SELECT "acknowledges".* FROM "acknowledges" ORDER BY "acknowledges"."created_at" DESC LIMIT 50
SQL (293.2ms) SELECT `triggers`.*, `triggers`.`triggerid` AS t0_r0, `triggers`.`expression` AS t0_r1, `triggers`.`description` AS t0_r2, `triggers`.`url` AS t0_r3, `triggers`.`status` AS t0_r4, `triggers`.`value` AS t0_r5, `triggers`.`priority` AS t0_r6, `triggers`.`lastchange` AS t0_r7, `triggers`.`comments` AS t0_r8, `triggers`.`error` AS t0_r9, `triggers`.`templateid` AS t0_r10, `triggers`.`type` AS t0_r11, `triggers`.`state` AS t0_r12, `triggers`.`flags` AS t0_r13, `hosts`.`hostid` AS t1_r0, `hosts`.`proxy_hostid` AS t1_r1, `hosts`.`host` AS t1_r2, `hosts`.`status` AS t1_r3, `hosts`.`disable_until` AS t1_r4, `hosts`.`error` AS t1_r5, `hos
@okdas
okdas / content
Last active August 29, 2015 14:18
Started GET "/api/acknowledges" for 127.0.0.1 at 2015-04-03 15:03:12 +0300
ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
Processing by Api::AcknowledgesController#index as JSON
User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."id" = 18 ORDER BY "users"."id" ASC LIMIT 1
Acknowledge Load (6.3ms) SELECT "acknowledges".* FROM "acknowledges" ORDER BY "acknowledges"."created_at" DESC LIMIT 50
SQL (268.3ms) SELECT `triggers`.*, `triggers`.`triggerid` AS t0_r0, `triggers`.`expression` AS t0_r1, `triggers`.`description` AS t0_r2, `triggers`.`url` AS t0_r3, `triggers`.`status` AS t0_r4, `triggers`.`value` AS t0_r5, `triggers`.`priority` AS t0_r6, `triggers`.`lastchange` AS t0_r7, `triggers`.`comments` AS t0_r8, `triggers`.`error` AS t0_r9, `triggers`.`templateid` AS t0_r10, `triggers`.`type` AS t0_r11, `triggers`.`state` AS t0_r12, `triggers`.`flags` AS t0_r13, `hosts`.`hostid` AS t1_r0, `hosts`.`proxy_hostid` AS t1_r1, `hosts`.`host` AS
$scope.triggersByProject = (trigger) ->
# Match by hostnames in project <-> trigger's host name.
if $.inArray(trigger.host.name, $scope.hosts) is not -1 then yes else no
$scope.triggersByProject = function(trigger) {
if ($.inArray(trigger.host.name, $scope.hosts) === !-1) {
return true;
} else {
return false;
}
desc 'temp task'
task :temp_task do
on roles(:app) do
execute "service iptables-persistent restart &"
%w{10. 11. 12. 16. 17. 20. 21. 22. 23. 24. 25. 31. 32. 50. panel.}.push('').each do |host|
begin
host = Resolv.getaddress "#{host}flyspring.net"
execute "iptables -A INPUT -m state --state NEW,ESTABLISHED,RELATED --source #{host} -p tcp --dport 25465 -j ACCEPT"
rescue Resolv::ResolvError
end