Category Archives: tips

Find Text and Find/Replace Easier Than You Think in Linux

How to search all files for a text string: grep -lr string ./ > results.txt -l will print only the path and file names of the matches. Search all files of a certain name for a certain string: grep -lr string ./ | grep filename Yes, do specify ./ if you are doing all directories [...]

Also posted in quickfire | Tagged , , , , , | 1 Comment

Installing Dropbox on Ubuntu (and others)

I’ve been using dropbox to sync and share files between my various computers for quite some time, and overall have been very pleased.  However, one area things are not so great… documentation for installation on Linux.  After having to reinstall on my notebook, I decided to somewhat document the hidden part of the process. After [...]

Also posted in quickfire | Tagged , | 1 Comment

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 [...]

Also posted in quickfire | 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 ~]$ [...]

Also posted in quickfire | 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 [...]

Also posted in quickfire | 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 [...]

Also posted in quickfire | 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 [...]

Posted in tips | Tagged | Leave a comment

Creating empty files in Linux

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 [...]

Also posted in quickfire | Tagged , | Leave a comment

Quickly mirror website…

This is going to (hopefully) be part of a much larger article on moving web sites from one host to another.  Until then, I leave with just a simple command to download almost all of an entire webpage to a local directory… <code>wget -rnp -nd www.example.com</code> Or, if we want to download the same files, [...]

Also posted in quickfire | Tagged | 2 Comments

Super simple, limited and basic look at tar

Create a tar archive tar -c -f archive.tar * Create a compressed archive with gzip tar -c -z -f archive.tar.gz * You can also condense down the commands like so.. tar -czf archive.tar.gz *

Posted in tips | Tagged , | 1 Comment