Jay Holler’s Blog

Icon

A technologist living in Philadelphia

Droid vs iPhone

I got a change to really dig into my friend Felix’s Droid this Thanksgiving. I wanted to write down my impressions here, not only to share with everyone but also to keep myself in check whenever I yearn to own this multitasking big screen monster of a phone.
First of all, let’s get the biggest pro the Droid has going for it, the screen. It’s a Backlit TFT 3.7-inch WVGA (480×854) 16:9 widescreen display (267 PPI) and it is amazingly beautiful. Holding the screen up to the iPhone and viewing the same content it is no contest as to which device is more pleasing to the eye. Under the casing the iPhone and Droid both use the same processor, and it wasn’t surprising to see that both OSes booted up within seconds of each other in our side by side contest.
Android has really come a long way, and it is refreshing as an iPhone user to have more granular control over how applications are used on your device. I was able to rip open six or more applications (Google Talk, Browser, Gmail, Android Market, Music, ConnectBot) and it was quick and easy to jump between the different applications using the home button hold method. I was really impressed with how easy it was to navigate between running apps this way, and the phone didn’t seem to have any issues with lag even though we were doing so much at once. That being said, it was extremely disappointing to see such heavy lag just swiping between the three default home screen panels and when pulling down the windowshade notification bar. I have read that you can replace these apps with third party applications that perform better, but honestly you shouldn’t have to do that just to get a good experience from basic functionality of OS navigation.
Another problem I ran into was that after connecting the Droid in USB mode, and unmounting the drive once we were done transferring some media, the SD card got in some kind of funky state that caused the entire phone to become unresponsive. After taking the battery out and putting it back in we got some white-text-on-black-background about a bootloader and instructions to connect the SD card to USB, but nothing undid the problem until we actually removed the SD card and put it back in.
I have been using an iPhone in various forms (original edge-only iPhone, iPhone 3G, and now iPhone 3GS) for over two years, and the responsiveness of the screen is hands down better than the Droid, I’m sad to say. The Droid screen seems to require either a little bit more pressure or a little bit more time to register where you are pressing. If it was my first touchscreen phone it probably wouldn’t even be something I would notice, but the iPhone sets a high bar with the effortless responsiveness of their screen. In line with that the software keyboard was pretty terrible at recognizing what keys I was pressing, especially in portrait mode. I am certain that I am partially to blame as it does take some time to adjust to how a particular phone reacts to your thumbpads tapping the screen, but it was really abominable at registering my intended key even when I was typing slowly and deliberately. The portrait keyboard actually takes up a much smaller amount of space than the iPhone portrait keyboard, making it more difficult to press the tiny targets.
The media features aren’t quite as robust as on the iPhone either, but it is definitely serviceable and of course with the Android Market you can replace the default media player with one of several available. It is a little disappointing that the SD card included is only a class 2 card so the speed is not exactly optimal for playing back large video files on that beautiful monster of a screen.
Not to get nitpicky, but the feel of the device also was not as organic and natural to me as holding the soft, rounded curves of the iPhone. It wasn’t uncomfortable by any means, but just didn’t match the same fit and finish. I would like to point out however that the slider has absolutely NO play whatsoever, which was something that really disappointed me about the Pre when I first put hands to it.
Of course, there are complaints I have about the iPhone as well. Android’s notification system is in my opinion the single best way to deal with incoming alerts from an unlimited number of applications. Icons populate the status bar indicating the number of alerts for a particular application, and when you drag down the windowshade you can select actions to be taken on the alerts which usually involves opening the application that generated the alert. On the iPhone, you are typically presented with a modal pop up dialog that REQUIRES your input prior to allowing you to move on. More than once I have received a push notification or text message during a call which required me to acknowledge the alert prior to having the ability to press the end call button beneath it. That is just piss poor design, and from Apple it is just not acceptable, knowing what they can accomplish.
The iPhone does not allow multitasking of any third party applications. However, many third party developers have begun to code their applications in such a way that the exact state of the application is stored when you press the home button, so when you relaunch the application again it is as though you never left in the first place. A perfect example of this in action is the newish Tweetie 2. Prior to the latest release if you exited the app and opened it again later you had to scroll back from the very top until you could find the tweet you were reading. Now, the list is exactly in the same place it was when you exited the app. Although this doesn’t help with apps that would require running in the background (ie a media streaming app like pandora) it does make the experience of using most data heavy apps much more enjoyable, and simulates multitasking as best as possible while still meeting Apple’s restrictions by sandboxing any third party applications.
I have jailbroken my iPhone so I can selectively chose which applications run in the background anyway, but I don’t take advantage of the feature that often, because it typically starts to negatively impact the performance of the foreground application I am currently using. The only essential thing I use the jailbreak software for is to add tiny notification icons to the statusbar with StatusNotifier, which is something every phone under the sun includes. I am hoping a future update will see Apple including something like that by default, so if you have a new email, you can tell without having to unlock your phone and look at the little red badge over the Mail icon.
Felix and I also took a quick drive so he could show off the Google Maps with navigation application. It was fucking awesome. Once we mounted the phone it switched into Map/GPS mode automatically. I pressed one button to begin the audio listener, and spoke the address of my proposed destination. The phone pulled up a route, locked in GPS, and started speaking directions. The GPS was pinpoint accurate as to our current location, and the directions we received were flawless. This is extremely well executed and I am hoping the rumors that this software will make its way over to the iPhone are true, because that was a truly badass experience.
All in all, the Droid is a very impressive phone, but the OS still felt a little too rough around the edges and unpolished for me to be tempted to switch devices. The iPhone has a consistency about it that is very hard to beat, plus the performance of native applications cannot be beat by java apps that Android runs. At this pace though, unless Apple really steps up their game (keep in mind all iPhones share the same exact screen size, this is going back over two years now) I could see the slew of Android devices coming out in 2010 to be a real threat. I am certainly going to keep a keen eye out for new Android headsets, but right now my iPhone still makes me the happiest. I use it more than I use my computer, which is saying a lot for me.

Side note: Last month we exceeded the number of minutes on our AT&T FamilyTalk plan. It came to the tune of an extra $100!! I called AT&T and explained that I wanted to increase the amount of minutes on our plan since we exceeded it last month and we were on track to exceed it again this month. The AT&T rep not only took care of this right away, backdated it so that we wouldn’t incur extra charges this month, but he also removed the extra charges from our overage last month!! He did this all without any prompting by me that this was something I was interested in. I thought this type of service was extremely excellent, and it makes me feel much better towards the company as a whole. I still hate having dropped calls, but that seems to have improved a tiny bit in the last week or so.

Filed under: Opinion, iPhone

Android

I have a problem. I have an addiction. It is a strong addiction. I am addicted to mobile phones/connected internet devices. Lately I have been jonesing for something better than the iPhone, which I love by the way. So today I installed the Android SDK on my Mac and this is the emulator running ConnectBot ssh’ed into my local Linux machine. I love technology.

Filed under: Uncategorized

Applescript for iPhoto

I was helping Anna pull some pictures off of our new camera so she could export them at a smaller size, and post them to her etsy shop: http://www.etsy.com/shop/mamaholler
So of course being the kind of guy that I am I decided to script the entire process, and ended up with a drop dead simple solution that only requires you to connect the camera to a USB port and press Yes/No on a single dialog box. It automatically launches when the camera is connected thanks to the setting being an option on Image Capture to launch any random script. Then it imports your photos into iPhoto (which is nice enough to recognize duplicates and ask what you want to do with them), then it asks if you want to export or not, and if you answer yes exports the photos to the dedicated Etsy directory on Anna’s desktop. Once that is complete it automatically unmounts the camera storage card so you can just pull the USB cable and get on with your life. I call it iPhoto_Magic.app:

– First we do the importing
tell application “iPhoto”
import from “/Volumes/DMC-FZ28/DCIM/101_PANA”
end tell
delay 3
– Then we do the exporting
property maxPixel : 800
property destinationFolder : “/Users/jayholler/Desktop/Etsy/” — the trailing slash is required

tell application “iPhoto”
select photos of album “Last Import”
set sel to selection
end tell
display dialog “Do you want to export these photos to Etsy?” buttons {“No”, “Yes”} cancel button 1 with title “Jay’s Awesome iPhoto Script” with icon stop
if result = {button returned:”Yes”} then
repeat with onePhoto in sel
tell application “iPhoto” to set {pLocation, pName} to {image path, title} of onePhoto
do shell script “sips -Z 800 -i -s format jpeg -s formatOptions best ” & quoted form of pLocation & ” –out ” & quoted form of (destinationFolder & pName & “.jpg”)
end repeat
end if

do shell script “hdiutil unmount /Volumes/DMC-FZ28″

if result = {button returned:”No”} then
do shell script “hdiutil unmount /Volumes/DMC-FZ28″
end if

This is how the dialog looks:

Filed under: Uncategorized

Nagios and iPhone push notifications

I have a friend who works for an ISP and a few months back he told me about how he had wrangled Nagios into monitoring their servers and networking equipment. His story piqued my interest, and last night I finally downloaded Nagios, and configured it to monitor my 24×7 Linux host that sits behind my TV providing a number of different services to my internal network. Installing Nagios from source was simple with the instructions at http://www.nagios.org, and within minutes I was up and running. I had a little trouble with setting up auth_digest authentication for apache2 but I think that was mostly because that module wasn’t enabled by default. After I got the main configuration up and running, and I was able to access the web interface, I began to poke around. While I was doing this I got an email notification that my disk space was over 20%. I then thought, wouldn’t this be cool if I could turn this into a push notification?
I already set up a script provided by http://prowl.weks.net/static/prowl.pl, and have that working to notify me when a new TV show is added to my Linux host. I found that the settings for notifications in Nagios were located at /usr/local/nagios/etc/objects/commands.cfg. In the notifications section, I added the following below the two entries for email notifications, which I included:

# ‘notify-host-by-email’ command definition
define command{
command_name notify-host-by-email
command_line /usr/bin/printf “%b” “***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n” | /usr/bin/mail -s “** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **” $CONTACTEMAIL$
}

# ‘notify-service-by-email’ command definition
define command{
command_name notify-service-by-email
command_line /usr/bin/printf “%b” “***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$” | /usr/bin/mail -s “** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **” $CONTACTEMAIL$
}

# ‘notify-host-by-prowl’ command definition
define command{
command_name notify-host-by-prowl
command_line /usr/local/bin/prowl.pl -application=”Nagios” -event=”** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **” -notification=”Host: $HOSTNAME$ State: $HOSTSTATE$ Address: $HOSTADDRESS$ Info: $HOSTOUTPUT$ Date/Time: $LONGDATETIME$” -priority=1 -apikey=THISISWHEREMYAPIKEYWOULDGO
}

# ‘notify-service-by-prowl’ command definition
define command{
command_name notify-service-by-prowl
command_line /usr/local/bin/prowl.pl -application=”Nagios” -event=”** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **” -notification=”Host: $HOSTNAME$ State: $HOSTSTATE$ Address: $HOSTADDRESS$ Info: $HOSTOUTPUT$ Date/Time: $LONGDATETIME$” -priority=1 -apikey=THISISWHEREMYAPIKEYWOULDGO
}

So now, when Nagios sends a notification, I get a pop up instantly on my phone that looks something like this:

Nagios iPhone Prowl

Nagios iPhone Prowl

Righteous!!

Filed under: Linux, iPhone , ,

moveAvis.sh updated

UPDATE: I made some improvements and will now catch both shows that start with letters or numbers.
ANOTHER UPDATE: Turns out i was truncating the show name, it is fixed and I have updated the script and link to pastie.org too.

I updated my script to be totally generic now. It does not depend on matching the names of any specific TV shows now, since I know the filename will always contain SxxExx to indicate Season and Episode, I filter that way. If the directory for that show already exists it will simply move the file there, if it doesn’t it will create a new one. Otherwise, if it isn’t a TV show, it goes to the Movie directory. Also, since I’m now using ushare to serve media to my xbox 360, I put a wget call in to the ushare web port to update the files so the xbox picks them up immediately over uPnP.

#!/bin/bash
#
#/usr/local/bin/moveAVIs.sh
#
# Jay Holler 09-10-2009
# Find *.avi files in the Downloads directory and move them to
# the appropriate folder on the NFS share

storageDir=/storage/TV

cd /home/jayholler/Downloads

for i in *.avi
do
myFile=”$i”

if [[ "$myFile" =~ ([A-Za-z0-9\.]*)\.(S..E..).avi ]] ; then
File=${BASH_REMATCH[2]}.avi
PreShowName=${BASH_REMATCH[1]}
ShowName=$(echo $PreShowName | sed ’s/\./ /g’)
echo “[*] A new episode of $ShowName is ready for your enjoyment: $File” > /tmp/emailmessage.txt && sleep 2
[ -d "$storageDir/$ShowName" ] || mkdir -v “$storageDir/$ShowName”
mv -v $myFile “$storageDir/$ShowName/$File”
wget http://localhost:49153/web/ushare.cgi?action=refresh -o /dev/null -P /dev/null
/usr/local/bin/email.sh
else
echo “[+] $myFile does not match our TV shows, pushing it to /storage/Movies on lunchbox” > /tmp/emailmessage.txt
mv -v “$myFile” /storage/Movies/$myFile
/usr/local/bin/email.sh
fi
done
exit 0

Here’s the same thing in nicer formatting: http://www.pastie.org/612353

Filed under: Uncategorized , ,

Updating my scripts

I’m always looking for ways to improve my current media setup, I can never be satisfied. After speaking with a co-worker I discovered I could change the format of one of my scripts and I wound up cutting the number of lines from 533 to 234! Here is the new and improved script:

#!/bin/bash
#
#/usr/local/bin/moveAVIs.sh
#
# Jay Holler 10-29-2008
# A script to find *.AVI files in the Downloads directory and move them to
# the appropriate folder on the NFS share at lunchbox (192.168.1.128)

storageDir=/storage/TV

MOVE_FILE() {
echo “[*] A new episode of $ShowName is ready for your enjoyment: $File” > /tmp/emailmessage.txt && sleep 2
[ -d "$storageDir/$ShowName" ] || mkdir -v “$storageDir/$ShowName”
mv -v $myFile “$storageDir/$ShowName/$File”
S=$(echo $File | sed -e ’s/S0\(.\).*.AVI/\1/’)
E=$(echo $File | sed -e ’s/S..E\(..\).*.AVI/\1/’)
if [ $E -lt 10 ]; then
episode=$(echo $E | sed -e ’s/0\(.\)/\1/’)
/usr/local/bin/tvxml.sh “$ShowName” $S $episode TV $EpisodeID
else
/usr/local/bin/tvxml.sh “$ShowName” $S $E TV $EpisodeID
fi
wget http://localhost:49153/web/ushare.cgi?action=refresh -o /dev/null -P /dev/null
/usr/local/bin/email.sh
exit 0
}

## Look for AVI files and mv -v them over to the NFS Share on lunchbox
## Look for the shows we watch, and move files to the right place.
cd /home/jayholler/Downloads
for i in *.[A,a][V,v][I,i]
do
myFile=`echo $i | tr [:lower:] [:upper:]`
mv -v $i $myFile

case $myFile in

LOST*)
File=$(echo $myFile | sed ’s/\(.*OST\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’Lost’
MOVE_FILE
;;
ROBOT*)
File=$(echo $myFile | sed ’s/\(.*KEN\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’Robot Chicken’
MOVE_FILE
;;
BIG*)
File=$(echo $myFile | sed ’s/\(.*OVE\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’Big Love’
MOVE_FILE
;;
MAD*)
File=$(echo $myFile | sed ’s/\(.*MEN\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’Mad Men’
MOVE_FILE
;;
GLEE*)
GleeFile=$(echo $myFile | sed ’s/\(.*LEE\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’Glee’
MOVE_FILE
;;
REAL.HOUSEWIVES*)
File=$(echo $myFile | sed ’s/\(.*SEY\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’Real Housewives’
MOVE_FILE
;;
WIZARDS.OF.WAVERLY*)
File=$(echo $myFile | sed ’s/\(.*ACE\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’Wizards of Waverly Place’
MOVE_FILE
;;
ICARLY*)
File=$(echo $myFile | sed ’s/\(.*RLY\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’iCarly’
MOVE_FILE
;;
DAISY.OF.LOVE*)
File=$(echo $myFile | sed ’s/\(.*OVE\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’Daisy of Love’
MOVE_FILE
;;
WEEDS*)
File=$(echo $myFile | sed ’s/\(.*EEDS\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’Weeds’
MOVE_FILE
;;
NURSE.JACKIE*)
File=$(echo $myFile | sed ’s/\(.*KIE\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’Nurse Jackie’
MOVE_FILE
;;
FAMILY.GUY*)
File=$(echo $myFile | sed ’s/\(.*GUY\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’Family Guy’
MOVE_FILE
;;
PUSHI*)
File=$(echo $myFile | sed ’s/\(.*IES\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’Pushing Daisies’
MOVE_FILE
;;
TRUE*)
File=$(echo $myFile | sed ’s/\(.*LOOD\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’True Blood’
MOVE_FILE
;;
SUMMER*)
File=$(echo $myFile | sed ’s/\(.*IGH\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’Summer Heights High’
MOVE_FILE
;;
THE.TUDOR*)
File=$(echo $myFile | sed ’s/\(.*ORS\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’The Tudors’
MOVE_FILE
;;
TIM.AND*)
File=$(echo $1 | sed ’s/\(.*HOW\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’Tim and Eric Awesome Show Good Job’
EpisodeID=’79905′
MOVE_FILE
;;
DOLLHOUSE*)
File=$(echo $myFile | sed ’s/\(.*OUSE\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’Dollhouse’
MOVE_FILE
;;
FLIGHT*)
File=$(echo $myFile | sed ’s/\(.*ORDS\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’Flight of the Conchords’
MOVE_FILE
;;
HEROES*)
File=$(echo $myFile | sed ’s/\(.*EROES\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’Heroes’
MOVE_FILE
;;
GOSSIP*)
File=$(echo $myFile | sed ’s/\(.*IRL\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’Gossip Girl’
MOVE_FILE
;;
THE.SECRET*)
File=$(echo $myFile | sed ’s/\(.*AGER\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’The Secret Life of the American Teenager’
MOVE_FILE
;;
AMERICAN.IDOL)
File=$(echo $myFile | sed ’s/\(.*DOL\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’American Idol’
MOVE_FILE
;;
AMERICAS.NEXT*)
File=$(echo $myFile | sed ’s/\(.*ODEL\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’Americas Next Top Model’
MOVE_FILE
;;
DEXTER*)
File=$(echo $myFile | sed ’s/\(.*XTER\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’Dexter’
MOVE_FILE
;;
90210*)
File=$(echo $myFile | sed ’s/\(.*0210\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’90210′
MOVE_FILE
;;
THE.OFFICE*)
File=$(echo $myFile | sed ’s/\(.*FFICE.US\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’The Office’
EpisodeID=’73244′
MOVE_FILE
;;
CALIFORNICATION*)
File=$(echo $myFile | sed ’s/\(.*ION\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’Californication’
MOVE_FILE
;;
ITS.ALWAYS*)
File=$(echo $myFile | sed ’s/\(.*PHIA\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’Its Always Sunny in Philadelphia’
MOVE_FILE
;;
DESPERATE*)
File=$(echo $myFile | sed ’s/\(.*IVES\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’Desperate Housewives’
MOVE_FILE
;;
PARIS*)
File=$(echo $myFile | sed ’s/\(.*EVER\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’Paris Hilton is my BFF’
MOVE_FILE
;;
THE.IT*)
File=$(echo $myFile | sed ’s/\(.*ROWD\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’The IT Crowd’
MOVE_FILE
;;
HANNAH*)
File=$(echo $myFile | sed ’s/\(.*TANA\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’Hannah Montana’
MOVE_FILE
;;
ROCK*)
File=$(echo $myFile | sed ’s/\(.*OVE\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’Rock of Love’
EpisodeID=’80610′
MOVE_FILE
;;
24.*)
File=$(echo $myFile | sed ’s/\(.*4\).\([Ss][0-9]*[Ee][0-9]*\).*/\2.AVI/’)
ShowName=’24′
MOVE_FILE
;;
*)
echo “[+] $myFile does not match our TV shows, pushing it to /storage/Movies on lunchbox” > /tmp/emailmessage.txt
mv -v “$myFile” /storage/Movies/$myFile
/usr/local/bin/email.sh
;;
esac
done
exit 0

Filed under: Linux, Media

gdgt gadget list widget

Here’s my widget from gdgt.com

Filed under: Uncategorized

Blacklisting hosts that try to break into my host

I have been noticing lately that a lot of poeple are trying to attack my host by logging in over ssh.  With the help of a friend I was able to concoct a script which takes those nasty IPs out of /var/log/auth.log and then banishes these IPs by using route and the reject option:

#!/bin/bash

echo -e “\n[`date`] – Scanning for new bad hosts to blacklist…”
tail -2000 /var/log/auth.log | grep ‘invalid user’ | awk ‘{print $13}’ | uniq > /tmp/badhosts.txt
route | egrep -v ‘Kernel|Destination|default’ | awk ‘{print $1}’ > /tmp/routes.txt

for i in `cat /tmp/badhosts.txt`; do
if [ -z `grep $i /tmp/routes.txt` ]; then
echo -e “\n Adding $i to blacklist” ;
route add -host $i reject ;
else echo “$i is in routing table”;
fi;
done
echo -e “Now printing routing table, make sure nothing in here looks wrong”
route
echo -e “\n”
exit 0

I have put the script in a cronjob so that it runs every fifteen minutes:

0,15,30,45 * * * * /usr/local/bin/blacklist.sh >> /tmp/blacklist.log

This all gets dumped to a log at /tmp/blacklist.log, which I then have emailed to myself each day at 8:00 AM by a cronjob:

0 8 * * * mail -s “Blacklist.log for `date +%b” “%d” “%Y`” XXXX@gmail.com < /tmp/blacklist.log

In this way, I effectively block anyone who ends up in /var/log/auth.log as an invalid user from bombarding my ssh daemon with nasty brute force attacks to get into my server.

Linux is so awesome.

Filed under: Linux

HTC Hero looks good

Gotta say, this phone is making android very compelling:

Filed under: Uncategorized

BeejiveIM with push finally hits the App Store!

Of course, the day I figured out that I could use TextFree (an app that provides you with an email address which displays any messages sent to it as a push notification to your iPhone) BeejiveIM finally hits the app store with push notifications enabled.  AIM did as well, as you can see below:

IMG_0634

I like the new splash screen, very classy, and uh, bee hivey?

IMG_0635

In the Settings app you can select which type of notifications you’d like to receive:

IMG_0637

This is how the notification appears when you have the screen locked and first turn the phone screen on:

IMG_0638

This is how the notification appears if you are currently using another app.  Not perfect, as it is disruptive, but it is leaps and bounds better than having to actually keep the single IM application open in order to see your updates.

IMG_0639

All in all I have to say I’m pretty pleased with the performance, as I saw the notifications pop up on my phone about 1-2 seconds after receiving the same IM message on my computer.  In addition, if you delete the chat from your phone you won’t get the notifications if you’re using an IM app on your computer, so you’re not getting bombarded with notifications when you really don’t need them.  Great work overall, @BeejiveIM!

Filed under: iPhone

Latest Tweets