Archive for May, 2009

What About An External Multi-Touch Trackpad For a Mac

Thursday, May 28th, 2009

I used to be a big fan of ergonomic keyboards (and I still am). But I am an even bigger fan of the multi-touch trackpad. I have even extended it by using MultiClutch (I know the link looks funny, but that’s the page title, I promise). MultiClutch allows you to extend the swiping and pinching of fingers to extend to other applications and key combinations (both locally and globally). This means that it is so much a part of my daily productivity that I have had to make due without an ergonomic keyboard.

If someone knows about an external multi-touch trackpad (either wireless or USB) that supports 1,2,3 and 4 finger multi-touch, please let me know. And if one doesn’t exist, please let Apple know :). Ultimately what I would like my “at home” setup to be is a wireless ergonomic keyboard along with a wireless ergonomic multi-touch trackpad.

I’d like to hear everyone’s thoughts on this.

HOWTO Recreate /dev/null

Wednesday, May 27th, 2009

If something happens that requires you to recreate /dev/null on your *nix system. Don’t fret, it’s easy. The most recent issue I had was that a Capistrano recipe inadvertently clobbered /dev/null. The file looked like this:

1
2
[root@web1 ~]# ls -l /dev/null
-rw-r--r-- 1 capistrano engineering 0 May 26 04:02 /dev/null

Thankfully to bring it back to its original state, just run the following commands:

1
2
3
4
5
6
[root@web1 ~]# rm /dev/null
rm: remove regular empty file `/dev/null'? yes
[root@web1 ~]# mknod /dev/null c 1 3
[root@web1 ~]# chmod 666 /dev/null
[root@web1 ~]# ls -l /dev/null
crw-rw-rw- 1 root root 1, 3 May 26 15:09 /dev/null

Take note of the following things:

  • It is not a joke that the mode of /dev/null needs to be 666. It should be user, group, and world read and write.
  • The user and group ownership here is root.
  • There is no size in the ls like you see in the top one. All you should see are the major (1) and minor (3) device numbers (separated by a comma) prior to the date.

Why Idea People Should Twitter

Tuesday, May 26th, 2009

Let me start off by explaining what I mean by an “Idea Person.” To me, an idea person is someone who just has a knack for thinking of things that would make the world a better place (or at least make things easier for some people). They don’t necessarily need to be a scientist on the order of Albert Einstein, but they should be people who are constantly thinking. Something like, “Wouldn’t it be great if in men’s rooms in bars, there was padding above the urinals so men wouldn’t hit their heads while relieving themselves.”. It’s just an idea.

Quite often, people don’t get those ideas out fast enough and they lose them. It even could be because their minds move so quickly that they forget to jot it down. Enter age of instant gratification. If you have an idea, Tweet it. Of course you could blog about it, but then people may only get it when they read your feed or whenever they get around to checking your blog. But with Twitter, its an almost instantaneous media connection. All it takes is one person who is highly followed in Twitter to retweet your idea(s) and you instantly have high visibility.

Why does this matter? Well I’m glad you asked. Because an idea person may not always have the want or even the means to implement the ideas, but with the connections and viral dispersion of information that Twitter provides, someone somewhere will have the means and may share your desire. Someone may even be able to point out the fact that the project or idea already exists (or is in production). Who knows you might just end up finding a new business partner on Twitter if you follow the right people and the right people follow you.

More Efficient SPAM Fighting with Amavisd-logwatch

Friday, May 22nd, 2009

This is the first in a multipart series on better SPAM fighting through log parsing. I have found that better Systems Administration can usually be achieved through proper log handling and analysis. In fact, I will use the data from one of the secondary mail servers in my personal mail setup in order to demonstrate this data analysis. I will do this by going through the report generated by amavisd-logwatch piece meal until complete.

I previously posted about a program that parses your amavisd-new SPAM log file called amavisd-logwatch. Now I am going to give you some tutorials of how to make efficient use of the results. I am assuming that you have access your SpamAssassin scoring config files. I am also assuming that you have access to the log parsing results. I have mine sent via email daily.

One item I would like to mention is that when making changes to SPAMAssassin, ensure that you make them in a separate file from the default configuration files. I use /etc/spamassassin/local_tests.cf. I strongly recommend this setup as this makes it easier to segment your configuration files by type when your rule sets and modifications start to get larger and larger.

Section: Bayes Probability
First things first, skip the majority of the summary sections and go right down to the section on Bayes probability:

Bayes Probability Information

Bayes Probability Information

You’ll notice that of the 14,627 times that the Bayesian filter was run on messages, that it came up with BAYES_99 11,825 of those times (or 80.85%) . You’ll also notice that all the subsequent BAYES_XX probability tests were extremely low (2nd and 3rd place being 5.4% and 4.5% respectively).

Conclusion: Assuming that you are relatively happy with your current level of SPAM filtering, that would mean that your Bayes filter is doing fairly well (in general). You may not need to tweak it. If you are feeling frisky though, to tweak the impact that the BAYES_99. To change this, open up your local_test.cf and add the line:

1
score BAYES_99 (1.25)

This increases your BAYES_99 score by 1.25 points from its base. It doesn’t have to be 1.25 points, start small to see what you are comfortable with and slowly work your way up. Be careful as too high a jump will cause false positives which makes for angry users.

Section: SPAM Score Frequency
The SPAM score frequency refers to how often a piece of email scores within a given range.

SPAM Score Frequency

SPAM Score Frequency

Conclusion: Taking note of the fact that nearly 60% of the emails scored a 30 or higher, and assuming again that you are comfortable with your SPAM filter, you can adjust the SPAM kill score threshold in amavisd-new accordingly. I trust my SPAM filter, but I have written many rules and made many tweaks to it. So I have set my SPAM kill threshold low enough (15.8 to be exact). As you can see, this is pretty close to the middle of the set of numbers (also known as the median). This eliminates the delivery of the vast majority of the obvious SPAM.

Stay tuned for the next part in the series where we will tweak the individual scores based on the results report.

Things (Todo App)

Wednesday, May 20th, 2009

After reading and commenting on these 2 blog entries by rbowen: iPhone Todo Apps Things and iPhone Todo Apps; I figured that I would throw my $0.02 on here.

Things by Cultured Code does come with a high price tag. But it is by far the most useful todo app that I have come across.

Let’s do a quick salient point pro/con analysis of this. One of my favorite parts of Things is the concept of context. When you create a todo item, you can tag it with what context it is in. Then you can sort or show your todo’s by context. You can sort by multiple tags. This can be shown with the following example, “How can I see what phone calls I have to make for work?” You can click on the items tagged with work and phone. Then you’ll have which phone calls to make.

The biggest con here is the hefty price tag. It definitely does cause some sticker shock. Between the USD $10 for iPhone app and the USD $50 for the laptop/desktop version, USD $60 can be quite a bit for the simplicity of a todo app.

I have found that since spending the USD $60, I have become a lot more efficient and productive. There are also a lot fewer things that fall through the cracks. I have to face facts that I have a pretty poor memory. So when I have something to do, I immediately put it into Things and then sync it as soon as I am in the same place as my laptop again.

One of the beautiful aspects of Things is its simplicity. It has a simple interface and a very succinct group of menus. The only thing that I believe that Things is missing is alerts. I like the iCal sync and iPhone sync, but I would like it to integrate into Growl. This would be even more useful if you could give specific times that you want the Growl notifications to pop up. I know this isn’t possible in the current state of the iPhone OS (until push notifications from the background are available). But this is certainly an available on the laptop/desktop setup.

I am a big believer in FOSS and Open Source in general. However, I am also a big believer in the right tool for the right job. Sometimes that tool costs a little bit of money. Although it may not be the right tool for everyone, it happened to be a tool that made me a more efficient worker and person.

More Wolframalpha Easter Eggs

Monday, May 18th, 2009

While finally getting to play around with the new Wolframalpha search (computational knowledge) engine. I found a few more Easter Eggs in addition to the ones posted on Mashable here and here. It appears that the creators of WolframAlpha believe that proverbs (more commonly referred to as aphorisms) are a handy trait for a computational knowledge engine to have. Regardless, they are fun to play with.

  1. I should probably listen to this one myself. Starting out with this cause it is just amusing.
    All Work and No Play Makes Jack a Dull Boy

    All Work and No Play Makes Jack a Dull Boy

  2. Another instance of WolframAlpha being health conscious.
    An apple a day Keeps the doctor away

    An apple a day Keeps the doctor away

  3. It wants to be smarter so it tries to learn from its mistakes (not really, but we are being proverbial here anyway).
    Fool Me Once, Shame On You

    Fool Me Once, Shame On You

  4. In the spirit of the Back To The Future (and other cult film references):
    1.21 Gigawatts

    1.21 Gigawatts

  5. Another great proverb reference ignorance.
    Out Of Sight, Out Of Mind

    Out Of Sight, Out Of Mind

  6. This isn’t really an Easter Egg. I was just expecting a response more like, “There is a season” or something a little more 60s ish. So I am including this one purely for amusement’s sake.
    Turn Turn Turn

    Turn Turn Turn

Designing Towards The User

Wednesday, May 13th, 2009

Any Systems Administrator who hasn’t heard of Tom Limoncelli should probably do some reading. His latest blog post ‘Gorillas in the Mist’ or ‘Sysadmins at the Keyboard’? over at Everything Sysadmin talks about how sometimes the time spent on designing a product or interface could have been better spent if the organization had just spoken to the people who will actually be *using* the systems.

Those of us that actually do the administering of systems and “grew up” without the GUI for the most part, feel more comfortable in the command line environment. Even when I have to fix something in Windows as simple as networking, the first thing I do is open up a command terminal and type ipconfig /renew. All the time that Microsoft spent developing the end user networking GUI was for nothing when dealing with a user like me. But then again, most users that use Windows aren’t like me. And the time Microsoft spent creating the interface was well spent.

The issues come in when someone like Cisco spends hundreds of thousands of dollars writing interfaces for something like the ASAs (which is actually an excellent GUI as far as GUIs go) and most people who deal with ASAs use the command line. I do most of my Cisco work directly using the command line within IOS. All the *nix machines I administer (which is actually quite a few more than I would like to think about at times), I don’t install any of the GUIs. I do everything via the trusty old command line and I know a lot of others do the same.

Even taking this so far as the development world. Even when I write code, I do so using vim on the command line and not an overkill IDE like Eclipse. Even the long time developers and engineers at my company use the command line when given the opportunity. Now this isn’t to say that GUIs don’t have their place, since they certainly do make some tasks, easier, faster, etc. But the fact remains that companies like Cisco will make these GUIs that costs them hundreds of thousands of dollars to develop/test/deploy/maintain, when the majority of the people that use it usually just want a solid debugging tool where they don’t have to keep clicking over and over (as Tom notes).

Social Media Information Propagation

Tuesday, May 12th, 2009

This morning I read the news story Irish Student Hoaxes World Media With Fake Quote. To summarize the article, an Irish student put a few quotes on Wikipedia on the page of a composer who had recently passed away to see how quickly people would use them. He made up the quotes and they were quickly on the editorial sheets.

The point is that we are all too quickly grabbing information without verifying. Although Wikipedia provides an invaluable service to the online community, it is all to easy to abuse. It seems as though writers have forgotten the scientific part of their career; fact checking. Although I am not a journalist, nor will I ever be, I think that sacrificing fact checking in order to make a deadline may be the wrong approach.

This is just my point from the perspective of Wikipedia. Let’s take this from another social media perspective like Twitter. For example, let’s say that someone wrote on Twitter:

RT @mattcutts Google will no longer honor the rel=”nofollow” aspect of linking

This could cause a pretty big uproar. There will be a massive amount of Tweeting both letting people know that Matt did not say this as well as people blindly retweeting this. Blog entries will show up saying why Google shouldn’t do that. Matt Cutts will likely have to write a blog entry saying he said no such thing. And I am sure all sorts of other hilarity will ensure. The speed of information in this day and age is so fast that misinformation can quickly wreak havoc. This is also a testament to the fact that people are generally more likely to spread negative information than positive information.

And to think all of this could have been avoided by a simple fact check by the first person who did an RT (after the person who made up the quote). And although it would be an interesting social experiment to test such a fact (as above), I think I’ll pass. Just keep in mind, fact checking is not something that should be left by the wayside.

Percona Conference Slides

Saturday, May 9th, 2009

For everyone who was not able to attend this year, here is the link to the Percona Perfmance Conference slides: http://conferences.percona.com/percona-performance-conference-2009/schedule.html.

I suggest you check them out if you work with MySQL. Enjoy.

Deploying Amavisd-logwatch

Friday, May 8th, 2009

I was looking for way to make my SPAM filtering more effective and came across this great tool from Mike Cappella called amavisd-logwatch.

On his web site, it says he doesn’t like waiting for package maintainers, so its just a tarball. Since my installs are Debian based, I created a deb for it. My .deb creating skills are not perfect, but it works. The deb was built on sid and is available here.

Download the Debian package and install it:

1
2
3
4
5
6
mail:~# dpkg -i amavis-logwatch_1.49.09-1.1_i386.deb
Selecting previously deselected package amavis-logwatch.
(Reading database ... 37342 files and directories currently installed.)
Unpacking amavis-logwatch (from amavis-logwatch_1.49.09-1.1_i386.deb) ...
Setting up amavis-logwatch (1.49.09-1.1) ...
Processing triggers for man-db ...

Leaving the defaults are safe in the config file. The one thing that does need to be changed is the additional cron script that I added to the installer. It will email the output of the script when cron.daily runs. If you do not want this to happen, then just delete the file /etc/cron.daily/amavis-logwatch. To have the script run, you have to edit it and change the defaults to reasonable defaults (like proper From, To, and CC email addresses). Also make sure to change the /var/log/mail.log file if that isn’t the location of your mail log.

1
2
3
4
5
6
7
$SUMMARY=`/usr/bin/amavis-logwatch --detail 5 -f /etc/amavis-logwatch.conf /var/log/mail.log`;
...
# Set the email header fun
$FROM = "\"Postmaster\" <postmaster \@example.com>";
$TO = "\"To\" <to \@example.com>";
$CC = "\"CC\" <cc \@example.com>";
</cc></to></postmaster>

Once you have made those changes, you will receive a nightly report with your amavisd-new log information.

Tops and Tops (15 of Them)

Wednesday, May 6th, 2009

There are so many variations on the original and good old useful version of Linux top that I figured I would list a few of the ones that I find handy on occasion. As with anything else, they all have their usefulness and each one can be more useful than any other at a particular time. You will need to figure out for yourself what is the most useful for what you are trying to accomplish.

I have used all of these at one time or another. They fall into the following general categories: general, network/service, and daemon. I am sure that are plenty more than I have listed here (in fact I know there are since I didn’t include any X based programs). If there is one that you find useful, please let me know about it as I always like to learn more about whats out there.

System

  1. atop
    Atop is an ASCII full-screen performance monitor that is capable of reporting the activity of all processes (even if processes have finished during the interval), daily logging of system and process activity for long-term analysis, highlighting overloaded system resources by using colors, etc. At regular intervals, it shows system-level activity related to the CPU, memory, swap, disks, and network layers, and for every active process it shows the CPU utilization, the memory growth, priority, username, state, and exit code.
  2. htop
    This is htop, an interactive process viewer for Linux. It is a text-mode application (for console or X terminals) and requires ncurses.

Network

  1. iftop
    iftop does for network usage what top(1) does for CPU usage. It listens to network traffic on a named interface and displays a table of current bandwidth usage by pairs of hosts.
  2. jnettop
    Jnettop allows administrators of routers to watch online traffic coming across the network in a fashion similar to the way top displays statistics about processes.
  3. nettop
    This program has a top like display which shows the different packet types. Possibly useful to determine the nature of packets on a given network and how much bandwidth they are using.
  4. ntop
    ntop is a network traffic probe that shows the network usage, similar to what the popular top Unix command does. ntop is based on libpcap and it has been written in a portable way in order to virtually run on every Unix platform and on Win32 as well.
  5. dnstop
    dnstop is a libpcap application (ala tcpdump) that displays various tables of DNS traffic on your network.
  6. pftop
    Pftop is a small, curses-based utility for real-time display of active states and rule statistics for pf, the packet filter. for OpenBSD.
  7. iptop
  8. Network tool for monitoring IPv4 activity. Iptraf, tcpdump, trafshow have not such ability. Gives sorted traffic load speed on each IP. Helps detect the channel overload and maybe sources of attacks. Requeres ULOG target of iptables.

Daemons

  1. mtop
    mtop (MySQL top) monitors a MySQL server showing the queries which are taking the most amount of time to complete.
  2. mytop
    mytop is a console-based (non-gui) tool for monitoring the threads and overall performance of a MySQL 3.22.x, 3.23.x, and 4.x server.
  3. innotop
    innotop is a ‘top’ clone for MySQL with more features and flexibility than similar tools.
  4. pgtop
    display PostgreSQL performance info like `top’
  5. apachetop
    Apachetop is a curses-based top-like display for Apache information, including requests per second, bytes per second, most popular URLs, etc.

Untried

  1. smbtop
    This is a part of the ISIS (Integrated Samba Inspection Service) Java framework. I have never tried this myself, but it would be great to see a top of what is currently being done by Samba on a machine.

Downloading Youtube Videos onto the iPhone on Mac OS X

Monday, May 4th, 2009

For months I have been trying to figure out the best way to download Youtube videos to watch on my iPhone my hour commute to work. I tried a few different methods, the most recent of which was TubeTV. TubeTV was good except it was missing a few key features like continuing partially downloaded files and importing directly into iTunes. I could live with this up until it completely stopped working for me (otherwise I would still be using it).

Enter Tooble. Tooble is the answer. You give it a URL and it downloads the movie, converts it and dumps it straight into iTunes. Great work. Clean and simple.