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 | |
| # streaming 1080p h264 to the ipad | |
| # vod style program | |
| ffmpeg -i infile.mkv -acodec libfaac -ac 2 -ar 48000 -ab 160k -vcodec copy -vbsf h264_mp4toannexb -f mpegts - | mediastreamsegmenter -f /Users/username/Sites/video/stream -t 30 -p | |
| # delete files to save space | |
| ffmpeg -i infile.mkv -acodec libfaac -ac 2 -ar 48000 -ab 160k -vcodec copy -vbsf h264_mp4toannexb -f mpegts - | mediastreamsegmenter -f /Users/username/Sites/video/stream -t 30 -s 4 -D |
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
| import Queue | |
| import multiprocessing | |
| import threading | |
| class BufferedReadQueue(Queue.Queue): | |
| def __init__(self, lim=None): | |
| self.raw = multiprocessing.Queue(lim) | |
| self.__listener = threading.Thread(target=self.listen) | |
| self.__listener.setDaemon(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
| #![feature(asm)] | |
| #![feature(lang_items)] | |
| #![crate_type = "staticlib"] | |
| #![no_std] | |
| const GPIO_BASE: u32 = 0x3F200000; // base address for Pi 2 and Pi 3 | |
| fn sleep(value: u32){ | |
| for _ in 1..value { | |
| unsafe { asm!("");} |
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
| {% set local_source = '/usr/local/src' -%} | |
| {% set output_folder = '/tmp' -%} | |
| {% set nginx = pillar.get('nginx', {}) -%} | |
| {% set openresty_config = nginx.get('openresty', {}) -%} | |
| {% set openresty_version = openresty_config.get('version', '1.9.3.2') -%} | |
| {% set openresty_checksum = openresty_config.get('checksum', 'sha1=5a20c096250b8fc22b01c003ed5929bb4b07e960') -%} | |
| {% set openresty_package = 'ngx_openresty-' + openresty_version + '.tar.gz' -%} |
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
| # go to 'https://developers.facebook.com/tools/explorer' to get your access token | |
| access_token <- "******************* INPUT YOUR ACCESS TOKEN ******************************" | |
| require(RCurl) | |
| require(rjson) | |
| # Facebook json function copied from original (Romain Francois) post | |
| facebook <- function( path = "me", access_token, options){ | |
| if( !missing(options) ){ | |
| options <- sprintf( "?%s", paste( names(options), "=", unlist(options), collapse = "&", sep = "" ) ) |
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
| # First we update the authorizer to call the right lambda function including the qualifier :xxx at the end of the function ARN | |
| aws apigateway update-authorizer --rest-api-id XXXXXXXXX --authorizer-id XXXXX --patch-operations op=replace,path=/authorizerUri,value=arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:XXXXXXXXXXX:function:Authorize2:AliasOrVersion/invocations | |
| # Then we give API Gateway permission to invoke the authorizer using resource policies on the Lambda function | |
| aws lambda add-permission --function-name Authorize2 --statement-id mystatement12334 --action lambda:InvokeFunction --principal apigateway.amazonaws.com --qualifier AliasOrVersion --source-arn arn:aws:execute-api:us-west-2:XXXXXXXXXXX:XXApiIdXX/authorizers/XXAuthorizerIdXX | |
| # You can check the structure of your authorizer with | |
| aws apigateway get-authorizer --rest-api-id XXXXXX --authorizer-id XXXX | |
| # You can also check the policy against the lambda function with |
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 | |
| # Install Python prerequisites on NVIDIA Jetson TK1 for iTorch | |
| # This is for https://github.com/facebook/iTorch | |
| # L4T 21.3, Torch 7 (http://torch.ch) | |
| # Python 2.7 or greater must be installed before running this script | |
| # Torch 7 should already be installed before running this script | |
| # iPython is loaded using pip, as repository version is 1.x version, > 2.0 is needed | |
| # Need to compile from source as repository version libzmq3-dev is not the correct revision | |
| wget http://download.zeromq.org/zeromq-4.0.5.tar.gz | |
| tar xzvf zeromq-4.0.5.tar.gz |
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
| # file name terraform/modules/aws_vpc/vpc.tf | |
| # first create the VPC. | |
| # Prefix resources with var.name so we can have many environments trivially | |
| resource "aws_vpc" "mod" { | |
| cidr_block = "${var.cidr}" | |
| enable_dns_hostnames = "${var.enable_dns_hostnames}" | |
| enable_dns_support = "${var.enable_dns_support}" | |
| tags { | |
| Name = "${var.env}_vpc" |
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 tomcat:8.0.38 | |
| # Place the code version inside the webapps directory | |
| ARG PACKAGE_VERSION | |
| RUN echo "${PACKAGE_VERSION}" >> /usr/local/tomcat/webapps/version.txt | |
| COPY project.war /usr/local/tomcat/webapps/project.war | |
| COPY docker-entrypoint.sh / | |
| RUN chmod +x /docker-entrypoint.sh | |
| ENTRYPOINT ["/docker-entrypoint.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
| var restify = require('restify'); | |
| // Authentication | |
| var passport = require('passport'); | |
| var LocalStrategy = require('passport-local').Strategy; | |
| var sessions = require("client-sessions"); | |
| var server = restify.createServer(); | |
| server.use(restify.queryParser()); | |
| server.use(restify.bodyParser()); |
OlderNewer