Skip to content

Instantly share code, notes, and snippets.

@jctosta
jctosta / screen_cheatsheet.markdown
Last active April 18, 2024 07:03
Screen Cheatsheet

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r
@mlabonne
mlabonne / finetune_llama2.py
Last active April 18, 2024 07:00
Easy Llama 2 fine-tuning script (📝 Article: https://tinyurl.com/finetunellama2)
# Based on younesbelkada/finetune_llama_v2.py
# Install the following libraries:
# pip install accelerate==0.21.0 peft==0.4.0 bitsandbytes==0.40.2 transformers==4.31.0 trl==0.4.7 scipy
from dataclasses import dataclass, field
from typing import Optional
import torch
from datasets import load_dataset
from transformers import (
@Aexylus
Aexylus / tailwind.config.ts
Created March 16, 2024 21:22
Tailwind vKitze with autocomplete
import type { Config } from 'tailwindcss';
import pluginCreator from 'tailwindcss/plugin';
export default {
content: ['./index.html', './app/**/*.{js,ts,jsx,tsx}'],
theme: {
extend: {},
},
plugins: [
pluginCreator(function ({ addUtilities, theme }) {
@zOrg1331
zOrg1331 / wireguard_layer2.md
Last active April 18, 2024 06:59
wireguard, wireguard layer 2, wireguard over TCP

Intro

This note describes how to connect two networks/devices/VMs over public network using Wireguard with Layer 2 support (ARP, IPv6 link-local, etc).

This can also be achieved using SSH and its "tap" tunnel, however, it does not provide the same level of latency and bandwidth as full-blown VPN such as Wireguard.

In addition, this note describes how to tunnel Wireguard over TCP connection. This may be of use if you encounter firewall in-between so, for instance, you can use TCP port 443 only.

Objective

version: "3"
services:
sftpgo:
image: "drakkan/sftpgo:v2-alpine"
# default user id
user: 1026
restart: always
expose:
# HTTP
- "8080"
@SoabY
SoabY / JetBrains products Activation code until 15 May 2024
Created October 1, 2023 08:04
JetBrains products Activation code until 15 May 2024
8Z6IT0PIZH-eyJsaWNlbnNlSWQiOiI4WjZJVDBQSVpIIiwibGljZW5zZWVOYW1lIjoiSHVuYW4gTm9ybWFsIFVuaXZlcnNpdHkiLCJhc3NpZ25lZU5hbWUiOiJTdGFyayB6aGFuZyIsImFzc2lnbmVlRW1haWwiOiJzdGFyazE5ODUyMDIwQGdtYWlsLmNvbSIsImxpY2Vuc2VSZXN0cmljdGlvbiI6IkZvciBlZHVjYXRpb25hbCB1c2Ugb25seSIsImNoZWNrQ29uY3VycmVudFVzZSI6ZmFsc2UsInByb2R1Y3RzIjpbeyJjb2RlIjoiRFBOIiwicGFpZFVwVG8iOiIyMDI0LTA1LTE1IiwiZXh0ZW5kZWQiOmZhbHNlfSx7ImNvZGUiOiJEQiIsInBhaWRVcFRvIjoiMjAyNC0wNS0xNSIsImV4dGVuZGVkIjpmYWxzZX0seyJjb2RlIjoiUFMiLCJwYWlkVXBUbyI6IjIwMjQtMDUtMTUiLCJleHRlbmRlZCI6ZmFsc2V9LHsiY29kZSI6IklJIiwicGFpZFVwVG8iOiIyMDI0LTA1LTE1IiwiZXh0ZW5kZWQiOmZhbHNlfSx7ImNvZGUiOiJSU0MiLCJwYWlkVXBUbyI6IjIwMjQtMDUtMTUiLCJleHRlbmRlZCI6dHJ1ZX0seyJjb2RlIjoiR08iLCJwYWlkVXBUbyI6IjIwMjQtMDUtMTUiLCJleHRlbmRlZCI6ZmFsc2V9LHsiY29kZSI6IkRNIiwicGFpZFVwVG8iOiIyMDI0LTA1LTE1IiwiZXh0ZW5kZWQiOmZhbHNlfSx7ImNvZGUiOiJSU0YiLCJwYWlkVXBUbyI6IjIwMjQtMDUtMTUiLCJleHRlbmRlZCI6dHJ1ZX0seyJjb2RlIjoiRFMiLCJwYWlkVXBUbyI6IjIwMjQtMDUtMTUiLCJleHRlbmRlZCI6ZmFsc2V9LHsiY29kZSI6IlBDIiwicGFpZFVwVG8iOiIyMDI0LTA1LTE1IiwiZ
@parmentf
parmentf / GitCommitEmoji.md
Last active April 18, 2024 06:53
Git Commit message Emoji
nodes:
- id: webcam
custom:
source: https://huggingface.co/datasets/dora-rs/dora-idefics2/raw/main/operators/opencv_stream.py
outputs:
- image
- id: idefics2
operator:
python: https://huggingface.co/datasets/dora-rs/dora-idefics2/raw/main/operators/idefics2_op.py
inputs:
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@abdennour
abdennour / README.md
Last active April 18, 2024 06:48
Nginx Reverse Proxy for Nexus Docker Registries

Overview

This is a solution of a common problem with Nexus Docker repositories. The administrator has to expose port for "pull", another port for "push", other ports for each hosted repository. This solution is about leveraging Nginx reverse proxy to avoid using these ports.

How it works ?

Given :

  • Nexus hostname is "nexus.example.com"
  • Nexus web port is 8081