Skip to content

Instantly share code, notes, and snippets.

@oscar-c
oscar-c / shariport-sync.log
Created July 18, 2018 00:42
shariport-sync start up log
-----------------First Instance-----------------------
Looking for configuration file at full path "/etc/shairport-sync-btspeaker.conf"
Value read for buffer size is 100.
alsa output device name is "IC-BTS04".
The processor is running little-endian.
Version: "3.2.1-OpenSSL-Avahi-ALSA-soxr-sysconfdir:/etc"
statistics_requester status is 0.
daemon status is 0.
deamon pid file path is "/var/run/shairport-sync/shairport-sync.pid".
@oscar-c
oscar-c / fix-congestion.sh
Created July 29, 2018 14:57
Check if iPhone can receive multicast packages. If not, send large amount of packages to force the "channel" open.
#!/bin/bash
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
ether=[iPhone's MAC address]
iface=[interface via witch the host connects to the iPhone]
mdns_ip=224.0.0.251 #the multicast address used by mDNS
#lookup iPhone's IP from its MAC address
ip_raw=$(arp -n -H ether -i $iface | grep $ether )
if [[ -z "$ip_raw" ]]
then
#!/bin/bash
input="ip"
unset transcribing
begin_pattern="[red]"
end_pattern=""
while read -r var
do
if [[ -v transcribing ]] ; then
if [ "$var" == "$end_pattern" ] ; then
from datetime import date, timedelta
class Day(date):
@property
def 的昨天(self):
return self + timedelta(days=-1)
@property