Skip to content

Instantly share code, notes, and snippets.

@arkk4
arkk4 / Readme.md
Last active February 21, 2025 20:49
Simple way to send your screenshots to telegram
  1. Create savedscreenshots folder

mkdir ~/savedscreenshots

  1. Move to /etc/systemd/system folder

cd /etc/systemd/system

  1. Create tgsender.sh file and paste code from tgsender.sh in this gist
@kurtdekker
kurtdekker / MatchTerrainToColliders.cs
Created August 18, 2021 13:55
Matching Unity3D terrain to arbitrary colliders
//
// Script originally from user @Zer0cool at:
//
// https://forum.unity.com/threads/terrain-leveling.926483/
//
// Revamped by @kurtdekker as follows:
//
// - put this on the object (or object hierarchy) with colliders
// - drag the terrain reference into it
// - use the editor button to "Stamp"
@DominicMaas
DominicMaas / rpi_pico_littlefs.h
Last active August 20, 2024 03:27
Not much testing, but this should work for using LittleFS with the Raspberry Pi Pico built in flash chip.
#pragma once
#include "pico/stdlib.h"
#include "pico/binary_info.h"
#include "hardware/flash.h"
#include "hardware/sync.h"
#include <lfs.h>
@VictorNS69
VictorNS69 / Docker-as-a-non-root-user.md
Last active July 13, 2024 01:12
Manage Docker as a non-root user

Manage Docker as a non-root user

The Docker daemon binds to a Unix socket instead of a TCP port. By default that Unix socket is owned by the user root and other users can only access it using sudo. The Docker daemon always runs as the root user.

If you don’t want to preface the docker command with sudo, create a Unix group called docker and add users to it. When the Docker daemon starts, it creates a Unix socket accessible by members of the docker group.

Warning: The docker group grants privileges equivalent to the root user. For details on how this impacts security in your system, see Docker Daemon Attack Surface.

Note: To run Docker without root privileges, see Run the Docker daemon as a non-root user (Rootless mode) .

@smagnani96
smagnani96 / linuxNvidia_guide.md
Last active January 31, 2024 22:23
This guide is supposed to help people experiencing problems with the Nvidia dedicated graphic card management.

Linux - Nvidia switchable setup guide

The aim of this guide is to provide a working strategy to make your dedicated graphic card turn on/off correctly in a Linux environment (with xorg).

The following scripts have been created by tyrells and this guide is a remake of Graff's one.

Required Packages

The following two packages are stricly required:

@wsh32
wsh32 / boards.txt
Created September 20, 2017 18:32
Arduino Board Tag reference for arduino-mk
uno.name=Arduino Uno
atmega328.name=Arduino Duemilanove w/ ATmega328
diecimila.name=Arduino Diecimila or Duemilanove w/ ATmega168
nano328.name=Arduino Nano w/ ATmega328
nano.name=Arduino Nano w/ ATmega168
mega2560.name=Arduino Mega 2560 or Mega ADK
mega.name=Arduino Mega (ATmega1280)
leonardo.name=Arduino Leonardo
esplora.name=Arduino Esplora
micro.name=Arduino Micro
@avinash-oza
avinash-oza / boot-from-ram-debian.md
Last active July 29, 2025 03:30
How to boot from RAM on debian
@jjgrainger
jjgrainger / Vector.js
Last active July 29, 2024 11:18
A simple Vector class in javascript
var Vector = function(x, y) {
this.x = x || 0;
this.y = y || 0;
};
// return the angle of the vector in radians
Vector.prototype.getDirection = function() {
return Math.atan2(this.y, this.x);
};
@tribut
tribut / btrfs-scrub.sh
Created September 15, 2015 21:45
Btrfs scrub cronjob with logs from systemd's journalctl
#!/bin/sh
# also see http://marc.merlins.org/perso/btrfs/post_2014-03-19_Btrfs-Tips_-Btrfs-Scrub-and-Btrfs-Filesystem-Repair.html
for fs in $(grep ' btrfs ' /proc/mounts | cut -d' ' -f1 | sort -u)
do
starttime="$(date "+%Y-%m-%d %H:%M:%S")"
logger "Starting btrfs scrub on $fs"
btrfs scrub start -Bd "$fs"
journalctl -q -k --since "$starttime" | grep BTRFS
@shamil
shamil / mount_qcow2.md
Last active November 5, 2025 00:00
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8