Skip to content

Instantly share code, notes, and snippets.

@adamgreenhall
adamgreenhall / commitment.csv
Created October 25, 2011 22:00
d3 stacked layout with time axis
times prices status: base power: base status: peaker power: peaker power: wind load power: Ireland
2010-04-27 00:00:00 30.0 1.0 2197.0 -0.0 0.0 303 2500
2010-04-27 00:15:00 30.0 1.0 2178.0 1.0 0.0 311 2489
2010-04-27 00:30:00 30.0 1.0 2092.0 1.0 0.0 340 2432
2010-04-27 00:45:00 30.0 1.0 2012.0 1.0 0.0 360 2372
2010-04-27 01:00:00 30.0 1.0 1975.0 1.0 0.0 345 2320
2010-04-27 01:15:00 30.0 1.0 1918.0 1.0 0.0 348 2266
2010-04-27 01:30:00 30.0 1.0 1824.0 1.0 0.0 411 2235
2010-04-27 01:45:00 30.0 1.0 1804.0 1.0 0.0 405 2209
2010-04-27 02:00:00 30.0 1.0 1759.0 1.0 0.0 411 2170
@gitaarik
gitaarik / git_submodules.md
Last active July 26, 2024 13:44
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:

  • Separate big codebases into multiple repositories.
@rothgar
rothgar / main.yml
Last active March 8, 2024 07:16
Generate /etc/hosts with Ansible
# Idempotent way to build a /etc/hosts file with Ansible using your Ansible hosts inventory for a source.
# Will include all hosts the playbook is run on.
# Inspired from http://xmeblog.blogspot.com/2013/06/ansible-dynamicaly-update-etchosts.html
- name: "Build hosts file"
lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present
when: hostvars[item].ansible_default_ipv4.address is defined
with_items: groups['all']
@tobilg
tobilg / custom_s3_endpoint_in_spark.md
Last active May 22, 2023 14:57
Description on how to use a custom S3 endpoint (like Rados Gateway for Ceph)

Custom S3 endpoints with Spark

To be able to use custom endpoints with the latest Spark distribution, one needs to add an external package (hadoop-aws). Then, custum endpoints can be configured according to docs.

Use the hadoop-aws package

bin/spark-shell --packages org.apache.hadoop:hadoop-aws:2.7.2

SparkContext configuration

Principles of Adult Behavior

  1. Be patient. No matter what.
  2. Don’t badmouth: Assign responsibility, not blame. Say nothing of another you wouldn’t say to him.
  3. Never assume the motives of others are, to them, less noble than yours are to you.
  4. Expand your sense of the possible.
  5. Don’t trouble yourself with matters you truly cannot change.
  6. Expect no more of anyone than you can deliver yourself.
  7. Tolerate ambiguity.
  8. Laugh at yourself frequently.
@broerjuang
broerjuang / thinkingInReact.re
Created February 9, 2018 18:39
This is the implementation of thinking in react using reason
type product = {
category: string,
price: string,
stocked: bool,
name: string
};
type products = list(product);
let products = [
@jsiwek
jsiwek / print-log-info.bro
Last active October 30, 2019 21:06
Prints out field descriptions of all logs generated by Bro/Zeek.
# Prints out field descriptions of all logs generated by Zeek 3.0+.
#
# * Set environment variable ZEEK_ALLOW_INIT_ERRORS=1 before running Zeek
# with this script.
#
# * Requires a version of Bro/Zeek with the improvements from:
# https://github.com/bro/bro/commit/1f450c05102be6dd7ebcc2c5901d5a3a231cd675
# (Was not included in 2.6 release)
@load zeekygen
@wchargin
wchargin / discussion.url
Created February 10, 2019 05:01
wcgit utils for pushing a one-patch-is-one-change local repository to a one-branch-per-change remote (see https://wchargin.github.io/posts/managing-dependent-pull-requests for explanation)
https://wchargin.github.io/posts/managing-dependent-pull-requests
[$github, $bitbucket]
| (flatten) as $all_projects
| ([$all_projects[] | select(.stats.languages != null).stats.languages | to_entries] | flatten) as $langstats
| (
[
$all_projects[]
| select(.stats.languages != null).stats.languages
| keys
]
| flatten

Simplify Grafana

Goal: a minimal grafana that is 100% provisioned via files. There is no U/I to add dashoards on the fly.

  • A (go?) package, contains structs that define the dasbhoards, either see what grafana has or cleanup: https://github.com/grafana-tools/sdk
  • Dashboard are put in folders and may have tags
  • Dashboards are defined in (minimal) YAML
  • Everything is defined on a per-dashboard basis - consistency is put in the generate dashboard layer.