Skip to content

Instantly share code, notes, and snippets.

View krzysztofantczak's full-sized avatar

Krzysztof Antczak krzysztofantczak

View GitHub Profile
@krzysztofantczak
krzysztofantczak / readme.md
Last active August 29, 2015 14:11 — forked from jas-/readme.md

myprint.scl.utah.edu

The myprint service handles wireless printing for the MLIB PC labs. FreeBSD is the operating system that was chosen for this service primarily for its security features.

Details on the current configuration of myprint.scl.utah.edu can be found below. 07/12/2013

Host OS configuration

This first section details the various configuration options applied to the kernel, NAT & traffic passing to jailed (non routable net) env, usage of IPFW service to filter incoming & outgoing traffic to specific subnets & or targets, OS, Jail & TCP stack hardening options

@krzysztofantczak
krzysztofantczak / main.go
Last active August 29, 2015 14:10 — forked from 0xcaff/main.go
package main
import (
"encoding/json"
"net/http"
"net/url"
"fmt"
"io"
"regexp"
package main
import (
"code.google.com/p/go.net/websocket"
//"github.com/garyburd/go-websocket/websocket"
//"github.com/zhangpeihao/gowebsocket"
"net/http"
"net/rpc"
"net/rpc/jsonrpc"
)
var WebSocketServer = require('ws').Server;
var wss = new WebSocketServer({port: 8080});
var jwt = require('jsonwebtoken');
/**
The way I like to work with 'ws' is to convert everything to an event if possible.
**/
function toEvent (message) {
try {

test.php

<?php
$priKey = file_get_contents('./id_rsa');
$res = openssl_get_privatekey($priKey);
$orderString = 'some string';
openssl_sign($orderString, $sign, $res);
//$sign为引用
openssl_free_key($res);
$sign = base64_encode($sign);

echo $sign;

_.extend = function(obj) {
if (!_.isObject(obj)) return obj;
var source, prop;
for (var i = 1, length = arguments.length; i < length; i++) {
source = arguments[i];
for (prop in source) {
if (hasOwnProperty.call(source, prop)) {
obj[prop] = source[prop];
}
}
#!/bin/bash
#### This script is published by Philipp Klaus <philipp.l.klaus@web.de>
#### on <http://blog.philippklaus.de/2011/05/ipv6-6in4-tunnel-via-hurricane-electric-tunnelbroker-net-automatic-ip-update-on-mac-os-x/>
#### It is originally by freese60 and modified by limemonkey.
#### Found on <http://www.tunnelbroker.net/forums/index.php?topic=287.0>
### Uncomment this line to debug the script:
#set -x
Movie {}
User {
favourites [
{ movieId: ObjectId }
]
}

The avconv utility can be made to work in 'the Unix way' by specifying stdin and/or stdout instead of filenames for the input and output respectively. See: http://libav.org/avconv.html#pipe

Example:

cat input.ts | avconv -i pipe:0 -f mp4 -movflags frag_keyframe pipe:1 | cat > output.mp4

Using node's require('child_process').spawn(), we can pipe streams of video data through avconv's stdin and stdout and thus Stream All The Things.

var fs = require('fs');
/*
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js
*/
var http = require('http'),
fs = require('fs'),
util = require('util');
http.createServer(function (req, res) {
var path = 'video.mp4';