Skip to content

Instantly share code, notes, and snippets.

View brennen's full-sized avatar

Brennen Bearnes brennen

View GitHub Profile
@brennen
brennen / lst
Last active May 28, 2020 07:13
for gavcloud
[bash] brennen@inertia 23:38:02 ~/fragments/xargs-alias (master m0/u0) $ ls
example_selection files.lftp lst.sh
[bash] brennen@inertia 23:38:06 ~/fragments/xargs-alias (master m0/u0) $ cat example_selection
Datach'i - Bonus - 01 Aldebaran.mp3
Datach'i - Bonus - 02 Something.mp3
[bash] brennen@inertia 23:38:08 ~/fragments/xargs-alias (master m0/u0) $ cat lst.sh
function lst {
echo -n '' > files.lftp
sed "s/'/\\\'/" example_selection | while read -r fname; do
printf "put '%s'\n" "$fname" >> files.lftp
@brennen
brennen / func-stdin.txt
Created May 31, 2019 20:32
read stdin in a shell function
brennen@inertia 14:31:49 ~/fragments (master m2/u4) ▣ cat func-stdin.sh
#!/bin/sh
myread () {
while read foo; do
echo "$foo";
done
}
cat /etc/motd | myread
FROM docker-registry.wikimedia.org/dev/stretch-php72-apache2
RUN groupadd -o -g "65533" -r "somebody" && useradd -o -m -d "/home/somebody" -r -g "somebody" -u "65533" "somebody" && mkdir -p "/var/www/html" && chown "65533":"65533" "/var/www/html"
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
WORKDIR /var/www/html/
COPY --chown=65533:65533 [".", "."]
brennen@inertia 16:57:39 ~/code/wmf/releng/dev-images (master 0/0) ▣ make
docker-pkg --info -c dockerfiles/config.yaml build dockerfiles
Traceback (most recent call last):
File "/home/brennen/.local/lib/python3.5/site-packages/urllib3/contrib/pyopenssl.py", line 453, in wrap_socket
cnx.do_handshake()
File "/usr/lib/python3/dist-packages/OpenSSL/SSL.py", line 1426, in do_handshake
self._raise_ssl_error(self._ssl, result)
File "/usr/lib/python3/dist-packages/OpenSSL/SSL.py", line 1174, in _raise_ssl_error
_raise_current_error()
File "/usr/lib/python3/dist-packages/OpenSSL/_util.py", line 48, in exception_from_error_queue
# This works when run from a shell:
#!/bin/sh
tmpfile=`mktemp /tmp/edit-clipboard.XXXXXX`
xclip -d localhost:1 -o > "$tmpfile"
"$EDITOR" "$tmpfile"
xclip -d localhost:1 -i "$tmpfile"
rm "$tmpfile"
# This doesn't work:
@brennen
brennen / gist:5b797f6fbf29c4451b94
Created November 27, 2015 03:22
journalctl -e -u etcd2
Nov 27 01:21:43 coreos-2 systemd[1]: Started etcd2.
Nov 27 01:21:43 coreos-2 systemd[1]: Starting etcd2...
Nov 27 01:21:43 coreos-2 etcd2[883]: 2015/11/27 01:21:43 etcdmain: etcd Version: 2.1.2
Nov 27 01:21:43 coreos-2 etcd2[883]: 2015/11/27 01:21:43 etcdmain: Git SHA: ff8d1ec
Nov 27 01:21:43 coreos-2 etcd2[883]: 2015/11/27 01:21:43 etcdmain: Go Version: go1.4.2
Nov 27 01:21:43 coreos-2 etcd2[883]: 2015/11/27 01:21:43 etcdmain: Go OS/Arch: linux/amd64
Nov 27 01:21:43 coreos-2 etcd2[883]: 2015/11/27 01:21:43 etcdmain: setting maximum number of CPUs to 1, total number of available CPUs is 1
Nov 27 01:21:43 coreos-2 etcd2[883]: 2015/11/27 01:21:43 etcdmain: peerTLS: cert = /home/core/coreos.pem, key = /home/core/coreos-key.pem, ca = /home/core/ca.pem
Nov 27 01:21:43 coreos-2 etcd2[883]: 2015/11/27 01:21:43 etcdmain: listening for peers on https://10.132.206.153:2380
Nov 27 01:21:43 coreos-2 etcd2[883]: 2015/11/27 01:21:43 etcdmain: clientTLS: cert = /home/core/coreos.pem,
@brennen
brennen / BangOpen.vim
Created October 1, 2015 19:26 — forked from thcipriani/BangOpen.vim
Open the output of a command as a file in a new tab: i.e. :BangOpen which git-new-workdir
" BangOpen ------------------------------------------------------------ {{{
function! BangOpen(arg)
execute 'tabe ' . system(a:arg)
endfunction
command! -nargs=1 BangOpen :call BangOpen(<f-args>)
" }}}
@brennen
brennen / errors.md
Last active September 3, 2015 23:59
hrmph.

ft6x06 error during compile:

CC [M]  drivers/input/touchscreen/ft6x06_ts.o
drivers/input/touchscreen/ft6x06_ts.c:472:2: error: unknown field 'suspend' specified in initializer
drivers/input/touchscreen/ft6x06_ts.c:472:2: warning: initialization from incompatible pointer type [enabled by default]
drivers/input/touchscreen/ft6x06_ts.c:472:2: warning: (near initialization for 'ft6x06_ts_driver.detect') [enabled by default]
drivers/input/touchscreen/ft6x06_ts.c:473:2: error: unknown field 'resume' specified in initializer
drivers/input/touchscreen/ft6x06_ts.c:473:2: warning: initialization from incompatible pointer type [enabled by default]
drivers/input/touchscreen/ft6x06_ts.c:473:2: warning: (near initialization for 'ft6x06_ts_driver.address_list') [enabled by default]
@brennen
brennen / mouselogger
Last active November 9, 2024 11:33
/etc/init.d/mouselogger
#! /bin/sh
### BEGIN INIT INFO
# Provides: mouselogger
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Adafruit-MouseLogger
# Description: Log mice.
### END INIT INFO
brennen@exuberance 15:01:57 /home/brennen/code/adafruit-raspberrypi-linux (rpi-3.18.y-powerswitch) ★ git diff rpi-3.18.y.. drivers/power/rpi_power_switch.c
diff --git a/drivers/power/rpi_power_switch.c b/drivers/power/rpi_power_switch.c
index 049af00..baee336 100644
--- a/drivers/power/rpi_power_switch.c
+++ b/drivers/power/rpi_power_switch.c
@@ -24,9 +24,7 @@
#include <linux/workqueue.h>
-/* the BCM2709 redefines this for us right!