Extend the timeout on SSH connections

May 29th, 2009 No comments

A quick google search will quickly answer this question, but I’ve found myself asking it a few times lately.  Often when I let an SSH session go idle, I’ll end up being disconnected.  By adding ServerAliveInterval 60 to ~/.ssh/config I’ve managed to limit this from happening.

There is also a similar server side fix for this.  Consult man ssh_config and man sshd_config for more details.

Categories: quickfire, tips Tags: ,

Counting occurance of word in list

May 15th, 2009 No comments

I’ve had a need to count the number of times a certain value (in this case, a word) appears in a list when using OpenOffice.org.

Here was my problem.  I had a long list of values, each had a status of either “good”, “bad”, or “incomplete”.  I wanted to count the number of times each of the follow occurred.  It turned out to be pretty easy.

Create the following formula where you want the count to be.COUNTIF(range,expression) and bobs your uncle.

Categories: tips Tags:

Connecting to serial devices with minicom

May 14th, 2009 No comments

I’ve often found the need to break out the console cable to configure a router, switch, or other device that only had a serial console.  On Windows, most folks fall back on the good old hyper terminal to get the job done.  This works great, as long as your on Windows.

Since I’ve been getting myself to use Linux (specifically Archlinux) more and more, I’ve managed to find a way to connect to these devices in a fairly straightforward manner.

Here comes minicom.  Included in most package management systems, is just a {yum,apt,pacman} away, and you’re ready to roll.  On first run, you need to execute minicom -s and setup some basic configurations options. Namely, if you’re connecting to a Cisco device, set the port speed to 9600 baud, and the rest of the defaults should be fine.

At this point, you’re ready to start configuring. Enjoy.

Categories: Uncategorized Tags:

Simple rules to keep you smart with email

May 6th, 2009 1 comment

When using email, you should always keep the following rules suggestions in mind.  Most of these apply to mailing lists, but could just as easily make any email communication (and maybe even instant messaging) better.

First, don’t top post.  Not only is top posting counter-productive it is annoying.  Also, if the person before you sucks at life, don’t follow with it.  Remove everything but the relevant parts, and post under that.  It makes life better for everyone.

Along with the last one, don’t include unnecessary posts in your reply.  More than likely, most people will choose not to follow the first suggestion, so lets alteast remove the parts of the message that are unneeded.  If you’re reply to a long message, break it apart.  Put your replies inline, so others can better read them..

Keep the signature short.  If you feel you must include a 12 line signature complete with pictures, color and blink tags, only do so once.  A simple sig is great.  A simple sig 24 times is annoying.  Don’t do it.  Any mailer worth using allows you to configure when to add a sig, so don’t add one on replies.

Stay on topic.  If the current thread has sparked a new topic, start it elsewhere.  Threads and topics enjoy having an exclusive relationship, so keep it that way.  If you’re changing the thread, atleast warn people (New Thread Topic (WAS: old thread)).

That’s all for now.  (actually, that’s just the 4 things that annoyed me while checking my mail tonight)  I’ll expand as more annoying things come to light.

Categories: rants Tags:

Asterisk with PRI support

May 2nd, 2009 No comments

If you’re going to be using Asterisk with a PRI card, there are some important steps you have to follow in the right order.

Normally, I install the zaptel package then install Asterisk. This is all great, until I need PRI support. For that, I must also install the libpri package.

Important to note, for asterisk to get PRI support you must install libpri BEFORE any other package.

Categories: Uncategorized Tags:

Subversion over SSH

April 24th, 2009 No comments

Continuing with my exploration of using some form of version control to hand configuration file managent, I’ve been using svn over ssh.

Setting up svn access over ssh is a fairly stright forward process.  The first set is to create the actual repo on the server.

mkdir /var/repo/configs

Then use svnadmin to create a repository in that directory.

svnadmin create /var/repo/configs

Now that you have you repoistority created, it’s time to start using it.  If you have an already existing set of files you’d like to import, do something similar to this…

svn import . svn+ssh:///var/repo/configs -m "Initial import"

If you’re just starting out, checkout a working copy like such..

 svn checkout svn+ssh:///var/repo/configs .
Categories: Uncategorized Tags:

Using source control for config management

April 22nd, 2009 No comments

A project involving asterisk has forced me to find a way to help manage my configurations. I’m going to give using subversion a go at helping me to keep some level of change control and really simple backups, and I’m going to share my thoughts on that here. This post doesn’t have any new details, it’s simply a way for me to remember to update :-)

Stay tuned.

Categories: projects Tags: , , ,

Quick review of the Aastra 57i

April 21st, 2009 No comments

As part of an project, I recently received a few Aastra 57i SIP phones at work.  After spending a few days with them, I’ve decided to write up a short review of something of the things I like (and don’t like) about these phones.

Let’s start with the phone itself.  It’s not much bigger than a normal telephone, and has the same basic “fancy IP phone” look you see with Cisco and others.  One thing does stand out; the screen.  It’s a fairly large screen, and backlight with a white light, instead of the normal Aastra golden brown color.  Obviously, this makes it much more appealing on the eyes.  However good, there is some bad.  The viewing angle of the screen is not near as good as say the 480i, but still useable.

The device itself is also somewhat light compared to others I’ve used.  At first, this seems nice, but as you use the phone you find it sliding around on the desk quite often.  The additional of some no-slide matting takes care of this, but not a very cosmetic solution for an otherwise good looking phone.

The webui also boosts some useful features.  Almost all configuration options can be set there, although I recommend the server configuration options for various reasons.

Overall, it’s a nice phone.  The buttons are a bit odd, the screen a little hard to read when not looking at it just write, and a tad light.  For the price, you can’t beat it though.

I’ve also got a few 480i and 9133i phones also.  Hopefully, I’ll get around to sharing my thoughts on those as well.

Categories: reviews Tags: , ,

Creating empty files in Linux

March 27th, 2009 No comments

I had a need for several files of various sizes to do some network testing with.  I found a very good us for dd here.

dd if=/dev/zero of=10mb-file.bin bs=1024k count=n

Using the above command (and replacing n for a value) allows the creation of empty files with the size specificed. Need a 10Mb file, n = 10. Need a 100Mb file… n = 100. You get the idea.

Categories: quickfire, tips Tags: ,

Force the use of ‘www’ in your URL.

March 12th, 2009 1 comment

This is a pretty simple use of mod_rewrite to force the use www in your urls.

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule .? http://www.example.com%{REQUEST_URI} [R=301,L]\

The first line is only needed if mod_rewrite isn’t enabled on your server (though the module does need to be enabled). Replace example.com with your actual domain name of course.

Categories: quickfire Tags: