This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: $ nix eval "(builtins.attrNames (import (builtins.fetchurl "https://matthewbauer.us/generate-versions.nix") {}).emacs)" | |
# $ nix run "(import (builtins.fetchurl "https://matthewbauer.us/generate-versions.nix") {}).emacs.\"24.3\"" -u LANG -c emacs | |
{}: | |
let | |
channels = [ "nixos-20.09" "nixos-20.03" "nixos-19.09" "nixpkgs-unstable" ]; | |
getSet = channel: (import (builtins.fetchTarball "channel:${channel}") {inherit (builtins.currentSystem);}).pkgs; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM jupyter/minimal-notebook:36bce751008f | |
USER root | |
RUN apt-get update && apt-get install -y curl | |
RUN mkdir /nix | |
RUN chown jovyan /nix | |
ENV PATH=/home/jovyan/.nix-profile/bin:$PATH |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Kudos to https://matthewbauer.us/blog/static-nix.html | |
$ docker run --rm -it -w /root alpine | |
$ apk add curl | |
$ curl https://matthewbauer.us/nix -o nix && chmod +x nix | |
$ ./nix run -f channel:nixpkgs-unstable awscli -c aws --version | |
aws-cli/1.17.13 Python/3.7.7 Linux/4.19.116 botocore/1.14.13 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
pkgs = import <nixpkgs> {}; | |
awscli = with pkgs; stdenv.mkDerivation { | |
name = "awscli"; | |
src = fetchzip { | |
url = https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip; | |
sha256 = "1pqvqhxbikqnji7nazvaqnk2czlmr3kvs1zyl13w96ym4if3np1v"; | |
}; | |
propagatedBuildInputs = with pkgs; [ | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
cat << 'EOF' > ~/dbeaver.dockerfile | |
FROM openjdk:14-slim | |
RUN apt-get update && apt-get install -y wget libgtk-3-dev | |
ENV VERSION 6.2.1 | |
RUN wget https://dbeaver.io/files/${VERSION}/dbeaver-ce-${VERSION}-linux.gtk.x86_64.tar.gz | |
RUN tar xvzf dbeaver-ce-${VERSION}-linux.gtk.x86_64.tar.gz | |
RUN rm dbeaver-ce-${VERSION}-linux.gtk.x86_64.tar.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Internal error. Please refer to http://jb.gg/ide/critical-startup-errors | |
java.util.concurrent.CompletionException: com.intellij.ide.plugins.StartupAbortedException: Fatal error initializing 'com.jetbrains.rider.protocol.ProtocolManagerInitializer' | |
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314) | |
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319) | |
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1739) | |
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:201) | |
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831) | |
at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:310) | |
at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:80) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -eu | |
dockerfile=$(mktemp) | |
trap "rm $dockerfile" EXIT | |
cat << EOF > $dockerfile | |
FROM ubuntu:bionic | |
RUN apt-get update && apt-get install -y wget gnupg2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface IValue<out T> | |
{ | |
T Value { get; } | |
} | |
interface INewTypeEq<TSelf, TValue> : IValue<TValue>, IEquatable<TSelf> | |
where TValue : IEquatable<TValue> | |
where TSelf : INewTypeEq<TSelf, TValue> | |
{ | |
TSelf New(TValue value); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Edit this configuration file to define what should be installed on | |
# your system. Help is available in the configuration.nix(5) man page | |
# and in the NixOS manual (accessible by running ‘nixos-help’). | |
{ config, pkgs, ... }: | |
{ | |
imports = | |
[ # Include the results of the hardware scan. | |
./hardware-configuration.nix |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# thanks to https://stackoverflow.com/a/32967407 for the CSV output | |
aws ec2 describe-spot-price-history --product-description "Linux/UNIX (Amazon VPC)" --start-time "$(date +%s)" | jq '.SpotPriceHistory | group_by(.InstanceType) | [.[] | min | {InstanceType, SpotPrice}]' | jq -r '(.[0] | keys_unsorted) as $keys | $keys, map([.[ $keys[] ]])[] | @csv' | less |