Sep 19

UPDATED: now works with most apache installs and is more portable / useful:

http://ip2k.com/sitelist.sh

This bash script combines many useful little tricks that you may be interested in even if you don’t need the whole thing. Some include:

- Print a list of IPs on the linux system
- Print a list of websites hosted on the server that match a certain pattern (app = Magento in this case)
- Looping


trap sorry INT
#Two levels of debugging, 1 and 2. 1 shows just pings, 2 shows everything.
dbg=0

function prnt {
echo -e "\e[1;36m[ $1 ]\e[00m"
}

function prntok {
echo -e "\e[1;32m[ $1 ]\e[00m"
}

sorry ()
{
prnt "Caught SIGINT, cleaning up..."
if [ -f tempfile ]; then
rm -rf tempfile
prntok "Found and removed tempfile, exiting now"
else
prntok "tempfile not found, exiting..."
fi
exit 1
}

function getip {
ping -c1 -W1 -q $1 | grep PING | awk '{print $3}' |tr -d \(\)
}

iplist="$(ifconfig | grep 'inet addr' | awk '{print $2}' | tr -d [a-z,:] | grep -v '127.0.0.1')"
echo > tempfile
for ip in $iplist; do
echo $ip >> tempfile
done

sites="$(awk '$1 == "ServerName" { print $2 }' /etc/httpd/conf.d/vhost_* | uniq)"

for site in $sites; do
if [ $dbg -gt 0 ]; then
prnt "DEBUG: Pinging $site..."
fi

siteip=$(getip $site)
ison=$(grep -c $siteip tempfile)

if [ $dbg -gt 1 ]; then
prntok "DEBUG: siteip = $siteip"
fi

if [ $ison = 1 ]; then
if [ $dbg -gt 1 ]; then
prntok "DEBUG: $site found!"
fi

echo "http://$site"
else
if [ $dbg -gt 1 ]; then
prnt "DEBUG: $site not found"
fi

fi

done

rm -rf tempfile
exit 0

Sep 19

I own a pair of Shure E3cs that I bought at Target on sale for $30 (retail is around $200). It was an amazing find and I’ve been quite happy with them. I had some Etymotic ER6i IEMs before owning the Shures, and the Shure phones are a bit more durable (thicker cable) and easier to take in and out (soft rubber tips instead of comply foam tips). They both have their place in my collection and both get used.

However, to my dismay, the last time I pulled my Shures out of the case to listen to music, I found that the sound coming from the left driver was much quieter than the right. At first, I didn’t even hear anything and thought that the driver was dead. I frantically searched the internet and the forums on Head-Fi and found that it might just be wax build-up (eww). I took the rubber tip off and the sound was still very quiet. There was no visible obstruction and I poked around lightly with a paperclip to see if I could free the wax, but there was none.

When I got home, I used the paperclip to GENTLY remove the filter (without poking it through the end, I just pushed to the side and pulled back, the friction of the paperclip pulling the tiny silver plug with green filter out). I then soaked the filter in rubbing alcohol for about 10 seconds, using the paperclip to ensure there was no air and that the alcohol got in and through the filter. I then picked it up and let the alcohol drain through the filter. I let the filter air dry for about a minute, then re-installed it the same was it was installed before I removed it by gently inserting it, green “cap” side first, then pushing it down by the metal sides (DO NOT PUSH ON THE GREEN FILTER, IT WILL TEAR) until it was properly seated at about the same depth as the other side. Volia, worked.

The entire filter is about the size of one grain of couscous, maybe 2mm by 0.75mm. The filter has TINY holes to prevent wax from getting in the driver, and obviously did its job. Shure should really include instructions on how to change the filter like Etymotic does. Instead they advise you to contact customer service, and I’ve heard of repair bills around $80 to just clean and replace the filters.

Link to the User’s Manual