Skip to content

Instantly share code, notes, and snippets.

@ryanburnette
ryanburnette / zfs_alerts.sh
Last active April 6, 2021 20:31 — forked from petervanderdoes/zfs_health.sh
zfs health alerts in bash with mailgun api alert
#!/usr/bin/env bash
hostname=`hostname`
emaildomain=''
alertemail=''
mailgunapikey=''
# max capacity % before getting capacity alert
maxCapacity=80
@ryanburnette
ryanburnette / better-errors-padrino.rb
Last active June 2, 2020 12:06 — forked from tyabe/better_errors_plugin.rb
How to use better_errors in Padrino
# Gemfile
group :development do
gem "better_errors"
gem "binding_of_caller"
end
# config/boot.rb, after Bundler.require(:default, RACK_ENV)
if Padrino.env == :development
require 'better_errors'
Padrino::Application.use BetterErrors::Middleware
@ryanburnette
ryanburnette / tmux-cheatsheet.markdown
Created February 12, 2017 16:08 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@ryanburnette
ryanburnette / sitemap.xml.erb
Last active February 4, 2017 17:10 — forked from ls-lukebowerman/sitemap.xml.erb
Sitemap template and associated helpers for Middleman.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<% sitemap_resources.each do |r| %>
<url>
<loc><%= sitemap_path(r) %></loc>
<priority><%= sitemap_priority(r) %></priority>
</url>
<% end %>
</urlset>
#! /bin/bash
TIMESTAMP=$(date +"%F")
BACKUP_DIR="./$TIMESTAMP"
MYSQL_USER="backup"
MYSQL_PASSWORD=""
mkdir $BACKUP_DIR
databases=`mysql --user=$MYSQL_USER -p$MYSQL_PASSWORD -e "SHOW DATABASES;" | grep -Ev "(Database|information_schema|performance_schema)"`
@ryanburnette
ryanburnette / echo.js
Created January 2, 2014 19:52 — forked from nazgob/hello_node.js
A little node server that just gives your request back to you as JSON.
var http = require('http')
, sys = require('sys')
, server
;
server = http.createServer(function(req, res) {
var echo = {}
;
echo.headers = JSON.stringify(req.headers, true, 2);
@ryanburnette
ryanburnette / slim-html5-boilerplate-ish
Last active January 1, 2016 20:48 — forked from blakehilscher/slim-html5-boilerplate
It's HTML5 Boilerplate(ish) ... in Slim.
doctype html
html.no-js
head
meta charset="utf-8"
meta content="IE=edge" http-equiv="X-UA-Compatible"
title Title
meta content="width=device-width,initial-scale=1" name="viewport"
@ryanburnette
ryanburnette / readme.md
Last active May 15, 2020 14:36 — forked from joelverhagen/README.md
A Jekyll plugin for creating YouTube or Vimeo embed codes.

This is a Jekyll plugin for creating YouTube or Vimeo embed codes.

Usage

Put the plugin file video-embeds.rb in your _plugins directory. Create a tag specifying the type of video you want to embed with the first required argument, the video id.

{% youtube ab1234ab1 %}
@ryanburnette
ryanburnette / config.rb
Last active December 20, 2015 07:58 — forked from nathansmith/config.rb
http_path = '/'
css_dir = 'assets/stylesheets'
sass_dir = 'assets/sass'
images_dir = 'assets/images'
javascripts_dir = 'assets/javascripts'
relative_assets = true
preferred_syntax = :sass