# BASH shell
boom()
{
find $@ -type f \( -iname "*.mp3" -o -iname "*.flac" -o -iname "*.webm" -o -iname "*.wma" \) | sort -R | head -n 100 | xargs -d "\n" smplayer > /dev/null 2>&1 &
disown
}
# FISH shell
function boom --description 'Play random music'
find $argv -type f \( -iname "*.mp3" -o -iname "*.flac" -o -iname "*.webm" -o -iname "*.wma" \) | sort -R | head -n 100 | xargs -d "\n" smplayer > /dev/null 2>&1 &
disown
end
ffmpeg -i video.mkv -i audio.aac -c copy out.mkv
mkvmerge -o out.mkv video.mkv audio.aac
mkvmerge -o output.mkv input1.mkv +input2.mkv
ffmpeg -i media.mkv -map 0:2 -an -vn -scodec copy out.srt
mkvinfo media.mkv
mkvextract tracks video.mkv track_id:out.srt
ffmpeg -i media.mp4 -ss 00:00:01 -t 01:00:00 -c copy out.mp4
#!/usr/bin/env sh
if [ "$2" = "" ]; then
ffmpeg -i "$nnn" -ss "$1" -c copy "$nnn".mp4
else
ffmpeg -i "$nnn" -ss "$1" -to "$2" -c copy "$nnn".mp4
fi
ffmpeg -i media.mkv -ss 00:00:55 -t 02:19:53 -vcodec copy -acodec copy -map 0:0 -map 0:2 out.mkv
Batch script to iteratively cut and extract 2 streams from multistream videos and remove initial specified number of chars from output file
#!/bin/bash
for file in *; do
outfile=`echo "$file" | cut -c "$1"-`
ffmpeg -i "$file" -map 0:0 -map 0:1 -c copy "$outfile"
done
ffmpeg -i media.mkv -ss 00:01:08 -t 01:36:56 -vcodec copy -strict experimental -c:a aac -ac 2 -b:a 128k out.mkv
#!/bin/bash
mkdir newfiles
for f in *.m4a; do ffmpeg -i "$f" -vn -codec:a libmp3lame -q:a 2 newfiles/"${f%.m4a}.mp3"; done
ffmpeg -i in.webm -vn -ab 128k -ar 44100 -y out.mp3
sudo apt install --only-upgrade packageA packageB
alias note='vi ~/Dropbox/Public/Docs/Notes/note'
# BASH/ZSH shell
transfer()
{
fname=`basename $1`
curl -T $1 https://transfer.sh/$fname
echo
}
# FISH shell
function transfer
set fname (basename $argv[1])
curl -T $argv[1] https://transfer.sh/$fname
echo
end
googl()
{
curl -s "http://download.finance.yahoo.com/d/quotes.csv?s=googl&f=l1c1"
wget -qO- "https://finance.google.com/finance/converter?a=1&from=USD&to=INR" | sed '/res/!d;s/<[^>]*>//g'
}
ta()
{
rm -rf tags
rm -rf cscope.files
rm -rf cscope.out
find $PWD | egrep -i '\.(c|h|cpp)$' > cscope.files
ctags -R . *.c *.h *.cpp --tag-relative=yes ./
}
youtube-dl -F "https://www.youtube.com/watch?v=o8NPllzkFhE"
youtube-dl -f best "https://www.youtube.com/watch?v=o8NPllzkFhE"
youtube-dl -cit -f best "https://www.youtube.com/watch?v=o8NPllzkFhE&list=PL9PwPs7-UT5w0-LnDt9dbNdO1UdtmC_QO" --merge-output-format mp4
rpm -qpR package.rpm
dpkg -I package.deb
git tag -s v1.x -m "Release v1.x"
git push origin --tags
git tag --delete v1.x
git push --delete origin v1.x
rd()
{
elinks "http://justread.mpgarate.com/read?url=$1"
}
function rd
elinks "http://justread.mpgarate.com/read?url=$argv"
end
#!/bin/bash
curl -s "$1" | html2text -utf8 -style pretty
chmod -R -x+X .
b64()
{
echo -n $@ | base64
}
function b64
echo -n $argv | base64
end
bd64()
{
echo -n $@ | base64 -d
}
function bd64
echo -n $argv | base64 -d
end
toP()
{
top -p $(pgrep -d',' "$1")
}
function toP
top -p (pgrep -d',' $argv[1])
end
Install poppler-utils
on Ubuntu. To join PDFs in specified order, run:
pdfunite 1.pdf 2.pdf ... n.pdf out.pdf
Bind F1
to xfce4-terminal --hide-borders --drop-down
function torgo export http_proxy=http://127.0.0.1:8118/ export HTTP_PROXY=http://127.0.0.1:8118/ export https_proxy=http://127.0.0.1:8118/ export HTTPS_PROXY=http://127.0.0.1:8118/ end
alias myip='curl ifconfig.me'
lsblk
udisksctl mount -b /dev/sdXn
udisksctl unmount -b /dev/sdXn
udisksctl power-off -b /dev/sdXn
while sleep 1;do tput sc;tput cup 0 $(($(tput cols)-29));date;tput rc;done &
http://www.isthe.com/chongo/tech/comp/calc/
http://manpages.ubuntu.com/manpages/bionic/man1/calc.1.html
ls -1hskR
blkdiscard -s /dev/sdX
man: http://man7.org/linux/man-pages/man8/blkdiscard.8.html
using hdparm: https://askubuntu.com/questions/604426/i-need-to-run-a-security-erase-tool-on-my-drive
# remove autoload.lua from ~/.config/mpv/scripts
mpv --no-terminal video.mpv
sudo setcap "cap_net_admin,cap_net_raw=ep" "$(which nethogs)"
pdfunite out1.pdf out2.pdf final.pdf
pdfseparate -f 1 input.pdf out%d.pdf