Skip to content

Instantly share code, notes, and snippets.

@burnbrian
burnbrian / proxmox-configure-community-repos.sh
Created January 6, 2024 18:36
Configured Proxmox 8.1.3 community repositories on fresh install
#!/usr/bin/env bash
# https://pve.proxmox.com/wiki/Package_Repositories
# Tested on Proxmox 8.1.3
# https://gist.github.com/ngadmini/7f9df377999cc78c1b58e361d5425ac4
# Disable commercial and ceph
sed -i "s/^deb/\#deb/" /etc/apt/sources.list.d/pve-enterprise.list
sed -i "s/^deb/\#deb/" /etc/apt/sources.list.d/ceph.list
# Enable community
echo "deb http://download.proxmox.com/debian/pve $(grep "VERSION=" /etc/os-release | sed -n 's/.*(\(.*\)).*/\1/p') pve-no-subscription" > /etc/apt/sources.list.d/pve-no-enterprise.list
# Update and upgrade
@lukaseder
lukaseder / postgis-mandelbrot.sql
Created November 14, 2021 10:03
PostGIS Mandelbrot
with recursive
dims (r1, r2, i1, i2, s, it, p) as (values (-2::float, 1::float, -1.5::float, 1.5::float, 0.01::float, 100, 256.0::float)),
sprites (s) as (values (st_makepolygon(st_geomfromtext('linestring (0 0, 0 1, 1 1, 1 0, 0 0)')))),
n1 (r, i) as (select r, i from dims, generate_series((r1 / s)::int, (r2 / s)::int) r, generate_series((i1 / s)::int, (i2 / s)::int) i),
n2 (r, i) as (select r::float * s::float, i::float * s::float from dims, n1),
l (cr, ci, zr, zi, g, it, p) as (
select r, i, 0::float, 0::float, 0, it, p from n2, dims
union all
select cr, ci, zr*zr - zi*zi + cr, 2 * zr * zi + ci, g + 1, it, p from l where g < it and zr*zr + zi*zi < p
),
@majek
majek / compile-kernel.sh
Created February 1, 2021 15:36
repro for kvm gvisor
rm .config
make tinyconfig
make kvm_guest.config
make kvmconfig
./scripts/config \
-e EARLY_PRINTK \
-e 64BIT \
-e BPF -d EMBEDDED -d EXPERT \
-e INOTIFY_USER
@stephencookdev
stephencookdev / App.js
Created July 16, 2018 15:09
`SwitchWithSlide` example
import React from "react";
import { animateSwitch } from "./animateSwitch";
import { SlideOut } from "./SlideOut";
const SwitchWithSlide = animateSwitch(Switch, SlideOut);
export default () => (
<SwitchWithSlide>
<Route path="/a" component={PageA} />
<Route path="/b" component={PageB} />
@ubergesundheit
ubergesundheit / readme.md
Last active June 24, 2024 06:57
systemd traefik.service

systemd Service Unit for Traefik

Adapted from caddy systemd Service Unit

The provided file should work with systemd version 219 or later. It might work with earlier versions. The easiest way to check your systemd version is to run systemctl --version.

Instructions

We will assume the following:

@jumpingfella
jumpingfella / RegressionRNN.java
Created May 25, 2018 14:17
1..100 deeplearning4j RNN example
import org.deeplearning4j.nn.conf.GradientNormalization;
import org.deeplearning4j.nn.conf.MultiLayerConfiguration;
import org.deeplearning4j.nn.conf.layers.GravesLSTM;
import org.deeplearning4j.nn.conf.layers.RnnOutputLayer;
import org.deeplearning4j.nn.api.OptimizationAlgorithm;
import org.deeplearning4j.nn.conf.NeuralNetConfiguration;
import org.deeplearning4j.nn.multilayer.MultiLayerNetwork;
import org.deeplearning4j.nn.weights.WeightInit;
import org.nd4j.linalg.activations.Activation;
import org.nd4j.linalg.api.ndarray.INDArray;
@avnerbarr
avnerbarr / murmur64.scala
Created January 23, 2018 08:10
64bit "murmur" hash in scala. The builtin murmur hash only outputs 32 bits so if hashing millions of items you will get quite a few conflicts. This method will allow hashing millions of items without any conflicts
// Simple function to generate 64 bit hashes using the builtin Murmur hash functionaliy which only outputs 32bits
// we had cases when hashing 15M+ items where we got around 0.08% conflicts
// using this method we were able to hash 15M items with 0 conflicts
object ExtendedMurmurHash {
val seed = 0xf7ca7fd2
def hash(u: String): Long = {
val a = scala.util.hashing.MurmurHash3.stringHash(u, seed)
val b = scala.util.hashing.MurmurHash3.stringHash(u.reverse.toString, seed)
// shift a 32 bits to the left, leaving 32 lower bits zeroed
@chrisdone
chrisdone / gist:02e165a0004be33734ac2334f215380e
Last active July 1, 2024 21:55
Build and run minimal Linux / Busybox systems in Qemu

Common

export OPT=/opt
export BUILDS=/some/where/mini_linux
mkdir -p $BUILDS

Linux kernel

@patoorio
patoorio / .gitignore
Last active August 24, 2021 23:13 — forked from endolith/readme.md
Continuous wavelet analysis by Roger Fearick
*.pyc