Monday, August 30, 2010

The bigger they are...

Well I had my first experience falling over because my feet were attached to my pedals... Actually just one foot was clipped in but it was the important foot. The new bike has pedals with clips and the guy I bought the bike from had a used pair of bike shoes that fit me so I have been using them and I really like using clips as opposed to not. For you non-bikers, The clips help with efficiency when riding as your feet stay in place plus you can actually use the upward motion as well as the downward motion of your feet to increase your speed, HOWEVER when you come to a stop you have to think ahead and remember to swivel your heel to unclip the shoe from the pedal. If you don't, then when your forward motions stops, the sideways motion starts pretty much immediately.

In my own defense I had gotten into the habit of unclipping only my right foot and leaning right when I stop and it has been working just fine until this morning when I lost my balance and leaned left instead. It probably looked rather like this:



...Well with the exception that I fell the other way and there was no smoke. I am only glad that it was 5:30 AM and nobody was around to see me (that I know of). So a skinned knee and slightly damaged pride aside it was a good ride.

Friday, August 27, 2010

So I am riding again...

Added a new widget to the right side with my daily cycling mileage. At the end of October some friends are going to be riding a section of the Katie Trail so I'm trying to get ready for that. I bought a mountain bike and I'm going to pretty much train exclusively with that since I won't be taking the Fuji road bike on the trip. The new bike (GT XCR 4000) has full suspension which takes some getting used to when you are only familiar with a road bike and basically zero suspension. So hopefully the widget won't get too far out of date, even though I'm sure I will stop riding during the colder months.

Monday, August 23, 2010

My bat file grows apace...

I keep making this easier and easier for the tech support guys to use. It is mildly gratifying.

Things the bat now does…

- Creates a temp file with all of the new MAC addresses added during that session (this file opens at the end when you are ready to document the new MACs in the Excel spread sheet… this helps save you from having to retype the MACs especially if you were adding them from a hand written note)

- Displays a cool blinking warning if you try to run the ‘app’ (I know, I am stretching there) while another admin is using it. This is because when you run the bat, a temp file is created and the bat checks for the existence of this file before allowing you to proceed. It’s to avoid more than one person editing the MAClist at a time to avoid duplicate entries. The last thing the bat does is delete this file before exiting.

- Error checking. Macs entered must now be no more or less than 12 characters long but before the counting happens, spaces and hyphens are removed. MACs can only use numbers and or letters A-F.


Old features

- Add new Macs one at a time to the existing MAClist text file

- Menu for controlling the DHCP service remotely via the ‘sc’ (service control) DOS command. Start, Stop and Query are available.

- Opens Excel spread sheet at the end so you can document newly added MAC addresses (user name, computer name, MAC and if applicable, expiration date).

If you are a nerd and actually care about this stuff, see below...





@echo off

:: This checks for the existence of the 'inuse' file which is created when someone is using
:: the maclist control app.  If the file exists it sends you to a message saying to try again later.

if exist \\lchqfp01\dhcp$\inuse.txt goto blink else goto prerun


:: This creates a temporary 'in-use' file to help avoid the problem with multiple admins using this
:: utility at the same time and potentially causing overwrites or redundant entries in the Maclist.

:prerun

echo This application is in use by another administrator (%username%).>>\\lchqfp01\dhcp$\inuse.txt


:: Creates a temp directory to hold temp txt file containing all macs entered in this session.  This
:: text file opens at the end so you can copy/paste into the XLS file.

md c:\temp007
del c:\temp007 /Q
echo Please copy these macs to the clipboard.  When you close this text file the Excel Spreadsheet will open and you can paste them in:>>c:\temp007\macs.txt
echo.>>C:\temp007\macs.txt


:: I got the 'convert case' parts from this website --
:: http://www.robvanderwoude.com/battech_convertcase.php which says to use the SETLOCAL
:: ENABLEDELAYEDEXPANSION command. Dunno what it does precisely besides making my code work.

:top

SETLOCAL ENABLEDELAYEDEXPANSION
cls
echo.
echo.
echo MACLIST MANAGEMENT CONSOLE
echo ==========================
echo.


:: Here is where the user enters a MAC address... the 'LoCase' routine will change
:: uppercase to lowercase and remove spaces and hyphens since neither are permitted
:: in the MAC list.  It sets the variable 'mac' as whatever the user inputs, then the
:: variable is put through the subroutine and finally the end result is added to an
:: existing text file called 'maclist.txt'.

:choice1
echo Capital letters will be converted to lowercase
echo     and spaces and hyphens will be removed
echo.
SET /p mac=[Enter a MAC address]?
CALL :LoCase mac


:: Ensures that the input does not exceed or come short of exactly 12 characters
  set Namecheck=%mac:~0,11%
  if "%NameCheck%"=="%mac%" (
    echo. ERROR: A MAC address cannot be less than 12 chars
    pause
   goto :top
  )
  set Namecheck2=%mac:~0,12%
  if not "%NameCheck2%"=="%mac%" (
    echo. ERROR: A MAC address cannot be more than 12 chars
    pause
   goto :top
  )


:: Ensures that the MAC address only uses hexadecimal notation (letters g-z not allowed)

echo %mac% | findstr /R /C:[g-z]>nul
if errorlevel 1 goto :check
if not errorlevel 1 echo.ERROR: Hexadecimal notation only uses numbers and A-F.
pause
goto:top


::This section does a find command on the maclist text file and if the entered MAC already is on the list
::an error message is given and they are taken back to the add mac section.

:check
find /I "%mac%" \\lchqcdc01\system32$\MAClist.txt
IF NOT errorlevel 1 goto redundant
IF errorlevel 1 goto :ADD

:redundant
cls
echo.
echo This mac is already in the list.  Would you like to:
echo.
echo 1. Add a different MAC
echo 2. Copy maclist and continue
echo 3. Exit this utility now
echo.
echo **Only use option 3 if you have NOT entered any MACs successfully
echo   and you are finished with the utility.
echo.
:choice3
set /P C1=[1,2,3]?
if "%C1%"=="1" goto top
if "%C1%"=="2" goto copy
if "%C1%"=="3" goto exitnow
goto choice3


::Appends the entered MAC address to a file on the network.

:ADD
echo %mac%>>\\lchqcdc01\system32$\MAClist.txt
echo %mac%>>c:\temp007\macs.txt
ENDLOCAL
GOTO:NEXT

:: Subroutine to convert a variable VALUE to all lower case and remove spaces and hyphens.
:: The argument for this subroutine is the variable NAME.
:: Only A-F are included as hexadecimal doesn't use the rest of the alphabet.

:LoCase

SET %~1=!%1:A=a!
SET %~1=!%1:B=b!
SET %~1=!%1:C=c!
SET %~1=!%1:D=d!
SET %~1=!%1:E=e!
SET %~1=!%1:F=f!
SET %~1=!%1: =!
SET %~1=!%1:-=!
GOTO:EOF

:NEXT
cls
echo MAC has been added...
echo.
echo 1. Add another MAC
echo 2. Copy maclist and continue
echo.

:choice2
set /P C1=[1,2]?
if "%C1%"=="1" goto top
if "%C1%"=="2" goto copy
goto choice2


::Copies the newly edited MAClist from the primary to the secondary DHCP server

:copy
echo Copying newly edited MAClist from LCHQCDC01 to LCHQCDC02...
copy \\lchqcdc01\system32$\MAClist.txt \\lchqcdc02\calloutdll$\MAClist.txt /y
pause
color 0E
goto menu


:: This menu allows users to issues service control commands to two DHCP servers.
:: The MACfilter list is not reapplied until the DHCP services have been restarted.

:menu
cls
echo.
echo Please choose from the following menu
echo =========================================
echo.
echo 1. Stop DHCP service on both corporate DCs
echo.
echo 2. Start DHCP service on both corporate DCs
echo.
echo 3. Query DHCP server status on both corporate DCs
echo.
echo 4. Open Excel spreadsheet and Quit
echo.

:choice3
set /P C=[1,2,3,4]?
if "%C%"=="4" goto quit
if "%C%"=="3" goto query
if "%C%"=="2" goto start
if "%C%"=="1" goto stop
goto choice3

:stop
cls
sc \\lchqcdc02 stop DHCPserver
sc \\lchqcdc01 stop DHCPserver
pause
goto menu

:start
cls
sc \\lchqcdc02 start DHCPserver
sc \\lchqcdc01 start DHCPserver
pause
goto menu

:query
cls
sc \\lchqcdc02 query DHCPserver
sc \\lchqcdc01 query DHCPserver
pause
goto menu


:: This last step opens an Excel spreadsheet where we manually document new MAC addresses
:: which have been added to the MAC filter list.

:quit
"c:\temp007\macs.txt"
"\\lchqfp01\DHCP$\MAC-HOST-USER list.xlsx"

:exitnow
del \\lchqfp01\dhcp$\inuse.txt /Q
exit

:blink
cls
echo.
echo.
color 47
echo                    ------------------------------
echo                    i ++++++++++++++++++++++++++ i
echo                    i +                        + i  
echo                    i +        WARNING!!!      + i
echo                    i +                        + i
echo                    i +  The DHCP control app  + i
echo                    i +  is in use by another  + i
echo                    i +     administrator.     + i
echo                    i +                        + i
echo                    i +    Please try again    + i
echo                    i +         later.         + i
echo                    i +                        + i
echo                    i ++++++++++++++++++++++++++ i
echo                    ------------------------------
echo.
\\lchqfp01\dhcp$\sleep -m 800
cls
color 07
echo.
echo.
echo                    ------------------------------
echo                    i ++++++++++++++++++++++++++ i
echo                    i +                        + i  
echo                    i +                        + i
echo                    i +                        + i
echo                    i +  The DHCP control app  + i
echo                    i +  is in use by another  + i
echo                    i +     administrator.     + i
echo                    i +                        + i
echo                    i +    Please try again    + i
echo                    i +         later.         + i
echo                    i +                        + i
echo                    i ++++++++++++++++++++++++++ i
echo                    ------------------------------
echo.
\\lchqfp01\dhcp$\sleep -m 800
cls
goto blink


Saturday, August 14, 2010

What have I done!!!!????

hy·brid (hbrd)
n.
1. Genetics - The offspring of genetically dissimilar parents or stock, especially the offspring produced by breeding plants or animals of different varieties, species, or races.
2.
a. Something of mixed origin or composition, such as a word whose elements are derived from different languages.
b. Something having two kinds of components that produce the same or similar results, such as a vehicle powered by both an electric motor and an internal combustion engine as sources of power for the drive train.





Some hybrids exist...





Some do not...







Let me tell you a brief tale...


I called my dad yesterday to tell him Happy Birthday (yes his Birthday is on Friday the 13th as is my own every few years). I am not a supersticious person but on occassion I do have the odd unlucky Friday the 13th. This could be said to be one of those although technically only the bad news came to me on that day.

Well I say 'bad news' but really it was only an odd little thing Dad mentioned to me. I was catching him up on life at my house... kids, wife, work, whatnot... and we come to my garden which he was interested in as he has been a gardener for a few decades. I tell him of the plentious cucumber crop and how the tomatoes look to be quite numerous if they mature before the growing season ends. The corn I said was dissapointing because we harvested a bit too late and it was sort of chewy and not as sweet as it would have been had I been more on the ball (and better educated on the subject). Then I come to the melons...

The watermelons are doing quite well AS are the canteloupe I say to him... then there is a slight pause and he asks me a question.

"How close are your canteloupe to your cucumbers?" Odd question I though to myself. I mean why would it matter? I know that they both attract cucumber beetles... in fact any vegetable that produces yellow flowers will attract the little buggers and those both in fact do produce similar yellow flowers... I ask "is it because of cucumber beetles? Because I've not had that big of a problem with them."

"No, no its just something I heard once from a fellow gardener."

"What is that?" I ask.

"Well," he goes on, "my friend told me once that if your cucumbers and canteloupe are close to each other then cross-pollination can occur and produce cucumber flavored canteloupe."

ABSURD! Who ever heard of such crazy talk? Well I mean aside from my Dad... and the fellow that told this to him. But then why would somebody make such a thing up? It still sounded just very strange to me. Today I decided to investigate because I had mentioned to DeAnna that the canteloupe WERE sort of growing elongated rather than round like the watermelons... also they were a darker green than I imagined they would be.

What I discovered was... well, please do not scroll down if you have a weak stomach. These images may be disturbing... ... ...









BEHOLD!!! ... ... ... ...








THE.... ... ...









CUCUMBELOUPE!!!!!!!!!!!!!!!!











Oh to all my friends and family... I'll be distributing lots of canteloupe this year I think because we look like we're gonna have a bumper crop and well, I just don't think we'll be able to eat it all.

Tuesday, August 10, 2010

The absolute furthest extent of my 'coding' skillz...

@echo off
:top
cls
echo.
echo.
echo MACLIST MANAGEMENT CONSOLE
echo ==========================
echo.
:choice1
set /p mac=[Enter a 12 character hexadecimal MAC with NO capital letters]?
echo %mac%>>\\lchqcdc01\system32$\MAClist.txt
cls
echo MAC has been added...
echo.
echo 1. Add another MAC
echo 2. Copy maclist and continue
echo.
:choice2
set /P C1=[1,2]?
if "%C1%"=="1" goto top
if "%C1%"=="2" goto copy
goto choice2
:copy
echo Copying newly edited MAClist from LCHQCDC01 to LCHQCDC02...
copy \\lchqcdc01\system32$\MAClist.txt \\lchqcdc02\calloutdll$\MAClist.txt /y
pause
color 0E
goto menu
:menu
cls
echo.
echo Please choose from the following menu
echo =========================================
echo.
echo 1. Stop DHCP service on both corporate DCs
echo.
echo 2. Start DHCP service on both corporate DCs
echo.
echo 3. Query DHCP server status on both corporate DCs
echo.
echo 4. Open Excel spreadsheet and Quit
echo.

:choice3
set /P C=[1,2,3,4]?
if "%C%"=="4" goto quit
if "%C%"=="3" goto query
if "%C%"=="2" goto start
if "%C%"=="1" goto stop
goto choice3

:stop
cls
sc \\lchqcdc02 stop DHCPserver
sc \\lchqcdc01 stop DHCPserver
pause
goto menu

:start
cls
sc \\lchqcdc02 start DHCPserver
sc \\lchqcdc01 start DHCPserver
pause
goto menu

:query
cls
sc \\lchqcdc02 query DHCPserver
sc \\lchqcdc01 query DHCPserver
pause
goto menu

:quit
"G:\Common\Technical Documentation\Network Administration\DHCP\MAC-HOST-USER list.xlsx"
exit
:end