Skip to content

Instantly share code, notes, and snippets.

@tstellanova
tstellanova / video_rec_python_rpi3.md
Last active September 9, 2022 20:06
Capture video and stills from python using a USB webcam and python on the rpi3 or similar

Setup: Install pyuvc

This is a wrapper around libuvc the USB video class, for USB-connected cameras.

Install pyuvc and all its dependencies:

  • sudo apt-get install libusb-1.0 cython
  • Install libturbojpeg from source (there are some related packages available, but not the one libuvc depends on)
wget -O libjpeg-turbo.tar.gz https://sourceforge.net/projects/libjpeg-turbo/files/1.5.1/libjpeg-turbo-1.5.1.tar.gz/download
tar xvzf libjpeg-turbo.tar.gz
cd libjpeg-turbo-1.5.1
@astamicu
astamicu / Remove videos from Youtube Watch Later playlist.md
Last active December 26, 2024 09:44
Script to remove all videos from Youtube Watch Later playlist

UPDATED 22.11.2022

It's been two years since the last update, so here's the updated working script as per the comments below.

Thanks to BryanHaley for this.

setInterval(function () {
    video = document.getElementsByTagName('ytd-playlist-video-renderer')[0];

 video.querySelector('#primary button[aria-label="Action menu"]').click();
@blacktwin
blacktwin / new_kill_trans_pause.py
Last active October 17, 2019 04:13
Kill Plex paused video transcoding streams using PlexPy.
"""
Kill Plex paused video transcoding streams.
PlexPy > Settings > Notification Agents > Scripts > Bell icon:
[X] Notify on playback pause
PlexPy > Settings > Notification Agents > Scripts > Gear icon:
Playback Pause: new_kill_trans_pause.py
"""
import pytesseract
import sys
import argparse
try:
import Image
except ImportError:
from PIL import Image
from subprocess import check_output
@zerda
zerda / .gitlab-ci.yml
Last active October 8, 2020 04:05
Gitlab CI for spring boot project
image: maven:3.3-jdk-8-alpine
cache:
key: "$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME"
paths:
- .m2/
variables:
MAVEN_OPTS: "-Dmaven.repo.local=.m2"
@twang2218
twang2218 / Dockerfile
Created July 14, 2016 16:00
Docker cron example
FROM python:3.5.2
ENV TZ=Asia/Shanghai
RUN apt-get update \
&& apt-get install -y cron \
&& apt-get autoremove -y
COPY ./cronpy /etc/cron.d/cronpy
CMD ["cron", "-f"]
@Jaza
Jaza / Private-pypi-howto
Last active July 2, 2023 16:24
Guide for how to create a (minimal) private PyPI repo, just using Apache with directory autoindex, and pip with an extra index URL.
*
@joseluisq
joseluisq / terminal-git-branch-name.md
Last active November 25, 2024 08:03
Add Git Branch Name to Terminal Prompt (Linux/Mac)

Add Git Branch Name to Terminal Prompt (Linux/Mac)

image

Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

# Git branch in prompt.

parse_git_branch() {
@rponte
rponte / ActiveMQBrokerRule.java
Last active July 27, 2023 17:41
Starting and stopping Embedded ActiveMQ Broker during integration tests with jUnit Rules.
package base.jms;
import java.net.URI;
import java.net.URISyntaxException;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.broker.TransportConnector;
import org.apache.activemq.usage.SystemUsage;
import org.junit.rules.ExternalResource;
public class ActiveMQBrokerRule extends ExternalResource {
@tallpsmith
tallpsmith / Listing JMX beans from ActiveMQ using Jolokia
Last active April 28, 2022 08:49
Jolokia REST example using ActiveMQ
#curl -XGET --user USERNAME:PASSWORD http://localhost:8161/api/jolokia/list | python -m json.tool
#
{
"request": {
"type": "list"
},
"status": 200,
"timestamp": 1420595652,
"value": {
"JMImplementation": {