Skip to content

Instantly share code, notes, and snippets.

@voluntas
voluntas / open_momo.rst
Last active August 17, 2024 07:04
OpenMomo プロジェクト
@brutella
brutella / rpi-enable-camera-module.md
Last active April 15, 2025 18:29
How to enable the camera module on a Raspberry Pi

Enable camera module

Edit your /boot/config.txt file and make sure the following lines look like this:

start_x=1             # essential
gpu_mem=128           # at least, or maybe more if you wish
disable_camera_led=1  # optional, if you don't want the led to glow

Load bcm2835-v4l2 module

@jfstenuit
jfstenuit / Huawei WWAN.md
Last active November 14, 2023 15:16
Using a Huawei WWAN dongle on Linux

Introduction

Installing Huawei E3531 Surf Stick on Linux

May be a valuable insight for more modern surf sticks like Huawei E8231 and the likes ...

Linux is currently Ubuntu, Debian or Raspbian should be similar

The problem

This Huawei Surf stick has several USB mode. It appears first as CD-ROM-like device, so that Windows users can install their driver, then switches mode to appear as "something else". By defaut, this is a network card (virtually connected to a router),

@smarek
smarek / 70-huawei-e3.conf
Last active February 26, 2022 17:00
Raspberry / Banana Huawei E3372 network interface name
# /etc/udev/rules.d/70-huawei-e3.conf
# Necessary for network interface name
SUBSYSTEM=="net", ACTION=="add", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="14dc", NAME="usb0"
# Might be duplicate to usb_modeswitch config, however it's good to have it there
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1f01", RUN+="/usr/sbin/usb_modeswitch -c /etc/usb_modeswitch.d/huawei_e3.conf"
@rnagarajanmca
rnagarajanmca / raspberrypi_usb_audio.md
Last active November 23, 2024 00:18
Configure Raspberry pi with USB Audio

Device specifications

List USB Device

Once you connected the USB Audio device with Raspberry pi use following command to see the list of connected USB device

@flyboy74
flyboy74 / webcam.py
Last active October 7, 2021 15:09
Capture images from webcam stream
import cv2
capture = cv2.VideoCapture(0)
capture.set(3, 320) #set width of frame
capture.set(4, 200) #set hieght of frame
capture.set(5, 20) #set FPS
capture.set(10, 20) #set brightness
successful = True
while successful:
successful, image = capture.read()

These are notes while researching a way to convert a browser/website to a stream. This could be used for Facebook Live or for webrecording. TL'DR:

  • I started with Phantomjs - but that didn't support the html5 video tag
  • SlimerJS supports it, but there is no way to record audio directly (though this might come from desktop audio)
  • So I moved to research ffmpeg/X11/XVFB to record it with linux which works
  • But ffmpeg has no easy way to mix streams/overlays to I moved on to OBS with overlay browser support
  • I started researching options OBS in docker and it needed best a GPU , so I move to nvidia-docker
  • And so came across building game servers on EC2/AWS using GPUs and managed to run OBS inside of GPU g2x.large machine
  • I tried streaming to twich , which works great and managed to restream 4K 60FPS youtube on an AWS instance
  • Remote control works through OBS-Remote but OBS has kinda limit in types of features
@aayubkh
aayubkh / huawei_e8372_config.md
Last active February 13, 2024 11:55
Huawei E8372 Linux Configuration and Setup

Dependencies

  1. usb_modeswitch, usb_modeswitch-data
  2. libusb1
  3. libusb-devel(Fedora), libusb-dev(Debian based)

Configuration

By default, your linux box would register your Huawei E8372 as a Mass Storage device and not (somehow) as a modem. First, make sure you have the exace same device we're talking about. This can be confirmed by looking at two values using the following command (while the dongle is plugged in): As an elevated user:

    # lsusb | grep Huawei
@wholypantalones
wholypantalones / pushbullet_steps.bin
Created July 9, 2016 15:43
Set up pushbullet boot notifications for a raspberry pi
# Multiple sources here:
# https://atinkerersblog.wordpress.com/2014/07/26/get-notified-when-your-raspberry-pi-is-booted-with-pushbullet/
# - follow the steps to make rc.local executable below
# this script is a compilation of all three below
# https://learnraspi.com/get-notifications-raspberry-pi-pushbullet/
# http://biosrhythm.com/?p=1151
# http://askubuntu.com/questions/9853/how-can-i-make-rc-local-run-on-startup
# create the pushbullet script
$ sudo nano /usr/bin/notify.sh
@bjoern-r
bjoern-r / Huawei_E3372_openwrt.md
Last active March 26, 2025 08:28
How to use a Huawei E3372 on OpenWRT

HOWTO use a Huawei E3372 on OpenWRT

This modem is also sold as a MegaFon M150-2 USB dongle

Needed Software

Install the needed packages via opkg tool

opkg update