Last active
December 21, 2015 08:49
-
-
Save 0mark/6281115 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dinge | |
- beedasul | |
creates playlist for madasul using beet | |
- deepcnv.pl | |
converts charset recursively | |
- dvd2avi | |
rips a dvd | |
- flac2ogg | |
ewisott | |
- k.js | |
creates download list for kinox | |
- notifycurrentuser.sh | |
sends a notification the "user" | |
- obex | |
obex mounter | |
- rddsk.pl | |
some recursive directory tree thingy ? | |
- remove_umlauts | |
removes umlaute from file names | |
- rplay.pl | |
plays stuff randomly using mplayer | |
- setpin | |
sets pin for umts modem | |
- soritertoer.pl | |
does fancy stuff with music, dont remember exactly what | |
- v2ogg.sh | |
video to ogg | |
- wav2ogg | |
ewisott | |
- ydl.sh | |
downloads stuff from youtube, converts to ogg and sets metadata |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
beet list -f '%lower{$format} $path $artist $album $title $genre $year $track' > /home/mark/.config/madasul/list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
my $path=shift() || die "error: no path"; | |
adddir($path); | |
sub adddir() { | |
my $lpath=shift(); | |
opendir(DIR, $lpath) || print "error: path $lpath"; | |
my @dir = readdir(DIR); | |
closedir(DIR); | |
my $exec="convmv -f iso8859-1 -t utf8 --notest '".$lpath."'*"; | |
#print $exec."\n"; | |
print `$exec`; | |
foreach (@dir) { | |
adddir($lpath.$_."/") if (-d "$lpath$_" && $_ ne "." && $_ ne ".."); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Dvd2Avi 0.2 | |
# Only does one title at a time, but "avimerge" from Transcode | |
# can sort it from there. | |
# by yyz | |
echo -n "Enter the name of output file (without extension):" | |
read FILE | |
echo -n "Enter the title you wish to rip:" | |
read TITLE | |
echo -n "Select a quality level (h/n/l)[[n]]:" | |
read Q | |
if [[ -z $Q ]];then | |
# If no quality passed, default to normal | |
Q=n | |
fi | |
if [[ $Q = h ]]; then | |
# If h passed, use high quality | |
mencoder dvd://$TITLE -alang en -oac mp3lame -lameopts br=320:cbr -ovc lavc -lavcopts vcodec=mpeg4:vhq -vf scale -zoom -xy 800 -o $FILE.avi | |
exit $? | |
fi | |
if [[ $Q = n ]]; then | |
# If n passed, use normal quality (recommended) | |
mencoder dvd://$TITLE -alang en -oac mp3lame -lameopts br=160:cbr -ovc lavc -lavcopts vcodec=mpeg4:vhq -vf scale -zoom -xy 640 -o $FILE.avi | |
exit $? | |
fi | |
if [[ $Q = l ]]; then | |
# If l passed, use low quality. not really worth it, | |
# hardly any smaller but much crappier | |
mencoder dvd://$TITLE -alang en -oac mp3lame -lameopts br=96:vbr -ovc lavc -lavcopts vcodec=mpeg4:vhq -vf scale -zoom -xy 320 -o $FILE.avi | |
exit $? | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#nav-bar { | |
background-image: none !important; | |
} | |
#TabsToolbar .tabbrowser-tab { | |
background-image: none !important; | |
background-color:#303030; | |
border:none; | |
margin-right:2px; | |
background-image:none !important; | |
border-radius:0; | |
height:26px; | |
border-top-width:3px; | |
border-top-style:solid; | |
border-top-color:#3a3a3a; | |
} | |
#TabsToolbar .tabbrowser-tab[selected] { | |
background-color:#3f3f3f; | |
border-top-width:3px; | |
border-top-style:solid; | |
border-top-color:#3f3f3f; | |
} | |
#TabGroupsManagerToolbar { | |
background-image:none !important; | |
} | |
#TabGroupsManagerToolbar .tabgroupsmanager-grouptab { | |
border: none !important; | |
background-color:#303030; | |
height:26px !important; | |
border-top-width:3px !important; | |
border-top-style:solid !important; | |
border-top-color:#3a3a3a !important; | |
} | |
#TabGroupsManagerToolbar .tabgroupsmanager-grouptab[selected] { | |
font-weight:normal !important; | |
background-color:#3f3f3f; | |
border-top-width:3px !important; | |
border-top-style:solid !important; | |
border-top-color:#3f3f3f !important; | |
} | |
#TabsToolbar { | |
border:none !important; | |
background-image:none !important; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for a in *.flac | |
do | |
OUTF=$(echo "$a" | sed s/\.flac$/.ogg/g) | |
ARTIST=$(metaflac "$a" --show-tag=ARTIST | sed s/.*=//g) | |
TITLE=$(metaflac "$a" --show-tag=TITLE | sed s/.*=//g) | |
ALBUM=$(metaflac "$a" --show-tag=ALBUM | sed s/.*=//g) | |
GENRE=$(metaflac "$a" --show-tag=GENRE | sed s/.*=//g) | |
TRACKNUMBER=$(metaflac "$a" --show-tag=TRACKNUMBER | sed s/.*=//g) | |
DATE=$(metaflac "$a" --show-tag=DATE | sed s/.*=//g) | |
oggenc -q9 --discard-comments -a "$ARTIST" -t "$TITLE" -l "$ALBUM" -G "GENRE" -N "$TRACKNUMBER" -d "$DATE" -o "$OUTF" "$a" | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function genlist(data) { | |
if(!data.length) return; | |
var d = data.shift(); | |
$.ajax({ | |
type: "GET", | |
url:'/aGET/Mirror/' + $('#SeasonSelection').attr('rel').substr(6, $('#SeasonSelection').attr('rel').indexOf('&')-6) + "&Hoster=4&Mirror=1&Season=" + d[0] + "&Episode=" + d[1], | |
dataType:"json", | |
success: function(xdata) { | |
//all.append(d[0]+', '+d[1]+', '+($(xdata.Stream).attr('href') + "<br>\n")); | |
all.append($(xdata.Stream).attr('href') + "<br>\n"); | |
genlist(data); | |
}, | |
error: function(jqXHR, textStatus, errorThrown) { | |
data.shift(); | |
genlist(data); | |
}, | |
}); | |
} | |
var all = $('<div></div>').css({position:'absolute', backgroundColor:'white', width:'800px', height:'600px', overflow:'auto'}); | |
$('body').prepend(all); | |
var list=[]; | |
$('#SeasonSelection>option').each(function(i, v) { | |
var Season=$(v).attr('value'); | |
var EpisodeList=$('#SeasonSelection > option[value='+Season+']').attr('rel'); | |
$.each(EpisodeList.split(","), function(ii, vv) { | |
list.push([Season, vv]); | |
}); | |
}); | |
genlist(list); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo -u $( who | egrep ' (tty|pts)' | egrep ' \(:(pts/)?0' | cut -d ' ' -f 1 ) sh -c 'notify-send blieb blab' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
notify-send "Mounting" "$1" | |
mkdir ~/bluetooth | |
fusermount -u -z ~/bluetooth | |
obexfs -b $1 ~/bluetooth | |
thunar --sync ~/bluetooth | |
#xfe ~/bluetooth | |
fusermount -u ~/bluetooth | |
rmdir ~/bluetooth |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
my $path=shift() || die "error: no path"; | |
my $showpath=shift(); | |
my $op=""; | |
adddir($path); | |
sub adddir() { | |
my $lpath=shift(); | |
opendir(DIR, $lpath) || print "error: path $lpath"; | |
my @dir = readdir(DIR); | |
closedir(DIR); | |
foreach (@dir) { | |
if ($_ ne "." && $_ ne "..") { | |
if (-d "$lpath$_") { | |
adddir($lpath.$_."/") | |
} else { | |
if($op ne $lpath && $showpath==1) { | |
print "\n---- $lpath ----\n"; | |
$op=$lpath; | |
} | |
print $_."\n"; | |
} | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ls | perl -e '@a=<STDIN>;foreach(@a){s/\n//g;$x=$_;s/ü/ue/g;s/ä/ae/g;s/ö/oe/g;s/ß/ss/g;s/&/+/g;s/Ä/Ae/g;s/ö/Oe/g;s/Ü/ue/g;print "mv \"".$x."\" \"".$_."\"\n" if ($x ne $_);}'|sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
my $path=shift() || die "error: no path"; | |
my @imgs; | |
my $exec; | |
opendir(DIR, $path) || die "error: path $path"; | |
my @dir = readdir(DIR); | |
closedir(DIR); | |
foreach (@dir) { | |
push (@imgs,$_) if (/\.(avi)|(mpg)/i); | |
} | |
$|=1; | |
while (1) { | |
$exec="mplayer -fs \"$path/".$imgs[rand($#imgs)]."\""; | |
`$exec`; | |
sleep (2); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
#`optionmodeswitch`; | |
my $modem = "/dev/ttyUSB0"; | |
# Substitute xxxx with your PIN. | |
# You should probably put your pin somewhere else, e.g. on an USB stick, | |
# an encrypted file system or something else, and read it from there... | |
# You have been warned! | |
my $pin = "5951"; | |
$SIG{ALRM} = sub { | |
die("timeout: no response from modem $modem\n"); | |
}; | |
open(MODEM, "+<", $modem) or die("can't open modem $modem"); | |
alarm(10); | |
print(MODEM "AT+CPIN=\"$pin\"\n\r"); | |
while (<MODEM>) { | |
if (m/OK/) { | |
close(MODEM); | |
print("PIN accepted\n"); | |
exit(0); | |
} | |
if (m/ERROR/) { | |
close(MODEM); | |
print("PIN rejected\n"); | |
exit(1); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
my $from=shift(); | |
my $to=shift(); | |
my $nojustajokethisistherealto=shift(); | |
sub dir { | |
my $path=shift(); | |
my @dir=shift(); | |
opendir(DIR, $path) || die "error: path $path"; | |
my @dir = readdir(DIR); | |
closedir(DIR); | |
splice(@dir,0,2); | |
return @dir; | |
} | |
my %genres; | |
foreach(dir($to)) { | |
$genres{$_}=[dir("$to/$_")]; | |
} | |
my @unknownartists=dir($from); | |
foreach my $genre(keys(%genres)) { | |
foreach my $artist(@{$genres{$genre}}) { | |
foreach my $unknownartist(@unknownartists) { | |
if (lc($unknownartist) eq lc($artist)) { | |
if ($nojustajokethisistherealto ne "") { | |
if (not -d "$nojustajokethisistherealto/$genre") { | |
mkdir("$nojustajokethisistherealto/$genre"); | |
} | |
print "mv \"$from/$unknownartist\" \"$nojustajokethisistherealto/$genre/$artist\""."\n"; | |
} else { | |
print "mv \"$from/$unknownartist\" \"$to/$genre/$artist\""."\n"; | |
} | |
} | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
p=${2//- /-} | |
p=${p// -/-} | |
p1=${p%%-*} | |
p2=${p#${p1}-} | |
if [ "$p1" != "$p2" -a ! -z "$p1" ]; then | |
p3=${p2%%-*} | |
if [ "$p2" != "$p3" ]; then | |
p2=${p2#$p3-} | |
metadata="-a \"$p1\" -l \"$p3\" -t \"$p2\"" | |
else | |
metadata="-a \"$p1\" -t \"$p2\"" | |
fi | |
else | |
metadata="" | |
fi | |
echo "metadata: $metadata" | |
tmpf=$(mktemp --suffix .wav) | |
echo "* converting to wav" | |
mplayer -vo null -vc null -ao pcm:fast:file=$tmpf "$1" &> /dev/null | |
echo "* converting to ogg" | |
echo "oggenc -q 7 -G \"$3\" $metadata -n \"$2.ogg\" $tmpf" | sh &> /dev/null | |
rm $tmpf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for a in *.wav | |
do | |
OUTF=$(echo "$a" | sed s/\.wav$/.ogg/g) | |
#ARTIST=$(metaflac "$a" --show-tag=ARTIST | sed s/.*=//g) | |
#TITLE=$(metaflac "$a" --show-tag=TITLE | sed s/.*=//g) | |
#ALBUM=$(metaflac "$a" --show-tag=ALBUM | sed s/.*=//g) | |
#GENRE=$(metaflac "$a" --show-tag=GENRE | sed s/.*=//g) | |
#TRACKNUMBER=$(metaflac "$a" --show-tag=TRACKNUMBER | sed s/.*=//g) | |
#DATE=$(metaflac "$a" --show-tag=DATE | sed s/.*=//g) | |
oggenc -q9 --discard-comments -o "$OUTF" "$a" | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
echo "$1, $2, $3, $4, $5, $6" > /home/mark/ydl | |
if [ $# -ne 6 ]; then | |
echo "ydl.sh GENRE BAND ALBUM TRACK NUMBER URL" | |
exit 1 | |
fi | |
echo "-- downloading video file *blinkblink*" | |
youtube-dl -o /tmp/$$.flv "$6" | |
echo "-- extracting audio *blinkblink*" | |
mplayer -vo null -ao pcm:fast:file=/tmp/$$.wav /tmp/$$.flv | |
rm /tmp/$$.flv | |
#echo "-- encoding to ogg *blinkblink*" | |
#oggenc -q 7 -G "$1" -a "$2" -N "$5" -t "$4" -l "$3" -n "%a - %l - %t.ogg" /tmp/$$.wav | |
#rm /tmp/$$.wav | |
echo "-- encoding to mp3 *blinkblink*" | |
lame --replaygain-accurate -q 2 --vbr-new -V 3 -o --tg "$1" --ta "$2" --tn "$5" --tt "$4" --tl "$3" /tmp/$$.wav "$2 - $3 - $4.mp3" | |
rm /tmp/$$.wav |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment