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
View gist:8442679
#!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
@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
View parser_warning
$ 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
View database.yml
default: &default
adapter: postgresql
encoding: unicode
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
development:
<<: *default
database: Ieva
username: Ieva
password:
@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 / 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 / work.yml
Created Jan 28, 2019
# ~/.tmuxinator/work.yml
View work.yml
name: backend
root: $HOME/backend
windows:
- editor:
layout: main-horizontal
panes:
- vim
- guard
- frontend_server:
You can’t perform that action at this time.