Skip to content

Instantly share code, notes, and snippets.

View lastfm-to-slack.sh
#!/bin/bash
# this script updates your slack status with the current playing track from last.fm
# requires URI::Escape perl module (cpan URI::Escape) and jq
# make sure to update slack_api_key, last_fm_api_key, and last_fm_username
#########################################
##### to run this script at startup #####
#########################################
# save this script to /Users/<your_user>/Library/scripts/lastfm-to-slack.sh
View spotify-to-slack.sh
#!/bin/bash
# this script updates your slack status with the current playing track in spotify in OS X
#########################################
##### to run this script at startup #####
#########################################
# create a com.user.spotifyToSlack.plist file containing the following xml
# make sure to update the /path/to/your/spotify-to-slack.sh in the file
# also update the xoxp-xxxxx to your real slack token
View docker-machine-update-hosts.sh
#!/usr/bin/env bash
list=( $(docker-machine ls | grep Running | awk '{ print $1 }') )
for i in "${list[@]}"; do
ip=$(docker-machine ip $i)
#remove line matching ip
sudo sed -i '' '/'$ip'/d' /etc/hosts
#insert ip/host on last line
sudo sed -i -e '$a\