Skip to content

Instantly share code, notes, and snippets.

@Juul
Juul / rogue_dhcp_check.py
Last active March 2, 2025 06:43
Python 3 script for detecting rogue DHCP servers
#!/usr/bin/env python3
# This script sends a DHCP discover on the specified interface
# then waits for the specified number of seconds (default: 5)
# for replies from DHCP servers and prints the results.
# Install dependencies:
# sudo apt install python3-scapy
# scapy API: https://scapy.readthedocs.io/en/latest/api/scapy.layers.html

Keybase proof

I hereby claim:

  • I am juul on github.
  • I am juul (https://keybase.io/juul) on keybase.
  • I have a public key ASDq1RuKZVTrMsQYIO8uYJkuCDg-_IytPr_8dxThs71y-Ao

To claim this, I am signing this object:

@Juul
Juul / raspian_bluetooth_sink.md
Last active September 20, 2020 17:03
Set up raspberry pi 3 as bluetooth sink (raspbian buster)

If you want to use pulseaudio, see BaReinhard's repo.

If you want to use bluealsa and avoid pulseaudio, keep reading.

So far this solution has two problems I haven't solved:

  • A ~450 ms delay (which can be compensated for in pavucontrol on the client)
  • If more than one source connects at the same time bluealsa-aplay crashes and bluealsa also needs restarting

If you have pulseaudio installed, make sure /etc/pulse/default.pa has the following two lines commented out and restart pulseaudio:

@Juul
Juul / ppp_notes.md
Created November 10, 2019 09:16
ppp_tunnel_notes

sit tunnel

client

ip tunnel add sit1 mode sit ttl 100 remote 107.170.232.149 local 173.132.20.41
ip addr add 172.30.0.1/24 dev sit1
ip link set dev sit1 up
echo 1 > /proc/sys/net/ipv4/ip_forward
@Juul
Juul / book_scanning_guide.md
Created July 13, 2019 22:07
Guide on book scanning using camera-based scanner like the one at noisebridge

Today I went to noisebridge and scanned Wonders Through the Microscope and it is now available for download on the freestore! I will likely also generate a color version of the PDF but the book is in black and white so it really doesn't add much.

This is my first attempt at book scanning and post-processing using only open source tools so I thought I'd share this book scanning guide based on my experiences :)

Scan

I used the noisebridge book scanner hardware and their python script which remote-controls two DSLR cameras and downloads the photos over USB. It worked very well.

Note that in addition to gphoto2 you will also need jpegtran. This command will get you both:

@Juul
Juul / certbot_reverse_proxy_guide.md
Created May 29, 2019 01:04
How to use Let's Encrypt / certbot with a reverse proxy

apache config

The secret sauce is:

<Location /.well-known>
    ProxyPass !
</Location>
@Juul
Juul / mount_dd_Image.sh
Created May 18, 2019 05:49
Mount all partitions from a full drive image
#!/bin/bash
# Mount all partitions from a full drive image
# in subdirs inside the specified dir
set -e
if [ ! "$#" -eq "2" ]; then
echo "Usage: $(basename $0) <image.dd> <mount_dir>" >&2
exit 1
@Juul
Juul / gcc_cross_switch_version.sh
Last active May 16, 2019 01:15
Switch currently used gcc cross-compiler versions
#!/bin/bash
# This script changes the `arm-linux-gnueabihf-*` (or specified prefix)
# symlinks in /usr/bin to point to the specified version
# e.g. running with "7" as the argument will create the symlink
# /usr/bin/arm-linux-gnueabihf-gcc -> /usr/bin/arm-linux-gnueabihf-gcc-7
# and so on for all the normal cross-compiler commands
CMDS=( "gcc" "gcc-ar" "gcc-nm" "gcc-ranlib" "cpp" "gcov" "gcov-dump" "gcov-tool" )
BINPATH=/usr/bin
@Juul
Juul / star_trek_tng_a_final_unity_guide.md
Last active December 25, 2021 16:13
How to get _Star Trek TNG: A final unity_ working on a GNU/Linux system

This is guide for how to get the game Star Trek TNG: A final unity working on a GNU/Linux system.

First download the game from myabandonware.com.

Unzip the file:

unzip Star-Trek-The-Next-Generation---A-Final-Unity_DOS_EN_ISO-Version.zip
@Juul
Juul / amazon_fire_2015_7_inc_lineageos_install.md
Last active February 22, 2025 23:09
How to install install LineageOS on a 2015 7" Amazon Fire tablet

This is a guide for getting LineageOS (an older and unofficial version) onto an Amazon Fire 2015 7" tablet (also known as the 5th generation 7" Amazon Fire or under the internal codename "ford").

NOTE: This guide was originally written before someone figured out how to unlock the bootloader. There is now a newer method. Here it is very briefly. The old guide can be found below.

Unlocked bootloader method

First unlock the bootloader using this guide.

Once you're booted into TWRP download the latest LineageOS 14 release for your device here.