Skip to content

Instantly share code, notes, and snippets.

@ercas
ercas / listenbrainz.R
Last active July 21, 2021 15:58
create graphs of listenbrainz data
library(dplyr)
library(ggplot2)
library(jsonlite)
library(lubridate)
library(stringr)
# load data ---------------------------------------------------------------
data <- fromJSON("ercas_lb-2021-07-21.json") %>%
flatten() %>%
@typelogic
typelogic / -
Created February 16, 2019 21:12
nix drv to json
nix show-derivation /nix/store/5g3180kwyi07qqbvv2r5rkr42khymqxd-simple.drv
@MawKKe
MawKKe / cryptsetup-with-luks2-and-integrity-demo.sh
Last active June 7, 2024 17:18
dm-crypt + dm-integrity + dm-raid = awesome!
#!/usr/bin/env bash
#
# Author: Markus (MawKKe) ekkwam@gmail.com
# Date: 2018-03-19
#
#
# What?
#
# Linux dm-crypt + dm-integrity + dm-raid (RAID1)
#
@goetzc
goetzc / btrfs-subvolume-diff.sh
Created December 30, 2017 23:02
Show the difference between two btrfs subvolumes/snapshots
#!/bin/bash
#
# Author: http://serverfault.com/users/96883/artfulrobot
#
# This script will show most files that got modified or added.
# Renames and deletions will not be shown.
# Read limitations on:
# http://serverfault.com/questions/399894/does-btrfs-have-an-efficient-way-to-compare-snapshots
#
# btrfs send is the best way to do this long term, but as of kernel
@ViktorNova
ViktorNova / rotate-video.sh
Created August 8, 2016 21:33
Rotate a video with FFmpeg (100% lossless, and quick)
$INPUTVIDEO='input.mp4'
$OUTPUTVIDEO='output.mp4'
ffmpeg -i $INPUTVIDEO -metadata:s:v rotate="-90" -codec copy $OUTPUTVIDEO
@olih
olih / jq-cheetsheet.md
Last active June 22, 2024 18:30
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@datagrok
datagrok / gist:2199506
Last active April 8, 2023 17:36
Virtualenv's `bin/activate` is Doing It Wrong