Skip to content

Instantly share code, notes, and snippets.

Avatar

Brennen Bearnes brennen

View GitHub Profile
@brennen
brennen / lst
Last active May 28, 2020
for gavcloud
View lst
[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
read stdin in a shell function
View func-stdin.txt
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
View Dockerfile
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 [".", "."]
View gist:ab3d046c8a9c02c3b7183551dc7c82f5
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
View edit-clipboard.sh
# 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:
View gist:5b797f6fbf29c4451b94
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 Oct 1, 2015 — 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
View BangOpen.vim
" BangOpen ------------------------------------------------------------ {{{
function! BangOpen(arg)
execute 'tabe ' . system(a:arg)
endfunction
command! -nargs=1 BangOpen :call BangOpen(<f-args>)
" }}}
View errors.md

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 Aug 31, 2015
/etc/init.d/mouselogger
View 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
View gist:53a908a096d6ec973b47
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!