Jameser's Tech Tips

Sunday, July 30, 2006

Tip #31: Simple Portable SFTP Server for Windows XP

Today's tip is on providing a small, portable SFTP server for Windows XP for SSH encrypted file transfers... While there are ports of OpenSSH available for Windows machines, we'll be taking a look at a tiny, single executable, SFTP server for Windows...

The utility we'll be using is called the Mini SFTP Server from CoreFTP, and it's provided free of charge from the developers of the CoreFTP FTP Client and Server... The single executable format makes it ideal for carrying around on your USB flash drive...

The Mini SFTP Server can be downloaded from here... There is no install process, just launch the msftpsrvr.exe executable after you have completed downloading it...

After you have launched the msftpsrvr.exe application, you can configure a single User ID / Password combination, the port number on which the server will run, and the directory which will serve as the root path for the server... After you have adjusted the settings to your needs, simply click on the Start button to start the server... If you are behind a router, you will need enable port forwarding to your machine using the port you specified in the configuration...

To connect to your SFTP server, remote users can use a SFTP client application of their choice, including pscp from the PuTTY developers, as well as WinSCP...


After you have run the application once, it stores the values you've supplied into the registry for future use... The registry keys can be deleted if you'd like (HKCU/Software/FTPWare), or you can simply clear the fields of the application prior to exiting the program to clear the registry entries...

To start the server process immediately upon launch (using the values previously stored in the registry), you can add the -start switch to the shortcut or from the command line, (i.e. msftpsrvr.exe -start)...

If you have any questions, please leave a comment...

Friday, July 28, 2006

Tip #30: Creating 3GP Video for Mobile Phones with Free Tools

Today's tip is on creating high quality 3GP files for playback on newer mobile phones... Using free tools compiled for Windows, we will convert DVDs or existing AVI files using two-pass encoding for optimum results...

The free tools we'll be using to convert the video will be mencoder and mplayer from the MPlayer project, FAAC, as well as MPEG4 Tools from the MPEG4IP group... While there are point-and-click applications available for video conversion, I think you'll find that the approach below provides better results and smaller file sizes...

The examples assume you are converting from a DVD... If you are converting an AVI or MPG file, replace "-dvd-device e:\video_ts dvd://1 -aid 128" with the name of your video file...

(NOTE: The following commands should be entered on a single line, even though they may appear multiline on this page...)

Using mencoder, start the first pass of video encoding:

mencoder -dvd-device e:\video_ts dvd://1 -aid 128 -nosound -ovc lavc -lavcopts
vcodec=mpeg4:vbitrate=300:v4mv:mbd=2:trell:cmp=10:
subcmp=10:mbcmp=10:autoaspect:vpass=1 -ofps 14.985 -vf scale=320:240 -ffourcc DIVX -o c:\path\out.avi


Next, complete the second pass of video encoding:

mencoder -dvd-device e:\video_ts dvd://1 -aid 128 -nosound -ovc lavc -lavcopts
vcodec=mpeg4:vbitrate=300:v4mv:mbd=2:trell:cmp=10:
subcmp=10:mbcmp=10:autoaspect:vpass=2 -ofps 14.985 -vf scale=320:240 -ffourcc DIVX -o c:\path\out.avi


Next, we'll need to strip the audio from the source using the following command... This will consume a lot of disk space, so be certain to have a gigabyte or so available before continuing...

mplayer -dvd-device e:\video_ts dvd://1 -aid 128 -vo null -ao pcm:file=out.wav -af resample=16000,volume=3

Now, we'll need to encode the audio we just extracted into AAC format using faac:

faac -b 64 f4.wav -o f4.aac

Finally, we'll use mp4creator to combine our AVI and AAC files into our final 3GP using the following commands:

mp4creator -allow-avi-files -force3GPCompliance -create=ourfile.avi out.3gp

mp4creator -aac-profile=4 -interleave -force3GPCompliance -create=ourfile.aac out.3gp

mp4creator -optimize out.3gp

The resulting 3GP file should be playable on any device which supports 3GP files, and can also be played in quicktime... Change the vbitrate= in the video encoding commands if you'd like a smaller or larger file...

If you have any questions please leave a comment...

Wednesday, July 26, 2006

Tip #29: Stateful Packet Filter Firewall for Windows

Today's tip is on replacing the Windows firewall with a kernel mode, packet-filtering firewall... The firewall we'll be using is called WIPFW, and is a Win32 port of FreeBSD's formidable IPFW firewall...

WIPFW will allow us to create detailed firewall rules which determine whether packets are dropped or accepted, as well as optionally logged... These rules can be applied manually while the firewall is running, or configured in the application's configuration file... We'll take a look at both approaches in a moment...

While WIPFW has almost all of FreeBSD's IPFW functionality, it cannot perform traffic shaping or packet redirection yet... It does provide stateful inspection however, and will create dynamic rules on the fly to allow packets through where the original rule specified to "keep state" or "limit"...

WIPFW may not be for everyone due to its rather complicated configuration, but when properly setup can provide a very secure host... The default wipfw.conf provides a basic stateful-inspection firewall configuration, and will log dropped packets which helps troubleshooting which ports you need to open... The generated log files are stored in C:\Windows\security\logs...

To install WIPFW, first download the stable zip from here, and extract to a location where you'd like to permanently keep the configuration and utility files... We'll use C:\Wipfw for the sake of this demonstration...

If you are installing on a remote host, it is important to modify the wipfw.conf prior to installation to allow remote access, otherwise you'll end up needing console access to correct it... It is probably best to configure and explore on a local machine, to ensure the rules are correct before you implement it remotely...

After you've unzipped the files, and modified wipfw.conf if necessary, you can install the service by opening a command prompt, changing to your installation directory, and typing install.cmd... This will install and start the service using the configuration supplied in the C:\Wipfw\wipfw.conf file...

To add temporary rules on the fly, use the ipfw add command from the command line, passing the action, protocol, source address, optional port, direction, destination port, optional port, and any options... The keywords "any" and "me" can be used to simplify making rules... For example to block access to your machine from a malicious IP address, you could add the following rule:

ipfw add deny ip from 86.7.5.309 to me

Or to allow access to your HTTP port from a particular subnet, you could use:

ipfw add allow tcp from 192.168.0.0/24 to me 80

To make any of these rules permanent, simply add the rule to your wipfw.conf file with a rule number and they will take effect at the next reboot... You can also force the loading of the new configuration by launching config.cmd from the C:\Wipfw directory...

For additional information on configuration, you can refer to the documentation, or better yet consult the FreeBSD docs on IPFW configuration...

Please leave a comment if you have any questions... Check back tomorrow for new tips...

Tuesday, July 25, 2006

Tip #28: XP System Information at a Glance

Today's tip is on adding simple "widgets" to your Windows XP desktop to provide easily accessible information about your system...

Using a free and customizable utility called Rainmeter, we will be able to display current system statistics directly on the desktop... The Rainmeter System Information widget displays current CPU, physical memory, virtual memory, and hard drive usage, as well as current network bandwidth utilization... Rainmeter is also skinnable and provides other widgets for current weather information, news feeds, and other information...

Rainmeter can be downloaded from here, and additional themes can be obtained here...

The screenshot below shows Rainmeter running using the "Lucid Smoked" theme:


If you have any questions, please leave a comment... Check back tomorrow for new tips...

Monday, July 24, 2006

Tip #27: Automating Linux Admin From Windows Over SSH

Today's tip is on performing and automating simple Linux administration tasks from a Windows workstation over SSH... Creating backups, restarting services, rebooting machines, and basically any other simple administrative task can be accomplished securely from the command line in Windows, or from a desktop shortcut...

To accomplish these tasks, we'll be using plink which is a free command line SSH client from the developers of PuTTY... plink allows you to create SSH connections from the command line, very similar to the way you would use the ssh client on a Linux machine... This means that we can use plink from within batch files, as well as pipe and redirect data to and from remote connections...

plink can be downloaded from here...

After you have downloaded and placed plink in your path, you are ready to start creating shortcuts to some simple routine Linux administration tasks... The examples below are just a few of the possibilities, so please drop a comment is you have ideas for additional examples...

Before proceeding with any of the examples, you should probably connect to the server using plink once to add the server to the key cache and also to ensure that you can actually connect to the box... Open a command prompt and type the following, replacing with your user and hostname information...

plink user@host

The first example will be to create and transfer a zipped tarball of a directory on a remote server... This example could also be placed into a batch file to be run as a nightly backup scheduled task... The command is as follows:

plink -pw password user@host "tar czf - /dir_to_be_backed_up" > filename.tar.gz

This command connects to the remote machine, creates a zipped tarball of a directory, and outputs it to STDOUT... In our case the STDOUT is being redirected to a local file named filename.tar.gz... This connection will not prompt for the password as it is being supplied in the plink parameters...

The next command will restart a service on the remote server... We will not include the password in this command, as the root user is most likely required for the service restart... This example assumes you have a Red Hat based distribution, so you'll need to modify to suit your particular server... When the command is run, it will prompt you for your password...

plink user@host "/etc/rc.d/init.d/service_name restart"

The last command will simply restart the server, and will also require that a password be entered:

plink user@host "shutdown -r now"

Any of the above listed commands can be created as a shortcut on your desktop for easy access...


If you have any questions on today's tip, please leave a comment... Check back tomorrow for new tips...

Sunday, July 23, 2006

Tip #26: Advanced Windows XP Transparency Techniques

Today's tip is on applying transparency settings to windows in Windows XP at application launch... We have previously taken a look at a method to apply a transparency effect to running applications, but today's tip will allow you to configure shortcuts with the desired transparency level...

We'll be using a utility called AutoHotKey, which is an amazing tool for automating Windows processes and creating useful Windows-centric scripts... I won't get into the details of the many facets of this program, but if you install it for the purposes of this tip, I'd recommend spending a while checking out the help file to discover what it is capable of...

AutoHotKey can be downloaded from here...

After you have downloaded and installed AutoHotKey, you can create simple scripts and save them as .AHK files, which will be processed by AutoHotKey when launched... The small script below will allow you to open Notepad (or any other program) with a transparency level of approximately 75% (192/255)...

;Hides the AutoHotKey System Tray Icon When Launched
#NoTrayIcon
;Run the Application, Don't Display Yet, and Assign PID to "ThePid"
Run Notepad.exe,,Hide,ThePid
;Allow WinWait to Detect Hidden Windows
DetectHiddenWindows, On
;Wait for the Application to Become Active
WinWait ahk_pid %ThePid%
;Set the Transparency to ~75% (192/255)
WinSet, Transparent, 192
;Show the Window Now
WinShow
;Make the Application the Active Window
WinActivate

The comments in the script should explain the purpose of each line... After you have created and saved the AHK file to your desktop, you can double-click the icon to launch the application with the transparency effects applied... You can also change the icon to the source application by selecting the shortcut's Properties and clicking on Change Icon...


Another effect I've found to be quite cool is to apply the transparency incrementally, so the application appears to fade in from invisible to fully opaque... The script below demonstrates this technique:

;Hides the AutoHotKey System Tray Icon When Launched
#NoTrayIcon
;Run the Application, Don't Display Yet, and Assign PID to "ThePid"
Run Notepad.exe,,Hide,ThePid
;Allow WinWait to Detect Hidden Windows
DetectHiddenWindows, On
;Wait for the Application to Become Active
WinWait ahk_pid %ThePid%
;Set the Transparency to ~75% (192/255)
WinSet, Transparent, 0
;Show the Window Now
WinShow
;Make the Application the Active Window
WinActivate
;Loop Up To 255 (Full Opacity) For A Cool Effect
Loop, 255 {
WinSet, Transparent, %A_index%
}


By looping through the transparency levels, we can achieve a nice fade-in effect, which should take around 1 second with a fast PC...

If you have any questions on today's tip, please leave a comment... Check back tomorrow for all new tips...

Tip #25: Mouse Gestures for All Windows Applications...

Today's tip is on adding the ability to use mouse gestures in any Windows application... If you're not familiar with mouse gestures, they are a method of controlling an application using simple gestures drawn with your mouse... Once you have been exposed to and get used to using them, it can be difficult to live without them...

If you've used mouse gestures in Firefox for any period of time, you've probably experienced a time where you inadvertently attempted a gesture in another application, and wished it worked everywhere... Fortunately for us mouse gesture addicts, there is a free utility which allows you to use mouse gestures from within any application...


The application we'll be using to provide system-wide mouse gestures is called StrokeIt... This unfortunately named utility provides global gestures accessible to any Windows application, as well as the ability to create custom gestures for specific applications... There are several predefined gestures and applications installed by default which may be modified or deleted...

StrokeIt can be downloaded from here...

After you have downloaded and installed StrokeIt, you'll probably want to make some adjustments to suit your needs... Clicking once on the StrokeIt system tray icon will bring up the Command Editor dialog, which will allow you add or modify programs... You can also adjust overall preferences by selecting Edit/Preferences from the Command Editor menu... One option I would suggest is to check the "Only enable StrokeIt in configured applications" and then manually add any applications that are not included by default... The StrokeIt forums are a good resource for help configuring applications and troubleshooting problems...



Please leave a comment if you have any questions, and check back tomorrow for new tips...

Friday, July 21, 2006

Tip #24: Extending Windows Clipboard Functionality

Today's tip is on extending the clipboard functions in Windows XP / 2000, allowing you to retain multiple items on the clipboard for future access...

Windows only allows you to capture a single instance to the clipboard, so we'll have to use a third-party application to accomplish copying multiple items... The application we'll be using to accomplish this is called Ditto... Ditto is a free extension to the Windows clipboard which allows you to store and access multiple clipboard items... Items copied to this clipboard are persistent and searchable, so copied items will be available after a reboot... Images copied to the clipboard will display a thumbnail of the image in the selection list...

The latest version of Ditto can be downloaded from here...

After you have installed Ditto and copied a few items to the clipboard, you can launch the "Quick Paste" list by pressing Ctrl+`... This keyboard combination can be modified in the program's options, so if Ctrl+Shift+V or another combination feels more comfortable to you, you are free to change it... With the "Quick Paste" list displayed, simply double-click on the desired item to paste it into your application... Items can be individually deleted, or if you want to delete all items in the list, you can select all items with a Ctrl+A then press Delete...


There are many more settings to explore in the Options panel, so experiment to see which available options can be modified to suit your needs...


Please leave a comment if you have any questions, and check back tomorrow for new tips...

Thursday, July 20, 2006

Tip #23: Secure Backups Over an Insecure Protocol

Today's tip is closely related to yesterday's tip on context menus, as well as the tips on Encryption and Using Curl for file transfers... What we'll be doing is combining these elements to create an extremely easy-to-use and secure method to backup important files with two clicks via a context menu...

We'll be creating a very simple batch file to perform each of the three steps involved in this process... First we'll encrypt the contents of the file, then transfer the file to an FTP server, and finally delete our local copy of the encrypted file, while leaving the original file intact... After we've created our batch file, then we'll configure Windows Explorer to provide a "Secure Backup" function via a context menu... I'll be assuming that you already have AxCrypt and curl already installed...

The batch file looks like this:

@echo off
set ftp_server=ftp://yourserver.com
set ftp_user=youruserid
set ftp_pass=yourFTPpassword
set ax_key="Top Secret Encryption Passphrase - Keep the Quotes!"

echo Processing %1...
echo Encrypting %1...
"%ProgramFiles%\Axon Data\AxCrypt\1.6.3\AxCrypt" -b 2 -c -e -k %ax_key% -n %1.axx -z %1
echo Transferring %1...
"curl" -T %1.axx -u %ftp_user%:%ftp_pass% %ftp_server%
echo Removing Local %1.axx...
del %1.axx
echo Finished...


Copy the above text into notepad and save it as securetransfer.cmd... For the sake of this demonstration, I'll assume you're placing it in "C:\Windows"...

You will need to modify the "set" variables at the top of the file to reflect your server, FTP user id, FTP password, and a decent passphrase for your encryption... Also if your AxCrypt was not installed to the default location, or curl is not in your PATH, you'll need to modify those lines as well...

Now that you've modified the batch file with your settings, let's put it into action... For detailed instructions on creating a context menu item for all files, please check yesterday's tip as I won't go into detail again in this tip... But, to summarize:

1. Open regedit (Start/Run/regedit)
2. Navigate to HKEY_CLASSES_ROOT/*/shell
(not shellex... If you don't have this key, read this...)
3. Right-click on shell and select New/Key...
(We'll call it securebackup)
4. Single-click on your new key, securebackup, then double-click the (Default) in the right pane... In the Value Data field, enter "Secure Backup"... This is the text that will appear in our context menu...
5. Right-click on securebackup and select New/Key... You must call this one Command...
6. Single-click on Command, then double-click the (Default) in the right pane... In the Value Data field, enter -> C:\Windows\securetransfer.cmd "%1"
Don't forget the quotes around the %1, or filenames with spaces in them will not work correctly...

Now, if you close regedit and open Windows Explorer, you should have a new context menu item , "Secure Backup", for all file types... Right-click on any file to ensure that the menu item is available... If the values in your batch file are correct, as well as the paths to AxCrypt and curl, your files should be encrypted and subsequently transferred to your FTP server when this context menu item is selected... This also works if you select multiple files by Control or Shift clicking items... These files can be downloaded from your FTP server at a later time and decrypted with AxCrypt using the passphrase you supplied in the batch file...


If you have any questions, or any ideas for improvement, please leave a comment... Check back tomorrow for all new tips...

Wednesday, July 19, 2006

Tip #22: Creating Context Menus for Explorer in Windows XP

Today's tip is on creating context menus for all file types in Windows Explorer... This will allow you to run any program on your PC against the file or files you have selected in Explorer... The example we'll be using today will use Notepad as the target application, but you can use any application you choose... Tomorrow's tip will apply these context menus towards a more practical purpose...

Open regedit(Start/Run/regedit)... If you haven't backed up your registry in a while, you should probably do that now... To back up your registry, simply select File/Export from the menu bar... Make certain that the "Export Range" at the bottom of the Export Registry File window is checked on "All", then select a filename to save your registry to... A good choice is the date you're backing it up, (i.e. 2006-06-29.reg)...


Now that we've backed up our registry, we'll need to expand HKEY_CLASSES_ROOT... We're looking for the folder labeled "*", which should be the first subfolder listed... The "*" is a wildcard that matches all file extensions... Click the "plus" next to the "*" folder to expand it... If you see a subfolder under "*" labeled shell, not shellex but shell, you can skip to the next paragraph... If you don't have the shell key, we'll create it now by right-clicking on the "*" folder and selecting New/Key from the menu... Name the new key shell...


Now, with our new shell key, we'll need to add another key for our context menu... Right-click on the shell folder, and select New/Key... Give this key a meaningful name for our context menu, such as opennotepad...


Next, single click on opennotepad (or whatever you named this key)... In the right-hand pane, you should see the default string labeled (Default)... Double-click on this (Default) string... In the Edit String dialog, give the title for this context menu as you'd like it to appear when a file is right-clicked... I'll use "Open With Notepad"...


Now, we need to let the system know what program we'd like to execute when our context menu is selected... Right-click on your "opennotepad" subkey, and select New/Key... Name this new key Command...


Now single-click on the new Command subkey so that it is highlighted... Then double-click on the (Default) string in the right hand pane... In the Value data field, enter the name of the command you'd like to run when this item is selected from your context menu... We'll use notepad.exe %1... The %1 is the filename of the file you're right-clicking on in Explorer...


Finally, test your new context menu by right-clicking on any file in Windows Explorer... You should now have a context menu item entitled "Open With Notepad" (or whatever you named yours) and it will launch the file in Notepad if selected...


Please leave a comment if you have any questions, and check back tomorrow for all new tips...

Tuesday, July 18, 2006

Tip #21: Customizable Command Prompt for Windows XP

Today's tip is on replacing the Command Prompt in Windows XP / 2000 with a new and sleeker alternative... We'll be checking out Console 2.0, a free Command Prompt replacement from Marko Bozikovic...

Console 2.0 is essentially a customizable Command Prompt, which allows you to tweak just about every aspect of the application... Fonts, colors, cursors, and backgrounds can all be changed to suit your taste... Other features you'll find useful as well are tabs, adjustable transparency, simple copy and paste, and the ability to add other shells such as bash or plink(PuTTY)...

Console 2.0 can be downloaded from here...

A screenshot of Console 2.0 is shown below:


If you have Cygwin installed on your machine, you can add the ability to open a bash prompt from within Console 2.0... Select Edit/Settings from the menu, and select Tabs from the left-hand column... From here, you'll be able to add new shell configurations for opening in tabs... Click on the Add button, then change the Title to Bash, and set the Shell to C:\cygwin\cygwin.bat... The next time you launch Console 2.0, you'll be able to select Bash from the File/New Tab menu...



Another nice feature is that if you have Plink available on your machine, you'll be able to set up a SSH session from within Console 2.0... While in the Settings dialog, add a new shell and set the Shell parameter to plink.exe svrs.ip.addr.ess, i.e. plink.exe 123.123.123.123...


If you have any questions, please leave a comment... Check back tomorrow for all new tips...

Monday, July 17, 2006

Tip #20: Remote Help for Family, Friends, and Clients

Today's tip is on providing remote assistance for Windows XP and 2000 users... Hopefully this tip will allow you to save time and money (gasoline: cha-ching!) by allowing you to provide PC help for family and friends without actually having to leave your home or office...

We'll be setting up and using the SingleClick (SC) version of the UltraVNC remote control software... While Windows provides methods for Remote Assistance from within their operating system, I think you'll find that UltraVNC SC provides an easier to use and more powerful application, while also being free... Also, UltraVNC SC is only ~160kB and does not require an install for your clients... Once connected to a client seeking assistance, you'll be able to control their desktop, transfer files to them, as well as carry on a chat conversation...

To start off, we'll be creating a customized version of SingleClick, which will allow you to provide company/support branding, and also tailor the application to use your local machine as the host for the VNC connection... To do this, we first need to download the base files which we'll need to modify... They are downloaded as a file called custom.zip and are available from here...

After you have downloaded the custom.zip file, extract its contents to a location where we can modify the files... The files we'll be focusing on for this article are logo.bmp and helpdesk.txt... The icon files, background.bmp, and rc4.key files can be modified if you wish, but changes are not necessary for the purpose of this demonstration...

Now that we have the files extracted, lets make some changes to the logo.bmp... Open the file in MS Paint, or an image editing program of your choice... It is important that after any changes, the file be saved as a Windows bitmap, with a maximum of 256 colors, and retain the size of 196 by 181... Although modifying this file is not absolutely necessary, it is the easiest method to provide some degree of customization... Our modified logo is shown below:


Now save your logo.bmp and let's move on to the next step, which is modifying the helpdesk.txt file... This file can be opened in notepad, and the following changes applied...

First, at the very minimum we'll need to change the HOST block near the top... You'll want to change the displayed IP address to your externally accessible IP address, and leave the port :5500 at the tail end... You may also want to want to change the line that says "Internet support" to "Double-Click Here For Remote Support" to provide better guidance for your users...

The second HOST block outlining an encrypted connection can be removed entirely for this demonstration... Encrypted connections are advisable, but are outside the scope of this article... For more information on encrypting your VNC connections, you can refer to the documentation at UltraVNC...

The remaining blocks should all remain, and can be modified to suit your language and purpose... You should be able to determine the intent of each block based upon its initial contents... They are all basically there to provide instruction to your end user... You'll most likely want to make some further changes after your first custom build, so you can always go back to further modify these comments...


Now that we've modified our files, we'll need to rezip them so we can upload them to UltraVNC's server... Use your favorite (7-zip?) Zip utility to create a standard zip file containing all of the files that were in the original custom.zip, including your modified logo.bmp and helpdesk.txt...

Now go to the UltraVNC SC Creator Tool website here... Fill in the top form using the User ID of "foo" and the Password of "foobar", and in the Upload File field, browse for the new zip file you just created, then click on Submit Query... The website will generate a file named "custom.exe" for you to download for distribution to your clients, or to place on your website for family and friends to access...


Okay, now you should have your own customized SingleClick UltraVNC application... Go ahead and launch it once to ensure that it appears like you had intended... If not, make necessary adjustments and resubmit to the Creator Tool website...

Now that you have your client application built, you'll need to install UltraVNC on your machine so that you can answer your "calls for help"... You can download the UltraVNC application from here... After you have downloaded it, install it...

What we'll use to accept the incoming connections is the UltraVNC Viewer in Listen Mode... To launch the viewer in Listen Mode, click on Start/All Programs/UltraVNC/UltraVNC Viewer/Run UltraVNC Viewer (Listen Mode)... You'll now have an icon in your system tray, and the application is now waiting for inbound connections... When someone is trying to connect to your Viewer application, you will informed of the user's IP address and asked whether you would like to accept the connection... If you accept, you will have full control over the client's desktop, as well as have the ability to transfer files back and forth... Simply close the window when you are ready to terminate the session... To discontinue accepting inbound connections, right-click on the system tray icon and select Close TrayIcon...


Also, if you are behind a router or firewall, you'll need to make sure that you have port 5500 forwarded to your host machine where the viewer is installed...

If you have any questions on today's tip, please leave a comment... Check back tomorrow for all new tips...

Sunday, July 16, 2006

Tip #19: Transferring Files via FTP Using "curl"

Today's tip is on transferring FTP files from the Command Prompt in Windows XP...

While Windows XP/2000 contains a command-line FTP client, it can be difficult to set up this application for unattended batch files and scripts... We'll be taking a look at a utility call curl, which was specifically developed for this purpose... It is yet another utility whose roots are in the Linux/Unix arena, but has been ported to the Win32 environment...

The Win32 port of curl can be downloaded from here...

After downloading and installing the utility, it can be used from the command line or added to virtually any script or batch file... From the Command Prompt, use the following syntax to transfer a file to an FTP server:

curl -T filenametoupload -u user:password ftp://yourFTPserver

The -T parameter specifies the "upload file", and the -u parameter allows you to specify the user name and password for this account... You can also consult the man page for additional parameters and options for this powerful utility...

If you have any questions please leave a comment, and check back tomorrow for more tips...

Saturday, July 15, 2006

Tip #18: Mapping FTP & WebDAV to a Drive Letter in Windows

Today's tip is on mapping an FTP account or a WebDAV account to a drive letter in Windows... If you do not currently have an FTP or WebDAV account, you can sign up for a free 1GB WebDAV compatible account at box.net...

The utility we'll be using to map to a drive letter is called NetDrive from Novell... NetDrive can be downloaded from here, or can be found by Googling for NetDrive...

Once you have downloaded and installed NetDrive, launch the application and you should see a Window similar to the one below...


Now, click on the New Site button in the lower left corner, and you'll receive a new window prompting for server information... You can give the connection a meaningful name, and then enter the name of the server you'll be connecting to... For Box.net, we'll be using "https://www.box.net/dav"... Then click Finish...


Now, unclick "Anonymous/Public Logon" and enter your account's credentials... You may also make changes to the Server Type and Drive at this point... Finally, click on the Connect button...


Congratulations... You should now have a drive letter assigned to your WebDAV or FTP account, and it is now accessible from Windows Explorer or a Command Prompt... You will be able to treat this newly mapped drive as you would any other local or network drive...

Please leave a comment if you have any questions, and check back tomorrow for new tips...

Thursday, July 13, 2006

Tip #17: Image Resizer PowerToy for Windows XP

Today's tip is on how to implement easy-to-use image resizing for Windows XP...

The application we'll be taking a taking a look at is one of the Microsoft PowerToys for XP, called Image Resizer... Image Resizer is a small utility which will allow you to resize one or multiple images to several predefined sizes, or allow you specify a custom size... The application is also integrated with Windows Explorer, so you can resize images with a simple right-click...

The Image Resizer PowerToy can be downloaded from here...

Once installed, you can right-click on any image in Windows Explorer and select the Resize Pictures context menu, as shown below...


After you have selected the Resize Pictures menu, select from one of the predefined sizes, or enter a custom value if desired... This application will create a new file with the size appended to the end, "Filename (Size).jpg"... If you'd rather replace the existing file, click the Advanced button and select "Resize the original pictures (don't create copies)" checkbox...


Multiple images can be resized simultaneously by selecting multiple images in Explorer before opening the Resize Pictures context menu...

Please leave a comment if you have any questions, and check back tomorrow for new tips...

Wednesday, July 12, 2006

Tip #16: Using Windows XP's Network Shell a.k.a. "netsh"

Today's tip is on how to use the Network Shell, netsh.exe, which is included with Windows XP and 2000... The Network Shell utility allows you to view and modify network interfaces, routing tables, firewall rules, and TCP/IP settings... We'll be going over just a few of the more useful functions of the shell...

First off, to use the commands below, open a command prompt (Start/Run/cmd)...

Enter the following command, all on one line, to display your current network settings:
netsh int ip show config
The displayed information is similar to what you'd get with an ipconfig, showing address, DNS and gateway settings...


Next, the following command can be used to set an adapter to a static IP address... This might be useful to place in a script where you need to change your address to join a different IP network on your physical network...
netsh int ip set address "Local Area Connection" static 192.168.1.10 255.255.255.0 192.168.1.1 1
The last four numbers are the IP address, subnet mask, default gateway, and gateway metric...

If you set your IP address manually, you'll probably also want to set your DNS as well... This is done by:
netsh int ip set dns "Local Area Connection" dns "Local Area Connection" static 192.168.1.1
The 192.168.1.1 being the primary DNS server...


To change to, or revert back to DHCP, use the following commands:
netsh int ip set address "Local Area Connection" dhcp
netsh int ip set dns "Local Area Connection" dhcp


Firewall settings can be set from the command line using netsh as well... In the following command, we'll be providing access to an application, and limiting incoming connections to a single IP address (enter all on one line):
netsh firewall set allowedprogram "C:\PathToProg\program.exe" "AliasWeGiveIt" ENABLE CUSTOM 192.168.1.155
This will allow network access to the program, and limit access to only the IP address we have given...

To disable this access, use the following command:
netsh firewall set allowedprogram "C:\PathToProg\program.exe" "AliasWeGiveIt" DISABLE

Enabling access as shown allows you to script and schedule network enabled applications, while limiting timeframes and allowable clients... You can view the current firewall configuration with
netsh firewall show config...


Finally we'll take a look at how to reset your TCP/IP to it's original settings when the O/S was first installed... This command should only be used when your TCP/IP is totally destroyed, and a reload seems to be your only option... Sometimes spyware removal can leave your TCP/IP stack in this unusable state...

netsh int ip reset reset.log

This will restore TCP/IP functionality and log the changes made to reset.log...

Further commands for netsh can be discovered by running netsh in interactive mode... This can be entered into by simply typing netsh at a command prompt... Once in the shell, type help for availables commands/contexts...

If you have any questions, or other interesting uses for netsh, please leave a comment... Check back tomorrow for new tips...

Tuesday, July 11, 2006

Tip #15: Unix Utilities for Windows XP

Today's tip is on installing Unix/Linux utilities for Windows XP/2000... Whether you've been using Unix commands for years ( and silently curse as you type "ls -l" at a Windows command prompt), or if you'd like to become familiar with some basic Unix commands, you'll be happy to know that many of these utilities have been ported to run natively on a Win32 system...

While Cygwin is an obvious option for Unix power-users, these individually available GNU utilities will provide the same basic functionality at a Windows prompt...

The individual packages can be downloaded from here... The Core utilities package includes the file, shell, and text utilities, which should cover a majority of your command line needs...

Once installed, you'll need to add the path to the utilities to your PATH environment variable... To do this, click on Start/Run, and enter sysdm.cpl... This will bring up the System Properties Dialog... Click on the Advanced tab, then the Environment Variables button... In the System Variables pane, scroll down to "Path" and double-click it... At the end of this line, type the following:
;C:\Program Files\GnuWin32\bin
The semicolon is important as it separates the individual elements of the Path variable...


Now that you have added the GnuWin directory to your path, Unix commands can be executed on the command line and run natively on Win32 without any emulation layer as shown below:


If you have any questions, please leave a comment...

Monday, July 10, 2006

Tip #14: Adjusting Window Transparency in Windows XP / 2000

Today's tip is on how to adjust the transparency of an application window in Windows XP... By adjusting the transparency of a window, you'll be able to see the contents of any windows beneath, as well as the desktop...

Windows 2000 and XP have the built-in ability to display variable transparency, but do not provide a method to adjust transparency levels for standard applications... We'll be using a free and extremely lightweight utility called Vitrite... Vitrite uses very little resources, and allows you to adjust the transparency for any Windows application...

Vitrite can be downloaded from here...

After you have downloaded and installed Vitrite, you can adjust individual window transparency by pressing Control+Shift+(number from top row of keyboard), for example Control-Shift-1 = 10% visible, etc... Control-Shift-0 returns the windows back to 100%...

Another cool feature of this utility is that you can make a window always stay on top by pressing Control-Shift-+... Pressing this combination again causes the windows to revert back from its "Always on Top" state...

Click on the image below to see an example of Vitrite in use:


Please leave a comment if you have any questions, and check back tomorrow for more tips...

Sunday, July 09, 2006

Tip #13: Displaying Folder Size Information in Windows Explorer

Today's tip is on displaying the size of the contents of a folder directly in Windows Explorer... This makes it easy to narrow down which folders/directories on your hard drive are using more space than you'd like...

Since Windows XP does not include this functionality in the operating system, we'll be using an open source Explorer extension called, appropriately enough, Folder Size... This extension allows you to add a column in Explorer's details view so that both file and folder sizes are shown... Folder Size calculates the folder sizes in the background as a service, so as to minimize any performance hit created by the application...

Folder Size can be downloaded from SourceForge here...

Once you've downloaded and installed the application, you'll need to configure Explorer to make use of it... Open Explorer/My Computer and change to details view by selecting View/Details from the menu bar...Your initial details view should look similar to this:


To add our new column, right-click on any of the column headers, deselect "Size" and select "Folder Size" as shown below:


After you've made the changes listed above, your details view will look similar to this:


Once you've become accustomed to using Folder Size, you'll wonder why this functionality was not included in XP, and it will become difficult to live without... To use this format as the default for all your folders, once you have it configured as you'd like it you can select Tools/Folder Options/View/Apply to All Folders from Explorer's menu bar...

If you have any questions, please leave a comment...

Check back daily for new tips...

Saturday, July 08, 2006

Tip #12: Visual Task Tips for XP's Taskbar

Today's tip is a visual enhancement for Windows XP's taskbar... Using a free utility, you'll be able to display a visual representation of the running application when hovering over the running program's button on taskbar...

This utility is called Visual Task Tips, and is available for download from here...

After you have downloaded and installed the utility, you'll notice that when you hover over your running programs in the taskbar, a miniature image of the window is displayed above it...



To adjust the size of the displayed task tip, you can scroll up or down with mouse's scroll wheel while the preview image is being displayed...

Please leave a comment if you have any questions, and check back daily for all new tips...

Friday, July 07, 2006

Tip #11: Simple File Encryption for Windows

Today's tip is on symmetric file encryption for Windows... Symmetric encryption requires only a single "key", or password, to encrypt as well as to decrypt... While this method of encryption is not as secure as asymmetric encryption (separate keys for encrypt & decrypt), if a strong passphrase is selected it is very robust... Tying into yesterday's tip, once your files are sufficiently encrypted you can safely store them on a remote server...

Windows XP provides a method of encrypting folders or drives called EFS, or Encrypted File System... This approach to encryption is tied to the currently logged on user, and as such if someone has physical access to your machine and is able to logon as your user, any encrypted files will be accessible... We'll be taking a look at something a little more secure, simple to implement, and allows transmission of the files with the encryption intact...

The utility we'll be using today is called AxCrypt... AxCrypt is a free application, is compatible with all recent versions of Windows, and uses 128-bit AES for strong and reliable encryption... The application integrates with Windows Explorer to provide a somewhat seamless approach to encrypting your data...

AxCrypt can be downloaded from here...

After you have downloaded and installed AxCrypt, you should notice that it has added a context menu in Windows Explorer... If you right-click on any file or folder, an AxCrypt menu is now available... We'll go through the process of encrypting and decrypting a file, but to further understand and explore its advanced features you should read the documentation that is installed with the application...

To encrypt an existing file, right-click on the file and select "Encrypt" from the AxCrypt context menu... This will encrypt the original file and replace it with an encrypted version... If you'd rather keep the original as is, and create a copy for archival or distribution, select "Encrypt to copy"... To create a self executing copy which can be distributed to someone who does not have or use AxCrypt, you can also select "Encrypt copy to .EXE"...


After you have selected "Encrypt" from the menu, you will be prompted to enter a passphrase to use as a key for the encryption process... The strength of the encryption is relative to the length of your passphrase, so be creative and try to use a passphrase of at least 20 characters... You will then need to verify your passphrase to ensure that you have entered it correctly... For our purposes, you can ignore the other options in this window and click "OK"...


You should now have an encrypted version of your file, which now has a filename of the original with .axx appended to it... While this is convenient to remember the name of the encrypted file, you can safely change the file name to obscure the contents of the document... When AxCrypt decrypts the file, it will revert to its original name... For example if you have a file called FinancialData.xls.axx, you can rename it to 2006BeachPhotos.axx... When decrypted the file will revert back to FinancialData.xls...

Now that we have our encrypted file, let's double-click on it to open the document... You will be prompted for the password with which it was encrypted... After entering the password, you have the option to "Remember this for decryption"... If you mark this checkbox, you will no longer need to enter a passphrase for this file, or others with the same passphrase, until you reboot or logoff... You'll appreciate this option if you created a long password... If you'd like to clear the passphrase from memory, you can right-click on a file and from the AxCrypt menu, select "Clear Passphrase memory"...


To decrypt a file back to its original self, right-click on the file and select "Decrypt" and enter your passphrase... The file will return to its original state, complete with original name...


If you have any questions, please leave a comment...

Thursday, July 06, 2006

Tip #10: Creating an FTP "Drive" in Windows Explorer

Today's tip is on adding an FTP "drive" to Windows Explorer... Adding an FTP site to Windows Explorer will allow you drag & drop, copy, delete, and edit files as though your space on the FTP server was another local drive... If you don't currently have access to an FTP server for file storage, you can search on Google for "free hosting" to find a host who will provide FTP space free of charge...

An important thing to keep in mind before proceeding with this tip is that you shouldn't place anything on your FTP account that you wouldn't want others to see, such as personal or financial information... After ensuring that the data you'll be placing on the server is not confidential, is sufficiently encrypted, or is intended for public consumption, let's begin...

First, start by opening Windows Explorer by clicking on Start/My Computer...


Next, click on Tools/Map Network Drive from the menu bar at the top of the window...

For our purposes, we are not concerned with the Drive or Folder assignment... We will instead be clicking on the link at the bottom of the window that says "Sign up for online storage or connect to a network server" which will in turn launch the "Add Network Place Wizard"...


On the first screen of the wizard, click Next to continue... On the following screen, click on "Choose another network location' and then click Next...


On the next screen, we'll be entering the name of the server we're connected to, for example ftp://ftp.somehost.com...


On the next screen, uncheck "Log On Anonymously", enter your User Name, and click on Next...


On the following screen, supply a name for this connection if you'd like to change it...


On the next and final screen, check the "Open this network place when I click Finish" box, and then click Finish...

You'll now be prompted for your password for this site...


After you have successfully entered your password, the contents of your FTP folder will be displayed, and can be accessed in the future by selecting your site from your "My Network Places"... You should now be able to edit, delete, and add files and folders without the need of a third-party FTP client...

If you have any questions, please leave a comment...