This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| Simply display the contents of the webcam with optional mirroring using OpenCV | |
| via the new Pythonic cv2 interface. Press <esc> to quit. | |
| ''' | |
| import cv2 | |
| def show_webcam(mirror=False): | |
| cam = cv2.VideoCapture(0) | |
| while True: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| """ | |
| Found on | |
| http://www.steinm.com/blog/motion-detection-webcam-python-opencv-differential-images/ | |
| """ | |
| import cv2 | |
| def diffImg(t0, t1, t2): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # sudo apt-get install python-opencv | |
| # opencv only works in python2? | |
| import cv2.cv as cv | |
| from datetime import datetime | |
| import time | |
| class MotionDetector(): | |
| def onChange(self, val): #callback when the user change the ceil | |
| self.ceil = val |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ping -c4 google.com > /dev/null | |
| if [ $? != 0 ] | |
| then | |
| echo "No network connection, restarting wlan0" | |
| /sbin/ifdown 'wlan0' | |
| sleep 10s | |
| /sbin/ifup --force 'wlan0' | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Created by Hosted Graphite on 2017-03-14 20:58:35 UTC | |
| # https://wwww.hostedgraphite.com/app/data-sources/ | |
| # Created for collectd version 5.4 | |
| # Config file for collectd(1). | |
| # | |
| # Some plugins need additional configuration and are disabled by default. | |
| # Please read collectd.conf(5) for details. | |
| # | |
| # You should also read /usr/share/doc/collectd-core/README.Debian.plugins | |
| # before enabling any more plugins. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [program:telegraf] | |
| command=/usr/bin/telegraf | |
| autostart=true | |
| autorestart=true | |
| stderr_logfile=/var/log/telegraf.err.log | |
| stdout_logfile=/var/log/telegraf.out.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #download telegraf, decompress, merge with root | |
| wget https://dl.influxdata.com/telegraf/releases/telegraf-1.2.1_linux_armhf.tar.gz | |
| tar xvfz telegraf-1.2.1_linux_armhf.tar.gz | |
| rsync -av telegraf/* / | |
| #install supervisord, add telegraf.conf from another gist, reread, update | |
| apt-get install supervisor | |
| wget https://gist.githubusercontent.com/f00-/969f73db5e0bff8202d61c8df2fb8475/raw/b373ec187fec469e17d2d448ac603e4d6a7e5494/telegraf.conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from flask import Flask, render_template | |
| import json, requests | |
| app = Flask(__name__) | |
| @app.route("/") | |
| def tickets(): | |
| base_url = "www.milb.com" | |
| path = "/ticketing-client/json/EventTicketPromotionPrice.tiksrv" | |
| parameters = "?team_id=498&display_in=singlegame&end_date=20170705&event_type=O&home_team_id=498&site_section=Default&begin_date=20170605&venue_id=2682&year=2017&leave_empty_games=true&ticket_category=Tickets" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #/bin/sh | |
| DISPLAY=:0 | |
| #minimzie everything | |
| wmctrl -k on | |
| #ncompass window id | |
| winid=`wmctrl -l | grep nCompass | cut -d " " -f1` | |
| #teamviewer window id | |
| teamviewer=`wmctrl -l | grep TeamViewer | cut -d " " -f1` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| avconv -same_quant -i "input.wmv" "output.mkv" |