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 | |
import numpy | |
import sys | |
import timeit | |
try: | |
import numpy.core._dotblas | |
print 'FAST BLAS' | |
except ImportError: | |
print 'slow blas' |
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 | |
app = Flask(__name__) | |
@app.route('/<string:page_name>/') | |
def static_page(page_name): | |
return render_template('%s.html' % page_name) | |
if __name__ == '__main__': | |
app.run() |
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
# Hello, and welcome to makefile basics. | |
# | |
# You will learn why `make` is so great, and why, despite its "weird" syntax, | |
# it is actually a highly expressive, efficient, and powerful way to build | |
# programs. | |
# | |
# Once you're done here, go to | |
# http://www.gnu.org/software/make/manual/make.html | |
# to learn SOOOO much more. |
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 | |
set -e | |
# | |
# This script is meant for quick & easy install via: | |
# 'curl -sSL https://get.docker.com/ | sh' | |
# or: | |
# 'wget -qO- https://get.docker.com/ | sh' | |
# | |
# For test builds (ie. release candidates): | |
# 'curl -fsSL https://test.docker.com/ | sh' |
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 python3 | |
import sys | |
import os | |
import time | |
import fcntl | |
def main(image_dir): | |
files = [] | |
for (dirpath, dirnames, filenames) in os.walk(image_dir): |
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 -ex | |
# Use -gt 1 to consume two arguments per pass in the loop (e.g. each | |
# argument has a corresponding value to go with it). | |
# Use -gt 0 to consume one or more arguments per pass in the loop (e.g. | |
# some arguments don't have a corresponding value to go with it such | |
# as in the --default example). | |
while [[ $# -gt 1 ]] | |
do | |
key="$1" |
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
# Use gstreamer with mpv | |
## source | |
gstreamer rtp source over udp: | |
gst-launch-0.10 v4l2src ! ffenc_mpeg4 ! rtpmp4vpay send-config=true ! udpsink host=127.0.0.1 port=5000 | |
## sink | |
mpv play a sdp file: mpv --untimed /tmp/video.sdp | |
/tmp/video.sdp's content: | |
v=0 | |
m=video 5000 RTP/AVP 96 |
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
mkfifo /tmp/testpipe | |
while true; do ffmpeg -f v4l2 -s 1280x720 -i /dev/video0 -f rawvideo -video_size 1280x720 -pix_fmt rgb24 - | ffmpeg -f rawvideo -video_size 1280x720 -pix_fmt rgb24 -i - -f rawvideo -pix_fmt rgb24 -video_size 1280x720 - > /tmp/testpipe; wait; done | |
cat /tmp/testpipe | mplayer -nosound -framedrop -benchmark -nostop-xscreensaver -nolirc -demuxer rawvideo -rawvideo w=1280:h=720:format=rgb24 - |
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
# Mount a path from a server to local machine | |
# Command to use on local machine | |
sshfs -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3 username@host:/host/path /mnt/path | |
# enter ssh password in stdin | |
sshfs -o password_stdin,reconnect,ServerAliveInterval=15,ServerAliveCountMax=3,StrictHostKeyChecking=no username@host:/host/path /mnt/path | |
# Reverse mount | |
# issue from the sshfs SERVER to let a CLIENT mount a SERVER directory | |
dpipe /usr/lib/openssh/sftp-server = ssh CLIENT sshfs :/mnt/host/path /mnt/client/path -o slave,reconnect,ServerAliveInterval=15,ServerAliveCountMax=3 |
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
# zmqimage.py -- classes to send, receive and display cv2 images via zmq | |
# based on serialization in pyzmq docs and pyzmq/examples/serialization | |
''' | |
PURPOSE: | |
These classes allow a headless (no display) computer running OpenCV code | |
to display OpenCV images on another computer with a display. | |
For example, a headless Raspberry Pi with no display can run OpenCV code | |
and can display OpenCV images on a Mac with a display. | |
USAGE: |
OlderNewer