Skip to content

Instantly share code, notes, and snippets.

View agalazis's full-sized avatar
🌴
On vacation

Andreas Galazis agalazis

🌴
On vacation
View GitHub Profile
@agalazis
agalazis / youtubetv
Last active August 29, 2015 14:04
remotely enable youtube tv and then controll it from your paired phone device
export DISPLAY=:0
firefox http://tv.youtube.com &
sleep 5
xdotool key F11
@agalazis
agalazis / Playlist Creator
Last active August 29, 2015 14:06
build all plalysts from directories that contain music
#!/bin/bash
#asuming you hace a ~/playlists directory dedicated for this purpose
cd ~/
rm -rf ~/playlists/* && find ~/ -name '*.mp3' | while read line ; do fn=$(echo ${line%/*}|md5sum | cut -d ' ' -f 1); [ ! -f "playlists/$fn.m3u" ] && echo "#EXTM3U" >>"playlists/$fn.m3u";echo $line>>"playlists/$fn.m3u"; done
@agalazis
agalazis / mplayerServer
Created September 14, 2014 23:36
track pids of websocketd instances
#!/bin/bash
websocketd /usr/bin/mplayer -volume 99 http://imagine.1stepstream.com:8000/aac -ao alsa:device=hw&
echo $!> /tmp/pidofmplayerserver
@agalazis
agalazis / mplayer stdout tracking
Last active August 29, 2015 14:07
sample stdout spying script for a process using strace (in this case for mplayer)
#track all (write sys call) output but clear from system call functions(only the text in quotes)
strace -p$(pgrep mplayer |head -n1 ) -s9999 -e write 2>&1 |grep -Po '".*?"'
#track volume changes
strace -p$(pgrep mplayer |head -n1 ) -s9999 -e write 2>&1 |grep -Po 'KVolume.*? %'
#track information and volume changes
strace -p$(pgrep mplayer |head -n1 ) -s9999 -e write 2>&1 |grep -Po 'KVolume.*? %|Title:.*?\\n|Album:.*?\\n|Year:.*?\\n|Track:.*?\\n'
#or
strace -p$(pgrep mplayer |head -n1 ) -s9999 -e write 2>&1 |grep -Po 'KVolume.*?\\n|Title:.*?\\n|Album:.*?\\n|Year:.*?\\n|Track:.*?\\n'
@agalazis
agalazis / final websocketd mplayer tarcker
Created November 15, 2014 20:56
final websocketd mplayer tarcker
websocketd strace -p$(pgrep mplayer |head -n1 ) -s9999 -e write 2>&1 |grep -Po 'KVolume.*?\\n|Title:.*?\\n|Album:.*?\\n|Year:.*?\\n|Track:.*?\\n'
@agalazis
agalazis / gist:92ae2ff2aa98038d8dd5
Last active August 29, 2015 14:10
new approach for mplayer draft
sudo mplayer -ao alsa:device=hw -af equalizer=0:0:0:0:0:0:0:0:0:0 -volume 60 http://imagine.1stepstream.com:8000/aac| while IFS= read -r line; do echo $line |grep -Po 'KVolume.*?%|Title:.*?\\n|Album:.*?\\n|Year:.*?\\n|Track:.*?\\n' | myamqclient; done
amq client -emits updates:
#!/usr/bin/env python
import pika
import sys
message= sys.stdin.read().rstrip()
connection = pika.BlockingConnection(pika.ConnectionParameters(
host='localhost'))
@agalazis
agalazis / Sound-controls-in-circle.markdown
Last active August 29, 2015 14:13
Sound controls in circle
<?php
/**
* stream - Handle raw input stream
*
* LICENSE: This source file is subject to version 3.01 of the GPL license
* that is available through the world-wide-web at the following URI:
* http://www.gnu.org/licenses/gpl.html. If you did not receive a copy of
* the GPL License and are unable to obtain it through the web, please
*
@agalazis
agalazis / Todo.md
Last active August 29, 2015 14:15
Thinks to do for mplayer api: