Nov 1

Safari 4 has known issues with showing just a white screen randomly. There are many threads on the Apple support forums regarding this, here is an exmaple: http://discussions.apple.com/thread.jspa?messageID=9785751 . Personally, I use Google Chrome which is also a WebKit-based browser and I’ve never had an issue.

It seems that with the iPhone encryption issues ( http://www.broadbandreports.com/forum/r22999133-iPhone-31-breaks-Exchange-Sync-for-pre3GS-phones , and even on the new 3GS: http://arstechnica.com/apple/news/2009/07/new-iphone-hardware-encryption-not-even-close-to-hack-proof.ars ), the Snow Leopard data loss issues ( http://news.cnet.com/8301-31021_3-10373064-260.html ), and Time Capsules dying early ( http://gizmodo.com/5379865/are-apple-time-capsules-short-lived , http://timecapsuledead.org/ ) Apple doesn’t have it’s software development in line just quite yet.

With all these issues, it’s no surprise that at least a few people feel the same as this columnist: “I suspect that Apple has set back its enterprise cause several years, if not permanently.” ( http://www.itbusiness.ca/it/client/en/home/News.asp?id=54536&PageMem=2 )

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

Aug 23

I oversee a few hundred Linux-based systems, and >99% of them run the typical QMail / ClamAV / SpamAssassin stack. I personally think QMail sucks, but I have written a script that usually fixes most issues (stuck queue, delayed mail, other strange issues). You could easily edit this to be compatible with cPanel-based servers, but as it stands it’s written for InterWorx-CP and servers without a control-panel system. Note that this needs BASH to run and won’t work properly due to the way the counter is incremented in regular POSIX ‘sh’.

Link: http://seanp2k.com/m.sh

It is below:

#!/bin/bash
# ----- BEING DECLARE FUNCTIONS -----

# prnt - formats and echos input
function prnt {
echo -e "\e[1;32m[ $1 ]\e[00m"
}

# killproc - uses pidof to find process name then tries to kill COUNTER number of times.
# Accepts $1 as process name and $2 as $
PROCNAME=""

function killproc {
procname=$1
counter=0
pids="$(pidof "$procname")"
while [ "$pids" ] && ((counter++ < $2)); do
if [ $counter -eq $2 ]; then
echo -e "\e[1;31m[ Couldn't kill $procname, tried $2 times. PID is $pids ]\e[00m"
else
# ----- DEBUGGING - uncomment next line -----
# ps -elf | grep -i $procname
for pid in $pids; do
echo -e "\e[1;36m[ $procname killed, PID $pid, try $counter/$2 ]\e[00m"
pkill -9 $pid
done
sleep 1
pids="$(pidof "$procname")"
echo
fi
done
}

# ----- END DECLARE FUNCTIONS -----
# ----- BEING MAIN SUB -----

prnt "Reset local and remote delivery concurrency limits"
echo 200 > /var/qmail/control/concurrencylocal
echo 200 > /var/qmail/control/concurrencyincoming
echo 200 > /var/qmail/control/concurrencyremote

prnt "Restart InterWorx-CP"
/etc/init.d/iworx restart

prnt "Restart ClamAV & SpamAssassin"
/etc/init.d/clamd stop
/etc/init.d/spamassassin stop

killproc spamd 5
killproc clamd 5

/etc/init.d/clamd start
/etc/init.d/spamassassin start
prnt "Restart POP3"
/etc/init.d/pop3 restart

prnt "Restart POP3-SSL"
/etc/init.d/pop3-ssl restart

prnt "Restart IMAP4"
/etc/init.d/imap4 restart

prnt "Restart IMAP4-SSL"
/etc/init.d/imap4-ssl restart

prnt "Restart SMTP"

svc -d /service/send /service/smtp /service/smtp2
/etc/init.d/smtp stop
/etc/init.d/smtp status

if [ "$(pidof qmail-send)" ]; then
counter=11
echo -en "\e[1;32m[ Waiting for SMTP to stop: "
while [ "$(pidof qmail-send)" ] && ((counter-- > 0)); do
echo -n "$counter.."
sleep 1
done
echo -e " ]\e[00m"
fi

/etc/init.d/smtp status
svc -k /service/send
killproc qmail-send 5
prnt "Force-send qmail message queue"
svc -u /service/send
svc -a /service/send
svc -u /service/smtp /service/smtp2
/etc/init.d/smtp start
prnt "Please ensure that SMTP and send are up"
/etc/init.d/smtp status
/var/qmail/bin/qmqtool -s
# ----- END MAIN SUB -----
exit 0;

Aug 23

Today I clicked the link at the bottom of this page to validate XHTML via w3c and found out that my page’s content-type was being incorrectly reported. To trace down this error, I first looked through all the PHP for WordPress, found a few things in wp-functions.php and changed those to no avail. Then I remembered that WordPress stores most, if not all, of its configuration data in MySQL. Now the real work starts:

Read the rest of this entry »

Aug 13


#!/bin/bash

# PURPOSE: Grabs text from user one line at a time
# until the input is null (user typed nothing).
# Does something each time with the user input (echo)

echo "Enter something. It will be echoed."
echo "If you enter nothing, the program will end."

read TEST
echo "output: $TEST"

while [ $TEST ]
do

read TEST

if [ $TEST ]; then
echo "output: $TEST"
fi

done