Skip to content

Instantly share code, notes, and snippets.

@mrancys
mrancys / work.yml
Created January 28, 2019 13:45
# ~/.tmuxinator/work.yml
name: backend
root: $HOME/backend
windows:
- editor:
layout: main-horizontal
panes:
- vim
- guard
- frontend_server:
@mrancys
mrancys / nginx_rails_sendfile.md
Created April 3, 2018 12:14 — forked from rally25rs/nginx_rails_sendfile.md
nginx rails send_file madness

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 April 3, 2018 12:14 — forked from rally25rs/nginx_rails_sendfile.md
nginx rails send_file madness

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 July 11, 2017 10:23 — forked from dideler/routes.md
Rails Routes

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'
default: &default
adapter: postgresql
encoding: unicode
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
development:
<<: *default
database: Ieva
username: Ieva
password:
$ rake parallel:spec
warning: parser/current is loading parser/ruby22, which recognizes
warning: 2.2.x-compliant syntax, but you are running 2.3.0.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
$ gem update parser
@mrancys
mrancys / dashing_zabbix_trigger.md
Last active September 17, 2015 18:12 — forked from chojayr/dashing_zabbix_trigger.md
Dashboard(Dashing) Zabbix Triggers

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
#!python
"""Bootstrap setuptools installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from ez_setup import use_setuptools
use_setuptools()
If you want to require a specific version of setuptools, set a download