bash array hints

source: http://www.linuxjournal.com/content/bash-arrays If you’re used to a “standard” *NIX shell you may not be familiar with bash’s array feature. Although not as powerful as similar constructs in the P languages (Perl, Python, and PHP) and others, they are often quite useful. Bash arrays have numbered indexes only, but they are sparse, ie you don’t have […]

bash – read command results into an array

read -a ARRAY <<< $(df -h /data | grep -w /data) OR read -d DELIMITER -a ARRAY <<< $(df -h /data | grep -w /data) THIS DOES NOT WORK FOR ME OR OIFS=$IFS;IFS=$’\|’;read -a ARRAY <<< “$STRING2PROCESS”;IFS=$OIFS # for delimiter ‘|’ OR BETTER (!) ARRAY=($(df -h /data | grep -w /data)) HINT —> OIFS=$IFS;IFS=$’\|’;read -a […]

Transcoding icecast streams from stereo mp3 to mono mp3, stereo aac+v2, stereo ogg with liquidsoap

url = “http://ADDRESS:80/radio.mp3&#8221; input = mksafe(input.http(url)) set(“log.file.path”,”/var/log/liquidsoap/radio.log”) output.icecast( %vorbis(samplerate=44100, channels=2, quality=0.9), mount=”/radio.ogg”, name=”RADIO”, url=”http://YOURSITE&#8221;, description=”YOURDESC”, genre=”YOURGENRE”, host=”ADDRESS”, port=PORT, password=”PASSWORD”, input) output.icecast( # %aac(channels=2, samplerate=44100, bitrate=128, adts=true), # %aacplus(channels=2, samplerate=44100, bitrate=64), %fdkaac(channels=2, samplerate=44100, aot=”mpeg2_he_aac_v2″, transmux=”adts”, sbr_mode=false, bitrate=48), mount=”/radio.aac”, name=”RADIO”, url=”http://YOURSITE&#8221;, description=”YOURDESC”, genre=”YOURGENRE”, host=”ADDRESS”, port=PORT, password=”PASSWORD”, input) output.icecast( %mp3(samplerate=44100, internal_quality=2, bitrate=64, stereo=false), mount=”/radio-mono.mp3″, name=”RADIO”, url=”http://YOURSITE&#8221;, description=”YOURDESC”, genre=”YOURGENRE”, […]

Transcoding icecast streams with vlc from stereo mp3 to stereo ogg or mono mp3

cvlc -d “http://ADDRESS/radio.mp3&#8243; ‘:sout=#transcode{acodec=vorbis,ab=128,channels=2,samplerate=41000}:duplicate{dst=std{access=shout,mux=ogg,dst=source:PASSWORD@ADDRESS:PORT/radio.ogg}}’ –no-sout-shout-mp3 –sout-shout-quality=100 –sout-shout-channels=2 –sout-shout-name=”restream” –sout-shout-description=”restreaming” –sout-shout-url=”http://YOURSITE&#8221; –sout-shout-genre=”GENRE” –loop cvlc -d “http://ADDRESS/radio.mp3&#8243; ‘:sout=#transcode{acodec=mp3,ab=64,channels=1}:duplicate{dst=std{access=shout,mux=raw,dst=source:PASSWORD@ADDRESS:PORT/radio-mono.mp3}}’ –sout-shout-mp3 –sout-shout-name=”restream” –sout-shout-description=”restreaming” –sout-shout-url=”http://YOURSITE&#8221; –sout-shout-genre=”GENRE” –loop