Skip to content

Instantly share code, notes, and snippets.

### BEGIN INIT INFO
# Provides: redis
# Required-Start: $syslog $remote_fs
# Required-Stop: $syslog $remote_fs
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description:redis-server - Persistent key-value db
# Description: redis-server - Persistent key-value db
#! /bin/sh
### BEGIN INIT INFO
# Provides: alena-sio-client-handler
### END INIT INFO
set -e
NAME=alena-sio-client-handler
RUN_AS=alena:alena
have a nice tee!
gst-launch --gst-debug=*:5 --gst-debug-no-color filesrc location=111.pcma ! audio/x-alaw,rate=8000,channels=1 ! alawdec ! audio/x-raw-int,rate=8000,channels=1,width=16 ! audioresample ! audio/x-raw-int,rate=16000,channels=1,width=16 ! speexenc mode=2 quality=6 ! tee name=t ! queue ! audio/x-speex ! flvmux streamable=true ! rcslabsrtmpsink url="rtmp://192.168.1.230/live/dima" librtmp-loglevel=0 t. ! queue ! filesink location=/home/ykrikun/spx/111.spx
speex to flash ok
gst-launch --gst-debug=*:2 --gst-debug-no-color filesrc location=ypp8k.wav ! wavparse ! audio/x-raw-int,rate=8000,channels=1,width=16 ! audioresample ! audio/x-raw-int,rate=16000,channels=1,width=16 ! speexenc mode=2 quality=6 ! flvmux streamable=true ! rcslabsrtmpsink url="rtmp://192.168.1.230/live/dima" librtmp-loglevel=0
speex from flash ok
gst-launch --gst-debug=*:5 --gst-debug-no-color rcslabsrtmpsrc url="rtmp://192.168.1.230/live/dima" librtmp-loglevel=0 ! flvdemux name=demux demux.audio ! audio/x-speex,rate=16000 ! speex
body {
font-size: 12pt;
font-family: Fixedsys;
-webkit-font-smoothing: none;
font-smooth: never;
}
@ykrkn
ykrkn / nginx.conf
Created March 14, 2013 16:49
nginx 1.3.14 + nginx-sticky-module = ws/xhr polling + round robin + sticky sessions
http {
upstream client_handler {
sticky; # !important
server 127.0.0.1:8000;
server 127.0.0.1:8001;
server 127.0.0.1:8002;
server 127.0.0.1:8003;
}
map $http_upgrade $connection_upgrade {
HOST=192.x.x.x
service denyhosts stop
mv /etc/hosts.deny /tmp
cd /var/lib/denyhosts
for i in `ls`; do mv $i $i.old; grep -v “$HOST” $i.old >> $i; done
grep -v $HOST /tmp/hosts.deny >> /etc/hosts.deny
service denyhosts start
utf8string = unicodestring.encode('UTF-8')
and back again
unicodestring = unicode(utf8string, 'UTF-8')
void runMidi() throws MidiUnavailableException, InvalidMidiDataException, InterruptedException{
MidiDevice.Info[] mdi = MidiSystem.getMidiDeviceInfo();
MidiDevice out = null;
for(MidiDevice.Info info : mdi){
System.out.println(info);
if("Microsoft GS Wavetable Synth".equals(info.getName())){
out = MidiSystem.getMidiDevice(info);
}
}
@ykrkn
ykrkn / gist:6353117
Created August 27, 2013 12:53
nginx CORS configuration
location /api {
proxy_pass http://localhost:8080/api;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header Access-Control-Allow-Origin *;
if ($request_method = OPTIONS ) {
add_header Allow 'POST, GET, PUT, DELETE, OPTIONS';
add_header Access-Control-Allow-Origin *;
// run top -p<PID> -b -d 1.0 > tmpfile
// code for prepare below
var fs = require('fs');
var FILESRC;
var PID;
var SEPARATOR=",";
process.argv.forEach(function(val, index, array) {