Skip to content

Instantly share code, notes, and snippets.

View peterromfeldhk's full-sized avatar

Peter Romfeld peterromfeldhk

View GitHub Profile
#!/usr/bin/env nix-shell
#! nix-shell -i bash -p curl bash nix
set -euxo pipefail
commit_sha=$1
digest=$(nix-prefetch-url --unpack "https://github.com/NixOS/nixpkgs/archive/${commit_sha}.tar.gz")
echo "{\"rev\": \"${commit_sha}\", \"sha256\": \"${digest}\"}"
@peterromfeldhk
peterromfeldhk / nixos-install-encrypted-root.sh
Created April 25, 2019 05:34 — forked from sveitser/nixos-install-encrypted-root.sh
Installs nixos on encrypted root from live CD.
#!/usr/bin/env bash
#
# Installs nixos with full disk encrypted root partition.
#
# - Prompts for password initially, after that no interaction should
# be required.
# - At the end it will prompt for a root password, could not make
# echo-ing it into nixos-install work.
# - Reserves 550MB for boot partition, rest for the root volume.
# - After booting, log in as root user and set password for normal user.
@peterromfeldhk
peterromfeldhk / gnupg.fish
Created April 15, 2019 07:00
(yubikey) ssh with gpg in fish
## ~/.config/fish/conf.d/gnupg.fish
# Start or re-use a gpg-agent.
#
gpgconf --launch gpg-agent
# Ensure that GPG Agent is used as the SSH agent
set -xg SSH_AUTH_SOCK ~/.gnupg/S.gpg-agent.ssh
@peterromfeldhk
peterromfeldhk / inventory2json.py
Created February 28, 2018 04:47 — forked from sivel/inventory2json.py
Ansible inventory to dynamic inventory JSON output, accepts all inventory input formats
import sys
import json
from ansible.parsing.dataloader import DataLoader
try:
from ansible.inventory.manager import InventoryManager
A24 = True
except ImportError:
from ansible.vars import VariableManager
@peterromfeldhk
peterromfeldhk / fish_prompt.fish
Last active May 27, 2021 08:52
~/.local/share/omf/themes/default/fish_prompt.fish
# You can override some default options with config.fish:
#
# set -g theme_short_path yes
function fish_prompt
set -l last_command_status $status
set -l cwd
set -l kube_context
if test "$theme_short_path" = 'yes'
@peterromfeldhk
peterromfeldhk / Dockerfile
Created November 16, 2017 07:43
gitlab-ci-android
#
# GitLab CI: Android
#
FROM ubuntu:17.04
ENV VERSION_SDK_TOOLS 3859397
ENV ANDROID_HOME /sdk
ENV PATH $PATH:$ANDROID_HOME/tools
@peterromfeldhk
peterromfeldhk / keybase.md
Last active December 11, 2017 03:33
Keybase

Keybase proof

I hereby claim:

  • I am peterromfeldhk on github.
  • I am peterromfeld (https://keybase.io/peterromfeld) on keybase.
  • I have a public key whose fingerprint is C47D 7C9D 9278 7232 ECC3 EB9C D10E 6F3F 1530 6D73

To claim this, I am signing this object:

[{"name":"Afghanistan","cc":"AF"},{"name":"Åland Islands","cc":"AX"},{"name":"Albania","cc":"AL"},{"name":"Algeria","cc":"DZ"},{"name":"American Samoa","cc":"AS"},{"name":"Andorra","cc":"AD"},{"name":"Angola","cc":"AO"},{"name":"Anguilla","cc":"AI"},{"name":"Antarctica","cc":"AQ"},{"name":"Antigua and Barbuda","cc":"AG"},{"name":"Argentina","cc":"AR"},{"name":"Armenia","cc":"AM"},{"name":"Aruba","cc":"AW"},{"name":"Australia","cc":"AU"},{"name":"Austria","cc":"AT"},{"name":"Azerbaijan","cc":"AZ"},{"name":"Bahamas (the)","cc":"BS"},{"name":"Bahrain","cc":"BH"},{"name":"Bangladesh","cc":"BD"},{"name":"Barbados","cc":"BB"},{"name":"Belarus","cc":"BY"},{"name":"Belgium","cc":"BE"},{"name":"Belize","cc":"BZ"},{"name":"Benin","cc":"BJ"},{"name":"Bermuda","cc":"BM"},{"name":"Bhutan","cc":"BT"},{"name":"Bolivia (Plurinational State of)","cc":"BO"},{"name":"Bonaire, Sint Eustatius and Saba","cc":"BQ"},{"name":"Bosnia and Herzegovina","cc":"BA"},{"name":"Botswana","cc":"BW"},{"name":"Bouvet Island","cc":"BV"},{"name":"
@peterromfeldhk
peterromfeldhk / google_play_scraper-reviews.clj
Last active September 23, 2019 13:36
Scraper for Google Play reviews
(ns google-play-scraper.reviews
(:require
[clojure.string :as s]
[org.httpkit.client :as http]
[clojure.data.json :as json]
[net.cgrand.enlive-html :as html]
[clj-time.format :as f]))
(defn reviews-req [app-id page]
(http/post "https://play.google.com/store/getreviews"
@peterromfeldhk
peterromfeldhk / countries.json
Created August 3, 2016 09:14
JSON of all the Countries, Country Codes, Phone codes. Raw - Thanks to https://gist.github.com/adhipg/1600028
[
{
"iso": "AF",
"iso3": "AFG",
"name": "Afghanistan",
"num-code": 4,
"phone-code": 93
},
{
"iso": "AL",