Skip to content

Instantly share code, notes, and snippets.

@jennyshane
jennyshane / Small-Raspbian-Image-for-Large-SD-Cards.md
Last active February 22, 2021 01:02
Creating a raspbian image to duplicate on large SD cards

(This is compiled from several very helpful stackexchange posts. I spent a while figuring this out, and I don't want to lose it.)

We recently needed several identical raspbian images, all with the same libraries installed, same content in the home directory and the same setup configuration.

The obvious thing to try is to just boot a base raspbian image, set it up as you want it, then remove the card from the Pi and use another machine to copy the contents of the card to create an image, then flash that image onto the other cards you have. There are two problems with this:

  1. If your SD cards are large (ours were 32G), this process becomes a bit cumbersome. Flashing the cards takes longer, creating an image from the card can take a really long time, and if you have limited space on your non-pi machine, you might not have anywhere to put a 32G image.
  2. Even if two SD cards are nominally the same size, they might not have exactly the same amount of space. This means that if you create your image from a card
@jennyshane
jennyshane / cv_image_stream.py
Created January 21, 2020 17:15
simple ros node to display camera stream using opencv
#!/usr/bin/env python
import threading
import rospy
import numpy as np
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
import cv2
camera_image=np.zeros((480, 640, 3), np.uint8)
@jennyshane
jennyshane / opencv_install.sh
Created March 20, 2020 21:26
opencv install
wget https://github.com/opencv/opencv_contrib/archive/4.2.0.tar.gz
gunzip 4.2.0.tar.gz && tar -xvf 4.2.0.tar && rm 4.2.0.tar
mv opencv_contrib-4.2.0/ opencv_contrib
wget https://github.com/opencv/opencv/archive/4.2.0.tar.gz
gunzip 4.2.0.tar.gz && tar -xvf 4.2.0.tar && rm 4.2.0.tar
mv opencv-4.2.0/ opencv
apt-get update
apt-get install --assume-yes pkg-config build-essential cmake