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
| # Package generated configuration file | |
| # See the sshd(8) manpage for details | |
| # What ports, IPs and protocols we listen for | |
| Port 7654 | |
| # Use these options to restrict which interfaces/protocols sshd will bind to | |
| #ListenAddress :: | |
| #ListenAddress 0.0.0.0 | |
| Protocol 2 | |
| # HostKeys for protocol version 2 |
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 socket | |
| import sys | |
| if len(sys.argv) != 3: | |
| print "Usage: %s host:port destfile.jpg" % sys.argv[0] | |
| sys.exit(1) | |
| s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
| host, port = sys.argv[1].split(':') |
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
| # Copyright (c) 2009-2010 Denis Bilenko. See LICENSE for details. | |
| """UDP/SSL server""" | |
| import sys | |
| import errno | |
| import traceback | |
| from gevent import socket | |
| from gevent import core | |
| from gevent.baseserver import BaseServer | |
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
| ## Configure eth0 | |
| # | |
| # vi /etc/sysconfig/network-scripts/ifcfg-eth0 | |
| DEVICE="eth0" | |
| NM_CONTROLLED="yes" | |
| ONBOOT=yes | |
| HWADDR=A4:BA:DB:37:F1:04 | |
| TYPE=Ethernet | |
| BOOTPROTO=static |
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/python | |
| #based on the ideas from http://synack.me/blog/implementing-http-live-streaming | |
| # Updates: | |
| # - 2024-04-24: Apply suggestions from @Pin80 | |
| # Run this script and then launch the following pipeline: | |
| # gst-launch videotestsrc pattern=ball ! video/x-raw-rgb, framerate=15/1, width=640, height=480 ! jpegenc ! multipartmux boundary=spionisto ! tcpclientsink port=9999 | |
| #updated command line | |
| #gst-launch-1.0 videotestsrc pattern=ball ! videoconvert ! video/x-raw, framerate=15/1, width=640, height=480 ! jpegenc ! multipartmux boundary=spionisto ! #tcpclientsink port=9999 | |
| from multiprocessing import Queue |
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
| void blendWithMask(cv::Mat &base, cv::Mat &src, cv::Mat &mask, cv::Mat &out){ | |
| char ch = base.channels(); | |
| double alpha = 0; | |
| for( int y = 0; y < base.rows; y++ ){ | |
| uchar* pBS = base.ptr<uchar>(y); | |
| uchar* pSR = src.ptr<uchar>(y); | |
| uchar* pMK = mask.ptr<uchar>(y); | |
| uchar* pOU = out.ptr<uchar>(y); | |
| for( int x = 0; x < base.cols*ch; x++ ){ | |
| int ix = x / ch; |
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 | |
| """ | |
| Plot data received over a ZeroMQ port in real time using matplotlib. | |
| Notes | |
| ----- | |
| This appears to segfault when run using the WxAgg backend. | |
| """ |
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
| #include <string> | |
| #include <ctime> | |
| #include <msgpack.hpp> | |
| struct message | |
| { | |
| std::string tag; | |
| std::time_t time; | |
| std::string text; | |
| MSGPACK_DEFINE(tag, time, text); |
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
| /** | |
| * group by day | |
| * @link https://gist.github.com/phnessu4/5636642 | |
| * @param query document {key1:123,key2:456} | |
| */ | |
| var count_by_day = function(query){ | |
| return db.action.group( | |
| { | |
| keyf: function(doc) { | |
| var date = new Date(doc.time); |
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 | |
| """ | |
| Create generator for reading consecutive chunks of data from a database table using pandas. | |
| """ | |
| import pandas.io.sql | |
| import sqlite3 | |
| def read_db(conn, table, names=None, chunksize=None): |
OlderNewer