Skip to content

Instantly share code, notes, and snippets.

View guilt's full-sized avatar
🎯
Focusing

Karthik Kumar Viswanathan guilt

🎯
Focusing
View GitHub Profile
@guilt
guilt / Pi Setup Steps.md
Last active April 13, 2024 06:54
Raspberry and Orange Setup Steps

Raspberry Pi Setup Steps

  1. Make the Box Ready. Either Keep the Box or Attach the Racking Unit
  2. Write Image, note down Hostname
  3. Install MicroSD Card
  4. Connect PoE and Reboot

Raspberry Pi Imaging Manual

  1. Use rapios-lite
@guilt
guilt / authy.spec
Created June 17, 2023 21:15
Authy Snap into RPM
%define _snapid H8ZpNgIoPyvmkgxOWw5MSzsXK1wRZiHn
%define _snaprev 18
Name: authy
Version: 2.2.3
Release: 1%{?dist}
Summary: Two factor authentication desktop application
ExclusiveArch: x86_64
License: Proprietary
URL: https://authy.com/
@guilt
guilt / env.nu
Last active May 11, 2023 22:39
NuShell Windows
# Custom Aliases
alias dir = ls
alias del = rm
alias ren = mv
alias move = mv
alias rmdir = rm
alias rd = rmdir
alias open = start
@guilt
guilt / unroll.c
Last active February 24, 2023 04:24
Header-Only Efficient Loop Unrolling in C and C++.
// Demo of unroll.h
#include "unroll.h"
int main()
{
int v;
U_unroll(v, 17, {
printf("Up Unroll\n");
});
@guilt
guilt / SDCascade.py
Last active March 6, 2024 06:29
Stable Diffusion
import os
from accelerate import Accelerator
from diffusers import StableCascadeDecoderPipeline, StableCascadePriorPipeline
from slugify import slugify
import torch
priorModelId = "stabilityai/stable-cascade-prior"
modelId = "stabilityai/stable-cascade"
dataType = torch.float32 #16 is buggy
@guilt
guilt / ROCM Setup Steps.md
Last active December 13, 2023 13:53
ROCM Setup Steps

ROCm Setup Steps

ROCm Docker Image

  1. Install Docker and ensure you can run docker ps correctly, add yourself to the docker group if necessary.
  2. Run build-rocm.sh builds a ROCm docker image for your Linux System. It is configured to use the render group configured in your Linux distribution and ensure that /dev/kfd and /dev/dri are writeable by the render group users. Ensure you are added to the render group if necessary.
  3. Run launch-rocm.sh if you wish to only use ROCm with the docker image you built.
@guilt
guilt / RESETDMA.VBS
Last active December 28, 2022 22:23
Windows Script to reset DMA mode on Optical Drives
' Visual Basic Script program to reset the DMA status of all ATA drives
' Copyright © 2006 Hans-Georg Michna
' Version 2006-03-14
' Works in Windows XP, probably also in Windows 2000 and NT.
' Does no harm if Windows version is incompatible.
If MsgBox("This program will now reset the DMA status of all ATA drives with Windows drivers." _
@guilt
guilt / oper.py
Last active December 13, 2023 13:56
Combinatorial Operator Interleaver
from itertools import product, permutations
"""
if __name__ == '__main__':
for expr in generateOperators([2,3,4], ['+','-']):
print(expr)
"""
def alternateBetween(items, operators):
lenItems = len(items)
@guilt
guilt / client.tsx
Last active December 28, 2022 22:26
Deno React App
import React from "https://esm.sh/react@17.0.2";
const App = () => {
return (
<h1>Hello Deno Land!</h1>
);
};
export default App;
@guilt
guilt / html2pdf.sh
Last active December 28, 2022 22:27
PhantomJS based HTML to PDF renderer
#!/bin/sh
set -e
HFILE=$1
[ -f "$HFILE" ] || { echo "HTML File not found."; exit 1; }
PFILE=$( echo "${HFILE}" | sed 's/.html/.pdf/g' )
TMPDIR=${TMPDIR:-${TEMP}}
TMPDIR=${TMPDIR:-${TMP}}