Skip to content

Instantly share code, notes, and snippets.

@Artefact2
Artefact2 / README.md
Last active March 30, 2025 03:38
GGUF quantizations overview
@gturi
gturi / mount-android-device-over-ssh.md
Last active November 10, 2024 06:23
Mount an Android device on your pc filesystem over ssh

Mount an Android device on your pc filesystem over ssh

Install scrcpy

Scrcpy allows to send keyboard input to the device, its installation is recommended since typing commands in the terminal from Android's keyboard it is quite uncomfortable:

scrcpy -K
@NaxAlpha
NaxAlpha / long_gpt.py
Last active July 23, 2024 13:07
Training script for LongGPT; Fine-tunes GPT-2 (335M) on The Pile Dataset with a context size of 8k tokens. (requires > 16GB RAM)
import time
from contextlib import suppress
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.backends.cuda as cuda
from torch.utils.data import DataLoader, IterableDataset
@atyachin
atyachin / Android_Emulator_AWS_EC2_ARM64_2022.txt
Last active March 13, 2025 13:37
Running headless android emulator on AWS EC2 Ubuntu instance (ARM64 / aarch64) - 2022
Android Emulator (ARM64) on EC2 - 2022
---------------------------------------
1. Launch EC2 ARM based Instance (a1.metal / a1.2xlarge): (16 Gb RAM, 32Gb Disk), Ubuntu Server 22.04 LTS (HVM) ARM x64
2. sudo apt update && sudo apt upgrade
3. sudo apt install default-jdk python3-pip repo python-is-python3 unzip libpcre2-dev adb
4. wget https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip
5. unzip commandlinetools-linux-8512546_latest.zip -d android-sdk
6. sudo mv android-sdk /opt/
7. mkdir /opt/android-sdk/cmdline-tools/latest
8. mv /opt/android-sdk/cmdline-tools/* /opt/android-sdk/cmdline-tools/latest (ignore the error)
@ritchiecarroll
ritchiecarroll / README.md
Last active February 11, 2025 23:11
Manual Windows Partitions Recovery and Restore from Windows Image Backup

Manual Windows Partitions Recovery and Restore from Windows Image Backup

Steps below iterate how to manually recreate the disk partitions required by Windows and restore a Windows installation from a system image backup created with the "Backup and Restore (Windows 7)" feature, especially when the official steps fail.

These steps were tested with Windows 11, but should work with prior versions of Windows as well:

@in03
in03 / encode_resolve_proxies.py
Last active October 5, 2023 17:08
Encode proxies for DaVinci Resolve using FFMpeg
# Windows: Create a shortcut to a .bat file in 'shell:sendto' to call this script with files passed as arguments
# Use with 'save_proxy_clip_list.py' gist to quickly pull used timeline clips into FFMPEG.
# Use 'link_proxies.py' gist to relink proxies correctly.
# Bug in current Resolve release links clips wrongly to one or two proxies only.
# This assumes FFMPEG is on path.
import os, sys, shutil
import subprocess
import argparse
import pathlib
@sebsto
sebsto / gist:6af5bf3acaf25c00dd938c3bbe722cc1
Last active November 3, 2024 19:16
Start VNCServer on Mac1 EC2 Instance
# YouTube (english) : https://www.youtube.com/watch?v=FtU2_bBfSgM
# YouTube (french) : https://www.youtube.com/watch?v=VjnaVBnERDU
#
# On your laptop, connect to the Mac instance with SSH (similar to Linux instances)
#
ssh -i <your private key.pem> ec2-user@<your public ip address>
#
# On the Mac
@gullyn
gullyn / flappy.html
Last active January 24, 2025 00:41
Flappy bird in 205 bytes (improved!)
<body onload=z=c.getContext`2d`,setInterval(`c.width=W=150,Y<W&&P<Y&Y<P+E|9<p?z.fillText(S++${Y=`,9,9|z.fillRect(p`}*0,Y-=--M${Y+Y},P+E,9,W),P))):p=M=Y=S=6,p=p-6||(P=S%E,W)`,E=49) onclick=M=9><canvas id=c>