Skip to content

Instantly share code, notes, and snippets.

echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/40-max-user-watches.conf && sudo sysctl --system
#include <random>
#include <sstream>
namespace uuid {
static std::random_device rd;
static std::mt19937 gen(rd());
static std::uniform_int_distribution<> dis(0, 15);
static std::uniform_int_distribution<> dis2(8, 11);
std::string generate_uuid_v4() {
@ppoffice
ppoffice / README.md
Last active May 29, 2024 16:52
Install Visual Studio Code (actually code-server) on Android
  1. Install Termux, an Android terminal emulator that provides a Linux execution environment and various tools.

  2. Update system packages in Termux:

    $ pkg update -y
@sorashi
sorashi / _readme.md
Last active December 26, 2023 05:01
Windows registry edit that adds Windows command-line (cmd), Powershell and optionally GIT Bash to directory context menu

Registry edit that allows you to add Windows command-line, Powershell and/or GIT Bash to explorer context menu. source

@looopTools
looopTools / Read File to std::vector<uint8_t> in C++
Created February 1, 2019 13:33
How to read a file from disk to std::vector<uint8_t> in C++
inline std::vector<uint8_t> read_vector_from_disk(std::string file_path)
{
std::ifstream instream(file_path, std::ios::in | std::ios::binary);
std::vector<uint8_t> data((std::istreambuf_iterator<char>(instream)), std::istreambuf_iterator<char>());
return data;
}
@Francesco149
Francesco149 / docker-cross-device-link.md
Last active October 27, 2023 08:51
docker error creating new backup file '/var/lib/dpkg/status-old': Invalid cross-device link
@fnky
fnky / ANSI.md
Last active June 2, 2024 17:38
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@ktnr74
ktnr74 / 99-android.rules
Created July 19, 2018 16:03
Universal udev rules file to set Android device permissions
# do not forget to run 'sudo udevadm control --reload-rules' after editing this file
ACTION!="add", GOTO="android_usb_rules_end"
SUBSYSTEM!="usb", GOTO="android_usb_rules_end"
ENV{DEVTYPE}!="usb_device", GOTO="android_usb_rules_end"
ENV{ID_SERIAL_SHORT}=="", GOTO="android_empty_serial"
ENV{ID_SERIAL_SHORT}=="0000:*", GOTO="android_empty_serial"
ENV{ID_SERIAL_SHORT}=="0123456789ABCDEF", GOTO="android_empty_serial"
@m93a
m93a / Shell_ContextMenu_GitHub.reg
Last active December 26, 2023 05:43
Create neat sub-menus for Windows Explorer directory right-click, one for the Command Line, one for PowerShell and one for Git
Windows Registry Editor Version 5.00
; GitHub Desktop
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuGit\shell\github]
; "Icon"=(REG_EXPAND_SZ)"%LocalAppData%\\GitHubDesktop\\GitHubDesktop.exe"
"Icon"=hex(2):25,00,4c,00,6f,00,63,00,61,00,6c,00,41,00,70,00,70,00,44,00,61,\
00,74,00,61,00,25,00,5c,00,47,00,69,00,74,00,48,00,75,00,62,00,44,00,65,00,\
73,00,6b,00,74,00,6f,00,70,00,5c,00,47,00,69,00,74,00,48,00,75,00,62,00,44,\
00,65,00,73,00,6b,00,74,00,6f,00,70,00,2e,00,65,00,78,00,65,00,00,00
@mkasberg
mkasberg / loundorm.py
Last active April 29, 2022 07:09 — forked from kylophone/loudness.rb
FFmpeg loudnorm filter - dual pass loudness normalization example - http://k.ylo.ph/2016/04/04/loudnorm.html
#!/usr/bin/env python
import json
import os
from subprocess import check_call, check_output, STDOUT
import sys
if len(sys.argv) != 3:
print "Usage: %s input.wav output.wav" % __file__
sys.exit(1)