Skip to content

Instantly share code, notes, and snippets.

View offlinehacker's full-sized avatar
🤓
deploying awesomeness

Jaka Hudoklin offlinehacker

🤓
deploying awesomeness
View GitHub Profile
[wsl2]
kernel=C:\\Users\\JAKA\\vmlinux
@offlinehacker
offlinehacker / utils.nix
Created October 12, 2019 13:03
Reusable utility nix functions
{
removeAttrByPath = attrPath: attrs:
let
recurse = residualPath: currentPath: set:
let
# if on course continue recursion else just return value
g = name: value:
if name == lib.head residualPath
then recurse (lib.tail residualPath) (currentPath ++ [name]) value
else value;
#!/bin/bash
set -e
VIRSH=virsh
[email protected]
LIBVIRT_URI=qemu+ssh://$LIBVIRT_HOST/system
POOL=images
PROJECT=$1
SHARE_DIR=/storage/share
@offlinehacker
offlinehacker / certs.nix
Last active May 1, 2024 08:50
Kubernetes nixops deployment
{
pkgs ? import <nixpkgs> {},
internalDomain ? "cluster.local",
externalDomain ? "<domain_name>",
serviceClusterIp ? "10.0.0.1"
}:
let
runWithCFSSL = name: cmd:
builtins.fromJSON (builtins.readFile (
pkgs.runCommand "${name}-cfss.json" {
@offlinehacker
offlinehacker / darwin.nix
Created October 24, 2016 15:44
Nix crossbuild
import ./default.nix # The root nixpkgs default.nix
{
crossSystem = {
# That's the triplet they use in the mingw-w64 docs,
# and it's relevant for nixpkgs conditions.
config = "x86_64-w64-mingw32";
arch = "x86"; # Irrelevant
libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
platform = {};
openssl.system = "mingw64";
@offlinehacker
offlinehacker / Dockerfile
Created June 26, 2016 14:55
Docker arm qemu
FROM resin/armv7hf-debian-qemu
RUN [ "cross-build-start" ]
RUN apt-get update
RUN apt-get install -y python python-pip
RUN pip install virtualenv
RUN [ "cross-build-end" ]
'use strict';
const amqp = require('amqplib-easy')('amqp://localhost');
const exchangeOptions = {
exchange: 'amq.headers',
exchangeType: 'headers'
};
// takes a default connection for handling errors
@offlinehacker
offlinehacker / config.nix
Last active May 3, 2017 13:03
.nixpkgs/config.nix
# This is mostly a work in progress and might not work with what is in
# nixpkgs trunk. If you have questions, feel free to contact me:
# Jaka Hudoklin <[email protected]>
{
allowUnfree = true; # for flash and such
#allowBroken = true; # for testing
chromium.enableGoogleTalkPlugin = true;
chromium.enablePepperFlash = true;
// npm install hapijs/joi#issue-577
'use strict';
var Joi = require('joi');
class TypableObject extends Object {
constructor(value, type) {
super(value);
Object.defineProperty(this, '_type', {value: type});
# initialization file (not found)