Skip to content

Instantly share code, notes, and snippets.

Martynas Rancys mrancys

Block or report user

Report or block mrancys

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mrancys
mrancys / nginx_rails_sendfile.md
Created Apr 3, 2018 — forked from rally25rs/nginx_rails_sendfile.md
nginx rails send_file madness
View nginx_rails_sendfile.md

Goal: Have some static content, served by Nginx, but it requires an authenticated user. User auth is through Rails.

Project structure: The actual static files are in /home/vagrant/docs/ The browser will use the URL /help/* to access this content

The Ruby bits: RAILS_ENV=production rails server is used to start a WEBrick on port 3000.

config/environments/production.rb

@mrancys
mrancys / nginx_rails_sendfile.md
Created Apr 3, 2018 — forked from rally25rs/nginx_rails_sendfile.md
nginx rails send_file madness
View nginx_rails_sendfile.md

Goal: Have some static content, served by Nginx, but it requires an authenticated user. User auth is through Rails.

Project structure: The actual static files are in /home/vagrant/docs/ The browser will use the URL /help/* to access this content

The Ruby bits: RAILS_ENV=production rails server is used to start a WEBrick on port 3000.

config/environments/production.rb

@mrancys
mrancys / routes.md
Created Jul 11, 2017 — forked from dideler/routes.md
Rails Routes
View routes.md

A summary of the Rails Guides on Routes, plus other tips.

The Rails router recognizes URLs and dispatches them to a controller's action. It can also generate paths and URLs, avoiding the need to hardcode strings in your views.

Examples

# Redirects /orders/report to orders#report.
get 'orders/report', to: 'orders#report'
@mrancys
mrancys / dashing_zabbix_trigger.md
Last active Sep 17, 2015 — forked from chojayr/dashing_zabbix_trigger.md
Dashboard(Dashing) Zabbix Triggers
View dashing_zabbix_trigger.md

Dashing dashboard for zabbix trigger

zabbix trigger zabbix trigger

This will provide the total number of alerts on triggers status

  • flash when there's an alert/triggers (color based on the zabbix trigger color format)
  • trigger = Warning, Average, High & Disaster
  • unacknowledge triggers
You can’t perform that action at this time.