const std = @import("std");
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
const a = gpa.allocator();
const hoge_str = try a.dupe(u8, "hogehoge");
defer a.free(hoge_str);
#!/bin/bash | |
# Check if running from within MSYS2. | |
if [ -z "$MSYSTEM" ]; | |
then | |
>&2 echo "This is intended to be run from within an MSYS2 environment." | |
exit 1 | |
fi | |
# Check arguments for correct length. |
This gist is almost entirely not unlike Derek Seaman's awesome blog:
Proxmox VE 8: Windows 11 vGPU (VT-d) Passthrough with Intel Alder Lake
As such please refer to that for pictures, here i will capture the command lines I used as i sequence the commands a little differently so it makes more logic to me.
This gists assumes you are not running ZFS and are not passing any other PCIE devices (as both of these can require addtional steps - see Derek's blog for more info)
This gist assumes you are not running proxmox in UEFI Secure boot - if you are please refer entirely to dereks blog.
This tutorial guides you through the process of creating Templates and Virtual Machines on Proxmox using cloud-based images from various Linux distributions. We provide clear instructions for Alma Linux 9, Amazon Linux 2, CentOS 9, Fedora 38, Oracle Linux 9, RHEL 9, Rocky Linux 9, and Ubuntu 23.04 Lynx Lobster.
Note: The instructions have been tested on Proxmox 8.0.4.
Let's begin by choosing the cloud-based image. If you already have your preferred Linux distribution, skip to the 1st step.
To assist in making informed choices when selecting a Linux distribution for your virtual machines, we've compiled a table showcasing key characteristics of each cloud image. This table provides a snapshot of important attributes, including kernel version, Python version, number of processes initialized after boot, number of packages installed, free memory after boot, VM disk size, root partition disk size, used size on t
#!/bin/sh | |
# Assumptions and requirements | |
# - All drives will be formatted. These instructions are not suitable for dual-boot | |
# - No hardware or software RAID is to be used, these would keep ZFS from detecting disk errors and correcting them. In UEFI settings, set controller mode to AHCI, not RAID | |
# - These instructions are specific to UEFI systems and GPT. If you have an older BIOS/MBR system, please use https://openzfs.github.io/openzfs-docs/Getting%20Started/Ubuntu/Ubuntu%2020.04%20Root%20on%20ZFS.html | |
# change the these disks variables to your disks paths (check with lsblk) | |
DISK1="/dev/nvme0n1" | |
DISK2="/dev/nvme1n1" |
All digest-*
packages built with the same GPG key:
$ gpg --list-keys
pub rsa4096 2022-06-30 [SC]
A5EA7083CF9513E99A476505B081E2685FE35E6E
uid [ultimate] MNX Cloud Package Signing (Linux) <[email protected]>
sub rsa4096 2022-06-30 [E]
#!/usr/bin/env bash | |
Z=$(curl -s https://ziglang.org/download/index.json | jq -r '.master."x86_64-linux".tarball') | |
OUT_DIR=$(echo "$Z" | awk -F "/" '{ print $NF }' | sed 's/.tar.xz//') | |
if [ -d "$OUT_DIR" ]; then | |
echo "Latest Zig already present: $OUT_DIR" | |
else | |
curl -s "$Z" | tar xJf - | |
fi |
const std = @import("std"); | |
const mem = std.mem; | |
const meta = std.meta; | |
const math = std.math; | |
const Vector = meta.Vector; | |
const expect = std.testing.expect; | |
fn generateSquareMatrix(N: usize, allocator: mem.Allocator, gen_rand: bool) ![][]f64 { | |
var matrix: [][]f64 = undefined; | |
matrix = try allocator.alloc([]f64, N); |
#!/bin/bash -eu | |
if [ $# -ne 1 ]; then | |
echo "Usage: $0 <cfilename> ending '.c' or '.h'" | |
exit 1 | |
fi | |
if [[ $1 == *.c ]]; then | |
OUTPUT=$(basename $1 .c)_translated.zig | |
elif [[ $1 == *.h ]]; then | |
OUTPUT=$(basename $1 .h)_h_translated.zig | |
else |