This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Just in case this happens to somebody else in the future, since search engines were not terribly helpful... | |
if you run "sudo -n (whatever)" and get back | |
error: prompt may be needed but -n given | |
... and search sudo's sources, and the message is not there... | |
try "type sudo", chances are you're using UserLAnd on Android and they have | |
nosudo installed as /usr/local/bin/sudo for some reason; | |
running /usr/bin/sudo does what you wanted. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# https://paludis.exherbo.org/faq/misfunctionality.html#wgetresume | |
# true<<TIL => shellcheck usefully complains... | |
til() { : ; } | |
til<<TIL | |
No Automatic Documentation Compression | |
Non-Problem: Paludis doesn't compress documentation or man pages with gzip/bzip/whatever. | |
Rationale: The space savings on an average system are very small, to non-existent for most filesystems. Most documentation and man pages are only about one block in size, so compression won't gain you anything except for wasted CPU cycles. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A reimplementation of GNU shuf (think *BSD) | |
// -- there was a shuffle(1) ages ago, but it got deleted. | |
// GNU shuf goes out of its way to optimize anything it can | |
// -- just see its treatment of --random-source! | |
// this is *much* more simple minded - TLDR: use GNU shuf. | |
// Seriously, its inspiration comes from: | |
// 1. shuf on *BSD without installing coreutils; | |
// 2. my router abandoning me for >30 minutes. | |
package main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!!!!!!!!!!!!!!!!!!!!!!!!! | |
! /etc/X11/app-defaults/ ! | |
!!!!!!!!!!!!!!!!!!!!!!!!!! | |
xvt*background: #000000 | |
xvt*foreground: #fefefe | |
yeahconsole*restart: 1 | |
yeahconsole*toggleKey: Alt+y | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# Self-contained - get arc4random for emergencies. | |
set -e # Not in "#!" to test different shells. | |
# TODO figure out the source files automagically? | |
test 0 -eq $(ls|wc -l) || { echo>&2 "run $0 in an empty directory"; exit 100; } | |
# Fix $OS if needed (eg "win") | |
if [ x = x"$OS" ] ; then | |
OS=$(uname -s) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# "Spritz - a spongy RC4-like stream cipher and hash function" | |
# http://people.csail.mit.edu/rivest/pubs/RS14.bib.txt | |
# In case you're insane enough to use it, keep in mind that the registers | |
# (i,j,...) have NO PREFIX, so you'll have to add it(_spritz_i, ...). | |
# This script is meant to run on any POSIX shell with local variables | |
# ("local" is not included in POSIX. Idiots!) and POSIX commands (printf(1)). | |
# Bash,dash,mksh,zsh: see how fast they Absorb()/Drip() compared to vim... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# This is my ~/bin/info | |
exec /usr/bin/info "$@" | exec less # linux | |
exec /usr/local/bin/info "$@" | exec less # *BSD | |
# References: | |
# https://news.ycombinator.com/item?id=7072844 | |
# https://news.ycombinator.com/item?id=7075802 | |
# THANK YOU robot_t on ycombinator!!! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Digital Mars bug */ | |
/* From stdint.h: | |
#define UINTMAX_MAX 18446744073709551615 | |
... except that "number is not representable": | |
the compiler rejects integer literals bigger than ULONG_MAX, | |
which is 32 bits on windows XD | |
*/ | |
#include <stdint.h> | |
#include <limits.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cute little thought: It’s obvious why there aren’t APIs for finding out, for example, the current credentials of the process on the other end of a UNIX-domain socket (there might be several processes on the end!) Less obviously, there could be no process on the other end: suppose you have a socket at your end, and the remote end is dup’ed into two related processes. You pass in an fd (with an SCM_RIGHTS message), then close it. It’s not open in your process, and it can’t be associated with either receiving process (either one of them could read it first). So, who ever’s on the other end of the passed fd is in the unusal situation of having a valid, connected socket with absolutely no process on the other end! Quirky. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# Ispirato dal papa in Sardegna XD | |
# -- per la cronaca, ha finito prima lui, ma di poco. | |
#/* $OpenBSD: arc4.c,v 1.3 2007/09/11 12:07:05 djm Exp $ */ | |
#/* | |
# * Copyright (c) 2003 Markus Friedl <markus@openbsd.org> | |
# * | |
# * Permission to use, copy, modify, and distribute this software for any | |
# * purpose with or without fee is hereby granted, provided that the above | |
# * copyright notice and this permission notice appear in all copies. |
NewerOlder