Tutorials

...now browsing by category

 

Cycling Training Log Spreadsheet

Wednesday, January 2nd, 2008

excel

Since 1995, I’ve been tracking every mile I rode on the bike in an Excel spreadsheet.  This has proven to be an excellent training tool and helped me notice trends and (sometimes) avoid over training.  Five years ago I set out to find an automated way to compute my average speed and embarrassingly, I couldn’t figure out how to do this in Excel so I wrote my first JavaScript application and published it over at : http://www.raincitystory.com/mph.htm.  Since that time, I’ve averaged almost 10,000 hits per month on that page (the other pages on my entire site get less than 1,000 hits per month COMBINED) and I often get e-mails from people asking for more help to automate the aggregation of their training data. 

Since I started 12 years ago, the log has gone through some serious evolution and I now think it’s ready from prime time.  Here are some major features:

1) All days including leap years for 2008 through 2012 are accounted for
2) Average speed automatically calculated and summed on a daily, monthly and annual basis
3) Space to record and average body weight, average heart rate, maximum heart rate, calories burned, temperature, elevation gain, cadence and time of day
4) Automatic monthly summary of number of rides, time spent on the bike, distance, and average speed
5) GRAPHS!
6) Much, much more

License:  GPL v2 (improvements appreciated!)
Available Formats:
Microsoft Excel 2000/2003/2007
Open Office Calc
Google Docs (recommended so you don’t have to worry about backing up! * Be sure to copy to your own Google account)

cycling_log_screenshot

I’ve put a sample entry in the first row so please be sure to delete that when using.  Any columns and rows can be deleted so enjoy!

Pantech PX-500 EVDO Rev A Card on Linux

Thursday, May 31st, 2007

Yes, you can use that Sprint EVDO Rev A Pantech PX-500 card on Ubuntu!  Network credentials are stored on the card so all we need to do is make sure we have a couple of kernel modules loaded and write two simple scripts to get it all working.  The PX-card has an OHCI compatible USB bridge internally off of which hangs the CDC serial port so it’s pretty easy.

First make sure you’re running a recent kernel by running uname -r and a terminal prompt.

Then, insert the card and let’s make sure you have the necessary kernel modules loaded:

michael@feisty:~$ sudo lsmod | grep cdc

cdc_acm                    15904 0

usbcore                     134280 7 cdc_acm,ohci_hcd,xpad,usbhid,uhci_hcd,echi_hcd

If your output matches the above, you already have the cdc_acm and ohci_hcd kernel modules loaded automatically. 

1) Install the Sprint Connection software on Windows XP or Vista

2) Insert the card, choose yes to update the firmware and activate the card by calling Sprint and providing the necessary information.

3) Reboot into Linux and insert the card into a free PCMCIA slot.  This tutorial will be done on Ubuntu 7.04 Feisty Fawn with kernel 2.6.20-16-generic.  If you use the the 2.6.20 kernel, you won’t have to compile in any additonal modules.

4) We’ve already confirmed that we have the correct kernel modules above so now you’ll need to create two extra files using these steps:

michael@feisty:~$ sudo vi /etc/ppp/peers/Sprint_EVDO

noauth
# Connection Script
connect “/usr/sbin/chat -v -f /etc/ppp/chatscripts/sprint-evdo” 
defaultroute
replacedefaultroute
usepeerdns
/dev/ttyACM0
230400
local
novj

michael@feisty:~$ sudo mkdir /etc/ppp/chatscripts

michael@feisty:~$ cd /etc/ppp/chatscripts

michael@fesity:~$ sudo vi sprint-evdo

TIMEOUT         5
ABORT           ’\nBUSY\r’
ABORT           ’\nERROR\r’
ABORT           ’\nNO ANSWER\r’
ABORT           ’\nNO CARRIER\r’
ABORT           ’\nNO DIALTONE\r’
ABORT           ’\nRINGING\r\n\r\nRINGING\r’
”              \rAT
TIMEOUT         3
OK              ATE0V1&F&D2&C1S0=0
TIMEOUT         3
OK              ATS0=0
TIMEOUT         3
OK              ATDT#777
TIMEOUT         20 
CONNECT         ”"

5) run this command to start the connection:

michael@feisty:~$ /usr/sbin/pppd call Sprint_EVDO updetach

And you’re good to go.  Interestingly, I saw about 25% faster speeds consistently under Linux and XP compared to Vista.  I know the card hasn’t been officially certified under Vista, but it’s not certified on Linux either and 25% is a huge difference.  Test your speed over at Speedtest.net

P.S. You might get different results with another distribution (especially Suse) and kernel but if you are still having problems, drop me a line at mikebuckingham at gmail dot com and I’ll try and help.

Wordpress 2.06 Released

Saturday, January 6th, 2007

wp_logo_new.jpg

Yesterday Wordpress released a significant update to the world’s most popular CMS. Mainly security fixes but also:

1) HTML quicktags now work in Safari browsers.
2) Comments are filtered to prevent long winded ones from hosing up your well crafted blog layout.
3) Compatibility with PHP/FastCGI environments

And while I’m on this subject, you should checkout Nixcraft’s guide to upgrading Wordpress in three simple steps via the command line. I used it to upgrade the three Wordpress installations I manage on this server and was able to do all three in under 6 minutes (the longest thing was tarring up the directories).

Cloning That Perfect Ubuntu Setup

Friday, January 5th, 2007

deb-logo.png

After recently ending my three year love affair with Gentoo, I moved to Ubuntu when I found Mint, an Ubuntu based distribution that comes preloaded with all the codecs necesary to enjoy multimedia as well as some other tweaks. Debian’s dpkg/apt package manager is by far the best in the biz (yes, even better than portage), but I had stayed away from Ubuntu because 1) it’s so popular 2) I hate that damn brown theme and 3) it took me a half day of “apt-get install” -ing just to play a damn mp3 file. I understand why but please don’t drag me down into your ideology war RMS.

With Mint, it’s just install and play! That being said, you’ll still need to install some stuff like smbfs (to mount your NAS smb shares), nmap, sshfs, etc, but once you’ve got it absolutely perfect, you can clone it easily.

While doing some research for this post, I found some crazy ass 50 line awk scrtipts and choked on my Mountain Dew more than once. I’ve got a better method and no, this doesn’t involve the use of dd (which I’m thinking of writing a lengthly post on since I have some time). The idea here is just to export all of the packages I currently have into a text file and then use dpkg to install those on any other debian based machine.

Run this to ask dpkg to export all of your installed packages into a text list:

sudo dpkg --get-selections > installed_packages.txt

On the new machine, copy installed packages.txt to / and use dpkg to import and have apt-get install these packages (after you’ve run apt-get update and apt-get upgrade of course):

sudo dpkg --set-selections < installed_packages.txt

Then do apt-get update and apt-get upgrade and you're done!

(Source: Knoppix Wiki)

SSH Tunnels for Fun And Profit

Thursday, December 28th, 2006

There will come a time where you are at an office or public place that blocks access to certain websites or ports. For example, at my current place of employment, they use a Websense caching proxy to block access to all sorts of sites, mainly webmail. This posed a problem on my first day because I needed some documents sent to me by my consulting firm. But a few minutes later, it wasn’t a problem. This article will show you how to set up a proxy of your own using ssh to get past any firewall out there.

Prerequisites:
1) The Firefox web browser
2) Putty SSH Client (free from http://www.chiark.greenend.org.uk/~sgtatham/putty/)
3) An Open SSH server outside the corporate local area network
4) A connection to the internet

Assumptions:
1) Your company or public hot spot allows outgoing TCP connections on port 22 (likely).

I’m going to assume that you are running an ssh server at home or have access to one with a web hosting account. If not, they are easy to find and obtain or you can e-mail me and I might be able to hook you up.

1. Create a new PuTTY session
Run PuTTY and create a new session in PuTTY to connect to the remote host that is running OpenSSH. Fill in the hostname, the port (usually 22), make sure SSH is checked, give it a session name and hit Save:
ssh1.jpg

2. Configure a secure tunnel
Click on “Tunnels� on the left and set up dynamic fowarding for a local port (e.g. 8080). Under “Add new forwarded port� type in 8080 for the source port, leave the destination blank, and check Auto and Dynamic. Then it the Add button. If you did it correctly, you’ll see D8080 listed in the Forwarded Ports box:
ssh2.jpg

That’s it for tunnels, as there is no need to create more than one. Remember to save your session profile in PuTTY so you don’t have to set up the tunnel next time.

3. Connect to the remote SSH server
Double click on the connection profile and type in your username and password when prompted.

4. Configure Firefox
Go to Tools, Options, General, and then click on Connection Settings. Check Manual Proxy Configuration, leave most of the fields blank, but fill in 127.0.0.1 for the SOCKS v5 host with a port of 8080 (or whatever portyou used in Step 2):
firefox1.jpg

6. There is one little problem with this. Although your communications are completely secure from your machine to the ssh host on the internet, your company or proxy operator will still be able to see the domain names you are visiting. This is because TCP/IP can be forwarded but UDP (what DNS runs on top of) cannot. So DNS lookups will be visible by your network administrator. That may not be a problem but you should be aware of this. But if are running the current version of Firefox and would like to protect that information, you can open the about:config page, and change network.proxy.socks_remote_dns to true.
firefox2.jpg

7. Enjoy! Though your communications are completely secure, please use responsibly. Don’t look at stuff you know you shouldn’t be looking at while on the job. I mainly use it to secure my connections to my bank (yes, your company can easily find out your bank passwords and information) and webmail but sparingly.

To prove that the your proxy is working, use ipchicken.com before and after:

Before:
ip1.jpg

And after with my new ssh tunnel:
ip2.jpg

Pretty cool huh? Traffic is totally encrypted end to end! This can also be accomplished with Linux and Mac OS X but I’m guessing that most of you are using Windows. This technique can also be used to secure your connection at a public wi-fi Hotspot like T-Mobile/Starbucks or hotels.

  • Blogroll
  • Cycling Links
  • Pages
  • Tags
  • Spam Blocked