Skip to content

Instantly share code, notes, and snippets.

@sagax
sagax / amixer_swap.sh
Last active February 24, 2016 19:45
excellent script of preservation and installation of a sound
#!/bin/bash -
FILE_SAVE_TEMPLATE="alsa_"
read_params() {
local number_card=$1
local numidlist=$(amixer -D hw:"$number_card" controls | awk --re-interval 'BEGIN{FS=","}{print $1}')
local numarray=($numidlist)
local params=()
@sagax
sagax / coffeescript_defineProperties.coffee
Last active February 24, 2016 19:47
javascript, defineProperties
class Item
constructor: (@url, @description, @tags = [], @firstname = '', @secondname = '') ->
@uid = gen_id.gen_item_uid()
Object.defineProperties @prototype,
fullname:
get: ->
@firstname + ' ' + @secondname
set: (name) ->
name = name.split ' '
@sagax
sagax / mp3tag2utf.sh
Last active March 1, 2016 19:24
Converting MP3 Tags To UTF-8
for i in *.mp3; do mid3iconv -e CP1251 --remove-v1 $i; done
@sagax
sagax / bash_var_on_awk.sh
Last active March 1, 2016 19:25
how to use shell variable in awk pattern
foo="bar"
awk "/$foo/"'{print $0}' some_file
@sagax
sagax / ffmpeg in loop.sh
Created March 9, 2016 05:05
converting some file to mp3 in loop
for i in *
do
number=$(echo "$i" | awk '{print $4}' | awk -F- '{print $1}')
name="some_"
ffmpeg -y -i "$i" -ab 320K -ar 44100 -ac 2 -acodec mp3 $name_$number.mp3
done
@sagax
sagax / email.sh
Created March 18, 2016 06:27
unpack email eml body
munpack $email_body.eml
@sagax
sagax / ffmpeg_compare_audio_video.sh
Created June 4, 2016 09:04
FFmpeg for compare audio + video with sourche qualty
# For compare audio + video with sourche qualty
ffmpeg -i video.mp4 -i audio.m4a -c:v copy -c:a copy output.mp4
@sagax
sagax / record.sh
Last active June 4, 2016 09:34
how to audio record
# Record audio with arecord + twolame + VUmeter + High quality source audio
arecord -V "stereo" -D hw:0 -c 2 -f S16_LE -r 44100 | twolame --talkativity=0 -r -b 256 - record.mp3
# Record audio with arecord + twolame + High quality source audio + without stdin output
arecord -q -D hw:0 -c 2 -f S16_LE -r 44100 | twolame --talkativity=0 -r -b 256 - record.mp3
# Record audio with arecord + lame + High quality source audio + without stdin output + resample
arecord -q -D hw:0 -c 2 -f S16_LE -r 44100 | lame -m m --resample 44.1 -b 256 - record.mp3
@sagax
sagax / gpaste.sh
Created June 13, 2016 08:33
dmenu for clipboard
NUM=$(gpaste history | dmenu -l 30 | sed 's/: .*//') && gpaste get $NUM
@sagax
sagax / mimeapps.list
Last active July 11, 2016 19:12
mimeapps.list
.local/share/applications/mimeapps.list