Skip to content

Instantly share code, notes, and snippets.

View junaid-malik-confiz's full-sized avatar

Junaid Malik junaid-malik-confiz

View GitHub Profile
ALLOCA:
AR: ar
archdir: /usr/local/rvm/rubies/ruby-2.1.2-ruby_212_optimized/lib/ruby/2.1.0/x86_64-linux
ARCHFILE:
ARCH_FLAG:
archincludedir: /usr/local/rvm/rubies/ruby-2.1.2-ruby_212_optimized/include/x86_64-linux
archlibdir: /usr/local/rvm/rubies/ruby-2.1.2-ruby_212_optimized/lib/x86_64-linux
arch: x86_64-linux
AS: as
ASFLAGS:
+----------+-------------------------------+
| count(*) | extract(HOUR from created_at) |
+----------+-------------------------------+
| 66 | 0 |
| 33 | 1 |
| 5 | 2 |
| 4 | 7 |
| 2 | 8 |
| 290 | 9 |
| 2335 | 10 |
@junaid-malik-confiz
junaid-malik-confiz / haproxy.cfg
Last active November 10, 2021 09:50
Haproxy configuration to handle email alerts in case servr go down / up
backend pakkey_ser_with_auth_junaid
email-alert mailers mta
email-alert level info
email-alert from noreply@example.com
email-alert to example@example.com
option httpchk HEAD / HTTP/1.1\r\nHost:\ www.pakkey.com\r\nAuthorization:\ Basic\ cGFrYm9hcmQ6cFlzWEtlR1R3Tm85Ng==
server server1 127.0.0.1:8080 check inter 5000 fastinter 2000 fall 1 observe layer7 on-error mark-down error-limit 10
server server2 127.0.0.1:9000 check inter 5000 fastinter 1000 fall 1 observe layer7 on-error mark-down error-limit 10
errorfile 503 /etc/haproxy/maintenance.http
ALLOCA:
AR: ar
archdir: /opt/ruby-2.1.2/lib/ruby/2.1.0/x86_64-linux
ARCHFILE:
ARCH_FLAG:
archincludedir: /opt/ruby-2.1.2/include/x86_64-linux
archlibdir: /opt/ruby-2.1.2/lib/x86_64-linux
arch: x86_64-linux
AS: as
ASFLAGS:
ALLOCA:
AR: ar
archdir: /usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/x86_64-linux
ARCHFILE:
ARCH_FLAG:
archincludedir: /usr/local/rvm/rubies/ruby-2.1.2/include/x86_64-linux
archlibdir: /usr/local/rvm/rubies/ruby-2.1.2/lib/x86_64-linux
arch: x86_64-linux
AS: as
ASFLAGS:
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
# to have these messages end up in /var/log/haproxy.log you will
# need to:
#
# 1) configure syslog to accept network log events. This is done
# by adding the '-r' option to the SYSLOGD_OPTIONS in
# /etc/sysconfig/syslog
require "sidekiq/pausable"
Sidekiq.configure_client do |config|
config.redis = Discourse.sidekiq_redis_config
end
Sidekiq.configure_server do |config|
config.redis = Discourse.sidekiq_redis_config
config.failures_max_count = 10000
LOG: duration: 138.396 ms execute <unnamed>: SELECT "topic_custom_fields".* FROM "topic_custom_fields" WHERE "topic_custom_fields"."name" = 'import_id' AND "topic_custom_fields"."value" = '171368' ORDER BY "topic_custom_fields"."id" ASC LIMIT 1
LOG: duration: 10.007 ms execute <unnamed>: SELECT 1 AS one FROM "email_logs" WHERE "email_logs"."post_id" = 5600348 AND "email_logs"."user_id" = 740596 AND "email_logs"."skipped" = 'f' LIMIT 1
LOG: duration: 829.019 ms execute <unnamed>: SELECT COUNT(*) AS count_all, topic_tags.tag_id, tags.name AS topic_tags_tag_id_tags_name FROM "topic_tags" INNER JOIN "tags" ON "tags"."id" = "topic_tags"."tag_id" INNER JOIN "topics" ON "topics"."id" = "topic_tags"."topic_id" AND ("topics"."deleted_at" IS NULL) GROUP BY topic_tags.tag_id, tags.name ORDER BY count_all DESC LIMIT 30
LOG: duration: 16.837 ms execute <unnamed>: SELECT COUNT(*) FROM "posts" WHERE ("posts"."deleted_at" IS NULL) AND (posts.post_type in (1,2,3)) AND (post_number > COALESCE((
# -----------------------------
# PostgreSQL configuration file
# -----------------------------
#
# This file consists of lines of the form:
#
# name = value
#
# (The "=" is optional.) Whitespace may be used. Comments are introduced with
# "#" anywhere on a line. The complete list of parameter names and allowed
{"utf8"=>"✓", "authenticity_token"=>"kRWxX27rx+v9SOwvwnqODNAkgrBx1/w+xIxNrqim8VY=", "car_certification_report"=>{"used_car_id"=>"", "report_abuse_history_id"=>"140323", "sheet_id"=>"13", "extra_fields"=>{"sure_date"=>"2016-02-09", "technician_id"=>"10", "denter_id"=>"12", "engine_no"=>"en123131222", "chassis_no"=>"ch1231311212", "no_of_owners"=>"2", "mileage"=>"123131", "transmission_type_id"=>"automatic", "drive_type_id"=>"2", "engine_type_id"=>"3", "cng_install_id"=>"2", "service_history_id"=>"3", "warranty_booklet_id"=>"1", "car_manufacturer_warranty_id"=>"1", "car_warranty_valid_date"=>"2016-02-23", "car_key_type_id"=>"1", "no_of_car_keys_id"=>"2", "token_paid_valid_date"=>"2016-02-24", "exterior_color"=>"Magenta", "city_id"=>"408", "engine_capacity"=>"1205", "is_ac_fitted"=>"0", "is_ac_operational"=>"0", "is_test_drive"=>"0", "general_comment"=>"good car."}, "questions_attributes"=>{"0"=>{"criteria_id"=>"771", "answer"=>"2"}, "1"=>{"criteria_id"=>"772", "answer"=>"1"}, "2"=>{"criteria_id"=>"773", "answer