Skip to content

Instantly share code, notes, and snippets.

View kbingham's full-sized avatar

Kieran Bingham kbingham

View GitHub Profile
@atoponce
atoponce / wordlist-builder.py
Last active June 2, 2021 22:10
Simple proposal using BIPS-0039 to encode plus code character pairs into readable English words
#!/usr/bin/env python3
# https://github.com/bitcoin/bips/blob/master/bip-0039/english.txt
with open('/tmp/english.txt', 'r') as f:
bips = f.readlines()
short_bips = []
# 442 unique words (all 4-character words)
for n in range(2048):
@KaairaGupta
KaairaGupta / libcamera_dev.md
Last active June 15, 2020 09:35
Steps to set up libcamera for dev (with latest media_master) using virtme
  • Follow https://libcamera.org/getting-started.html to install libcamera on your native machine.
  • Clone latest media_tree using:
    git clone git://linuxtv.org/media_tree.git
    
  • Install virtme:
    pip3 install --user git+https://github.com/ezequielgarcia/virtme.git
    
  • Compile Kernel with Virtme:
@justinschuldt
justinschuldt / raspberry-pi-zero_as_webcam.md
Last active February 25, 2024 07:34
Directions for setting up a RaspberryPi to act as a generic USB webcam

hardware/software

Webcam parts:

  • Raspberry Pi Zero W Rev 1.1
  • Raspberry Pi Camera v2 (8-megapixel)
  • Raspberry Pi High Quality Camera (12.3-megapixel)
  • Raspbian Buster Lite 2020-02-13

Webcam works with:

  • Windows 10
  • Windows 10 "Camera" app
@daniel-thompson
daniel-thompson / parallel.bash
Created November 13, 2017 19:50
bash job server
# `parallel <cmd...>` works similarly to `<cmd...> &` but limits the
# maximum job count to prevent over-zealous memory consumption when
# batch processing huge numbers of files.
parallel () {
while [ "$(jobs | wc -l)" -ge $((3 * $(nproc) / 2)) ]
do
wait -n
done
"$@" &
}
@qlyoung
qlyoung / linux-clang-format
Created July 17, 2017 18:37
Linux kernel style .clang-format
---
BasedOnStyle: LLVM
Language: Cpp
IndentWidth: 8
UseTab: Always
BreakBeforeBraces: Linux
AlwaysBreakBeforeMultilineStrings: true
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
@kylemanna
kylemanna / eth.network
Created May 11, 2017 00:01
How to prevent systemd-networkd from breaking nfsroots
# /etc/systemd/network/eth.network
# Pass nfsroot=... on the kernel command line as you'd expect
[Match]
Name=eth*
KernelCommandLine=!nfsroot
[Network]
DHCP=v4
[DHCPv4]
@nicowilliams
nicowilliams / issetugid-sadness.md
Last active July 2, 2021 00:46
issetugid() sadness

Warning: work in progress. Incomplete

People who have been in security a long time (or even not that long) know that some inputs should be treated as tainted. For example, environment variables from a user should not be used in a set-uid program, inputs from a different user should be validated, etc... Traditionally we say that the environment of a set-uid program is tainted and should not be used (or used with much care).

Therefore we want all set-uid/set-gid programs to treat their environment and user inputs as tainted.

@casperbiering
casperbiering / rrsync-on-debian.txt
Created January 18, 2017 19:41
rrsync on debian
apt-get install rsync
nano /root/.ssh/authorized_keys
prefix key with
command="rrsync -ro ~/rsyncbackup/",no-agent-forwarding,no-port-forwarding,no-pty,no-user-rc,no-X11-forwarding
mkdir /root/rsyncbackup
cd /root/rsyncbackup
ln -s /backup
gunzip /usr/share/doc/rsync/scripts/rrsync.gz -c > /usr/local/bin/rrsync
chmod +x /usr/local/bin/rrsync
@17twenty
17twenty / gist:4985374
Created February 19, 2013 12:20
Git diff odt files
To get Git to diff between your odt/odp/ods files you will need to do the following things:
Install a conversion tool
$ sudo yum install odt2txt
Create your git config info directory if it's not already there
$ mkdir -p ~/.config/git/info
Add in attributes (you can paste this straight in or edit the file accordingly)
$ cat > ~/.config/git/info/attributes <<DELIM
@misaelnieto
misaelnieto / live-mjpeg-stream.py
Last active April 25, 2024 03:22
Streaming MJPEG over HTTP with gstreamr and python - WSGI version
#!/usr/bin/python
#based on the ideas from http://synack.me/blog/implementing-http-live-streaming
# Updates:
# - 2024-04-24: Apply suggestions from @Pin80
# Run this script and then launch the following pipeline:
# gst-launch videotestsrc pattern=ball ! video/x-raw-rgb, framerate=15/1, width=640, height=480 ! jpegenc ! multipartmux boundary=spionisto ! tcpclientsink port=9999
#updated command line
#gst-launch-1.0 videotestsrc pattern=ball ! videoconvert ! video/x-raw, framerate=15/1, width=640, height=480 ! jpegenc ! multipartmux boundary=spionisto ! #tcpclientsink port=9999
from multiprocessing import Queue