Skip to content

Instantly share code, notes, and snippets.

@kyv
kyv / webm2icecast
Last active August 29, 2015 14:06
gst webm a icecast
gst-launch-0.10 v4l2src device=/dev/video0 ! typefind ! ffmpegcolorspace ! videorate force-fps=12/1 ! vp8enc ! \
queue ! mux. alsasrc ! audioconvert ! audioresample ! audiodynamic ! vorbisenc ! \
queue ! mux. webmmux name=mux streamable=true ! shout2send ip=127.0.0.1 port=8000 mount=montaje.webm password=XXXXX
@kyv
kyv / dvstream.cmd
Last active August 29, 2015 14:06
command for dvswitch
dvswitch -p2000 -hlocalhost 2>&1 /dev/null &
sleep 1
avconv -v 0 -f video4linux2 -i /dev/video1 -target ntsc-dv - | \
dvsource-file /dev/stdin -p 2000 -h localhost 2>&1 /dev/null &
sleep 5
dvsink-command -h localhost -p 2000 tee /dev/null | \
@kyv
kyv / vstream
Last active August 29, 2015 14:06
envolutura para dvstream y icecast
#!/bin/bash
# Script facilitador para transmitir video con dvswitch a icecast
# Ejemplo de uso
# vstream -h 127.0.0.1 -p 2000 -d /dev/video1 -i espora.org:8000/vstream.ogg
while [[ $# > 1 ]]
do
key="$1"
shift
@kyv
kyv / wavecmp
Created June 19, 2013 14:37
Compare wave files in two folders for length. Shows which files in second folder are closest to the length of files in first folder
#!/usr/bin/env python2
import os, sys
import contextlib
import wave
def main():
folders = []
dir1, dir2 = parseArgs(sys.argv)
print dir1, dir2
@kyv
kyv / mpdsched
Last active December 18, 2015 00:19
Simple script in ruby which schedules genres of musica by hour. Personally I call it with mpdcron.
#!/usr/bin/env ruby
require 'ruby-mpd'
mpd = MPD.new
mpd.connect
sched = ['Jazz', 'Jazz', 'Classical', 'Classical', 'Country', 'Blues', 'Son Jarocho', 'Jazz', 'Classical', 'Classical', 'Country', 'Blues', 'Jazz', 'Soul', 'R&B', 'R&B', 'Chilena', 'African', 'Afrobeat', 'Cumbia', 'Salsa', 'Tropical', 'Salsa' ,'Classical'] # 0-24
# make list of filenames w/out extension
@kyv
kyv / photos_tag.rb
Last active January 12, 2021 21:10 — forked from sukima/photos_tag.rb
Gallery Tag for Jekyll/Octopress Using extended version of bootstrap carousel
# Title: Gallery Tag for Jekyll
# Authors: Kevin Brown
# Description: gallery using extended bootstrap carousel. Uses a CDN if needed.
#
# Adaption of "Photos tag for Jekyll" by Devin Weaver
# Using bootstrap carosel-extended instead of fancybox: "http://bootsnipp.com/snipps/carousel-extended"
# We have also left out the photo tag and are using solly the gallery function
#
# ** This only covers the markup. Not the integration of carousel-extended **
#
@kyv
kyv / images-tags
Created March 14, 2013 15:42
cakecd tags plugin pagination
#Model/Image.php
...
public $actsAs = array('Tags.Taggable',
'Containable',
);
...
#Controller/ImagesController.php
...
class ImagesController extends AppController {
@kyv
kyv / gist:3978602
Created October 30, 2012 06:20
intro fit the second
NARRARADOR
Profundamente lejos en los remanos inexplorados del espiral pasado del moda del Oeste de la Galaxia esta un desatendido sol amarillo. Orbitando a ello a una distancia de mas o menos cincuenta millones de kilómetros es un pequeño y completamente insignificante planeta de azul-verde cuyos simio-descendiente formas de vida son tan increíblemente primitivos que aun piensan que relojes digitales son una idea genial.
Este planeta tiene, o tenia, un problema - lo cual era lo siguiente: la mayoría de las personas viviendo en ello estaban infelices el mayor parte del tiempo. Muchos soluciones fueran surgidos para resolver la problema, pero la mayoría de ellos preocupaban principalmente por el movimiento de pequeños verdes piezas de papel, lo cual es un poco extraño debido al hecho que por lo general no eran los pequeños verdes piezas de papel que estaban infelices.
Entonces la problema continuaba; y muchos personas eran muy bajos, y la mayoría eran miserables, inclusive los con relojes digitales. Much
@kyv
kyv / cpls.pl
Created October 6, 2012 17:57
copy y convert music for mp3 player
#!/usr/bin/perl
#Copyright 2012, kev@flujos.org
# * Licensed under the GPL Version 2 license.
use File::Copy;
use File::Basename;
my $PLS="$ARGV[0]";
my $DEST="$ARGV[1]";
my $tmp='/tmp/out.wav';
my @exts=qw(.ogg .oga .wma .m4a);
open($p, $PLS);
@kyv
kyv / nginx.conf
Created August 28, 2012 18:01
sinatra nginx config
upstream unicorn {
server unix:/tmp/.sock fail_timeout=0;
}
server {
listen 80;
server_name xyz.org;
rewrite ^(.*) https://$host$1 permanent;
}
server {
client_max_body_size 100m;