KyleMacLean.comKyleMacLean.com

March 6, 2004

Using a USB Memory Key

Posted at 3:14 PM in FreeBSD Manual.

FreeBSD is a weird OS, I'll give you that. I still can't get my Nvidia TNT2 video card working, but my Lexar Jumpdrive is working fine. I came across this script on the net and modified it to mnt the USB memory key to the /mnt/lexar directory.

#!/usr/bin/perl -w

use strict;

# If no arguments are given, print a brief help message
if (!defined($ARGV[0]))
{
print "\n";
print "Help:\n";
print "Lexar Jumpdrive mounting script\n";
print "\n";
print "You must provide one of the following arguments:\n";
print "m Mounts the Jumpdrive.\n";
print "u UnMounts the Jumpdrive.\n";
print "\n";
print "Example: lexar m\n";
print "\n";
}

# m mounts the jumpdrive
elsif ($ARGV[0] eq "m")
{
# mounting the jumpdrive at /mnt/lexar
# this can be set to whatever you like
system "/sbin/mount -t msdos /dev/da0s1 /mnt/lexar";
print "Jumpdrive mounted at /mnt/lexar.\n";
}

elsif ($ARGV[0] eq "u")
{
# umounts the jumpdrive
system "/sbin/umount /mnt/lexar";
print "Jumpdrive unmounted.\n";
}

This does a great job of mounting the drive. Adding:

alias lexar perl /usr/local/scripts/lexar
(alter this to point to whatever path your scripts are at) to your .cshrc file will allow for quick and easy access to your Lexar Jump Drive in FreeBSD.


January 26, 2004

Adding an IP Checker

Posted at 8:12 PM in FreeBSD Manual.

After a few hours of playing around, I finally have a DynDNS compatible IP checker up and running. This means I can log in to my FreeBSD box via ssh/sftp from anywhere with a net connection regardless of whatever crappy ip Bell Sympatico assigns me.

Basically the steps involved were:
1. Download nifty python script.
2. Ensure that python was running on my system with "pkg_info" - it was
3. Edit ls_dyndns.py in the following manner: change top line to indicate my local python path; change variables to specific settings for my router/DynDNS account.
4. Edit /etc/crontab by adding the following line:
paths= (include link to local python path, in my case /usr/local/bin)

#ipchecker for dyndns.org
01 * * * * root python /usr/local/ls_dyndns.py
This will run the script once an hour and update my router's IP with DynDNS only if necessary.

Phew! N00b help was found here.


Style select: Green Blue

  • Resources
  • About
  • Resume
  • RSS FeedFeed
  • XHTML 1.0
  • CSS
  • Creative Commons License
  • Site Search: