Skip to content

Instantly share code, notes, and snippets.

@eqyiel
eqyiel / Use Yubikey (GPG key) for SSH.md
Created Aug 2, 2020 — forked from jacquesbh/Use Yubikey (GPG key) for SSH.md
Use my Yubikey with GPG keys to SSH with a guest computer (OSX or Windows)
View Use Yubikey (GPG key) for SSH.md
@eqyiel
eqyiel / nix-serve.md
Last active May 6, 2020
How to use nix-serve with an alternative store location
View nix-serve.md

This is something you might want to do if you have an existing store directory on another dataset but don't want to overlay mount it onto /nix/store.

~/shell.nix is

{
  pkgs ? import <nixpkgs> {
    overlays = [
      (self: super: {
        nix = super.nix.override {
@eqyiel
eqyiel / apache-json-log-format
Created May 4, 2020 — forked from vmadman/apache-json-log-format
An apache log format that allow access logs (but not error logs) to be output in JSON format. I found this here: http://untergeek.com/2012/10/11/getting-apache-to-output-json-for-logstash/ -- but modified it for my purposes a good bit.
View apache-json-log-format
# Access Logs
LogFormat "{ \
\"@vips\":[\"%v\"], \
\"@source\":\"%v%U%q\", \
\"@source_host\": \"%v\", \
\"@source_path\": \"%f\", \
\"@tags\":[\"Apache\",\"Access\"], \
\"@message\": \"%h %l %u %t \\\"%r\\\" %>s %b\", \
\"@fields\": { \
\"timestamp\": \"%{%Y-%m-%dT%H:%M:%S%z}t\", \
@eqyiel
eqyiel / nixos-encrypted-zfs.sh
Created May 4, 2020 — forked from dysinger/nixos-encrypted-zfs.sh
How I installed Encrypted ZFS root on NixOS
View nixos-encrypted-zfs.sh
#!/bin/sh
# FIRST STOP THE zfs-zed SERVICE
systemctl stop zfs-zed
# FORCE UNLOAD ZFS KERNEL MODULES
lsmod | grep zfs | cut -d' ' -f1 | xargs rmmod -f
# NOW ADD THE FOLLOWING TO /etc/nixos/configuration.nix
#
View catj.txt
#!/usr/bin/env jq --raw-output --from-file --stream
. as $in
| select(length > 1)
| (
.[0] | map(
if type == "number"
then "[" + @json + "]"
else "." + .
end
View *scratch*.el
~/sync/git/blue-moon-games/blue-moon-games master* 7s
❯ omnisharp-roslyn
Failed to launch '/bin/bash' with args, '-c 'uname -s -m''
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Stdio.Host","Message":"Starting OmniSharp on Unknown 0.0 (Unknown)"},"Seq":1,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Services.DotNetCliService","Message":"DotNetPath set to dotnet"},"Seq":2,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.Discovery.MSBuildLocator","Message":"Located 1 MSBuild instance(s)\n 1: StandAlone 15.0 - \"/nix/store/yjqp3591f77mgki0i2bqxcbja0ad557b-omnisharp-linux/omnisharp/msbuild/15.0/Bin\""},"Seq":3,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.Discovery.MSBuildLocator","Message":"MSBUILD_EXE_PATH environment variable set to '/nix/store/yjqp3591f77mgki0i2bqxcbja0ad557b-omnisharp-linux/omnisharp/msbuild/15.0/Bin/MSBuild.dll'"},"Seq":4,"Type":"event"}
{"E
View *scratch*.el
#!/bin/sh
# Sample usage:
# ❯ nix-grep-propagated-build-inputs /nix/store/0bvp7g95i5p7m3s0is1acikhwjhv1vr9-nextcloud-client-2.5.0git.drv openssl
# /nix/store/0jd1gsnmsdg8zrzy4an1cdhj1cfrmaj3-qtbase-5.11.1-dev/nix-support/propagated-build-inputs:/nix/store/zsb7fpy9k61kbdg3h3dqcqfk3wrxwfpr-libxml2-2.9.8-dev /nix/store/b8kyvsj5xfbxafgb0acp8gsr6wr200b1-libxslt-1.1.32-dev /nix/store/pvwihqljhxd4zv5g5l3qxkqfzz2d0d0q-openssl-1.0.2o-dev /nix/store/awplqhpipm0cq28k6sgr2dcryhb650cg-sqlite-3.24.0-dev /nix/store/wm92zyin0gjjvha3kxg2x7xg19wbj686-zlib-1.2.11-dev /nix/store/miq37wrkg7n23i3164vm6dwbxn9k2rq5-harfbuzz-icu-1.8.2-dev /nix/store/mpayk2qxxnjzg9imiixbfg7zcqjjpy9m-icu4c-59.1-dev /nix/store/pvfyhd8s4zsr0x8avwb59kr971vrqn4b-libjpeg-turbo-1.5.3-dev /nix/store/9zfcc0m4byss40ynixsgnryyq3p0lv3k-libpng-apng-1.6.34-dev /nix/store/1954i1yvaqww5l05v84ds3lrxf6kw15a-libtiff-4.0.9-dev /nix/store/7c2v0bwdjjw5zzjlrk05cpj31rj6zfzf-pcre2-10.31-dev /nix/store/wxqkkhir16ki7m5hx8pzzj15m9jkdr00-dbus-1.12.8-dev /nix/store/qvxkvwhbsmvz72s
View shell.nix
{ nixpkgs ? <nixpkgs> }:
# note that importing ./nix/node is equivalent to importing ./nix/node/default.nix
with import nixpkgs {}; (import ./nix/node { nodejs = pkgs.nodejs; }).shell
View *scratch*.el
❯ ./nixops deploy -d tomoyo.maher.fyi
added deployment ‘aa41d5a6-a81a-11e7-96f3-28d244ac8d32’
building all machine configurations...
these derivations will be built:
/nix/store/02nglk49pjsp6bs8a9hj55psgx3vismp-unit-pulseaudio.service.drv
/nix/store/06yhdxcygd6ckhh8y7rj94m6wvp2gzwy-unit-script.drv
/nix/store/0blazp16bg0j8ixvj32nl7964zx3i5fq-unit-zfs-snapshot-daily.service.drv
/nix/store/0bmvc31m8ca8js1imn1ffx6l7ffn9z7v-unit-network-setup.service.drv
/nix/store/5kpqa3npsz3x5062ccclpphhh2lmfj6g-unit-script.drv
/nix/store/fgs7hvmwvpfq7jzj5vnard16sq48l8w8-unit-script.drv
@eqyiel
eqyiel / configure.sh
Created Feb 22, 2018 — forked from LnL7/configure.sh
darwin nix-daemon distributed builds
View configure.sh
#!/usr/bin/env bash
sudo mkdir -p /run/nix/current-load
sudo launchctl unload /Library/LaunchDaemons/org.nixos.nix-daemon.plist
sudo rm /Library/LaunchDaemons/org.nixos.nix-daemon.plist
sudo curl -fsSL -o /Library/LaunchDaemons/org.nixos.nix-daemon.plist https://gist.github.com/LnL7/ba2eac19e77cd6b4bb02c8de03bf5f4e/raw/69722c2b13c4eb022a1312cd6891838b413e1f96/org.nixos.nix-daemon.plist
sudo launchctl load /Library/LaunchDaemons/org.nixos.nix-daemon.plist
# Configure /etc/nix/machines
# Make sure root can ssh to the builder (known_hosts etc.)