Skip to content

Instantly share code, notes, and snippets.

View mikeesto's full-sized avatar
🙂

Michael Esteban mikeesto

🙂
View GitHub Profile
@mikeesto
mikeesto / date.sh
Last active June 14, 2021 03:46
How to update date/time on Raspberry Pi
sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z"
@mikeesto
mikeesto / reset-usb.md
Last active September 21, 2022 04:19
Reset USB ports on Raspberry Pi (useful for USB audio)

Reset USB ports on Raspberry Pi on boot

Add to /etc/rc.local:

# To shut off power on USB ports (this shuts power on ethernet as well):
echo '1-1' | tee /sys/bus/usb/drivers/usb/unbind

# To turn power back on
echo '1-1' | tee /sys/bus/usb/drivers/usb/bind
@mikeesto
mikeesto / polaroid-cli.md
Last active September 21, 2022 04:19
Print to a Polaroid Zip via the command line

How to print to a Polaroid Zip via the command line

  1. Install blueman: sudo apt install blueman
  2. Find the MAC address of the zip: hcitool scan
  3. Send the photo blueman-sendto --device=XX.XX.XX.XX.XX.XX photo.png
@mikeesto
mikeesto / start-script-on-boot.md
Last active September 21, 2022 04:18
Start a Python script on boot (Raspberry Pi 3)

Start a Python script on boot (Raspberry Pi 3)

This method will also work with any program, including those that require access to xorg

Edit the LXDE autostart file

/etc/xdg/lxsession/LXDE-pi/autostart

Append to the end of the file the command/script to run, for example:

@mikeesto
mikeesto / omxplayer.md
Last active September 21, 2022 04:16
OMXPlayer with Python

Use OMXPlayer with Python

Import:

import os

Play a video: