Archive for January, 2009

Apple and Adobe reported to be working together on Flash

Saturday, January 31st, 2009

Via AppleInsider

“It’s a hard technical challenge, and that’s part of the reason Apple and Adobe are collaborating,” he says. “The ball is in our court. The onus is on us to deliver.”

Curious that the quote comes from Adobe, not Apple. And Apple really doesn’t like stuff like this getting out early. Hasn’t anyone learned anything yet?

Personally, I hope this doesn’t work out. Flash is a blight upon the web, and given Apple’s deep investment into AJAX based systems like SproutCore, anything that pushes them toward yet another proprietary, closed, system isn’t just a bad idea, it makes no sense.

Keeping an eye on things with rsyslog

Saturday, January 31st, 2009

A few months ago I discovered rsyslog, a drop-in replacement for the standard Unix syslog daemon. Rsyslog can do a lot more than I will talk about, but the major appeal to me was built in mail sending.

Since rsyslog is completely compatible with syslog.conf, I started by cp /etc/syslog.conf /etc/rsyslog.conf. Then to make a few specific changes. First, we should know that you can split your config directives out to multiple files and read them in independently. You can include multiple files or whole directories.

$IncludeConfig /etc/rsyslog.d/

I commented that line out, since all my config will be in one file: rsyslog.conf

Next, let’s allow some remote connections to use this daemon for logging:

$AllowedSender UDP, 127.0.0.1, 192.168.1.0/24
$AllowedSender TCP, 127.0.0.1, 192.168.1.0/24
$UDPServerRun 514

This allows local loopback connections and the LAN.

Now, we get into the heart of rsyslog, modules and templates. First, we will load a module allowing the import and logging from klogd, the Linux kernel logging daemon:

$ModLoad /usr/lib/rsyslog/imklog.so

And then, a module to allow rsyslog to communicate to SMTP servers directly:

$ModLoad /usr/lib/rsyslog/ommail.so

Since these are the only modules I load, let’s go ahead and configure the directives for ommail:

$ActionMailSMTPServer airwaterunix.org
$ActionMailSMTPPort 25

$ActionExecOnlyOnceEveryInterval 1

$ActionMailEnableBody on

$ActionMailFrom alert

The options are pretty straightforward. The third option there can be increased to keep rsyslog from slamming your mail server, and the fourth option is incase you only want a subject line sent (in the case of SMS). The “alert” in the last option is the name of a specific mail alias on the server that points to root.

Now it’s time to set up some templates:

$template TraditionalFormat,”%timegenerated% %HOSTNAME% %syslogtag%%msg:::drop-last-lf%\n”

This one won’t apply to mail. It’s just the standard template to use for the messages that appear in the log files.

Next:

$template mailSubject,”%programname% on %hostname%”
$template mailBodyShort,”\r\n\r %timegenerated% \r\n\r\n %msg%”

$template mailBody,”\r\n\r %timegenerated% \r\n\r\n %hostname% %programname% %msg%”

A generic template for mail Subject, consisting of messages that will appear like “ssh on airwaterunix,” and two types of mail Body templates. One truncated style for SMS, and one longer one for email. I could have multiple Subject templates also, but it’s not really necessary at this time.

Now that we have defined the templates, we have to enable a Subject:

$ActionMailSubject mailSubject

Now come the conditionals. For every 'if...then' style line we use, we must define the mail recipient beforehand, as that directive is reset after the loop closes. So for our first recipient and conditional:

$ActionMailTo alert if ($fromhost == ‘airwaterunix’) and ($msg contains ‘Failed password’) or ($msg contains ‘eth0: link up’) then :ommail:;mailBodyShort

Simply, the logic works like: if
A

and

(B or C)

then

ACTION

So for this to be met, it must be happening on host airwaterunix, and the message must either be “Failed password” or “eth0: link up”
These two messages have nothing in common, except they are two messages for which I would like to trigger an email to user ‘alert’ (which happens to be an alias not only to root, but my SMS number as well). And since these are going to a phone, we use the mailBodyShort template so everything fits in one message.

Next, a slightly less alarming notifier:

$ActionMailTo admin if $msg contains ‘Authentication failed’ then :ommail:;mailBody

In this case, ‘admin’ is an alias to root and nothing else. This string will only pass through rsyslog if an incorrect password was entered via the ’su’ command. Since I typo this one from time to time, I don’t want an SMS every time I do it. An email will suffice.

Let’s add one more similar one, but this time to handle failed logins from the console:

$ActionMailTo admin if ($programname contains ‘login’) and ($msg contains ‘invalid password’) then :ommail:;mailBody

Next up, handling specific messages from smartd, the SMART disk monitoring daemon:

$ActionMailTo admin
if ($programname == ’smartd’) and

($msg contains ‘RawReadError_Rate’) or

($msg contains ‘ReallocatedSectorCt’) or

($msg contains ‘SeekErrorRate’) or

($msg contains ‘SpinRetryCount’) or

($msg contains ‘Reported_Uncorrect’) or

($msg contains ‘AirflowTemperatureCel’) or

($msg contains ‘Temperature_Celsius’) or

($msg contains ‘HardwareECCRecovered’) or

($msg contains ‘Offline_Uncorrectable’) or

($msg contains ‘UDMACRCError_Count’) or

($msg contains ‘MultiZoneError_Rate’) or

($msg contains ‘TAIncreaseCount’)

then :ommail:;mailBody

Note: Even though I split this up for legibility, rsyslog will not work unless you put your entire 'if...then' conditional on one single line.

Finally, we’ll add one to handle failed ssh logins on a secure remote server:

$ActionMailTo ssh-alert if ($fromhost == ’seraphim’ ) and ($msg contains ‘Failed password’) then :ommail:;mailBodyShort

In this case ’ssh-alert’ is an alias of several email addresses and SMS numbers that will all be notified in the event that an ssh login failure occurs on host “seraphim.”

The rest of rsyslog.conf is lines like:

.info;.warn;authpriv.none;cron.none;mail.none;news.none -/var/log/messages;TraditionalFormat

to handle the actual text file logging of messages, specified by a previously defined template.


iStat for iPhone

Sunday, January 25th, 2009

Bjango’s iStat for iPhone works with iStat Server (free download) to let you monitor your Mac remotely. Very clever interface and includes a couple of extra tools like ping and traceroute.

iStat Server installs to /Library/Application Support/iStat Server/ and includes /Library/LaunchDaemons/com.bjango.istatserver.plist

The Problem with “Feeling Creative”

Thursday, January 22nd, 2009

Creative work only seems like a magic trick to people who don’t understand that it’s ultimately still work.

More wisdom from Merlin Mann.

Stanford iPhone Class Over, Details Posted

Thursday, January 22nd, 2009

http://www.stanford.edu/class/cs193p/cgi-bin/index.php

“App Store rewards crap apps”

Thursday, January 22nd, 2009

http://www.appleinsider.com/articles/09/01/22/iphone_developer_app_store_rewards_crap_apps.html

Fascinating article from the developer of Sound Grenade, an app that he spent less than hour on, but which ended up in the top list within a few days. Now, he updated it with an ad-supported version that nets him over $200 an hour from embedded ad revenue.

“The App Store is not like any other software market we’ve ever seen. If it could be compared to any other market, it’s like the Billboard Charts for Music. A good pop music producer can take someone with minimal talent, get them to sing some lyrics, and then run it through auto tune. Bam. Number one song. That’s all it takes with the App Store. Do some market research, work out that most of the people that download free apps are immature and seriously uncool. Then wrap an average idea that you think will appeal to immature and uncool people with some average graphics, and boom, top 10 app. Like the pop market, it’s hit or miss; sometimes it will work, sometimes it won’t.”

How to not use Marker Felt in a Notes.app note

Thursday, January 22nd, 2009

1) Go to Settings > General > Keyboards and enable an Asian language keyboard.

2) Open Notes and create a new note.

3) Tap the globe icon to change languages.

4) Tape the 123 key and enter a digit into your note.

5) Marvel as the font changes to Helvetica.

6) Tap the globe and change back to English.

That note will now be Helvetica permanently.

7) Cry about why this is not an option.

iPhone apps worth buying

Thursday, January 22nd, 2009


Things

Complements the desktop app very well, syncs over wifi. Very simple, not too much to play around in and lose focus.


PCalc


Throw away the default iPhone calculator and any other unit conversion apps you have and use this instead. Simple yet full of features.


Grocery iQ


If you’re the type to completely forget what it is you’re shopping for every time you go buy food, get this. I’m not sure I use it the way the developer intended, as I make one long permanent master list, and check/uncheck items based on have/need status. Too much work to create a new list every single time.


Weighbot


If only just for how well designed it is and how fun it is to use.


Gas Cubby


If you hate car maintenance because of all the crap you have to remember to do.


Keynote Remote (iTunes link)


Simple and works well.


Wordbook (iTunes link)


Best dictionary app yet, and a bunch of other stuff like anagrams and crossword solver too. Great “words of the day” feature to help increase your wordiness.


Mobile Chat


Some people praise BeeJive and the official AIM client, but for my money this is the best one yet. Supports several common protocols and has a clean usable interface.


Tweetie


Fast, clean, bunch of features (trends, search) and it can fart too. What more could you want? Can also support more than one account.


Jaadu


If you need a VNC client on your iPhone, this is the one to get. Most stable, fastest, and most remote control features with no resolution limits.


Deliveries


Package tracker that syncs with the Dashboard widget, and looks fantastic.

Seagate posts updated firmware for affected drives

Thursday, January 22nd, 2009

http://seagate.custkb.com/seagate/crm/selfservice/search.jsp?DocId=207931

One of these is in airwaterunix.org, and has been promptly updated.

“Transparency and the rule of law will be the touchstones of this presidency”

Thursday, January 22nd, 2009

January 19, the robots.txt on whitehouse.gov was over 2,400 lines long.

January 20, it became 2 lines.