Added jffs2unpack. Nice 2 for mp3gain/mp3lame. Added yt2mp3 with -V4

quality. Updated glances conf.
This commit is contained in:
Markus Birth 2015-06-01 22:41:23 +02:00
parent dc6517e44d
commit 723c4b85dc
5 changed files with 72 additions and 9 deletions

View File

@ -145,15 +145,12 @@ list_5_countmin=1
list_6_description=OpenFire
list_6_regex=.*openfire.*
list_6_countmin=1
list_7_description=PleX Media Server
list_7_regex=.*[Pp]lex.*
list_7_description=MediaTomb
list_7_regex=.*mediatomb.*
list_7_countmin=1
list_8_description=MediaTomb
list_8_regex=.*mediatomb.*
list_8_description=Apache2
list_8_regex=.*apache2.*
list_8_countmin=1
list_9_description=Apache2
list_9_regex=.*apache2.*
list_9_countmin=1
#list_10_description=NFSd
#list_10_regex=.*nfs.*
#list_10_countmin=1

59
jffs2unpack.sh Executable file
View File

@ -0,0 +1,59 @@
#!/bin/bash
# Needs mtd-tools with jffs2reader
if [ ! -f "$1" ]; then
echo "Syntax: $0 JFFS2IMAGE"
exit 1
fi
BASENAME=`basename "$1"`
OUTDIR="./${BASENAME}_unpack/"
mkdir $OUTDIR
while read -u3 line; do
# echo "Line: $line"
PERMS=`echo $line | cut -d" " -f1`
SIZE=`echo $line | cut -d" " -f5`
FILE=`echo $line | cut -d" " -f6`
TYPE=${PERMS:0:1}
PERMS=${PERMS:1}
# echo "P:$PERMS S:$SIZE F:$FILE T:$TYPE"
if [ "${FILE:0:1}" == "/" ]; then
FILE=${FILE:1}
fi
PERMSU=`echo "${PERMS:0:3}" | sed 's/-//g'`
PERMSG=`echo "${PERMS:3:3}" | sed 's/-//g'`
PERMSO=`echo "${PERMS:6:3}" | sed 's/-//g'`
FULLPERMS="u=$PERMSU,g=$PERMSG,o=$PERMSO"
OUTFILE="$OUTDIR$FILE"
case "$TYPE" in
"d")
OUTFILE="$OUTDIR$FILE"
echo "DIR: $FILE ($FULLPERMS) --> $OUTFILE"
mkdir "$OUTFILE"
chmod $FULLPERMS "$OUTFILE"
;;
"l")
LINKTARGET=`echo $line | cut -d" " -f8`
echo "Symlink: $FILE --> $LINKTARGET"
ln -s $LINKTARGET "$OUTFILE"
;;
"-")
echo "FILE: $FILE ($SIZE bytes, $FULLPERMS)"
jffs2reader "$1" -f "$FILE" > $OUTFILE
chmod $FULLPERMS "$OUTFILE"
;;
*)
echo "UNKNOWN!!!!!!! ($line)"
;;
esac
done 3< <(jffs2reader "$1")

View File

@ -9,6 +9,6 @@ if [ -z "$CONCURRENCY_LEVEL" ]; then
fi
echo "Processing using $CONCURRENCY_LEVEL processes..."
find "$@" -print0 | xargs -0 -P $CONCURRENCY_LEVEL -n 1 -I {} mp3gain -q -k -p -r -s i "{}"
nice -n2 find "$@" -print0 | xargs -0 -P $CONCURRENCY_LEVEL -n 1 -I {} mp3gain -q -k -p -r -s i "{}"
echo "All done."

2
mp3lame.sh Executable file → Normal file
View File

@ -9,6 +9,6 @@ if [ -z "$CONCURRENCY_LEVEL" ]; then
fi
echo "Processing using $CONCURRENCY_LEVEL processes..."
find "$@" -print0 | xargs -0 -P $CONCURRENCY_LEVEL -n 1 -I {} lame -m j --replaygain-fast --vbr-new -V 2 -o --id3v2-only --resample 44.1 --quiet "{}" "{}.mp3"
nice -n2 find "$@" -print0 | xargs -0 -P $CONCURRENCY_LEVEL -n 1 -I {} lame -m j --replaygain-fast --vbr-new -V 2 -o --id3v2-only --resample 44.1 --quiet "{}" "{}.mp3"
echo "All done."

7
yt2mp3_V4.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
if [ "$#" = "0" ]; then
echo "Usage: $0 youtube-url output-filename"
exit 1
fi
youtube-dl "$1" -o - | avconv -i pipe:0 -f wav -vn - | lame -m j --replaygain-fast --vbr-new -V 4 -o --id3v2-only --resample 44.1 - "$2.mp3"