Skip to content

Instantly share code, notes, and snippets.

@ufizo
ufizo / muz.sh
Created March 10, 2013 15:17
Music scanner script
#!/bin/sh
unset url
pattern="([^\w-]clementine)"
if ps ux | grep -P $pattern | grep -v grep | grep -vq tagreader; then
# $app is running!
url=`lsof -F n -c clementine | grep -i "^.*\.mp3$" | sed 's/^n//g'`
file=`basename "$url"`
# ft it is a mp3 file, get ID3 info
title=`id3info "$url" | grep "Title" | sed 's/^===.*[:].//g'` ; title=$(tr -d '\n' <<<"$title")
artist=`id3info "$url" | grep "performer" | sed 's/^===.*[:].//g'`; artist=$(tr -d '\n' <<<"$artist")
@ufizo
ufizo / stock4.pl
Created March 10, 2013 15:15
Queries Google Finance to get current stock rates for NSE and NYSE.
=head1 NAME
stock4.pl No fancy name yet
=head1 DESCRIPTION
Queries Google Finance to get current stock rates for NSE and NYSE.
=head1 DEPENDENCIES