Skip to content

Instantly share code, notes, and snippets.

@bgyarfas
bgyarfas / fix_dji_jpegs.py
Created September 15, 2023 14:44
Fix DJI JPEGs for instant-ngp
import sys
import itertools
from pathlib import Path
from PIL import Image
def fix_dji_jpegs(path):
""" Load and re-save with Pillow.
This removes the JPEG Marker 0 that STB doesn't like. """
@bgyarfas
bgyarfas / setup_xrdp.sh
Created April 8, 2022 19:39
Setup remote desktop (RDP i.e. Microsoft Remote Desktop) for xubuntu 20.04
#!/bin/bash
# Sets up the xrdp service. Use the microsoft remote desktop client and you use your ubuntu credentials to login
sudo apt update
sudo apt install xrdp
if ! systemctl is-active --quiet xrdp; then
echo "WARNING: The xrdp service is not running!"
fi
@bgyarfas
bgyarfas / setup_vino.sh
Last active April 8, 2022 17:17
Script to setup vino on a Jetson.
#!/bin/bash
# Script for remotely setting up VNC on a Jetson TX2 running Jetpack 4.6 over ssh
# You can run the script in a one shot with the following command
# sudo apt -y install curl && sudo /bin/bash -c "$(curl -fsSL https://gist.githubusercontent.com/bgyarfas/41470dd3045519786793bad1fc744b14/raw/b7bbb04929bc764194e27d419c7cbae58bbd9508/setup_vino.sh)"
if [[ $EUID -ne 0 ]]; then
echo "$0 is not running as root. Try using sudo."
exit 2
fi