Google Search
- videos/movies/tvshows :
intext:"Search Term" intitle:"index.of" +(wmv|mpg|avi|mp4|mkv|mov) -inurl:(jsp|pl|php|html|aspx|htm|cf|shtml)
- Images :
intext:"Search Term" intitle:"index.of./" (bmp|gif|jpg|png|psd|tif|tiff) -inurl:(jsp|pl|php|html|aspx|htm|cf|shtml)
- Music :
intext:"Search Term" intitle:"index.of./" (ac3|flac|m4a|mp3|ogg|wav|wma) -inurl:(jsp|pl|php|html|aspx|htm|cf|shtml)
- Books :
intitle:"Search Term" (pdf|epub|mob) "name or title" -inurl:(jsp|pl|php|html|aspx|htm|cf|shtml)
Google Drive
- Shared everything:
site:drive.google.com
- Shared folders:
site:drive.google.com +"drive/folders" + term
- Shared spreadsheets:
site:drive.google.com +"spreadsheets" + term
- Shared documents:
site:drive.google.com +"documents" + term
BASH
Find
find . -type f | perl -ne 'print $1 if m/\.([^.\/]+)$/' | sort -u
- Show all the file types on the directory.
find . -type f | awk -F. '!a[$NF]++{print $NF}'
- -F fs --field-separator fs Use fs for the input field separator (the value of the FS predefined variable).
- awk $NF prints only the last column in a record. If the file has only one row,
your variable will contain whatever is in the last column (space/tab delimiter).
find . -type 'f' -printf '%h\n' | sort | uniq -c
- The find command will print out the directory name of all the files. Which we then run through sort, and then use the -c option of uniq to give us the number of files per directory. Once you have the count per directory it should be easy enough to just grep out the directories with a value of 1.
If you would prefer to perform actions on the directories while keeping it on one line, you can pipe the results through awk to xargs. For example, to delete each folder:
find . -type 'f' -printf '%h\n' | sort | uniq -c | awk '{ if ($1 == "1") printf "%s%c",$2,0 }' | xargs -0 -I {} rm -rf {}
Avoid "Permission denied" messages
find ./ -iname "term" 2>&1 | grep -v "Permission denied"
Find info
Search in file a term and sort result
grep "texto a buscar" archivofuente.txt | grep -v -ie "comments" | sort -u > archivo.txt
Search in file URL and sort result uniques results
cat messages*.html | grep -Eo '(http|https)://[^<"]+' | sort -u
Search in file a term and know in what file is it
cat *.html | grep -H -R 'Goku'
Search unique URL term and order.
lynx -dump -listonly https://t.me/s/howtoarsenio | grep -o "http:.*" | grep -E -v "http://t.me|http://www.t.me" | sort | uniq > file.txt
List
- Avoid a file type
ls -1 | sed -e 's/\.png$//'
Download
wget -c -nc -r --no-parent -R "index.html*"
- -c, --continue Continue getting a partially-downloaded file.
- -nc, --no-clobber The local file will be overwritten
- -r, --recursive specify recursive download
- Do not ever ascend to the parent directory
- -R, --reject=LIST comma-separated list of rejected extensions
wget -r -R -A -E -H -k -p -e robots=off https://ww..url.com
- -r, --recursive specify recursive download
- -R, --reject=LIST comma-separated list of rejected extensions
- -E, --adjust-extension save HTML/CSS documents with proper extensions
- -H, --span-hosts go to foreign hosts when recursive
- -K, --backup-converted before converting file X, back up as X.orig
- -p, --page-requisites get all images, etc. needed to display HTML page
Rename
Multiple files
for i in chr*.fasta; do mv "$i" "${i/%.fasta/.fa}"; done
Delete
0 Size files
find ./ -type f -size 0
Empty folders
find ./ -type d -empty -delete
FFmpeg
FFmpeg setting to upload YouTube video from an a scientific camera capture with uncompressed video:
ffmpeg -i in.avi -c:v libx264 -preset slow -crf 18 -c:a aac -b:a 192k -pix_fmt yuv420p -movflags +faststart out.mp4
If the video has no audio, use:
ffmpeg -i in.avi -c:v libx264 -preset slow -crf 18 -pix_fmt yuv420p -movflags +faststart out.mp4
imagemagick
Split in half a image
convert -crop 50%x100% +repage +adjoin img.tif img.tif
Split in half all images in a folder with X size
find . -type f -size +80M | convert -crop 50%x100% +repage +adjoin "${/%.tif/_.tif}"; done
PDF to JPG (ImageMagick) los parametros son para mejor calidad.
convert -density 300 -quality 100 in.pdf out.jpg
Music download with spotdl
Using WSL
C:/Windows/System32/bash.exe -c "spotdl --output '/mnt/c/temp' --lyrics-provider genius 'https://open.spotify.com/playlist/7j5tAMUPNuhRFDcP1iClui'"
Using BASH
spotdl "https://open.spotify.com/playlist/7j5tAMUPNuhRFDcP1iClui" --output "C:\temp" --lyrics-provider genius