Skip to content

Instantly share code, notes, and snippets.

View geek-at's full-sized avatar
🐢

Christian Haschek geek-at

🐢
View GitHub Profile
@scyto
scyto / hyperv-migration-win.md
Last active November 6, 2023 13:42
Migrating Windows Gen2 VMs from Hyper-V

How To migrate Gen2 Windows VM from Hyper-V

This assumes you have Windows Server 2022 Gen2 VM running on hyper-v that uses gen2 with UEFI and Secure Boot - it should work for win11 but i haven't tested that. This has only tested with a vanilla windows server 2022 VM so far (three times to write guide). I will comment this gist when i manage to move one of my domain controllers.

I suggest creating a fresh test windows VM and use this procedure on that test VM long before you try this on a production VM. And repeat after me 'i will backup all VMs with snapshots AND will backup with backup application before i do this`... ok...

this gist is part of this series

VM preparation

@scyto
scyto / proxmox.md
Last active July 21, 2024 23:31
proxmox cluster proof of concept

ProxMox Cluster - Soup-to-Nutz

aka what i did to get from nothing to done.

note: these are designed to be primarily a re-install guide for myself (writing things down helps me memorize the knowledge), as such don't take any of this on blind faith - some areas are well tested and the docs are very robust, some items, less so). YMMV

Purpose of Proxmox cluster project

Required Outomces of cluster project

@rain-1
rain-1 / llama-home.md
Last active June 19, 2024 03:05
How to run Llama 13B with a 6GB graphics card

This worked on 14/May/23. The instructions will probably require updating in the future.

llama is a text prediction model similar to GPT-2, and the version of GPT-3 that has not been fine tuned yet. It is also possible to run fine tuned versions (like alpaca or vicuna with this. I think. Those versions are more focused on answering questions)

Note: I have been told that this does not support multiple GPUs. It can only use a single GPU.

It is possible to run LLama 13B with a 6GB graphics card now! (e.g. a RTX 2060). Thanks to the amazing work involved in llama.cpp. The latest change is CUDA/cuBLAS which allows you pick an arbitrary number of the transformer layers to be run on the GPU. This is perfect for low VRAM.

  • Clone llama.cpp from git, I am on commit 08737ef720f0510c7ec2aa84d7f70c691073c35d.
@ignis-sec
ignis-sec / Microsoft.PowerShell_profile.ps1
Created September 22, 2020 15:16
My powershell profile
function Prompt
{
$FullUnicode = 'U+1F525'
$StrippedUnicode = $FullUnicode -replace 'U\+',''
$UnicodeInt = [System.Convert]::toInt32($StrippedUnicode,16)
$promptEmoji = [System.Char]::ConvertFromUtf32($UnicodeInt)
(Write-Host -NoNewline (Get-Date -Format "[HH:mm:ss]$promptEmoji"))
(Write-Host -NoNewline $env:USERNAME -ForegroundColor Red)
@ruanbekker
ruanbekker / k3s_on_alpine.md
Last active January 14, 2024 20:28
Install k3s on Alpine Linux
$ apk add --no-cache curl
$ echo "cgroup /sys/fs/cgroup cgroup defaults 0 0" >> /etc/fstab

$ cat > /etc/cgconfig.conf <<EOF
mount {
  cpuacct = /cgroup/cpuacct;
  memory = /cgroup/memory;
  devices = /cgroup/devices;
  freezer = /cgroup/freezer;
@d4v3y0rk
d4v3y0rk / howto.md
Created March 14, 2020 13:04
Encryption with DM_CRYPT in WSL2

Encrypted Volumes in WSL2

Description

This is a quick guide on how to setup dm_crypt under WSL2 for working with encrypted volumes. I use an encrypted volume to store things like password recovery codes and 2nd factor backup codes etc. I recently switched over to using WSL2 and wanted to figure out how to enable this functionality there. This is the distilled howto for getting it to work.

Guide

First thing you have to do is create a custom WSL2 kernel. Inside your already installed and running WSL2 (ubuntu) installation:

  • Install some required packages.
@rikka0w0
rikka0w0 / ipxe_build.md
Last active July 21, 2024 16:44
Build IPXE

1. Install tools and config IPXE

# Install compiler and dependencies
sudo apt-get install -y git gcc make liblzma-dev

# Grab the source code
git clone https://github.com/ipxe/ipxe.git
cd ipxe/src

# Enable NFS support
@erincandescent
erincandescent / netboot.nix
Created January 6, 2020 01:06
netbooting a raspberry pi running alpine with nix
# dhcp server settings:
# dhcp-mac=set:rpi,b8:27:eb:*:*:*
# dhcp-boot=tag:rpi,boot,10.69.69.179
{ lib, stdenv, config, pkgs, ... }:
let
alpineRelease = "3.11";
alpineRevision = "2";
alpineVersion = "${alpineRelease}.${alpineRevision}";
@hdogan
hdogan / curl-smtp.php
Last active March 16, 2024 07:49
Sending SMTP e-mail with curl/php
<?php
function read_cb($ch, $fp, $length) {
return fread($fp, $length);
}
$fp = fopen('php://memory', 'r+');
$string = "From: <no-reply@example.com>\r\n";
$string .= "To: <hdogan@example.com>\r\n";
$string .= "Date: " . date('r') . "\r\n";
$string .= "Subject: Test\r\n";
@thomasnorris
thomasnorris / Raspberry Pi Kiosk Setup.md
Last active October 22, 2023 03:36
Instructions for installing a fresh image of Raspbian and turning the Pi into a kiosk (for google slides, google photos, etc)

Raspberry Pi Kiosk Setup

  • Install a fresh image of Raspbian and boot the Pi
  • Go through the prompts to finish initial setup
  • Open a Termial window
    • Type sudo apt-get install unclutter
    • Type sudo raspi-config
      • Select Boot Options with Enter
        • Select Wait for Network at Boot with Enter
        • Select Yes with Enter