Skip to content

Instantly share code, notes, and snippets.

View xlson's full-sized avatar

Leonard Gram xlson

View GitHub Profile
@xlson
xlson / Dockerfile
Created April 6, 2020 13:43
Dockerized Grafana on CentOS
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 June 12, 2018 12:53
Modifying grafana.ini of a running docker container
[database]
log_queries = true
@xlson
xlson / grafana.ini
Last active March 7, 2018 08:51
Enables anonymous access for testing volume mapping with Docker and Grafana
##################### 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 July 14, 2017 08:52
Example of removing blanks in columnNames
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 October 17, 2013 11:18
Logstash 1.2.1 config to reproduce the problem of logstash not shutting down properly after being sent ^C.
input {
redis {
host => "127.0.0.1"
data_type => "list"
key => "logstash"
codec => json
}
}
output {
####################################
# 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 April 8, 2013 08:43
Emacs tips to me
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 July 15, 2012 18:47
The sweetest spam I've ever received
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 08:42
Prowl notifcation script
#!/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',
- 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]