-
Build Firecracker from source (it's fast and easy, builds in docker): https://github.com/firecracker-microvm/firecracker/blob/master/docs/getting-started.md#building-from-source
-
Adjust
/dev/kvm
permissions: https://github.com/firecracker-microvm/firecracker/blob/master/docs/getting-started.md#prerequisites -
Build Talos, you will need
build/vmlinux
&build/initramfs.xz
. -
Prepare configs for Talos:
osctl config generate fire https://172.16.0.2:6443
. Make following changes to the config: add resolvers to themachine.network
config:nameservers: ["8.8.8.8", "1.1.1.1"]
(IP config will come from kernel args), update install location:install: disk: /dev/vda
(default issda
).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} /> |
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
.
We will assume the following:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.pyc |
NewerOlder