Skip to content

Instantly share code, notes, and snippets.

@icy-arctic-fox
icy-arctic-fox / Dockerfile
Last active March 2, 2018 21:34
Dockerfile for Grafana with Elasticsearch alerting
FROM centos:6.6
# Install dependencies.
RUN curl -sL https://rpm.nodesource.com/setup_6.x | bash - && \
yum install -y initscripts curl tar gcc libc6-dev git nodejs bzip2 freetype fontconfig urw-fonts
# Install Go.
# Note that 1.4 is needed first to build 1.9.
ENV GOLANG_VERSION 1.4
RUN curl -sSL https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz \
@thomasklemm
thomasklemm / active_record_sqlite_in_memory_db.rb
Created April 27, 2015 21:01
Awesome ActiveRecord bug report script. How to use ActiveRecord and SQLite in a Ruby script.
# Based on http://www.jonathanleighton.com/articles/2011/awesome-active-record-bug-reports/
# Run this script with `$ ruby my_script.rb`
require 'sqlite3'
require 'active_record'
# Use `binding.pry` anywhere in this script for easy debugging
require 'pry'
# Connect to an in-memory sqlite3 database
@tbonza2
tbonza2 / gist:20757551443a61254aa6
Last active November 4, 2016 21:39
Saltstack mode for emacs

Saltstack mode for emacs

Earlier today I was looking for a Saltstack mode for emacs. Couldn't find one, so I posted the question on Stack overflow. Somebody had a good suggestion about using yaml-mode because a Sublime Text implementation appeared to be taking this approach.Another person thought that Saltstack's use of jinja templates would make an emacs mode easy enough to configure. These were both helpful ideas so I wanted to implement parts of each.

Reasoning

After looking around, I found that someone had configured an emacs mode for a similar situation. They needed to combine HTML and Python to use Mako templates for a project not involving Saltstack. Since Edx uses Mako t

This diff is a modified version of a diff written by Arnis Lapsa.
[ The original can be found here: https://gist.github.com/ArnisL/6156593 ]
This diff adds support to tmux for 24-bit color CSI SRG sequences. This
allows terminal based programs that take advantage of it (e.g., vim or
emacs with https://gist.github.com/choppsv1/73d51cedd3e8ec72e1c1 patch)
to display 16 million colors while running in tmux.
The primary change I made was to support ":" as a delimeter as well
@karmi
karmi / .gitignore
Last active November 12, 2022 12:11
Example Nginx configurations for Elasticsearch (https://www.elastic.co/blog/playing-http-tricks-nginx)
nginx/
!nginx/.gitkeep
!nginx/logs/.gitkeep
src/
tmp/
@choppsv1
choppsv1 / tmux-24.diff
Last active December 21, 2018 15:25
True color (24-bit) terminal support for tmux-1.9a and tmux-2.0
This diff is a modified version of a diff written by Arnis Lapsa.
[ The original can be found here: https://gist.github.com/ArnisL/6156593 ]
This diff adds support to tmux for 24-bit color CSI SRG sequences. This
allows terminal based programs that take advantage of it (e.g., vim or
emacs with https://gist.github.com/choppsv1/73d51cedd3e8ec72e1c1 patch)
to display 16 million colors while running in tmux.
The primary change I made was to support ":" as a delimeter as well
@alexpchin
alexpchin / Rails_Generating_and_Scaffolding.md
Last active April 2, 2024 12:24
Rails Generating & Scaffolding

Rails Generating & Scaffolding

Rails' use of strict naming conventions means a lot of core code SHOULD be in the same format whoever writes it? It could be written by a friend, colleague or a computer... it shouldn't matter because the same Rails rules apply to everyone.

This means that Rails can actually do some tasks for you! It can actually build things and write code on your behalf...

Coming from another language like PHP, this can seem like magic.

@dankogai
dankogai / gist:11215062
Created April 23, 2014 13:24
bash-4.3.11_1 in FreeBSD ports
% cat /usr/ports/shells/bash/pkg-message
======================================================================
bash requires fdescfs(5) mounted on /dev/fd and procfs(5) mounted on
/proc.
If you have not done it yet, please do the following:
mount -t fdescfs fdesc /dev/fd
mount -t procfs proc /proc
@jfrost
jfrost / gist:8798108
Created February 4, 2014 04:21
Basic Saltstack mine.get example
# This jinja template will demonstrate what grains are available from other nodes via salt's mine.get function
{% for host, data in salt['mine.get']('*', 'grains.items', expr_form = 'glob').items() -%}
{% for key, value in data.items() -%}
{{ host }} - {{ key }}: {{ value }}
{% endfor -%}
{% endfor -%}
@XVilka
XVilka / TrueColour.md
Last active July 9, 2024 23:28
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!