Skip to content

Instantly share code, notes, and snippets.

@noonien
noonien / fdm-printer.md
Last active October 31, 2023 15:07
fdm-printer

Requirements:

  • Core XY
  • Accelerometer for input shaping
  • Temperature controlled closed chamber
  • Klipper support
  • Webcam
  • Automatic bed leveling
  • Linear rails
  • Filament detector
@noonien
noonien / a.nim
Created May 6, 2019 10:55
nim import fail 1
# if the imports are reversed, it works
import c
import b
echo Foo(3)
import ./machines/nomad
import 'dart:collection';
void main() {
var le = new ListEquality();
print(le.equals([1, 2, 3], [1, 2, 3]));
}
@noonien
noonien / memory_usage.ipynb
Created January 12, 2018 21:27
Chrome Memory Usage
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@noonien
noonien / forward-pxe-to-windows-deployment.md
Created October 12, 2017 12:05
Forward PXE requests to Windows deployment servers using OpenWRT

Append the following to /etc/config/dhcp:

config boot 'linux'                        
        option filename 'pxelinux.0'       
        option serveraddress 'YOUR.SERVER.IP.HERE'
        option servername 'HP Deployment'  
        list dhcp_option '186,10.0.255.251'
        list dhcp_option '187,8017'      
 list dhcp_option '252,\\boot\BCD'
@noonien
noonien / lego_00-namespace.yaml
Last active May 22, 2017 12:03
kube-lego + nginx-ingress on k8s 1.6+
apiVersion: v1
kind: Namespace
metadata:
name: kube-lego
@noonien
noonien / recwin
Last active April 19, 2017 17:30
Record window, encode and upload
#!/usr/bin/env python3
import argparse
import subprocess
import time
import os
import re
parser = argparse.ArgumentParser(description='Record window')
parser.add_argument('-window-id', type=int)
parser.add_argument('-fps', type=int, default=30)
@noonien
noonien / cache_stat.cpp
Last active October 13, 2016 16:19
LRU cache for stat()
// compile with: g++ -fPIC -shared -std=c++11 cache_stat.cpp -ldl -O3 -o cache_stat.so
#include <functional>
#include <sys/stat.h>
#include <dlfcn.h>
#include "lrucache.hpp"
typedef int (*xstat_type)(int ver, const char *pathname, struct stat *buf);
typedef int (*xstat64_type)(int ver, const char *pathname, struct stat64 *buf);
typedef int (*fxstatat_type)(int ver, int dirfd, const char *path, struct stat *stat_buf, int flags);
apiVersion: v1
kind: List
items:
- kind: ReplicationController
apiVersion: v1
metadata:
name: gitlab
namespace: internal
spec:
replicas: 1