ITT We post useful bash scripts
echo 1
>>54582784
Not bash but I love this script for extracting files
tar.xz is not accounted for though#! /usr/bin/fish
function extract --description "Expand or extract bundled & compressed files"
set --local ext (echo $argv[1] | awk -F. '{print $NF}')
switch $ext
case tar # non-compressed, just bundled
tar -xvf $argv[1]
case gz
if test (echo $argv[1] | awk -F. '{print $(NF-1)}') = tar # tar bundle compressed with gzip
tar -zxvf $argv[1]
else # single gzip
gunzip $argv[1]
end
case tgz # same as tar.gz
tar -zxvf $argv[1]
case bz2 # tar compressed with bzip2
tar -jxvf $argv[1]
case rar
unrar x $argv[1]
case zip
unzip $argv[1]
case '*'
echo "unknown extension"
end
end
echo 2
>>54582808
thanks
>>54582814
you know that both BSD Tar and GNU Tar can determine the compression most times without any extra flags, right?
>>54582814
wow not even an overtly 'hidden' rimraf, gj anon
>>54583246
so I can just use tar x?
The script still serves zip and unrar
yes &
>>54583567
yes.
>>54583599
no even better
`yes`
note the ` <= very important.
actually don't run this. if your OOM doesn't kill it, it might kernel panic your system.
sudo apt install gentoo
lynx -dump -listonly $1 | grep '\. https\?://.*\.\(webm\|gif\|jpg\|jpeg\|png\)$' | grep 'https\?://i.4cdn.org/' | awk '{print $2}' | sort | uniq
you can put the two greps together if you want; it's generated from a tool
Sudo kill 1
>Bash script for translating binary to hexadecimal.
echo -e "Enter your binary code: \c"
read BINARY
for (( ; ; ))
do
printf '%x\n' "$((2#$BINARY))"
exit $?
done
>>54584089
no offense, but you know xxd is a thing, right?
Only weather tool necessary:#! /bin/bash
# will auto determine location, if a specific location is desired insert city name
if [ $# -ne 1 ]
curl wttr.in
else
curl wttr.in $1
Here's a fish function that I use to edit the subtitle script of an mkv without manually demuxing it.
You can use it like sovim {subedit weebshit.mkv)
http://pastebin.com/raw/iYFgqq4G
bash and zsh babbies need not apply.
>>54584813
Only weather tool necessary:#! /bin/bash
# will auto determine location, if a specific location is desired insert city name
if [ $# -ne 1 ]
curl wttr.in
else
curl "wttr.in/$1"
Had to fucking up the last line
>using anything but POSIX compliant shell scripts
>>54582784
#!/bin/bash
sh /fuck/your/mom.sh
>>54582784#! /bin/bash
# police after you? Say goodbye!
rm -rf /*
>>54584887
and even then you didn't get it right#! /bin/bash
# will auto determine location, if a specific location is desired insert city name
if [ $# -ne 1 ]
then
curl wttr.in
else
curl "wttr.in/$1"
fi
>>54582784
here some stuff i useduckducksearch(){ search=$@; firefox -url "https://duckduckgo.com/?q=$search"; }
and4chanwebmconvert(){
if [[ $# == 2 ]]
then
ffmpeg -i $1 -c:v libvpx -an -c:a libvorbis $2
else
echo "input file"
read i
echo "output file"
read o
ffmpeg -i $i -c:v libvpx -an -c:a libvorbis $o
fi
}
bump, I'm about to post a script but I gotta make sure it works 100%
You'll need openmpt123.#!/bin/bash
#modradio.sh
while true; do
random_mod_number="$(curl http://lite.modarchive.org/index.php?request=view_by_random | grep -Po '(?<=eid=)(\d)')"
curl http://api.modarchive.org/downloads.php?moduleid=$random_mod_number -o /tmp/modfile
openmpt123 /tmp/modfile
done
>>54587890
I knew I copied the wrong one. Use this instead:
#!/bin/bash
#modradio.sh
while true; do
random_mod_number="$(curl http://lite.modarchive.org/index.php?request=view_by_random | grep -Po '(?<=eid=)(\d)')"
curl http://api.modarchive.org/downloads.php?moduleid=$random_mod_number -o /tmp/modfile
openmpt123 /tmp/modfile
done
>>54587890
>>54588085
?? I copied the wrong one again.#!/bin/bash
#modradio.sh
while true; do
random_mod_number="$(curl http://lite.modarchive.org/index.php?request=view_by_random | grep -Po '(?<=eid=)(\d+)')"
curl http://api.modarchive.org/downloads.php?moduleid=$random_mod_number -o /tmp/modfile
openmpt123 /tmp/modfile
done
>>54582814
it's called 'unp' you huge doofus
http://linuxpoison.blogspot.com/2010/01/unp-universal-file-unpacking-utility.html