Related issue:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Download images from a Wikimedia Commons category | |
# | |
# Highest preview resolution and metadata in XML format will be saved in subfolders. | |
# Usage: execute this script on a Linux command line, providing the full URL to the category page. | |
# | |
# Shell tools required for this script: wget sed grep | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Text color - normal | |
fgblack="$(tput setaf 0)" # Black | |
fgred="$(tput setaf 1)" # Red | |
fggreen="$(tput setaf 2)" # Green | |
fgyellow="$(tput setaf 3)" # Yellow | |
fgblue="$(tput setaf 4)" # Blue | |
fgpurple="$(tput setaf 5)" # Purple | |
fgcyan="$(tput setaf 6)" # Cyan | |
fgwhite="$(tput setaf 7)" # White |
- Use
curl
to get the JSON response for the latest release - Use
grep
to find the line containing file URL - Use
cut
andtr
to extract the URL - Use
wget
to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
GEANY_PATH="/usr/bin/geany" | |
if [ -z "$XDG_RUNTIME_DIR" ]; then | |
[ -z "$XDG_CACHE_HOME" ] && | |
XDG_CACHE_HOME="$HOME/.cache" | |
XDG_RUNTIME_DIR="$XDG_CACHE_HOME" | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$originalsFolder = 'originals' | |
$resizedFolder = 'resized' | |
$reorganizedFolder = 'reorganized' | |
$originals = Get-ChildItem -Path $originalsFolder -Recurse -Include *.jpg | |
foreach ($original in $originals) { | |
$resized = Get-ChildItem -Path $resizedFolder -Recurse -Include $original.Name | |
$destination = ($resized.FullName).Replace($resizedFolder, $reorganizedFolder).Replace($resized.Name, "") | |
New-Item $destination -Type Directory |