IRS PDF forms are "fillable" meaning you fill in values on screen and then save the form with the values you entered.
The IRS PDF forms do not format completely correctly if you use Mac OS X Preview (for example social security numbers are all bunched together instead of being spread out like the form intends), so the best bet is to just use Adobe Reader.
Once you open an IRS PDF form in Preview and then save it you can no longer open it in Adobe Reader in fillable format; it will tell you that you cannot save your changes. So it is best to just use Adobe Reader from the outset on IRS PDF forms.
The Arizona PDF 140 form has its permissions set so that you cannot save the form with the values you entered. However, if you open this form using the Foxit Reader instead of Adobe Reader you can save the form with your input.
Unfortunately, the Foxit Reader cannot print the saved form with the barcode on the front page which encodes all your input.
Fortunately, you can use Adobe Reader to open a form with saved values that you saved using Foxit Reader and then print it with the barcode on the front page.
2010-04-11
Lessons learned from doing my own 2009 income taxes on Mac OS X
Posted by
AndyfromTucson
at
10:24
0
comments
Labels: Taxes
2010-03-23
Making CDs of recordings using a Zoom H2 and Windows
Download and install Audacity (open source software for editing audo files) from http://audacity.sourceforge.net/
Download and install InfraRecorder (open source software for burning CDs) from http://sourceforge.net/projects/infrarecorder/
Record something using the Zoom H2 using MP3 recording format.
Connect the Zoom H2 to the Windows computer using USB cord and then put the Zoom H2 in Storage mode: Menu -> USB -> Storage.
Copy the MP3 file from the Zoom H2 to the Windows computer.
Use "Safely Remove Hardware" icon on Windows taskbar to dismount Zoom H2, disconnect USB cable, and exit USB mode by hitting Menu key on Zoom H2.
Start Audacity and then use File -> Open to open the MP3 file.
Edit the MP3 file as needed, and then export it to WAV file: File -> Export As WAV
Insert blank CD-R in computer
Start InfraRecorder
Click Audio Disc.
In the Explorer View window select the WAV file (one click) and then click the blue plus sign above the window. This should make the WAV file show up in the bottom window. Or you can just drag the WAV file from the top window to the bottom window.
Drag as many WAV files as you want on the CD to the bottom window, and put them in the order you want them to be on the CD.
When ready to burn CD, click Action -> Burn Compilation then select the lowest write speed and click OK.
Posted by
AndyfromTucson
at
15:10
0
comments
2010-03-21
Installing Mythbuntu backend on Virtualbox virtual machine running on Mac OS X
This is just a rough outline of steps, not a how to!
Install Sun Virtualbox on Mac.
Download ISO of Mythbuntu
Create new Linux virtual machine in Virtualbox. I used 8 GB as the disk size (figuring I would store recordings on an external drive) and 500 MB RAM (no particular reason.
Change settings on the virtual machine's Details list:
- Click on Storage then under the CD-ROM entry browse to and select the Mythbuntu ISO.
- Click on Network and then select bridged as the network type instead of NAT (I actually did this after the Mythbuntu install was finished so I am not sure if there would be problems selecting it intitally).
When it got to the part of the process when the Mythbuntu backend setup program ran I escaped out of it to get to the desktop because I wanted to make some changes to the system before I set up the backend.
Set the virtual machine to use a static IP address:
- Right click on the network manager icon on the right side of the virtual machine menu bar and selecting edit connections.
- Select Auto eth0 under Wired
- Click Edit
- Select IPv4 Settings
- Enter values in all fields; Apply button will grey out unless all required fields are completed.
- Click Apply
- Shut down virtual machine.
- Go to Details list for VM and click on Shared Folders
- Browse to external drive and designate it as a shared folder.
- Install VirtualBox Guest additions on the VM by:
- Restart VM
- Click on the Window for the VM to make it active, and then on the Mac menubar click on Devices and then select Install Guest Additions (if the VirtualBox program window is the active window you can't see the Devices menu). This causes a virtual CD to be mounted to the VM.
- Follow the instructions How to install VirtualBox Guest Additions in Ubuntu with the following changes: run the installer by using "sudo ./VBoxLinuxAdditions-x86.run" otherwise you will get command not found.
- Reboot VM.
- Test mounting external hard drive by making mount point and then running this:
- sudo mount -t vboxsf SharedFolderName \MountPointPath where SharedFolderName is the name you gave to the shared folder in VirtualBox and \MountPointPath is the path to the mount point you created.
- However, if you mount the shared folder this way it will be mounted as owner root, group root and read only.
- Dismounting the shared folder and setting the ownership and permissions on the mount point doesn't work to change this because the next time you mount the shared folder the ownership, group, and permissions will revert.
- This is the mount command that finally made it possible to write to the shared folder: sudo mount -t vboxsf -o uid=andy,gid=users SharedFolderName /MountPointPath/
- Once I got that working I added it to the /etc/fstab file so that the shared folder would mount on boot by using sudo nano /etc/fstab to open the fstab file in a text editor and then adding this to the bottom of the file SharedFolderName /MountPointPath vboxsf gid=105,uid=103
- The uid and gid are for the user mythtv and the group mythtv. I tried mounting it with uid=1000 and gid=1000 but mythbackend was not able to write recording files to it, so I just made mythtv the owner of the mount.
- General-Host Address Backup Setup-Local Backend-IP Address = static IP address of VM
- General-Host Address Backup Setup-Local Backend-Security Pin = 0000
- General-Host Address Backend Setup-Master Backend-IP Address = same
- General-Locale Settings-Channel frequency table = us-cable (selected)
- Capture Card Setup-Card type = HDHomeRun DTV tuner box (selected)
- Capture Card Setup-Available Devices = 1019A9DB-0 (selected)
- On Input Connections I scanned channels using Cable High.
- After the channel scan was done and I added all the ATSC channels I used the Channel Editor to manually fill in the XMLTV ID field for each high def channel. For some reason SchedulesDirect.org doesn't link up to the high def channels correctly, so I just fill in the XMLid values for the broadcast versions of the channels, which I looked up on SchedulesDirect.org
- Then I went to the Storage Groups section, clicked on default, and then filled in the mount point of my shared folder as the default storage location.
I shut down the VM and then in VirtualBox I disconnected the shared folder from the VM by clicking on Details - Shared Folders and then removing the shared folder.
Next in VirtualBox I created a new virtual disk on my external hard drive and made it as big as I could. I picked expandable, instead of fixed, because when I tried fixed it said it would take 20 hours to format the virtual disk!
Then in VirtualBox I attached the new virtual disk to my VM and then started the VM up. From there I used regular linux commands to partition and format the new virtual disk, and then I added it to the /etc/fstab file so it would mount on boot to the same mount point as I had previously used for the shared folder (and obviously I removed the old /etc/fstab entry for the shared folder while I was in there.
Then I did a sudo mount -a to mount the new virtual drive and tested it by recording a show in MythTV, and everything worked great.
Posted by
AndyfromTucson
at
10:46
1 comments
Labels: mac, mythtv, VirtualBox
mjpg-streamer documentation
The documentation for mjpg-streamer is kind of scattered about. I have dumped it all here for my own convenience.
Usage introduction
This example shows how to invoke mjpg-streamer from the command line
export LD_LIBRARY_PATH="$(pwd)"
./mjpg_streamer -o "output_http.so -w ./www"
pwd echos the current path you are working at, the backticks open a subshell to execute the command pwd first the exported variable name configures ldopen() to search a certain folder for *.so modules
export LD_LIBRARY_PATH=`pwd`
This is the minimum command line to start mjpg-streamer with webpages for the input-plugin default parameters are used
./mjpg_streamer -o "output_http.so -w `pwd`/www"
To query help for the core:
./mjpg_streamer --help
To query help for the input-plugin "input_uvc.so":
./mjpg_streamer --input "input_uvc.so --help"
To query help for the output-plugin "output_file.so":
./mjpg_streamer --output "output_file.so --help"
To query help for the output-plugin "output_http.so":
./mjpg_streamer --output "output_http.so --help"
To specify a certain device, framerage and resolution for the input plugin:
./mjpg_streamer -i "input_uvc.so -d /dev/video2 -r 320x240 -f 10"
To start both, the http-output-plugin and write to files every 15 second:
mkdir pics
./mjpg_streamer -o "output_http.so -w `pwd`/www" -o "output_file.so -f pics -d 15000"
To protect the webserver with a username and password (!! can easily get sniffed and decoded, it is just base64 encoded !!)
./mjpg-streamer -o "output_http.so -w ./www -c UsErNaMe:SeCrEt"
If you want to track down errors, use this simple testpicture plugin as input source. To use the testpicture input plugin instead of a webcam or folder:
./mjpg_streamer -i "./input_testpicture.so -r 320x240 -d 500" -o "./output_http.so -w www"
Usage: mjpg_streamer
mjpg_streamer
-i | input "<inputplugin.so> [parameters]"
-o | output "<outputplugin.so> [parameters]"
[-h | help ]........: display this help
[-v | version ].....: display version information
[-b | background]...: fork to the background, daemon mode
Note: If you start mjpg-streamer in the background use this to stop it:
kill -9 `pidof mjpg_streamer`
Example #1:
To open an UVC webcam "/dev/video1" and stream it via HTTP:
mjpg_streamer -i "input_uvc.so d /dev/video1" -o "output_http.so"Example #2:
To open an UVC webcam and stream via HTTP port 8090:
mjpg_streamer -i "input_uvc.so" -o "output_http.so -p 8090"
Example #3:
To get help for a certain input plugin:
mjpg_streamer -i "input_uvc.so help"
In case the modules (=plugins) can not be found:
* Set the default search path for the modules with:
export LD_LIBRARY_PATH=/path/to/plugins,
* or put the plugins into the "/lib/" or "/usr/lib" folder,
* or instead of just providing the plugin file name, use a complete
path and filename:
mjpg_streamer i "/path/to/modules/input_uvc.so"
Parameters for input_uvc.so
This is the output from:
#mjpg_streamer --input "input_uvc.so --help"
The following parameters can be passed to this plugin:
[-d | --device ].......: video device to open (your camera)
[-r | --resolution ]...: the resolution of the video device,
can be one of the following strings:
QSIF QCIF CGA QVGA CIF VGA
SVGA XGA SXGA
or a custom value like the following
example: 640x480
[-f | --fps ]..........: frames per second
[-y | --yuv ]..........: enable YUYV format and disable MJPEG mode
[-q | --quality ]......: JPEG compression quality in percent
(activates YUYV format, disables MJPEG)
[-m | --minimum_size ].: drop frames smaller then this limit, useful
if the webcam produces small-sized garbage frames
may happen under low light conditions
[-n | --no_dynctrl ]...: do not initalize dynctrls of Linux-UVC driver
[-l | --led ]..........: switch the LED "on", "off", let it "blink" or leave
it up to the driver using the value "auto
Posted by
AndyfromTucson
at
07:50
15
comments
Labels: MJPG-Streamer
NSLU2 + Debian Lenny + wireless + webcam
My webcam is a HP KQ246AA 8.0MP Deluxe WebcamFirst I installed Debian on my NSLU2 following this guide:
http://www.cyrius.com/debian/nslu2/install.html
Then I connected my HP Webcam (purchased because it is supposed to be UVC compatible) and ran dmesg | tail and it looked like it was recognized.
I tried installing mjpg-streamer using aptitude, but it said there was no package by the name in the repositories.
I then downloaded the tar.gz file from the mjpp-streamer sourceforge site:
http://sourceforge.net/projects/mjpg-streamer/files/
I had no idea what to do with it, so I double-clicked on it on my Mac OS X desktop, which uncompressed it to a directory. Inside that directory was a file called README which had the following instructions:
To compile and start the tool:
tar xzvf mjpg-streamer.tgz
cd mjpg-streamer
make clean all
export LD_LIBRARY_PATH=.
./mjpg_streamer -o "output_http.so -w ./www"
So I used Macfusion to connect my Macbook to the NSLU2 as root and copied the tar.gz file over to the NSLU2. Then I ran the tar xzvf command, which created a directory called mjpg-streamer-r63. I went into that directory and ran make clean all, but that gave me a command not found error.So I used aptitude to install the make package, and tried again. This time it ran for a bit and then gave me an error that gcc wasn't found. So I used aptitude to install the gcc package, and tried again.
This time I got a bunch of errors related to jpeg_utils. Looking at the README file I saw this:
"In case of error: the input plugin "input_uvc.so" depends on libjpeg, make sure it is installed."So I tried aptitude install libjpeg, but that gave me an error saying there was no such package, but listed the names of some packages with similar names. I took a chance and installed libjpeg-dev, figuring that sounded the most promising. Aptitude then said it was installing a different package with 62 in the name.
After the 62 variation of libjpg was installed I ran "make clean all" again and it seemed to finish without any fatal errors, but lots of warnings.
However when I tried to run it I got this error:
./mjpg_streamer -o "output_http.so -w ./www"
MJPG Streamer Version.: 2.0
i: Using V4L2 device.: /dev/video0
i: Desired Resolution: 640 x 480
i: Frames Per Second.: 5
i: Format............: MJPEG
o: www-folder-path...: ./www/
o: HTTP TCP port.....: 8080
o: username:password.: disabled
o: commands..........: enabled
Unable to start capture: Cannot allocate memory
i: Error grabbing frames
I figured this meant there wasn't enough memory so I went to this web page I had found about Debian on the NSLU2:http://www.sunspot.co.uk/Projects/SWEEX/slug/notes/Debian_notes.html
And tried his recommendation:
"If you are not using IPv6, you can prevent the module from being automatically loaded by adding the lineAnd then rebooted using "shutdown -r now"
blacklist ipv6
to /etc/modprobe.d/blacklist."
Then by running the export command again, and going into the mjpg-streamer directory I was able to get it to work; pointing firefox at port 8080 of the IP address of the NSLU2 worked.
Then I decided to try and install mjpg-streamer in the system itself so I wouldn't have to run it from the folder where I made it, and have to run the export library thing every time. But I had no idea where to put the files. So I downloaded the Ubuntu deb package from the mjpg-streamer Sourceforge site, and ran dpkg-deb -c (I think) to get a list of the tree structure of the files, and then I copied the files from my install folder to those folders on my system (I had to make one new folder /usr/www).
Then I was able to run the program from any prompt just using mjpeg-streamer without any ./ etc. but it kept giving me unable to start capture: Cannot allocate memory errors and exiting. Interestingly, I was still able to run it from the install folder putting ./ before the name, at least once, but then even that didn't work. So back to trying to open up more memory.
I went through the ideas listed here:
http://www.cyrius.com/debian/nslu2/reducing-memory.html
I couldn't find any libdevmapper1.02 in /etc/init.d so I couldn't do that idea.
Then I started reviewing kernel modules shown by lsmod. The first one, evdev, appeared to just be used for managing input devices for X.org, so I went to the blacklist file:
nano /etc/modprobe.d/blacklistand added "blacklist evdev" (no quotes) to the end of the file and rebooted. evdev no longer appears when I run lsmod.
Next I tried blacklisting both usbhid and hid modules since they seem to be for mouses. Slug still boots.
It seems that the ixp4xx_beeper module is for making the NSLU2 beep. I guess I won't blacklist it yet.
Then I moved on to reducing the services (daemons?) loaded when the system starts. This page mentioned a package called rcconf to change the services loaded. It is apparently a utility that shows you what is loaded and allows you to specify what gets loaded and what doesn't. So I installed it using aptitude.
Using rcconf I turned off the following:
- exim4 (apparently for handling email)
- mountnfs.sh (I am guessing its for the NFS file system)
- nfs-common (same guess)
After all that, now I am able to run mjpg-streamer from any command prompt:
mjpg_streamer -o "output_http.so -w /usr/www"
Note that all the mjpg_streamer commands below are for the way I manually installed it on my system. To get them to work on a machine where mjpg_streamer wasn't manually installed you will have to modify the command to match the syntax in the original instructions.Next issue: the streamer stops working if you end the terminal session where you launched it. So time to try this idea from this web page:
"there is an option in mjpg-streamer to launch it in background, use it as a daemon:It works! After I launched mjpg-streamer with the -b option it continues running after closing the SSH terminal session.
[-b | --background]...: fork to the background, daemon mode"
So this lets me keep using the ttyS0 terminal -
mjpg_streamer -i "input_uvc.so -r 960x720" -b -o "output_http.so -p 8080 -w /webcam_www"
Note:- to make mjpg-streamer exit cleanly, use -
kill -9 `pidof mjpg_streamer`"
kill -9 `pidof mjpg_streamer`
Seems to shut it down successfully.
Now to explore options. Here is the output from mjpg_streamer --help
Usage: mjpg_streamerI am having a heck of a time finding any documentation on the syntax. I found this forum post:
-i | --input "[parameters]"
-o | --output "[parameters]"
[-h | --help ]........: display this help
[-v | --version ].....: display version information
[-b | --background]...: fork to the background, daemon mode
-----------------------------------------------------------------------
Example #1:
To open an UVC webcam "/dev/video1" and stream it via HTTP:
mjpg_streamer -i "input_uvc.so -d /dev/video1" -o "output_http.so"
-----------------------------------------------------------------------
Example #2:
To open an UVC webcam and stream via HTTP port 8090:
mjpg_streamer -i "input_uvc.so" -o "output_http.so -p 8090"
-----------------------------------------------------------------------
Example #3:
To get help for a certain input plugin:
mjpg_streamer -i "input_uvc.so --help"
-----------------------------------------------------------------------
In case the modules (=plugins) can not be found:
* Set the default search path for the modules with:
export LD_LIBRARY_PATH=/path/to/plugins,
* or put the plugins into the "/lib/" or "/usr/lib" folder,
* or instead of just providing the plugin file name, use a complete
path and filename:
mjpg_streamer -i "/path/to/modules/input_uvc.so"
mjpg_streamer -i "input_uvc.so -r 320x240 -f 6" -o "output_http.so -p 8080" -b
Which I modified to:
mjpg_streamer -i "input_uvc.so -r 320x240 -f 6" -o "output_http.so -w /usr/www" -b
That seemed to work to reduce the resolution, but how to increase it?
After looking at the webcam specs I tried:
mjpg_streamer -i "input_uvc.so -r 800x600 -f 20" -o "output_http.so -w /usr/www" -b
But it still gave me a 640x480 image. I am giving up in trying to get a higher resolution for now.
On to wireless. I have a Belkin USB wifi adapter that uses the rt73usb driver which is built into Debian Lenny.
I followed the directions here on how to set up a rt73 wireless device on Debian Lenny:
http://wiki.debian.org/WiFi/rt73
Everything seemed to go smoothly.
I had a lot of troubles getting the wifi to connect to my network, but I think most of it was because I was trying to use the wrong wpa2 password (i.e. psk). After I used the right wpa psk it worked using the following /etc/network/interfaces file:
auto wlan0
iface wlan0 inet dhcp
wpa-ssid Chacala
wpa-psk mywirelesspassword
That is, I was able to get it working while the ethernet cable was also plugged in. I could connect SSH to the IP address assigned to the wireless connection while the ethernet cable was plugged in, but once I unplugged ethernet the wireless connection dropped. I did some googling and discovered this hint on this page:
"If everything looks like it's working, don't just unplug your ethernet. use "ifconfig eth0 down" beforehand, otherwise you'll loose both connections."
Once I followed that hint the wireless link stayed alive after I disconnected the ethernet.
So next I tried rebooting with ethernet unplugged and just the wifi adapter. The Slug appeared to boot, and the LED on the wireless was flashing, but I couldn't ping or SSH to the Slug. So I connected the ethernet cable again, but I still wasn't able to ping or SSH to the Slug. So I rebooted with both the wifi adapter and ethernet connected, and after reboot I was able to ping and ssh to both wifi and ethernet IP addresses.
Next I tried a hint from this page:
"Actually there's a strange behavior of networkingon NSLU, when i boot without the ethernet cable plugged, in the wlan interface is also not working.
When i replug the ethernet cable, the wireless network also comes up. When i ifconfig eth0 down and unplug the ethernet cable the wlan does still work.
Strange, after some meditation on the interfaces file I noticed the commented line # The primary network interface and had the idea to just change the sections for the interfaces, so lets wlan0 be my primary interface and eth0 an additional one."
i.e. he swapped the order of eth0 and wlan0 in /etc/network/interfaces to have wlan0 come first. I changed the order in my interfaces file and rebooted.
It worked! After reboot I was able to connect to the Slug through the wireless connection with no ethernet cable attached. Here is the final /etc/network/interfaces file that worked:
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto wlan0
iface wlan0 inet dhcp
wpa-ssid mywirelessnetworkname
wpa-psk mywirelesspassword
allow-hotplug eth0
iface eth0 inet dhcp
Now onto having the camera and the USB wireless adapter connected at the same time using a hub.
I shut down the Slug, and then connected both the webcam and the wireless adapter using a cheap USB hub I had purchased from Walmart years ago on a trip.
After reboot I was able to connect to the Slug via wireless
Next I tried running the camera:
mjpg_streamer -o "output_http.so -w /usr/www
It works! I now have a wireless webcam.
Poking around looking for something else, I discovered that the following command will list all of the supported modes of the webcam:
lsusb -v
Looking at this it seems that the only streaming mode higher than 640 x 480 is 1280 x 1024, which I haven't tried before, so I tried it:
mjpg_streamer -i "input_uvc.so -f 1 -r 1280x1024" -o "output_http.so -w /usr/www"And here is what I got:
MJPG Streamer Version.: 2.0The good news is that it didn't reject the resolution saying it wasn't found. The bad news is the memory error. On to troubleshooting the memory error. dmesg shows a log of error messages, starting off with:
i: Using V4L2 device.: /dev/video0
i: Desired Resolution: 1280 x 1024
i: Frames Per Second.: 1
i: Format............: MJPEG
o: www-folder-path...: /usr/www/
o: HTTP TCP port.....: 8080
o: username:password.: disabled
o: commands..........: enabled
Unable to start capture: Cannot allocate memory
i: Error grabbing frames
mjpg_streamer: page allocation failure
[42951766.100000] mjpg_streamer: page allocation failure. order:5, mode:0x1After a lot of googling it seems that this is some flavor of running out of memory, and one possible solution is to set overcommit to 2. Apparently you do that by running this command:
echo 2 > /proc/sys/vm/overcommit_memorySo I did. But I still got the Cannot allocate memory error when I tried to launch the streamer! Even after rebooting.
Then I decided to try blacklisting the audio modules from the kernel:
nano /etc/modprobe.d/blacklist
And then added the following line to the bottom of the file
blacklist snd_usb_audioAfter I rebooted I checked lsmod and it looked like all the sound modules that had previously been loading were no longer loading, and free showed about 6 MB free memory with no use of swap. But still get a memory error trying to run mjpg-streamer!
Then I had a brainstorm. Free showed no swap being used the first time I ran it after boot, but it should more swap being used, and more memory free, after I tried and failed to run mjpg-streamer, so maybe it would run now that some programs had been moved to swap? So I tried again, and success! The Slug is now streaming 1280 x 1024 at the rate of 1 frame per second! Here is the command I used to get the high resolution streaming:
mjpg_streamer -i "input_uvc.so -f 1 -r 1280x1024" -o "output_http.so -w /usr/www"The new USB 2.0 hub I ordered (Belkin USB 2.0 4-Port Ultra Mini Hub F5U407 Belkin USB 2.0 4-Port Ultra Mini Hub F5U407) arrived from Amazon. I bought this because it was under $10 and had good ratings on Amazon. I plugged it in, hooked the webcam and the wifi dongle up to it and rebooted. I hung on the first reboot, so I rebooted with nothing connected and then added the new USB hub by itself, then the webcam, and then the wifi dongle, and things worked that time.
The picture quality from the webcam seems much better with the USB 2.0 hub. I suspect the webcam automatically detects when it is hooked up to a 1.1 hub earlier and jacks up the compression on the video stream to compensate.
Next up: reduce wear on flash drive. I bookmarked some pages about this in the Firefox NSLU2 folder.
Posted by
AndyfromTucson
at
07:49
4
comments
Labels: Debian, MJPG-Streamer, NSLU2
2010-02-16
Notes on using Google Maps to show hiking trails
I have been working on using Google Maps to show the routes of various hiking trails in my area. It can be done, but it's not very straightforward. Here are cursory notes on what I learned in the process (i.e. this is not a detailed how-to).
Initially I used Google "My Maps." Here are the characteristics of Google "My Maps" relevant to mapping hiking tails:
- Google "My Maps" displays the length of a path when you click on it, which is good for showing people how long a trail is.
- You can upload a GPX track to it by the roundabout method of importing the GPX track into Google Earth and then exporting it from Google Earth as a KML file, which you can then import into Google My Maps. Or you can use the GPS Visualizer web site to convert GPX files to KML files: http://www.gpsvisualizer.com/
- Unfortunately Google My Maps has a limit on the number of placemarks and lines it will display at one time. If you add exceed this number of items Google My Maps will automatically bump some of your items to a second page so that it is impossible to see everything at once.
- Another unfortunate characteristics of Google My Maps is that it apparently has a limit on the number of points that can be in a single line. If you exceed this limit Google My Maps will split the track into two lines of the same color. I searched for a long time and couldn't find any work around. See: http://www.google.com/support/forum/p/maps/thread?tid=7d6964088b224b32&hl=en
If you don't want to upload a KML file to a web server to display it you can also display all the items of a Google "My Maps" map that has too many items to fit on one page using this trick. Just right click on the View in Google Earth link in My Maps to get the http address of the KML file, and then enter that in the search field in regular Google Maps. I have seen forum postings that some people have had problems with this, so posting a KML file to a web server may be the most reliable approach.
I decided to go with uploading my KML file to a web server and then searching for its URL in Google Maps. Once I that I faced the choice of whether to continue to use Google My Maps to edit my KML and then export the KML file, or to use Google Earth to edit the KML. Although both Google Earth and Google My Maps are awkward to work with if you have a lot items, I decided to go with Google Earth.
The problem with using Google Maps to render a KML file is that you don't get distance measurements on the length of lines. I decided to work around that by uploading my KML to Google My Maps and then clicking on tracks/lines there to find out the distance. There is also this hand web site that will tell you the length of a Google Earth track/line: http://www.emaltd.net/google/gec/utilities/index.asp?l=en
Posted by
AndyfromTucson
at
06:03
1 comments
Labels: Google Earth, Google Maps, Maps
2009-11-29
How to download KML data from Google My Maps
I had put a lot of time into a particular custom map under Google "My Maps" and I wanted to make an offline backup of the data. I clicked on the "View in Google Earth" button when viewing my Google "My Maps" map and it downloaded a KML file which I could open in Google Earth. However, when I opened the KML file in a text editor I saw that it didn't contain any actual map data but instead just had a http URL pointing back to Google Maps. After some experimentation I discovered that I could download the actual map data by taking the URL from inside the downloaded KML file and changing each instance of "&" into plain old & and then pasting the edited URL into my browser address bar. This returned a real KML file with real data.
Incidentally, you can display a KML file on Google Maps by uploading the KML file to any webserver and then putting the http address of the file in the Google Maps search box and hitting enter. Google maps will then display the KML file placemarkers and paths on Google Maps.
Posted by
AndyfromTucson
at
11:38
0
comments
Labels: Google Earth, Google Maps, Maps
2009-09-11
How to convert Microsoft Word documents to clean HTML
I often want to take a MS Word document that someone has sent me and convert it to HTML so that I can distribute it to others via the web rather than emailing it around to people. MS Word has built-in HTML conversion, but the resulting HTML is so ugly, confusing, and bloated, that it is very hard to work with if I want to do edits or tweak formatting.
Here is my current favorite method for converting Microsoft Word documents to clean HTML using Gmail:
- I email the document to my Gmail account.
- When I view the email in Gmail there is a "View as HTML" link provided for the attachment, which I click to see the Word document displayed in my web browser.
- At the next screen click the View link in the upper left, which brings up a menu of viewing options. Choose Plain HTML.
- Then with the document showing in my browser I go to view page source (Firefox for Mac = View -> Page Source) on my browser, which shows me the underlying HTML, which I block and copy into a new file in a test editor.
Posted by
AndyfromTucson
at
08:26
0
comments
Labels: html css, Microsoft Word
2009-07-30
Transact SQL for including concatenated text fields in WHERE clause
I am working with a database on an SQL Server that carries forward a legacy table structure where the description field for a Purchase Order line item is spread across multiple text columns in the table. In other words, instead of having one 250 character text field for the item description it has a total of 7 text fields of (I think) about 25 characters each. I have a web application where users can search for purchase orders using the description fields. My original solution was to check for the user's search term across each of the seven text fields using OR clauses. However, this meant that a user's search term would not be found if it happened to straddle the border between two of the seven fields.
To solve this problem I tried concatenating all of the description fields and then testing the concatenated string using LIKE, but that resulted in some POs not being inlcuded in the results when they should have been. I finally puzzled out that what was happening was that database treated empty description fields as null and Transact SQL gives a null value for the whole concatenation if you try to concatenate a number of valid string values with one null value. In other words if you concatenate Field1 + Field2 + Field3, and the first two fields have text in them, but Field3 does not, then Transact SQL will give you a null result. So the solution was to use ISNULL to convert null description fields to zero length strings when concatenating them for the WHERE clause, so that one null value doesn't ruin the whole concatenation, like so:
WHERE Field_1 + ISNULL(Field_2,"") + ISNULL(Field_3,"") + ISNULL(Field_3,"") LIKE %search-term%
Posted by
AndyfromTucson
at
08:38
0
comments
Labels: SQL, Transact SQL
2009-06-16
Easy Find is a great free alternative to Spotlight for finding files
I usually give my files long and meaningful names, so to find stuff I just need a tool that will quickly and easily let me do a wildcard search on just file names. I tried a few times, but I was never able to figure out how to do that kind of search using Spotlight. I finally came across a free application called Easy Find from Devon Technologies that is optimized for the kind of searching I need. Its pretty bare bones, but it does exactly what I want to be able to do.
Posted by
AndyfromTucson
at
16:22
0
comments
Labels: mac
2009-06-12
Applescript to give a primative command line interface to MS Word 2008
One of the things I hate about MS Word is having to use the mouse to click through menus to do simple things. Of course you can create keyboard shortcuts for stuff, but I find it hard to remember really complicated keyboard combos. What I prefer is the old XyWrite approach, which is to hit a command key, then enter a two or three letter code for an action, and then hit enter to have it execute.
Back when I was using Word 2000 for Windows I found a simple solution: Create a keyboard shortcut for the Run Macro command (Ctrl-M), and then write macros with 2-3 character names. For example: I wrote a macro to accept all revisions in a document, then named it 'aa' (for accept all). Then to accept all revisions all I had to do was hit Ctrl-M, type aa, hit enter, and boom, all the revisions were accepted.
When I switched to Mac OS X and Word 2008 for Mac I couldn't find any obvious way to recreate this functionality, so I suffered through clicking through menus for a lot of commands. However, one day I just reached my limit with click-click-click-click and decided to find a solution using Applescript. Here is what I ended up with:
-- Open a dialog box for user input
set var_input to display dialog "Word command: " default answer ""
-- For some reason you need to do this to get the user input into a string variable
set var_input to (text returned of var_input) as string
-- Applescript apparently doesn't have SELECT CASE statements so use If Else to take different
-- actions based on user input
if var_input = "st" then
-- Convert selected text to strikethrough font
tell application "Microsoft Word"
set strike through of font object of selection to true
end tell
else if var_input = "aa" then
-- Accept all changes in the document
tell application "Microsoft Word"
accept all revisions active document
end tell
else if var_input = "kt" then
-- Toggle keep text together (so text doesn't break over page break)
tell application "Microsoft Word"
tell selection
if ((keep with next of paragraph 1 as boolean) is false) then
set keep with next of every paragraph to true
else
set keep with next of every paragraph to false
end if
end tell
end tell
else if var_input = "uc" then
-- Convert the selected text to all UPPERCASE
tell application "Microsoft Word"
set case of characters of selection to upper case
end tell
end ifThen I saved the Applescript in the folder:
Users/myusername/Documents/Microsoft User Data/Word Script Menu Items With the name:
Command Line\cM.scptAlthough its not at all obvious, the \cM.scpt at the end creates a Ctrl-M as a keyboard shortcut for the Applescript. For more on naming Applescripts in this folder so they have keyboard shortcuts see:
http://www.entourage.mvps.org/script/add_shortcuts.html
Its for Entourage, but the script naming conventions appear to be the same.
Posted by
AndyfromTucson
at
12:54
0
comments
Labels: Applescript, mac, Microsoft Word
2009-06-04
How to make keyboard shortcuts for Accept Revision and Next Revision in Microsoft Word 2008 for Mac
I find the native interface for working with tracked changes in MS Word 2008 to be unbearably clumsy. You have to turn on the Reviewing toolbar and then click an icon to get to the next tracked change, then click another icon to accept the change, and then repeat, which gets to be quite a clickapalooza with a long document with lots of changes.
I prefer to hit one keyboard shortcut to move to the next tracked change, then hit another keyboard shortcut to accept the change. For some reason Microsoft didn't bother to include these keyboard shortcuts. To set them up:
- Choose View -> Customize Toolbars and Menus
- Click the Keyboard button
- In the Categories box select Tools
- In the Commands box select AcceptChangesSelected
- Click in the box for "Press new keyboard shortcut" and then hit your preferred key combo. Be sure not to use a combo that is already assigned to something because it just won't work.
- Click the Assign button.
I also like to have a keyboard shortcut for toggling track changes off and on. For that select ToolsRevisionMarksToggle in the Commands box.
Posted by
AndyfromTucson
at
12:15
0
comments
Labels: mac, Microsoft Word
2009-05-26
Batch file with ampersand in its name won't run under Windows Task Scheduler
I wrote a batch file to run a simple script and then tried to schedule it using the Task Scheduler in Windows Server 2003, but for some reason it just wouldn't run a scheduled, even though I could run it with no problem by double-clicking on the batch file name.
After banging my head against the wall for a while, I finally tried taking the ampersand out of the name of the batch file, and suddenly Task Scheduler was able to run it.
Posted by
AndyfromTucson
at
17:19
1 comments
Labels: Windows
2009-05-22
Copying all the files that match a certain pattern in a directory structure over to a single directory
For a long time I have wanted to collect all the files matching a certain pattern (Inv*.pdf) from a directory structure and copy them all to a single directory.
A Windows utility, xxcopy, has a command line switch to do exactly this.
I also found a forum discussion on how to do it in both Windows and *nix. And another one just about Windows.
With xxcopy the command line syntax to do what I wanted is:
xxcopy d:\contract\inv*.pdf d:\procurement\invoices\ /SG /BI
The /SG switch tells it to recursively (i.e. including from subdirectories) copy all of the files matching the wildcard pattern to the single target directory (i.e. without recreating the subdirectories under the target).
The /BI switch only copies files that either do not exist in the target directory or are newer versions of existing files.
Posted by
AndyfromTucson
at
13:18
0
comments
Labels: Windows
How to use Windows Task Scheduler to copy files from a server in another domain
My problem was that I wanted to do a nightly transfer of files froma Windows machine in another domain to my Windows Server 2003 machine.The script to do the file transfer was easy, but I couldn't find a wayto keep the remote server mapped as a network drive. If I mapped thedrive through the GUI and clicked "Reconnect at Logon" it wouldn'treconnect after the server rebooted. Possible part of what made itdifficult was that the remote server was in a different domain and Ihad a different credentials on the remote server.
I figured out a way to permanently map a network drive to the remote server in a different domain, but then I discovered that batch files run using the Task Scheduler do not see any mapped network drives. Apparently network drives are only mapped to drive letters for real interactive sessions, and a user's network drives are not mapped when you run run a Task Scheduler job as that user.
After poking around a bit I found that the solution was to enter my credentials for the remote server in the Stored User Names and Passwords (Start button -> Control Panel -> Stored User Names and Passwords) utility on the local server. Apparently if you do that, whenever the local machine tries to access a resource on the remote machine Windows automatically uses the stored credentials to log into the remote machine.
So, once I entered my credentials to the remote machine in Stored User Names and Passwords I then mapped a drive letter to that machine in the first line of the batch file like so:
net use n: \\servername\volumename /persistent:no
And then used that drive letter for the copy command in the batch file.
UPDATE 2009-09-04. Somehow my entries in Stored User Names and Passwords on a Windows Server 2003 machine vanished overnight. When I went into the Stored User Names and Passwords GUI application from the Control Panel and re-entered my credentials using the format "\\10.10.10.1\sharename" for the server name the stored credentials wouldn't work when I tried to access shares on remote servers. I then opened a DOS prompt and tried this:
net use \\10.10.10.1\sharename /savecred
which resulted in prompts for me to enter my user name and password, which I did. After that new entries showed up in the Stored User Names and Passwords panel access through the Control Panel, and the stored credentials worked when I tried connecting to remote servers. I did notice that the new entries created through the/savecred method used just 10.10.10.1 as the server name, with no slashes and no share name, so maybe that was the problem all along.
Posted by
AndyfromTucson
at
08:40
5
comments
Labels: Windows
2009-05-20
How to permanently map a network drive to a machine on another domain in Windows Server 2003
After a lot of trial and error trying different combinations of switches on the net use command, here is the network drive mapping method that resulted in a drive mapped to a remote machine in a different domain using different credentials that will survive a reboot of the local machine.
At a command prompt I ran:
net use h: \\server\folder /savecred /persistent:yes
I was then prompted to enter my username and password for the remote server, which I did. The drive was then successfully mapped, and the drive was still mapped after the machine was rebooted.
Posted by
AndyfromTucson
at
08:21
0
comments
Labels: Windows
2009-05-06
How to create a Mac OS X keyboard shortcut to print to PDF
I was getting sick and tired of having to go to the mouse to click the PDF button from the Mac OS X print dialog every time I print a web page to PDF (which is really the only "printing" I do anymore). I googled around and found this awesome tutorial about how to set up a keyboard shortcut for this that I never would have figured out on my own in a million years:
Keyboard Shortcut for “Save as PDF…” in OS X at macsparky.com
This only gotcha I ran into is that you have to enter "Save as PDF..." with "as" in all lowercase in order for it to work. Entering "Save As PDF..." doesn't work.
Posted by
AndyfromTucson
at
17:38
0
comments
Labels: keyboard shortcuts, mac, PDF
2009-03-16
Backing up Google calendar using wget for Mac OS X
Back when I was on Windows I used wget to download the iCal file of my Google calendar as part of my nightly backup. I am finally getting around to adding it to my Mac backup script.
First step; Does Mac OS X have wget built in? Doesn't appear to.
I found wget for Mac OS X Leopard on Quentin Stafford-Fraser's blog and followed the installation instructions in the readme file.
The readme file says you will need to add the folder where you put wget to the PATH, so I googled and found these instructions on how to do that:
- Create the file /etc/paths.d/wget like this:
sudo touch /etc/paths.d/wget - Edit the file:
sudo nano /etc/paths.d/wget - Put the path inside the file:
/usr/local/bin
Then I looked up the http address of my Google Calendar iCal file by going to Calendar Settings and clicking on the iCal button in the Private Address area near the bottom.
Then I went to Wget manual at gnu.org and figured out the syntax for what I wanted to do:
wget -P /Users/myusername/Documents/Google_Calendar_Backups http://www.google.com/calendar/ical/mygoogleusername@gmail.com/private-randomlettersandnumbers/basic.icsAnd then I tested it in a bash script, and when I verified it worked I added it to my regular nightly backup bash script.
Posted by
AndyfromTucson
at
17:50
1 comments
Labels: backup, google calendar, mac, PATH, wget
2009-02-25
Finally found a way to create a browseable archive of Thunderbird folders
For literally years I have been looking for a way to create an archive of a Thunderbird folder that is easy to access without having to import it back into Thunderbird. In other words, I want to be able to share a whole email with someone without having to print each email, etc. I finally found a Thunderbird Add-on that allows me to highlight all the emails in a folder and then with one click output all of the emails as individual HTML files along with an index html file which lists the Subject, To, From, and Date for each email and has a link to each individual email file.
ImportExportTools (MboxImport enhanced)
I have probably spent a total of 10-15 hours over the years looking for ways to do this, so it is quite a relief to find something that appears to work!
Posted by
AndyfromTucson
at
16:34
0
comments
Labels: Thunderbird
2009-01-09
Where Cisco VPN Client for Mac hides profiles
My connection profile (pcf file) for my Cisco VPN Client somehow got corrupted (it magically lost my group authentication password) so I had to copy over a backup copy of my profile. It took me a while to puzzle out where the profiles are stored on a Mac, but its:
/etc/CiscoSystemsVPNClient/Profiles
Posted by
AndyfromTucson
at
05:01
0
comments
Labels: Cisco VPN Client, mac