Month: December 2017

Echo Dot on the Ceiling

I’ve been using an Apple Airport Express for a number of years connected to a Marantz amplifier in the top of a cupboard which is then connected to some ceiling speakers for music via iTunes and more recently Spotify. Earlier this year I bought an Amazon Echo and found it much simpler to control Spotify, so I decided to ditch the Airport Express and replace with an Amazon Echo Dot and use it for voice control of music with the ceiling speakers. I also purchased another Belkin WeMo Switch Smart Plug to turn the amp on and off and a Dot flush ceiling mount kit.

Plan was, Dot to amp and power, amp to ceiling speakers (already in place), amp into Wemo socket. After about an hour or so of cutting and wiring I ended up with the flush ceiling mount in place, the Dot mounted and all wired back to the amp.

The ceiling was really easy to fit, just a case of finding a suitable spot and then cutting a hole. It fitted tightly into the ceiling and the kit comes with a 90degree 3.5mmm jack and also a very long USB power lead. All I had to add was a 3.5mm male jack to left/right phono to plug into the back of the Marantz amp. The Dot fits well into the mount and can’t fall as the wires keep it in place plus the kit comes with some stick pads for extra security, not that it really needs them.

Once all wired in and the Wemo plug setup the Marantz amp can be switched on and off with a simple “Alexa turn on Marantz” command and then Spotify played back with a simple “Alexa play“, so much easier than having to find my iPhone, launch Spotify, turn the amp on, play a track and then choose Airplay.

Proxy Setting for all network devices

An issue that came up recently was the proxy URL and bypass was not being set correctly when connecting a Mac via USB-A or USB-C cable to a network enabled device, like screen, docks or hubs. DisplayLink was installed so they were all making a network connection but as no proxy was set there were a few access issues.

In the past setting network settings via a script had been pretty easy but now Mac’s don’t have a network port and desks are  switching to a single cable solution which is USB-C to a dock which than connects to screens, ethernet and power its got a little harder.

The previous solution was to identify the device and add the settings, for example if it was an ethernet connection then you just specify the connection and the details:

1
2
networksetup -setautoproxyurl "Ethernet" http://urltoyourproxy.pac
networksetup -setproxybypassdomains "Ethernet" "*.local" "169.254/16" "*.adomain.com"

You could add this for various devices that were used to connect to a network:

1
2
3
4
networksetup -setautoproxyurl "Apple USB Ethernet Adapter"
networksetup -setautoproxyurl "Wi-Fi"
networksetup -setautoproxyurl "Thunderbolt Ethernet"
networksetup -setautoproxyurl "USB Ethernet"

The problem was with docks and hubs and screens all being different names and makes and models there  you would have to set each item specifically:

1
networksetup -setautoproxyurl "Philips 231P4U"

Clearly this is not ideal as usually as an Admin you have no idea what is being put on a desk, so another solution was required.

The following script is via a variation from MacMule, this loops through all the devices that have been connected or are connected and regardless of name adds in the required details.

Simply set you values at the top of the script. The script can then be deployed via MDM such as JAMF and set it to run on network change. Now when a Mac changes network connection the script loops through and adds in the the correct proxy URL and proxy bypass details.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/sh
####################################################################################################
#
# More information: https://macmule.com/2014/12/07/how-to-change-the-automatic-proxy-configuration-url-in-system-preferences-via-a-script/
#
# GitRepo: https://github.com/macmule/setAutomaticProxyConfigurationURL
#
# License: http://macmule.com/license/
#
# Updated to add proxyBypass settings by M Griffin October 2017
####################################################################################################

# HARDCODED VALUES ARE SET HERE
autoProxyURL="http://urltoyourproxy.pac"
proxyBypassDomains="*.local 169.254/16 *.adomain.com"

# CHECK TO SEE IF A VALUE WAS PASSED FOR $4, AND IF SO, ASSIGN IT
if [ "$4" != "" ] && [ "$autoProxyURL" == "" ]; then
autoProxyURL=$4
fi

# Detects all network hardware & creates services for all installed network hardware
/usr/sbin/networksetup -detectnewhardware

IFS=$'\n'

#Loops through the list of network services
for i in $(networksetup -listallnetworkservices | tail +2 );
do

# Get a list of all services
proxyBypassDomainsLocal=`/usr/sbin/networksetup -getproxybypassdomains "$i" | head -1 | cut -c 6-`

# Echo's the name of any matching services & the autoproxyURL's set
echo "$i Proxy set to $proxyBypassDomainsLocal"

# If the value returned of $autoProxyURLLocal does not match the value of $autoProxyURL for the interface $i, change it.
if [[ $proxyBypassDomainsLocal != $proxyBypassDomains ]]; then
/usr/sbin/networksetup -setproxybypassdomains $i $proxyBypassDomains
echo "Set proxy bypass for $i to $proxyBypassDomains"
fi

if [[ $autoProxyURLLocal != $autoProxyURL ]]; then
/usr/sbin/networksetup -setautoproxyurl $i $autoProxyURL
echo "Set auto proxy for $i to $autoProxyURL"
fi
# Enable auto proxy once set
/usr/sbin/networksetup -setautoproxystate "$i" on
echo "Turned on auto proxy for $i"

done

unset IFS

# Echo that we're done
echo "Auto proxy present, correct & enabled for all interfaces"

Recent Posts

Recent Comments

    Archives

    Categories

    Meta

    GiottoPress by Enrique Chavez