Modify Windows XP routing table

During some network changes I’ve found the need to modify the routing table.

To change the default route on Windows XP (and possibly Windows Vista, 2000, etc) you use the route command. The syntax is pretty simple, here is a quick example….

route change 0.0.0.0 mask 0.0.0.0 172.18.12.120

To delete or add routes, simply change the keyword change to either add or delete.

route add 192.168.0.0 mask 255.255.255.0 10.10.0.50
Posted in quickfire, tips | Tagged , | Leave a comment

Check speed of connected link in Linux

If you’ve ever wanted to check on the status of your Ethernet links, you’ve probably used the ip commands (or ifconfig) to view some basic information.  However, you might have noticed these commands do not tell you what the current link speed is, or other possibly important details.  That’s where ethtool comes in.

[jonmoore@megaton ~]$ sudo ethtool eth0
Settings for eth0:
Supported ports: [ MII ]
Supported link modes:   10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes:  10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: MII
PHYAD: 1
Transceiver: external
Auto-negotiation: on
Supports Wake-on: g
Wake-on: d
Link detected: yes

As you can see, ethtool will show you the support modes, as well as the current mode.  From the above example, I’m currently connected at 1000Mb/s at Full Duplex.  Very nice.

Check out the ethtool man page for more useful commands.

Posted in quickfire, tips | Tagged , | Leave a comment

Cancel a traceroute on Cisco devices

Many times I’ve started a traceroute to either a mistyped IP address, the wrong IP or something else that I would really rather not wait for 30 hops to time out before moving on. When doing the traceroute the device tells yous to “Type escape sequence to abort,” but doesn’t share what exactly this escape sequence is. After a bit of googling and finding a few references here and here I’ve found an answer.

This elusive key combination is CTRL+SHIFT+6 twice. I’ve had mixed results using it, but it appears, that holding CTRL+SHIFT while hitting 6 works sometimes, and others retyping the entire combination works. Either way, it’s been a help.

Posted in quickfire, tips | Tagged | Leave a comment

Extend the timeout on SSH connections

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.

Posted in quickfire, tips | Tagged , | Leave a comment

Counting occurance of word in list

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.

Posted in tips | Tagged | Leave a comment

Connecting to serial devices with minicom

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.

Posted in Uncategorized | Leave a comment

Simple rules to keep you smart with email

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.

Posted in rants | Tagged | 1 Comment

Asterisk with PRI support

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.

Posted in Uncategorized | Leave a comment

Subversion over SSH

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 .
Posted in Uncategorized | Leave a comment

Using source control for config management

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.

Posted in projects | Tagged , , , | Leave a comment