Skip to content

Instantly share code, notes, and snippets.

@rk295
rk295 / set_NatGeo_img_as_desktop.sh
Last active June 19, 2018 10:23 — forked from bergeycm/set_NatGeo_img_as_desktop.sh
Sets National Geographic's Image of the Day as Desktop background for Mac OSX
#!/usr/bin/env bash
cd ~/Pictures/NatGeo || exit 1
today="$(date +%Y-%m-%d)"
hostname="https://yourshot.nationalgeographic.com"
originalUrl="$(curl -s https://www.nationalgeographic.com/photography/photo-of-the-day/_jcr_content/.gallery.json | jq -r '.items[0].originalUrl')"
fullPhotoUrl="${hostname}${originalUrl}"
curl -s "$fullPhotoUrl" -o "national-geographic-photo-of-the-day_${today}.jpg"
# force HTTP to HTTPS - /etc/nginx/conf.d/nonssl.conf
server {
listen 80;
server_name jira.example.com;
access_log off;
return 301 https://$server_name$request_uri;
}
# /etc/nginx/conf.d/jira.conf
server {