Skip to content

Instantly share code, notes, and snippets.

@wmertens
wmertens / ssh-crypt.bash
Last active March 20, 2025 16:55
ssh-crypt: bash function to encrypt using ssh-agent and openssl
#!/usr/bin/env bash
#
# ssh-crypt
#
# Bash function to encrypt/decrypt with your ssh-agent private key.
# Requires the commands gzip, ssh-add, ssh-keygen and openssl.
#
# Uses bash-specific extensions like <<<$var to securely pass data.
#
# [email protected] 2021-11-11 - MIT Licensed
@probonopd
probonopd / Wayland.md
Last active April 25, 2025 07:27
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.


As 2024 is winding down:

@mafredri
mafredri / rm-backup.sh
Last active June 7, 2024 12:56
Scripts for the reMarkable tablet (backup and factory reset)
# Creates remarkable_backup-(date).tar.gz with todays date, backs up /home/root.
(
ssh [email protected] 'tar cf - .' \
| gzip >remarkable_backup-$(date '+%Y-%m-%d').tar.gz
) 2 >err.log
cat err.log
@veekaybee
veekaybee / wholesome-data-science.md
Last active August 16, 2019 06:40
Wholesome data science.

Wholesome Data Science

Data science has a really bad reputation recently. Between Facebook's privacy violations , facial scanning at kiosks in restaurants, and racism in algorithms, there are a lot of cases where surveillance, invasion of privacy, and unethical algorithms are dominating the news.

These cases are really important to make public, study, and prevent. But it's just as important to collect examples of good use cases of data science (that are not hyperbolized or PR fluff) so we can focus on those as an industry, and learn about what makes them work, as well.

Have some? Make some? Feel free to leave a comment or edit.

Examples

@wyatt8740
wyatt8740 / update-gtk3.sh
Created April 2, 2017 21:42
Downloads latest debian GTK3 source, patches to fix annoyances, and compiles.
#! /bin/bash
# for this to work correctly, make an empty directory and put this shellscript inside it, along with the patch 'gtk3_make_filechooser_not_suck.patch'.
# Running this in a directory with a previous gtk source tree or any other files or directories may make this script behave unexpectedly!
# the patch file is found at:
# https://gist.github.com/wyatt8740/ae82550264564e2bba49b58d3e07f0f5.
# raw patch file (direct link):
# https://gist.github.com/wyatt8740/ae82550264564e2bba49b58d3e07f0f5/raw/bc5bc32d15e852ba92a8b0b710e01960c371ba8b/gtk3_make_filechooser_not_suck.patch
@raineorshine
raineorshine / human-readable-hash-comparisons.md
Last active July 21, 2024 20:31
An aesthetic comparison of a few human-readable hashing functions.

An Aesthetic Comparison of Human-Readable
Hashing Functions

The following compares the output of several creative hash functions designed for human readability.

sha1's are merely used as arbitrary, longer, distributed input values.

input 1 word output 2 word output 3 word output
diff -x '*.html' -x '*.png' -a -r -u a/gtk+-3.22.7/gtk/gtkfilechooserwidget.c b/gtk+-3.22.7/gtk/gtkfilechooserwidget.c
--- a/gtk+-3.22.7/gtk/gtkfilechooserwidget.c 2016-12-30 09:55:56.000000000 -0500
+++ b/gtk+-3.22.7/gtk/gtkfilechooserwidget.c 2017-01-25 19:38:43.000000000 -0500
@@ -2420,7 +2420,10 @@
gdk_device_get_source (device) == GDK_SOURCE_TOUCHSCREEN;
get_selection_modifiers (widget, event, &modify, &extend);
- if (!is_touchscreen &&
+ /* Ubuntu, disable the new behaviour of opening sometime on single click
+ it's confusing for users and the change had no rational
@iwillspeak
iwillspeak / Cargo.toml
Created September 3, 2016 17:49
Simple Pratt-style Parsing in Rust
[package]
name = "parsetest"
version = "0.1.0"
authors = ["Will Speak <[email protected]>"]
[dependencies]
[[bin]]
name = "parsetest"
path = "main.rs"
@esrever10
esrever10 / gs.sh
Last active March 13, 2025 06:30
gstreamer send and receive h264 rtp stream
# linux send h264 rtp stream:
gst-launch-1.0 -v ximagesrc ! video/x-raw,framerate=20/1 ! videoscale ! videoconvert ! x264enc tune=zerolatency bitrate=500 speed-preset=superfast ! rtph264pay ! udpsink host=127.0.0.1 port=5000
# Macos send h264 rtp stream:
gst-launch-1.0 -v avfvideosrc capture-screen=true ! video/x-raw,framerate=20/1 ! videoscale ! videoconvert ! x264enc tune=zerolatency bitrate=500 speed-preset=superfast ! rtph264pay ! udpsink host=127.0.0.1 port=5000
# receive h264 rtp stream:
gst-launch-1.0 -v udpsrc port=5000 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! decodebin ! videoconvert ! autovideosink