Skip to content

Instantly share code, notes, and snippets.

@TheSherlockHomie
TheSherlockHomie / RenewExpiredGPGkey.md
Created January 3, 2021 16:36
Updating expired GPG keys and backing them up 🔑🔐💻

Updating expired GPG keys and their backup 🔑🔐💻

I use a GPG key to sign my git commits.

An error like this one might be a sign of an expired GPG key.

error: gpg failed to sign the data fatal: failed to write commit object
@eric-maynard
eric-maynard / Example.scala
Last active November 19, 2018 14:30
Manipulating nested Spark DataFrames
package com.cloudera.example
import org.apache.spark.sql._
import org.apache.spark.sql.types._
import org.apache.spark.sql.functions._
import scala.collection.mutable._
import scala.collection.mutable.ListBuffer
@AndruC
AndruC / Roll20 Macros.md
Last active May 10, 2024 06:25
Macros that I use to improve my D&D games

Macro Must-Haves

These are my must-have macros for running games online. I make full use of the compendium, which gives these macros access to common actions and rolls, saving me time.

Remember to add /w gm or @{selected|wtype} to hide sensitive info from your players. WTYPE is an attribute used in the 5th Edition OGL character sheet, a prerequisite for most of these.

Here's what my bar looks like.

Macro Quickbar

@JoshuaGross
JoshuaGross / README.md
Last active April 9, 2022 04:10
Freeing up extra disk space inside a Docker container

Freeing up extra disk space inside a Docker container

Sometimes while running a command inside of a docker container, the container itself will run out of disk space and things can fail (sometimes in strange ways). This is not a guide on how to allocate resources, but a quick cookbook on how to free up disk space inside a container. See below for links to more resources and reading.

If at all possible, just run Docker with increased disk space

See Limit disk size and bandwidth of a Docker container.

Resize an aufs volume

@andreicristianpetcu
andreicristianpetcu / ansible-summary.md
Created May 30, 2016 19:25
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@bmhatfield
bmhatfield / .profile
Last active May 6, 2024 22:27
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active May 3, 2024 12:32
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@hammer
hammer / HelloAvro.scala
Last active October 17, 2022 04:16
Concise example of how to write an Avro record out as JSON in Scala
import java.io.{IOException, File, ByteArrayOutputStream}
import org.apache.avro.file.{DataFileReader, DataFileWriter}
import org.apache.avro.generic.{GenericDatumReader, GenericDatumWriter, GenericRecord, GenericRecordBuilder}
import org.apache.avro.io.EncoderFactory
import org.apache.avro.SchemaBuilder
import org.apache.hadoop.fs.Path
import parquet.avro.{AvroParquetReader, AvroParquetWriter}
import scala.util.control.Breaks.break
object HelloAvro {
@granturing
granturing / HCatInputFormat.java
Last active September 28, 2016 14:24
HCatalog InputFormat wrapper to use with Spark (FYI for those finding this now, this was originally written pre-SparkSQL)
public class HCatInputFormat extends InputFormat<SerializableWritable<Writable>, HCatRecord> {
private final org.apache.hcatalog.mapreduce.HCatInputFormat input;
public HCatInputFormat() {
input = new org.apache.hcatalog.mapreduce.HCatInputFormat();
}
@Override
public RecordReader<SerializableWritable<Writable>, HCatRecord> createRecordReader(
@nandub
nandub / ProtobufEnvelope.java
Created May 1, 2011 05:52
ProtobufEnvelope - allows creating a protobuf message without the .proto file dynamically.
import com.google.protobuf.DescriptorProtos;
import com.google.protobuf.Descriptors;
import com.google.protobuf.DynamicMessage;
import com.google.protobuf.Message;
import java.util.HashMap;
/**
* ProtobufEnvelope - allows creating a protobuf message without the .proto file dynamically.
*