Skip to content

Instantly share code, notes, and snippets.

View matthiasg's full-sized avatar

matthiasg matthiasg

View GitHub Profile
# Licensed under CC BY 3.0 http://creativecommons.org/licenses/by/3.0/
# Derived works must attribute https://gist.github.com/4492300 at the beginning, and the date.
##################################################################
Installing and Configuring SmartOS on a budget server (with a /29)
##################################################################
# if you find this gist useful, please star it
# please be aware that budget hosting companies usually cut corners somewhere,
@matthiasg
matthiasg / INSTALL.md
Last active August 29, 2015 14:07
Compile zbar on SmartOS (works against JPEG! but not PNGs)

Tested:

SmartOS BaseImage: 20150219T102159Z Zone Image: b451ca78-1ca5-11e4-8a4c-5f463f94e8f1 (elasticsearch 14.2.0 smartos 2014-08-05T13:37:54Z)

Source:

Download zbar source from: http://zbar.sourceforge.net/download.html => zbar-0.10.tar.bz2 Download imagemagick source from: http://www.imagemagick.org/download/ImageMagick.tar.gz => ``

@matthiasg
matthiasg / INSTALL.md
Last active August 29, 2015 14:07
Tesseract and leptonica on SmartOS

Download

Leptonica from: http://www.leptonica.org/download.html

Tesseract from: https://code.google.com/p/tesseract-ocr/

Leptonica

Configure

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Cross-browser kerning-pairs & ligatures</title>
<style>
body { font-family: sans-serif; background: #f4f3f3; color: rgba(40, 30, 0, 1); width: 500px; margin: 80px auto; padding: 0px; }
a { color: rgba(15, 10, 0, 0.8); text-decoration: none; border-bottom: 1px solid; padding: 1px 1px 0px; -webkit-transition: background 1s ease; }
a:hover { background: rgba(0, 220, 220, 0.2); }
p, li { line-height: 1.5; padding: 0em 1em 0em 0em; margin: 0em 0em 0.5em; }

HLS streaming from node

Provided that you already have a file or stream segmenter generating your .m3u8 playlist and .ts segment files (such as the ffmpeg 'hls' muxer), this little node server will serve up those files to an HLS compatible client (e.g. Safari). If you're using node for your streaming app already, this obviates the need to serve the HLS stream from a separate web server.

loosely based on https://gist.github.com/bnerd/2011232

// loosely based on https://gist.github.com/bnerd/2011232
// requires node.js >= v0.10.0
// assumes that HLS segmenter filename base is 'out'
// and that the HLS playlist and .ts files are in the current directory
# References:
# http://blog.mixu.net/2011/08/13/nginx-websockets-ssl-and-socket-io-deployment/
# http://blog.exceliance.fr/2012/09/10/how-to-get-ssl-with-haproxy-getting-rid-of-stunnel-stud-nginx-or-pound/
#
global
nbproc 2
maxconn 16384
defaults
The MIT-except-Apple License (MIT-EA)
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person (except
anybody associated with Apple Inc.) obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the
Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@matthiasg
matthiasg / prtconf -d
Created May 30, 2015 07:18
sln30-1 Diagnostic Infos
System Configuration: Joyent i86pc
Memory size: 131037 Megabytes
System Peripherals (Software Nodes):
i86pc
scsi_vhci, instance #0
ramdisk, instance #0
pci, instance #0
pci15d9,702 (pciex8086,e00) [Intel Corporation Xeon E7 v2/Xeon E5 v2/Core i7 DMI2] (driver not attached)
pci8086,e02 (pciex8086,e02) [Intel Corporation Xeon E7 v2/Xeon E5 v2/Core i7 PCI Express Root Port 1a] (driver not attached)
@matthiasg
matthiasg / app.css
Last active September 14, 2015 13:20 — forked from rdtsc/app.css
NW.js Windows PDF Printing Demo
body {
font-family: sans-serif;
}
section {
margin-bottom: 40px;
}
h1 {
font-size: 20px;
@matthiasg
matthiasg / test.js
Created October 12, 2015 09:49
ES7 Async test for sourcemaps
asyncTest().then(()=>console.log('done'));
async function asyncTest(){
let asyncTest = await test();
}
async function test(){
var t = new Array(10);