Skip to content

Instantly share code, notes, and snippets.

@tgran2028
tgran2028 / cp-from-user.sh
Last active December 30, 2023 19:38
Util to copy file/dir from one user to another. This includes parsing relative paths to a user's home, updating ownership, and modifying file contents to home path changes (e.g. /home/foo -> /home/bar).
#!/bin/env bash
set -e
set -o pipefail
display_help() {
echo "Usage: cp-from-user [option...] --path <PATH> --source-user <SRC-USER> [--destination-user <DST-USER>]"
echo
echo "Util to copy file or directory from one user to another"
echo
echo " -p, --path <PATH> Path to the file or directory from home directory."
@m-bartlett
m-bartlett / 0b.bin
Last active March 9, 2025 10:00
Dell XPS 15 9510 / Dell Precision 5560 ELAN touchpad firmware updates (might fix touchpad input lag)
@mattc927
mattc927 / goodix_fedora.txt
Created March 18, 2022 14:36
Install Goodix fingerprint drivers on Fedora.
Tested and working with 27c6_530c on Fedora 35
# Install default fprintd and pam
sudo dnf install fprintd fprintd-pam
# Build libfprint-tod
# a. Install build dependencies
sudo dnf install -y gcc gcc-c++ glib glib-devel glibc glibc-devel glib2 glib2-devel libusb libusb-devel nss-devel pixman pixman-devel libX11 libX11-devel libXv libXv-devel gtk-doc libgusb libgusb-devel gobject-introspection gobject-introspection-devel ninja-build git libgudev-devel cairo-devel
# b. clone and build
mkdir fingerprint && cd fingerprint
@sts10
sts10 / rust-command-line-utilities.markdown
Last active May 14, 2025 22:55
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
@rvanbruggen
rvanbruggen / 1-scm-background.txt
Last active January 10, 2024 02:42
Supply Chain Management Example in Neo4j
// Found article on https://or.stackexchange.com/questions/529/supply-chain-public-data-repository
// https://pubsonline.informs.org/doi/suppl/10.1287/msom.1070.0176
// https://pubsonline.informs.org/doi/suppl/10.1287/msom.1070.0176/suppl_file/msom.1070.0176-sm-datainexcel.zip
//Article by Sean P. Willems: https://pdfs.semanticscholar.org/232c/451fcf58dbcc1527de6d02cd6e76aea9e871.pdf?_ga=2.33151675.429569592.1581427039-1552162479.1581427039
Table 2 Classifications Used to Label Every Stage in the Chains
Classifications label Activity
Dist_ A stage that distributes an item
Manuf_ A stage that manufactures or assembles an item
Part_ A stage that procures an item
@fnky
fnky / ANSI.md
Last active May 15, 2025 23:07
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@redlotus
redlotus / docstrings.py
Created October 2, 2017 04:34
Google Style Python Docstrings
# -*- coding: utf-8 -*-
"""Example Google style docstrings.
This module demonstrates documentation as specified by the `Google Python
Style Guide`_. Docstrings may extend over multiple lines. Sections are created
with a section header and a colon followed by a block of indented text.
Example:
Examples can be given using either the ``Example`` or ``Examples``
sections. Sections support any reStructuredText formatting, including
@QuantumGhost
QuantumGhost / example.puml
Last active September 21, 2024 19:19
A simple template for PlantUML to draw ER diagram.The basic idea comes from http://plantuml.sourceforge.net/qa/?qa=331/database-modeling
@startuml
' uncomment the line below if you're using computer with a retina display
' skinparam dpi 300
!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >>
' we use bold for primary key
' green color for unique
' and underscore for not_null
!define primary_key(x) <b>x</b>
!define unique(x) <color:green>x</color>
!define not_null(x) <u>x</u>