Skip to content

Instantly share code, notes, and snippets.

View moycat's full-sized avatar
💮
明日晴

Qing Deng moycat

💮
明日晴
View GitHub Profile
@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.
@nikhiljha
nikhiljha / README.md
Last active July 10, 2024 12:48
Apple Silicon (M1) + MultiMC + Minecraft 1.18 + Native LWJGL

Edit (2024): You no longer need to follow this guide! Just use PrismLauncher.

.

.

.

.

@khang06
khang06 / shittyinjector.cpp
Last active November 17, 2023 17:16
Barebones launcher/injector for mhynot2
#include <Windows.h>
#include <stdio.h>
#define GAME_DIR L"D:\\Games\\Genshin Impact\\Genshin Impact game"
#define DLL_PATH "C:\\Users\\Khang\\source\\repos\\mhynot2-rewritten\\x64\\Debug\\mhynot2-rewritten.dll"
int main() {
printf("hi\n");
SetCurrentDirectoryW(GAME_DIR);
@fritschy
fritschy / tcpdump-bpf-disasm.sh
Created December 17, 2019 11:01
How to disassemble a pcap BPF program
#!/bin/sh
(
echo -n load bpf ""
sudo tcpdump -ilo -ddd "$@" | tr '\n' ','
echo
echo disassemble
) | bpf_dbg
@knightsc
knightsc / hijack.c
Created February 26, 2019 21:20
Example of how to hijack a thread on macOS to run code in a remote process
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>
#include <mach/mach.h>
#include <mach/mach_vm.h>
#include <dlfcn.h>
#include <objc/runtime.h>
@0xTowel
0xTowel / bsgs.py
Last active August 1, 2023 16:49
Simple Baby-Step-Giant-Step implementation in Python3 for finding discrete logs with a prime modulus
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Towel 2017
from math import ceil, sqrt
def bsgs(g, h, p):
'''
Solve for x in h = g^x mod p given a prime p.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Date: 2015/7/03
# Created by 独自等待
# 博客 http://www.waitalone.cn/
import sys, os
from Crypto.Cipher import DES
def decode_char(c):
@Mygod
Mygod / iperf.sh
Last active November 30, 2019 22:18 — forked from madeye/iperf.sh
Bandwidth test for shadowsocks
#!/bin/bash
number=$1
method=$2
ss-tunnel -k test -m $method -l 8387 -L 127.0.0.1:8388 -s 127.0.0.1 -p 8389 &
ss_tunnel_pid=$!
ss-server -k test -m $method -s 127.0.0.1 -p 8389 &
ss_server_pid=$!
@pvieito
pvieito / amfid_patch.py
Created December 27, 2016 00:14
This script can patch macOS 10.12.2 amfid daemon on memory to allow arbitrary entitlements in Developer ID signed binaries.
#!/usr/bin/env python3
'''amfid_patch.py - Pedro José Pereira Vieito © 2016
This script can patch macOS 10.12.2 amfid daemon on memory
to allow arbitrary entitlements in Developer ID signed binaries.
Killing amfid will make the patch disapear:
$ sudo kill -9 `pgrep amfid`
You must run the script as a root (sudo) and with SIP disabled.
@walm
walm / main.go
Last active May 15, 2024 06:01
Simple Golang DNS Server
package main
import (
"fmt"
"log"
"strconv"
"github.com/miekg/dns"
)