Skip to content

Instantly share code, notes, and snippets.

View naveenadi's full-sized avatar
🎯
Focusing

Aditya Agarwal naveenadi

🎯
Focusing
View GitHub Profile
@naveenadi
naveenadi / gpg-ssh-setup.md
Created September 8, 2024 13:46 — forked from mcattarinussi/gpg-ssh-setup.md
A setup guide to use a personal gpg key for ssh authentication

GPG - SSH setup

Generating the master key

Here we create the master key. We want only Certify capability: we use the master key only to create the subkeys, Sign - Encrypt - Authenticate capabilities will be assigned to the subkeys.

Run the following command to start the master key generation process. Select the set your own capabilities creation process (type 8)

  ▶ gpg --full-generate-key --expert

gpg (GnuPG) 2.2.9; Copyright (C) 2018 Free Software Foundation, Inc.

@notthebee
notthebee / compose.yaml
Created August 23, 2024 13:12
Ollama docker-compose
---
services:
webui:
image: ghcr.io/open-webui/open-webui:main
ports:
- 8080:8080/tcp
environment:
- OLLAMA_BASE_URL=http://ollama:11434
volumes:
- /var/opt/data/ollama/webui:/app/backend/data
-- vim: tabstop=2 shiftwidth=2 expandtab
-- We almost always start by importing the wezterm module
local wezterm = require 'wezterm'
-- Define a lua table to hold _our_ module's functions
local module = {}
-- Returns a bool based on whether the host operating system's
-- appearance is light or dark.
function module.is_dark()
@yordanoweb
yordanoweb / fix-dirty-ntfs.md
Created January 17, 2024 16:11
Fix dirty NTFS disk from Linux

Fix dirty NTFS disk from Linux

The problem

Sometimes when try to mount an NTFS disk in Linux, you get at journalctl the error:

ene 17 10:52:55 hp3nvyl17 kernel: ntfs3: sda1: It is recommened to use chkdsk.
ene 17 10:52:55 hp3nvyl17 kernel: ntfs3: sda1: volume is dirty and "force" flag is not set!
@kasuganosora
kasuganosora / llama_download.sh
Last active September 8, 2024 13:45
llama权重下载脚本
PRESIGNED_URL="https://agi.gpt4.org/llama/LLaMA/*"
TARGET_FOLDER="./" # where all files should end up
declare -A N_SHARD_DICT
N_SHARD_DICT["7B"]="0"
N_SHARD_DICT["13B"]="1"
N_SHARD_DICT["30B"]="3"
N_SHARD_DICT["65B"]="7"
# original post: https://rentry.org/sd-loopback-wave
# original author: https://rentry.org/AnimAnon
import os
import platform
import numpy as np
from tqdm import trange
import math
import subprocess as sp
import string
import random
@naveenadi
naveenadi / with_hooks.dart
Created April 12, 2022 16:15 — forked from rei-codes/with_hooks.dart
with useEffect
class HomePage extends HookWidget {
@override
Widget build(BuildContext context) {
useEffect(
() {
// initState
return () {
// dispose
};
},
@DavidAce
DavidAce / nvidia-tdp.service
Last active September 22, 2024 11:05
Nvidia power limit at boot
[Unit]
Description=Set NVIDIA power limit above default
[Service]
Type=oneshot
ExecStartPre=/usr/bin/nvidia-smi -pm 1
ExecStart=/usr/bin/nvidia-smi -pl 275
@vegard
vegard / kernel-dev.md
Last active September 8, 2024 20:40
Getting started with Linux kernel development

Getting started with Linux kernel development

Prerequisites

The Linux kernel is written in C, so you should have at least a basic understanding of C before diving into kernel work. You don't need expert level C knowledge, since you can always pick some things up underway, but it certainly helps to know the language and to have written some userspace C programs already.

It will also help to be a Linux user. If you have never used Linux before, it's probably a good idea to download a distro and get comfortable with it before you start doing kernel work.

Lastly, knowing git is not actually required, but can really help you (since you can dig through changelogs and search for information you'll need). At a minimum you should probably be able to clone the git repository to a local directory.

@qzm
qzm / aria2.conf
Last active August 14, 2024 14:11
Best aria2 Config
### Basic ###
# The directory to store the downloaded file.
dir=${HOME}/Downloads
# Downloads the URIs listed in FILE.
input-file=${HOME}/.aria2/aria2.session
# Save error/unfinished downloads to FILE on exit.
save-session=${HOME}/.aria2/aria2.session
# Save error/unfinished downloads to a file specified by --save-session option every SEC seconds. If 0 is given, file will be saved only when aria2 exits. Default: 0
save-session-interval=60
# Set the maximum number of parallel downloads for every queue item. See also the --split option. Default: 5