Skip to content

Instantly share code, notes, and snippets.

Avatar

Leonard Gram xlson

View GitHub Profile
@xlson
xlson / Dockerfile
Created Apr 6, 2020
Dockerized Grafana on CentOS
View Dockerfile
ARG BASE_IMAGE=centos:8
FROM ${BASE_IMAGE} AS grafana-builder
ARG GRAFANA_TGZ="grafana-latest.linux-x64.tar.gz"
COPY ${GRAFANA_TGZ} /tmp/grafana.tar.gz
RUN mkdir /tmp/grafana && tar xfz /tmp/grafana.tar.gz --strip-components=1 -C /tmp/grafana
FROM ${BASE_IMAGE}
@xlson
xlson / grafana.ini
Created Jun 12, 2018
Modifying grafana.ini of a running docker container
View grafana.ini
[database]
log_queries = true
@xlson
xlson / grafana.ini
Last active Mar 7, 2018
Enables anonymous access for testing volume mapping with Docker and Grafana
View grafana.ini
##################### Grafana Configuration Example #####################
#
# Everything has defaults so you only need to uncomment things you want to
# change
# possible values : production, development
; app_mode = production
# instance name, defaults to HOSTNAME environment variable value or hostname if HOSTNAME var is empty
; instance_name = ${HOSTNAME}
@xlson
xlson / ColumnFixesSpec.groovy
Created Jul 14, 2017
Example of removing blanks in columnNames
View ColumnFixesSpec.groovy
import spock.lang.Specification
class ColumnFixesSpec extends Specification {
def csvData = """Name,Last Name,Age
Leonard,Gram,33"""
def "Removing all blanks from columnNames to make them easier to parse"() {
setup:
def columnNames = CsvParser.parseCsv(csvData).next().columns.collect { it.key.toString().replaceAll(' ','') }
@xlson
xlson / indexer.conf
Created Oct 17, 2013
Logstash 1.2.1 config to reproduce the problem of logstash not shutting down properly after being sent ^C.
View indexer.conf
input {
redis {
host => "127.0.0.1"
data_type => "list"
key => "logstash"
codec => json
}
}
output {
View install-graphite-ubuntu-12.04.sh
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Last tested & updated 10/13/2011
####################################
cd
sudo apt-get update
sudo apt-get upgrade
@xlson
xlson / gist:5335234
Created Apr 8, 2013
Emacs tips to me
View gist:5335234
delete-matching-lines (uses regexp)
C-x r k
Kill the text of the region-rectangle, saving its contents as the “last killed rectangle” (kill-rectangle).
@xlson
xlson / gist:3118133
Created Jul 15, 2012
The sweetest spam I've ever received
View gist:3118133
My name is mary As I whisper my prayer tonight and went into search for a nice friend at Google today and saw you
profile I came across your contact , My mind and my heart told me to contact you for friendship, A friend who truly
understand his or her friend and share their feelings together. please kindly accept my request, I believe that distance
or age can never be a barrier but let's love connect us because love is a bridge that connected far distance to be close
to each other, I will send more pictures to you immediately I receive your reply at my email address and i have
something in mind to tell you about my life.
PLEASE I WANT YOU TO CONTACT ME DIRECTLY TO ME EMAIL ADDRESS
@xlson
xlson / gist:2658443
Created May 11, 2012
Prowl notifcation script
View gist:2658443
#!/usr/bin/python
from optparse import OptionParser
import sys
import urllib2
import urllib
description = sys.stdin.read()
parser = OptionParser()
parser.add_option('-k', '--key', dest='key',
View gist:1771171
- Exception
java.lang.RuntimeException: java.io.FileNotFoundException: Could not locate pallet/resource__init.class or pallet/resource.clj on classpath:
at clojure.lang.Util.runtimeException(Util.java:165) ~[clojure-1.3.0.jar:na]
at clojure.lang.Compiler.eval(Compiler.java:6476) [clojure-1.3.0.jar:na]
java.io.FileNotFoundException: Could not locate pallet/resource__init.class or pallet/resource.clj on classpath:
at clojure.lang.Compiler.eval(Compiler.java:6455) [clojure-1.3.0.jar:na]
at clojure.lang.Compiler.load(Compiler.java:6902) [clojure-1.3.0.jar:na]
at clojure.lang.RT.loadResourceScript(RT.java:357) ~[clojure-1.3.0.jar:na]
at clojure.lang.RT.loadResourceScript(RT.java:348) ~[clojure-1.3.0.jar:na]
at clojure.lang.RT.load(RT.java:427) ~[clojure-1.3.0.jar:na]