Skip to content

Instantly share code, notes, and snippets.

View AlexHunterCodes's full-sized avatar

Alex Hunter AlexHunterCodes

View GitHub Profile
# Function to Get Custom Directory path
Function Get-CustomDirectory
{
[CmdletBinding()]
[Alias("CDir")]
[OutputType([String])]
Param
(
[Parameter(ValueFromPipeline=$true,Position=0)]
$Path = $PWD.Path
@AlexHunterCodes
AlexHunterCodes / dscovr-epic-desktop
Created February 4, 2016 15:25 — forked from cjdaniel/dscovr-epic-desktop
This is an OS X command-line script that downloads the latest DSCOVR:EPIC <http://epic.gsfc.nasa.gov/> image and sets it as your desktop picture. Prerequisites: requires installing Homebrew <http://brew.sh/> and then the jshon tool (`brew install jshon`). Then you can run the command manually, or add it to your crontab.
#!/usr/bin/env bash
download_directory="$HOME/Pictures/Wallpapers/epic-earth";
apiurl="http://epic.gsfc.nasa.gov/api/images.php";
curl -s "$apiurl" | jshon -a -e image -u | while read image; do
destfile="$download_directory/$image.jpg";
mkdir -p "$download_directory";
if [[ -n "$image" && ! -f "$destfile" ]]; then
echo "New 🌍 ! $image.jpg";
curl -so "$destfile" "http://epic.gsfc.nasa.gov/epic-archive/jpg/$image.jpg";
ln -sf "$destfile" "$download_directory/latest.jpg";
@AlexHunterCodes
AlexHunterCodes / dundeemakerspace-linux-setup.sh
Last active November 10, 2015 00:21 — forked from grantcodes/dundeemakerspace-linux-setup.sh
The setup script for Dundee MakerSpace standard Lubuntu install
#! /bin/bash
# Add PPAs {
#
# chrome
#
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'