Skip to content

Instantly share code, notes, and snippets.

@salewski
salewski / sshtranger_things.py
Created February 10, 2019 15:36 — forked from mehaase/sshtranger_things.py
SSHtranger Things Exploit POC
'''
Title: SSHtranger Things
Author: Mark E. Haase <mhaase@hyperiongray.com>
Homepage: https://www.hyperiongray.com
Date: 2019-01-17
CVE: CVE-2019-6111, CVE-2019-6110
Advisory: https://sintonen.fi/advisories/scp-client-multiple-vulnerabilities.txt
Tested on: Ubuntu 18.04.1 LTS, OpenSSH client 7.6p1
We have nicknamed this "SSHtranger Things" because the bug is so old it could be
@salewski
salewski / dot-emacs-snippet-org-CREATED
Last active November 16, 2019 18:43
emacs org-mode: insert "CREATED" date and timestamp when creating new TODOs
;; I've customzied `org-log-note-headings' to add a 'created' heading. This
;; allows us to have a 'CREATED' timestamp automatically inserted into the
;; LOGBOOK when creating a new TODO item.
;;
;; This technique learned from:
;;
;; http://lists.gnu.org/archive/html/emacs-orgmode/2009-11/msg00914.html
;;
;; for TODOs created in the buffer
;;
;; The variable ‘emacs-major-verseion’ and the variable ‘emacs-minor-version’
;; both first existed in GNU Emacs 19.23.
;;
;; Since GNU Emacs 24.3, the function ‘toggle-read-only’ is obsolete; the
;; recommendation is to use the function ‘read-only-mode’ instead. Note that
;; ‘read-only-mode’ is, by default, set to "C-x C-q", but I’ve got 20+ years
;; of muscle memory in my hands that want to use "C-c r" to toggle the
;; "read-onlyness" of the buffer.
;;
;; See also the function ‘view-mode’ and the variable ‘view-read-only’; having
# Downloads and unpacks (in subdirs of the current directory) all of the
# Debian source packages associated with the *-dbgsym and *-dbg packages whose
# symbols are referenced by the specified program ('/usr/bin/someprogram' in
# the snippet below). Takes pains to ensure the downloaded source packages are
# at the exact same version number as the corresponding *-dbgsym/*-dbg
# packages.
#
# Assumes you are in the directory beneath which you would like the sources to
# be unpacked (by 'apt-get source'). Each unique package will have a separate
# subdirectory. We are not clever about avoiding duplicates, but 'apt-get source'
@salewski
salewski / dot-gitconfig-snippet-add-alias-ads-push-all-from-upstream.ini
Last active May 6, 2020 16:38
Provides two new git aliases: 'ads-push-all-from-upstream' and 'ads-push-all-from-upstream-force'
# -*- conf-unix -*-
# snippet for your ~/.gitconfig file
# provides two new git aliases:
# * ads-push-all-from-upstream
# * ads-push-all-from-upstream-force
# ...
[alias]
# ...
@salewski
salewski / compressing-unicode-names.md
Created July 23, 2020 20:07 — forked from js-choi/compact-unicode-character-names.md
Succinct Unicode character names

Compressing the Unicode names lists

Perhaps the most prominent, if not the most important, property of any Unicode character is its name. These immutable labels are much more descriptive than their hexadecimal codes.

But these names aren’t used often in most programming languages. Why is that? Perhaps the biggest reason why is the [sheer size of the list of names][UnicodeData.txt], weighing 1.769 MB; embedding such a file in every language runtime would impose a large burden on resource-constrained environments such as mobile devices. But can this burden be mitigated with data compression? How compressible is this list? Can we create a [succinct data structure][succinct] from this list?

Precedent for this project comes from GNU Uniname, a GNU Project utility, written by Bill Poser of British Columbia, which can look up the characters of names and the names of characters. Its source may be read in [uniname.c][] and [test-uninames.c][]. According to its documentation, the size of the compiled program

@salewski
salewski / some-program-file
Last active January 6, 2024 02:16
These /are/ the droids you're looking for.
# SPDX-FileCopyrightText: <text>
# © 2024 Alan D. Salewski <ads@salewski.email>
# </text>
#
# SPDX-License-Identifier: GPL-2.0-or-later
@salewski
salewski / dot-emacs-snippet-maximize-window-vertically.el
Last active September 21, 2020 07:00
Provides function 'ads/maximize-window-vertically', plus a suggested key binding.
;; SPDX-FileCopyrightText: <text> © 1985, 1989, 1992-1994, 2000-2020 Free Software Foundation, Inc.
;; © 2020 Alan D. Salewski <ads@salewski.email> </text>
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;; This file IS NOT part of GNU Emacs, but it is derived from the function
;; `maximize-window', which IS part of GNU Emacs. At the time of writing
;; (2020-08-27) the `maximize-window' function is defined in the Emacs file
;; 'window.el':
;;
@salewski
salewski / ~__bin__crontab
Last active September 21, 2020 06:37
Half-unfuck Debian's 'crontab -e' when $EDITOR is emacsclient
#!/bin/bash -
# SPDX-FileCopyrightText: <text> © 2020 Alan D. Salewski <ads@salewski.email> </text>
#
# SPDX-License-Identifier: GPL-2.0-or-later
# This file has been saved as a GitHub Gist here:
#
# https://gist.github.com/salewski/b33ce69a7d8c74587545d5bb65cfd4a4
@salewski
salewski / on-new-kbd
Last active September 22, 2020 18:27
invoked by inputplug(1) to respond to device add/remove events
#!/bin/bash -
# SPDX-FileCopyrightText: <text> © 2020 Alan D. Salewski <ads@salewski.email> </text>
#
# SPDX-License-Identifier: GPL-2.0-or-later
# on-new-kbd: Applies a canned X11 keyboard config, when invoked.
#
# Intended to be invoked by the inputplug(1) daemon, in response to
# devices being added/removed, enabled/disabled, etc.
#