Export/Import Grindstone XML to Google/iCal/ICS

I recently started using Grindstone to track my daily workload, and I've been using a number of calendars on Google to not only share classifications of appointments, but to track historical data (Android call logs, etc). I kind of expected that Grindstone would have iCal/ICS export capability, but sadly it does not appear so. You can, however, export to XML. So I thought I'd write up a Perl script to convert the XML data into an ICS file ready for import into Google Calendars. Feel free to download it and use to to convert your Grindstone XML files into iCal data.

Here's the Perl script: grindstone2ics.txt (Save as .pl, not .txt)

If you are on Windows with ActivePerl installed, here's a batch file that you can drag-and-drop your XML file onto. Place it in the same folder as "grindstone2ics.pl": grindstone2ics.bat

Let me know if this helped you!

Simple Script to Mount Disk Image Partitions Looped on Linux

Every so often I have to recover a drive to a disk image on Linux, and before I transfer the data back to a physical drive, I like to mount the disk image check on it's status. Mounting a partition from a disk image is slightly more complicated than mounting just an image of a partition, so I thought I'd post a shortcut to doing so. This information was derived from the how-to posted here (http://madduck.net/blog/2006.10.20:loop-mounting-partitions-from-a-disk-image/). You will need to alter three variables: DISKIMAGE, DISKPARTITION, and the mount path at the end of command.

DISKIMAGE=/media/usbdisk/mydiskimage.img ; DISKPARTITON=2 ; mount -o loop,offset=$((`fdisk -lu $DISKIMAGE 2> /dev/null | grep -P "$DISKPARTITON\s+\**\s+[0-9]+\s+[0-9]+\s+[0-9]+\s+[0-9]+" | sed 's/\*//g' | awk '{print $2}'` * `fdisk -lu $DISKIMAGE 2> /dev/null | grep "^Units" | awk -F"= " '{print $3}' | awk '{print $1}'`)) $DISKIMAGE /media/recovereddisk/

Hope this helps someone else save some time!

Whitelisting Incoming Calls on Asterisk

For some reason, this is a topic that I couldn't seem to find a simple HOWTO online for, so I had to create my own.

I ran into a situation where I have a large number of auto-answering intercom boxes connected to an Asterisk system. The intercoms are programmed to pick up immediately upon ringing, allowing the caller to communicate with the room's occupant without any action taken by the occupant. These intercom lines are assigned a DID number from the outside world in a large metro area. See the problem? The occupants were getting a number of calls from locals whom had dialed the wrong number. Sometimes the caller wouldn't hear a response, so they'd call back repeatedly, to the irritation of the occupant. For our scenario, blacklisting wasn't a good option. In metro areas, misdialed numbers are common, and rarely from the same person. I needed to only allow a handful (~20-50) of callers that we knew would be calling the intercoms legitimately. Furthermore, it would be useful to have a notice played for a blocked caller to that they knew either to not try calling again, or to contact us to whitelist the number.

Here are the rules I used in Asterisk to achieve this goal. First, in extensions.conf, I created a macro for whitelisting:

; Only allows calls from numbers in the whitelist DB
[macro-inbound-whitelist]
exten => s,1,GotoIf(${DB_EXISTS(whitelist/${CALLERID(num)})}?:blacklisted,s,1)
exten => s,2,Dial(${ARG1})

Then, if you don't have a blacklisted context already, create one:

[blacklisted]
exten => s,1,Playback(not-taking-your-call)
exten => s,3,Hangup

Next, change your inbound call config to use the inbound-whitelist macro:

exten => 5551234567,1,Macro(inbound-whitelist,SIP/123)
exten => 5551234567,2,Hangup

Reload the asterisk config and make a test call. You should get a recording saying that it (Asterisk) is not taking your call.

Now add your number to the whitelist:

asterisk -r
database put whitelist 5551230000 1

And do another test call.

One last word of warning. I did once run into a condition where our telco provider abruptly stopped sending caller ID through our PRI. When this happens, ALL calls show up as null/blank calling numbers. In these instances, ALL calls to your whitelist-protected extensions will be blocked (at least from outside). To temporarily disable whitelisting until the problem is resolved, simply comment out the "exten => s,1,GotoIf ..." line and reload asterisk.

Hopefully this saved someone else out there some time.

UPDATE: I found that comparing against two whitelists (a customer whitelist, and our support number whitelist) can be handy. Use this line instead if you want similar logic:

exten => s,1,GotoIf($[ ${DB_EXISTS(whitelist-${ARG2}/${CALLERID(num)})} | ${DB_EXISTS(whitelist-support/${CALLERID(num)})} ]?:blacklisted,s,1)

Also with this option, I can treat the whitelist name as an argument in my macro call:

exten => 5551234567,1,Macro(inbound-whitelist,SIP/123,customername)

In this case, the whitelist DB would be named "whitelist-customername".

Installing Fedora 16 on XenServer 6

Credit for this procedure goes to Major Hayden at Racker Hacker (http://rackerhacker.com/2012/02/11/installing-fedora-16-in-xenserver/). My procedure just uses an alternate, minimal kickstart file that gives you more control over the installation using the Anaconda GUI.

- Start an installation using the RedHat 6.0 64bit template
- In the installation wizard, use these advanced options: console=hvc0 serial ip=dhcp nogpt vnc ks=/"content/f16onxen6.ks
- Connect to the installer GUI using VNC and the IP shown in the console.

Proceed as normal! If you care to see the source of the kickstart: /"content/f16onxen6.ks

Cisco ASDM-IDM Launcher: Stuck on "Contacting the device. Please wait..."

I recently ran into an issue on Windows 7 64-bit where ADSM-ISM Launcher failed to connect to my ASAs. Launching the application from a shortcut, and attempting to connect resulted in the launcher halting on "Contacting the device. Please wait...". And waiting didn't help. Opening the java console revealed another error which didn't get me any useful results on Google:

Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: sun.security.ssl.X509TrustManagerImpl cannot be cast to com.sun.net.ssl.internal.ssl.X509ExtendedTrustManager

However, if I "re-installed" ASDM via the "dm-launcher.msi", the first time it was spawned by the installer, everything worked fine. Subsequent launches from the application shortcuts failed. A quick check with Process Explorer revealed the issue. The dm-launcher installer launched the java app using "C:\Windows\SysWOW64\javaw.exe", whereas the shortcut would use "C:\Windows\system32\javaw.exe".

The ultimate fix ended up being updating all my ASDM shortcuts to use "C:\Windows\SysWOW64\javaw.exe". Now everything is working great!

UPDATE 2/25/2013: So the pain continues with Java 7. If you have upgraded your JRE, you probably saw a recurrence of this issue. In that case, I recommend pointing your shortcut(s) directly to the version 1.6/6 JRE instead:
"C:\Program Files\Java\jre6\bin\javaw.exe"

Hope this helps someone else out there.

If you found this helpful, maybe you'd like to send a thank you from my wishlist?

Forcing RDP Connections Fullscreen on a Specific Monitor (Saving Window Position)

One of the frustrations I have/had with Remote Desktop connections on multi-monitor workstations (with unique display resolutions mind you) is that there's no way within the RDP GUI to save the position of a fullscreen RDP session. So if your RDP session opens up on display 2 each time, good luck getting it to display properly on display 1 or 3 unless you have identical resolutions on each display. Even then, it's a hassle to restore the RDP session to windowed mode and move the the preferred display each time you connect.

Hassle no more: There is a solution. All you need is notepad and a little understanding of how display coordinates work (don't worry, I'll explain).

First off, save your RDP session to an RDP shortcut (ie, Acme.rdp). Open notepad and drag the RDP file into the window. Notpad should open the source of the RDP file for your perusal. You'll see some lines similar to this buried within the file:

screen mode id:i:2
use multimon:i:0
desktopwidth:i:1920
desktopheight:i:1080
winposstr:s:0,1,50,170,250,370

Set "screen mod id" and "use multimonitor" as shown above. The settings "desktopwidth", "desktopheight", and "winposstr" will vary depending upon the resolution and physical position of the display you iwsh to use as the destination.

First, an explanation of the winposstr variables we are concerned with (in order):
s: Not applicable
0: Not applicable
1: Sets the RDP session to start windowed (screen mode id sets it to be fullscreen after launch)
50: Pixel distance from the left-hand edge of display 1 to the left edge of the RDP window
170: Pixel distance from the upper edge of display 1 to the upper edge of the RDP window
250: Pixel distance from the left-hand edge of display 1 to the RIGHT edge of the RDP window. Difference between this and the left edge must be >= 200! (250 - 50 = 200)
370: Pixel distance from the upper edge of display 1 to the LOWER edge of the RDP window. Difference between this and the upper edge must be >= 200! (370 - 70 = 200)

Note again that the window dimensions MUST be greater than or equal to 200x200. If it is less, RDP will completely ignore your windows placement dimensions and go with defaults, defeating the purpose of this process.

Now that you know what the numbers mean, you need to understand where to place the window (by pixel dimension) in order to get it to come up on the proper display each time. You have two options: The complex/geeky way, or the simple way.

The Complex Way

Screen coordinates are all relative to the upper left edge of display 1. This position is 1,1. So if You have a single display system with a resolution of 800x600, the lower right corner of the screen is position 800,600. If you have two displays at 800x600 positioned like this in display properties:

[1][2]

...the lower right corner of display 2 would be 1600x600

If the displays were physically reversed:

[2][1]

..the lower LEFT corner of display 2 would be -800,600

Based upon this information, and using some simple math, you should be able to estimate window position amongst your displays. Now, this will get slightly more complex if your displays are offset on the Y axis, so what you might prefer is the...

Simple Way
Download and install the free AutoHotKey Basic. It comes with a nice utility called "AutoIt3 Window Spy". Run this utility and fire up your RDP session in windowed mode. Then, move the RDP window into your desired destination display. Try to keep the Active Window Info screen visible when you do this.
You should see something similar to this in the Active Window Info window:

>>>>>>>>>>( Active Window Position )<<<<<<<<<<
left: 434 top: 700

Now, lets use those numbers to create the winposstr settings:

winposstr:s:0,1,434,700,634,900

Note that I added 200 to the window position (634,900) creating a window size of 200x200.

Adjust the display width and height settings to match your destination screen.

Go ahead and save the RDP file and try connecting again. The RDP session should now open on the correct screen each time you use this shortcut.

Authenticating to MS SQL Server on a Different Domain Using Windows Authentication (Windows 7)

When trying to connect to an MSSQL server on another domain (of which you are not a member), you'll probably run into the issue where selecting the Windows Authentication option in the SQL Server connection dialog grays out the username and password. Here are two workarounds:

Scenario
SQL Server: sqlserver.mydomain.com
Domain: MYDOMAIN
MYDOMAIN Username: joe.user

A) Create Saved Credentials
Go to the Control Panel --> User Accounts --> Manage Your Credentials (in left-hand pane) --> Add a Windows Credential

Address: sqlserver.mydomain.com
User Name: MYDOMAIN\joe.user
Password: (password for joe.user on MYDOMAIN)
Click OK

Now, when you fire up SQL Server Management Studio, enter your server name (sqlserver.mydomain.com) and select Windows Authentication. THE USERNAME WILL BE GRAYED OUT but that's fine. The connection will authenticate properly anyhow. Go ahead and connect.

B) RunAs Command Line (requires user interaction for password)
Open a command line and run this:
runas /netonly /user:MYDOMAIN\joe.user "C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe -S sqlserver.mydomain.com -E"
(You will need to alter the SQL Management Studio exe path as is applicable to your PC)
When prompted on the command line, enter the password for joe.user.
SQL Management Studio should load and automatically connect to the SQL server.

If you are unable to connect with either of these scenarios, check the firewall settings on the remote system.

Credit where credit is due (references):
http://stackoverflow.com/questions/849149/connect-different-windows-user-in-sql-server-management-studio-2005-or-later
http://support.microsoft.com/kb/306541
http://social.msdn.microsoft.com/forums/en-US/sqlsecurity/thread/ed11ff0f-b59c-48bc-ba92-277f1c3e3107/

If you found this helpful, maybe you'd like to send a thank you from my wishlist?

Overcoming the the Zyploit error when using Unrevoked

If when your try rooting your phone with Unrevoked, you encounter the error "process com.unrevoked.zysploit has stopped unexpectedly" during the initial rooting process, you probably have an application interfering with Zysploit, or a bad install of Zysploit itself. Try removing the following apps (from Manage Applications") in order, and retry between apps:
- Zyploit
- Wireless Tether
- Comcast Xfinity

If someone out there could help confirm what app ultimately fixed this issue, I would appreciate it so I can report the confirmation here. I my case, I started with uninstalling Comcast Xfinity, then with Wireless Tether and Zysploit. Once I did that, Unrevoked worked great.

My Struggle with Android: Stock or Mod?

Since about November of last year, I've been running an HTC Evo 4G. I had to leave the WebOS platform due to ongoing (and persisting) uncertainty surrounding it's future viability in a quickly firming iOS/Android market plurality. I've enjoyed a number of features from Android and it's apps, even though I miss a large number of design features of WebOS. I'll have to leave that comparison for a future article perhaps.

So after I got used to the features and quirks of the Evo stock ROM, I ventured into the world of ROM modding, specifically Cyanogenmod 7. The feature set of CM7 is very alluring, tweaking away many of those annoyances that come with the stock ROM. However, I notice a number of other quirks that crop up with this Gingerbread-based ROM that constantly make me wish for some of the polish of the HTC-customized Froyo stock ROM. This list is an attempt to document these pros and cons between the two sides of the modding coin.

HTC Evo Stock ROM
Pros
Clock App (integrated timer/stopwatch/alarm)
Dialer (functions just seem more intuitive)
Contacts (better contact linking, more intuitive)
Cons
Text Selection utility is lacking, missing entirely in some apps

CyanogenMod 7
Pros
Improved text selection tool
Universal LED notifications using "WiMax LED"
Better unattended 4G scanning (compared to latest stock ROM)
Notification area quick-toggles (Wifi, 4G, Torch, etc)
Cons
No text selection in email
Intermittent signal issues, connectivity loss
Poor Swype integration (conflicts with Gingerbread text selection popup menu)

I will be updating this list periodically as I recall each issue.

HOWTO: Install Mobile Hotspot on a non-Verizon Palm Pre

(Adapted from http://forums.precentral.net/web-os-development/239471-how-install-mobile-hotspot-1-4-1-1-sprint-pre.html)

Disclaimer:
Installing and/or using Mobile Hotspot and other tethering methods may violate your wireless contract's terms of service, and possibly the device warranty as well. You do so at your own risk. In the highly unlikely event that you damage your phone beyond recovery, I am not responsible.

That said, the process is actually pretty simple, and you don't have a lot of reason to be afraid. If you screw your phone up, Palm provides a tool to recover it called WebOS Doctor which will reset and re-install the software on your phone back to new. Tethering really isn't a problem either, just as long as you use it within reason and stay under the radar. Most providers don't pay much attention to your traffic until you consume more than 5GB in a month on your 3G connection. There's a homebrew utility for the Pre called Netstat that will help you keep an eye on this. Don't do something stupid like download a bunch of large files as this will probably throw up red flags at your carrier. If you just use Hotspot for web browsing a few times a month for a few hours at a shot, you probably have little to nothing to be concerned about. And, if you follow these instructions, you should have no problem installing and using Hotspot, even if you've never done something like this before.

There are the several basic (but detailed) steps involved:

- Turn on developer mode on your Pre
From the main screen, as if you a searching for an application, type:
webos20090606
A hidden application named "Developer Mode Enabler" will show up. Tap it. When the application opens, flip the mode switch to "On". It will then ask you to restart. Go ahead and restart.

- Obtain and Install WebOS Quick Install
Download WebOS Quick Install from the PreCentral forums. Once you've downloaded it, double-click on the file to run it. If in the unlikely event it doesn't run, you may need to download and install Java. When it first runs, it will ask you to download the WebOS Doctor for your carrier and phone. Just select your option, and proceed. When it's finished downloading, WebOS Quick Install will finish starting up. Now, with the USB cable that came with your phone, connect your phone to your computer. If windows indicates that it is installing new software, wait until it completes before proceeding. Now go to the Tools menu and select Device Management. After a pause of about 10-20 seconds, you should see a windows showing you details about your Pre. If you don't see this window, you may need to re-install the phone driver. Only in this case, go to the File menu, select Options, and click "Attempt Novacom re-installation". After this completes, unplug the USB cable and plug it back in to re-detect the phone.

- Install Preware
Close the Device Management window. Now that you are back on the main screen, click the blue down arrow. When the IPKG Repository Viewer opens, drop down the top combo box and select WebOS-Internals Feed (Pre). Then check the box in the list below next to Preware, and click Download. When it is finished downloading, click Close. Finally, click Install. When the installer finishes, you may proceed.

- Download and Install the FreeTetherd and and Mobile Hotspot ipk files
Download the FreeTetherd and Mobile Hostspot ipk files from the PreCentral forums. You may need to register to download, but registration is free. Once downloaded, drag the files into the WebOS Quick Install window and click Install. Congratulations! Mobile Hotspot is installed and ready to be used!

- Configure Mobile Hostspot
When you first start Mobile Hotspot, it will welcome you with the usual statement about needing a plan from your carrier to support it. Refer to the statements made above, and feel free to continue. By default, the phone will automatically name the wireless network something like "webOS Network 3F:2E:1D". You may click on the name and rename it whatever you wish, such as "Palm Pre Hotspot", or you can leave it be as is. Tap Change Passphrase and enter your desired wireless password. This is the password that will keep others from using your hotspot, and allow you to connect to it with your laptop or other WiFi device. When you have clicked done, you are done configuring!

- Connect to your Hotspot!
When you are ready to use your hotspot feature, simply tap the "Off" switch to flip it on. Then just connect to your wireless network with your laptop and enter the password you previously specified. Once it connects, you're ready to surf! Note that while the Hotspot is running, you can still multitask on your Pre (Listen to music, browse the web, check email, etc.). When you are finished using the Hotspot feature, turn it back off to conserve battery and restore the normal WiFi client connectivity. I should also mention that on non-GSM carriers (such as Verizon and Sprint), when a phone call is placed or received, it will pause your internet connection until the phone call is ended.

- (Optional) Install Netstat

On your phone, you now have an application installed called Preware. This application opens up a whole world of free modifications (patches) and homebrew software for your Pre that isn't otherwise available in the App Catalog. In this case, we're going to install Netstat, which allows you to tally up your data usage over the period of a month. This should help you keep an eye on how hard you are on your data plan. To install, launch Preware. After it has finished starting up, just start typing "netstat" and hit enter. Tap "Netstat" and then tap Install. If it asks you to install dependencies, proceed. When it has finished installing, you will probably be asked to restart Luna. Proceed with the restart. When the Pre interface comes back, launch Netstat. You will then see 3 counters: The first is WiFi, which is irrelevant our concern, then 3G/Wireless (looks like a pole with radiating blue lines) which is what we want to watch, and lastly Bluetooth which is irrelevant. As you use your Pre on a daily basis, and as a hotspot, your 3G usages will increase. After a month has passed, you can click on this value to see your historical usage. Make sure you don't exceed or even come too close to 5Gig or your carrier might have a fit and give you an uncomfortable call.

Lastly, if you ever wish to return your phone, or bring your phone in because of problems following this, I would highly recommend using WebOS doctor to restore your phone to factory default software first. Nobody at your local wireless store likes to hear about device problems potentially created by unsupported software.

So there you have it! Painless, eh?

Finicky: A2DP Bluetooth Stereo on Dell Latitude E6500 w/ Windows 7 64-bit

I thought I'd write up a little bit on my ongoing hassles with A2DP (Bluetooth Stereo Headphones) on Windows 7. I would say it's a hassle only on Windows 7, but in all honestly, my experiences with A2DP on WinXP weren't much better, just different.

To start out, a little background: My first success with A2DP was with my Dell D820 with WinXP and the Toshiba Bluetooth stack. This was far from stable, but I could at least get it to work consistently by following a routine involving disabling and re-enabling the Bluetooth adapter and rebooting my headphones. From here, I "upgraded" to Windows 7 RC 32-bit, which worked OK with the Vista drivers for the D820. Audio connectivity was finicky, especially after rebooting, but I could usually get it working again just by removing and re-pairing my headphones. Next was my upgrade to the full release of Windows 7 (32bit). The same problems pretty much stuck around. My biggest issue was with a Windows Update driver that seemed to break A2DP, so I'd have to keep backing it out if I accidentally installed it. Unrelated instability issues with Win7 on the D820 led me to a new PC, the Latitude E6500.

So here I am, with brand-spanking new Dell Latitude E6500 with Windows 7 64-bit and a Dell Wireless 370 Bluetooth mini-card inside. Aside from the topic at hand, this didn't fix the stability issues, just FYI. The from-factory drivers for the Bluetooth adapter were version 6.2.1.100 A17, IIRC. When I look it up now, it shows up as Vista 64 driver. These drivers simply didn't work. They would pair with my Insignia NS-BTHDP headphones, create all sorts of devices in Device Manager, but no audio device would show up in the Sound control panel. Needless to say, audio never routed out to my head.

Next I tried downgrading to the 6.2.0.9600 A01 drivers, listed on Dell's support site as being for Win7 64bit. These would pair, work for an hour or so, then apparently crash. The Bluetooth icon would disappear from the taskbar, and audio would get re-routed to my hardwired desktop speakers. This happened multiple times, and re-installing the drivers didn't seem to help.

Currently I'm using the v6.2.1.800_7a drivers from Gateway's website (http://support.gateway.com/support/drivers/getFile.asp?id=24324&dscr=Broadcom%20Bluetooth%20Network%20Driver%20Version%206.2.1.800&uid=263953937). These seem to work OK, so far.I did notice today that I had to toggle the wireless switch to get the Bluetooth light to activate on my laptop. Once it lit up, it automatically re-connected to my headphones. I can live with this for now. Hopefully I don't see any more driver crashes.

Note that when re-installing these drivers, you should follow this procedure. Failure to do so can lead to some odd results in Device Manager, and total lack of Bluetooth functionality.

- Delete any paired devices (if possible)
- Clear pairings from your BT device
- Turn off the Wifi/BT switch on your laptop
- From "Programs and Features" control panel, uninstall the WIDCOMM or Dell Bluetooth drivers
- Reboot (DON'T SKIP THIS)
- Run the install for the new Bluetooth driver (v6.2.1.800 is my recommendation)
- When asked, flip the WiFi/BT switch back on.
- Reboot (just to be sure that the new driver takes)
- Pair your headphones

If you reboot/hibernate/suspend and find that the BT light is out, toggle the WiFi/BT switch.

Good luck!

UPDATE 4/2: Grr. It's still happening. Still looking for a solution...

Fixing Xen Error: (12, 'Cannot allocate memory')

I don't know why this hasn't already been posted all over the interwebs, so I thought I'd post it here. It's amazing how some of the simplest answers never seem to make it into prominence in the Google search rankings.

Anyway, after cloning a VM today in Xen, I tried to start the DomU, and got this error:

Error: (12, 'Cannot allocate memory')

I assumed it had something to do with my Dom0 memory cache consuming nearly every last bit of free memory on my system, so I ran this to clear the cache:

echo 3 > /proc/sys/vm/drop_caches

I confirmed that that "free" reported that the cached memory dropped near zero. Great! Except it didn't help. I then ran "xm info" to check the memory usage in Xen

total_memory : 16378
free_memory : 2

Odd. I checked the Dom0 status to see what's up, and sure enough, my memory allocation on Dom0 is way high.

xm list Domain-0
Name ID Mem VCPUs State Time(s)
Domain-0 0 10482 4 r----- 3273110.4

But I still didn't know how to shrink it. I knew it had something to do with memory ballooning. I also knew you could set the memory allocation of a DomU with "xm mem-set", but I didn't know anything about how to do it with the Dom0. A quick IRC message to my Xen guru, Jima, and I get this simple command (obvious really) in response:

xm mem-set Domain-0 512

This balloons the Dom0 host system (as well as any domain, really) memory usage down to 512MB. In my case, my Dom0 claimed to be using about 2 Gig already, so I ballooned down to 4G instead. Not sure if that was just due to some bad math or assumptions on my part, as I never run anything of significance in Dom0. After you run this, you should be able to start your DomU just fine.

Something Fun

My wife is pretty fun.

Installing PCL6 Drivers to a Samba/CUPS Print Server

First, a little background...

The classic procedure for installing drivers to a printer shared via CUPS with a raw Samba frontend, usually is roughly something like this:

  1. Create printer in CUPS
  2. Open shared printer properties in Windows
  3. Install drivers via Advanced tab

For me, this worked great, most of the time, assuming that the driver was either PS or PCL5(e). However, PCL6 drivers rarely loaded properly. They crashed upon upload, and the driver rarely ever worked, if point 'n print even installed the driver. As I understand it, the root of the problem is that the drivers need a valid "form" database specific to the driver to be stored on the server in order to load, but valid form data can only be created by executing the driver. On Windows servers, this isn't a problem, but Samba servers cannot execute the windows driver code in order to generate this form. PCL6 drivers are particularly finicky about this, and often times will refuse properly copy to the server.

The solution I've come up with is to load the driver entirely on a Windows PC first, and tell Samba to copy the drivers and related forms, ACLs, etc over. Some of the values I use here for the printer names, etc, are very generic and only specified to match the naming standards in my environment. Feel free to change your printer setup to suit your needs.

The Procedure
On a Windows PC:

  1. Install the printer as you would normally for TCP/IP printing on a windows PC.
  2. Rename the printer to the share name you will be using (i.e., CopierCP5000)
  3. Open the printer properties
  4. Share the printer using the same name (CopierCP5000)
  5. Set the printer description to the printer name (i.e., Copier CP 5000)
  6. Set the printer location to the office name and city (ACME Abu Dhabi)
  7. Usually under the Accessories/Options tab, update/get information from the printer
         This ensures that we obtain all the correct hardware configuration information for the device (duplexer, trays, hole punch, stapler, etc)
  8. Open the Advanced tab and click the "Printing Defaults" button
  9. Click on each tab and allow the tab to load
         This ensures that the form values for each tab are created.
  10. Still inside the Printing Defaults, change the page orientation to Landscape, hit apply, change the page orientation to Portrait, and hit apply. Click OK.
  11. Close the printer properties by clicking OK

Next, on the server:

### Set up the printer in CUPS, i.e.:
lpadmin -p CopierCP5000 -L "ACME Abu Dhabi" -D "Copier CP 5000" -v lpd://192.168.xx.xx -m raw -E
smbcontrol smbd reload-config
 
### Copy the drivers, forms, ACLs, etc from the Windows PC
net rpc printer MIGRATE ALL CopierCP5000 -S mypcname -Uusername

Finally, test the driver in Windows:

  1. Open the local Printers control panel (shortcut command below for Win7 users)
         rundll32 shell32.dll,SHHelpShortcuts_RunDLL PrintersFolder
  2. Delete your shared printer
  3. Right-click in the control panel window and select "Server Properties"
  4. Open the Drivers tab
  5. Select your driver and click "Remove".
  6. Proceed with removal and close the server properties window.
  7. Open \\servername\
  8. Double-click your printer
  9. Print a test page
         If this fails, try restarting the local PC's Print Spooler service

So far I've only tested this on a few of our known-problematic printers that have PCL6 drivers available, and it's worked perfectly in each case. However it you notice this doesn't work for you, post a comment and I'll see what I can do to help.

Palm Pre: Coming Soon to Muchtall?

I just got this email in my inbox this morning (BCC'd to me):

From: (My Boss)
To: (Our Company Sprint Rep)
Subject: Palm Pre
What are the chances of getting our hands on a couple of these when they are released?
(Other Palm User) from (Our Company) and (Muchtall) from my office are waiting patiently for theseā€¦.
Thanks,
(My Boss)

Pretty awesome. Hopefully our Sprint rep can swipe us a couple before the masses clean the stores out.

Update 6/2: Just got an IM from my boss:

(11:17:23 AM) Boss: hey you available for lunch on Thur?
(11:17:32 AM) Muchtall: Sure
(11:17:43 AM) Boss: Im gonna get our Sprint reps to take us out

Sweet!

Update 6/8: So I was greeted by this email earlier this morning:

To: Boss (fwd'ed to Me)
From: Purchasing Dept
Subject: (Muchtall's) Phone
Just received call from Sprint, phone on backorder. Not sure when resupply fulfilled, will keep you in touch.

Which sucks. However, a few hours later, I get this email:

From: Corporate Sprint Rep
To: Purchasing Dept (fwd'ed to Me)
Subject: Pre
Inventory is expected tomorrow so you should have on Wednesday.

Awesome! I can't wait!

FeedReader: My New Favorite RSS Aggregator/Reader

My requirements for an RSS feed reader were simple:

  • Windows Support
  • Toaster Pop-ups (with individual news item titles)
  • Feed filters
  • Free
  • I had been using FeedDemon for a while, but it missed the second half of my toaster requirement. That and for whatever reason it seems to take days to get updates to feeds, even when I'd tell it to update sooner.

    I recently switched to FeedReader, and I have to say, if you're looking for a Windows-based RSS reader, you should make this the first client you try. It will probably be the last one you'll need.

    If you aren't using an RSS reader, I highly recommend it. They make life so much easier when you are trying to keep up to date with your favorite news sites, and most sites offer an RSS feed nowadays. It's nice to be able to just open FeedReader and see a list of what sites have updated articles, and even limit the stories to the topics you want. In my case, it's made keeping up with all the latest Palm Pre news a snap. Instead of periodically refreshing 10-15 different sites in Firefox, I just listen for that chirp.

    SourceForge Spam (or How I Learned to Stop Worrying and Just Cancel My Account)

    After having a SourceForge account for about 10 years, I'm canceling it for one reason and one reason alone: Spam. SourceForge has this "feature" where anyone can email you at yourusername@users.sourceforge.net, and they will happily forward it on to the email address you have on file with SF. That's great, except, I don't want spam bots emailing me. It would be great if you could either opt out of this behavior, or even specify a human-readable anti-spam address as the forwarding address, but SF doesn't offer either of these options. It's either you have an account and all the crap that comes with it, or you have nothing. So I choose nothing.

    Thanks for nothing SourceForge.

    So I guess if I actually want to use the SF site for forum activity, I'll have to re-create my account each time.

    Update: Ok I lied, sort of. Turns out that if you delete your SF account, you can't come back and re-create it. This sucks because I like my persona, and should I come back, I'd like to re-use it. So now I'm willing to give feedback a chance. Vote for Solution 3!: SourceForge Spam Solution

    Update 10/15/2009: You complained, and SF listened. I got a Tweet last week from @sourceforge informing me that they have added an option to allow you control over your alias behavior. You can find this setting at https://sourceforge.net/account/. Go there. Now! That is all.

    Countdown to Palm Pre

     
    I'm dying for this thing to come out. I'm even more hopeful that I'll get my hands on it come release day.
     
     
     


     
     
    Countdown to Pre-Day

    Restreaming ASF to MP3 Via Icecast and VLC

    Say you have an internet radio stream that you like to listen to. You like to actually get up from your computer once in a while and go outside, so you want to play it on your iPhone/Blackberry/G1/Treo/Centro/Pre/Whatever as you're out and about. But wait! Due to poor decision making by your beloved stream provider, your favorite stream is only in Microsoft's poorly-supported ASF streaming format. There's no MP3 or OGG options! Many if not all of the phones I just mentioned may/will not play these streams, at least not natively. MP3 on the other hand, is ubiquitous (though, given, not truly as free as OGG). One option you may have, if you run your own Linux server, is to download the ASF stream, re-encode it to MP3, and re-stream it via your own Icecast server. Icecast is easy enough to set up, however information on setting up the VLC portion of this workaround online seems a little slim online, so I thought I'd make a post simplifying the setup.

    First off, check to make sure your VLC has "Shout" Shoutcast/Icecast output support:

    vlc --list | grep access_output_shout

    You should see the following in the output:

    access_output_shout IceCAST output

    If not, you may need to either re-install with a version of VLC that supports shout output, or recompile it with shout support.

    Then run the following command, altering the items in bold for your purposes (all on one line):

    cvlc "http://classicalstream2.publicradio.org/classical" ':sout=#transcode{acodec=mp3,ab=192,channels=2}:duplicate{dst=std{access=shout,mux=raw,dst=source:YOURPASSWORD@your.icecast.server.com:8000/mpr.mp3}}' --sout-shout-mp3 --sout-shout-name="MPR MP3 Restream" --sout-shout-description="Restreaming of MPR" --sout-shout-url="http://minnesota.publicradio.org" --sout-shout-genre="Liberal Tripe" --loop

    Assuming you have already properly set up your Icecast server, you should now have a mountpoint running the stream you have just created.

    Note that VLC seems to have problems parsing some ASX playlist files. You may need to download the ASX file with wget to investigate what the actual stream URL is. For example, the stream above came from "http://minnesota.publicradio.org/tools/play/streams/classical.asx", which had these contents:

    <ASX version="3.0">
       <ABSTRACT>The Windows Media Stream for MPR's Classical Music Service</ABSTRACT>
       <TITLE>MPR Classical Windows Stream</TITLE>
       <AUTHOR>Minnesota Public Radio</AUTHOR>
       <COPYRIGHT>2009 Minnesota Public Radio</COPYRIGHT>
       <MOREINFO HREF = "http://minnesota.publicradio.org" />
       <ENTRY>
          <TITLE>MPR Classical Windows Stream Underwriter</TITLE>
          <COPYRIGHT>2009 Minnesota Public Radio</COPYRIGHT>
          <REF HREF="http://ondemand2.publicradio.org/ondemand/joinnow.wma"/>
          <BANNER HREF="http://www.publicradio.org/applications/underwriters/images/prepend/content/joinnow.gif">
              <MOREINFO HREF = "https://contribute.publicradio.org/"></MOREINFO>
          </BANNER>
       </ENTRY>
       <ENTRY>
          <TITLE>MPR Classical Windows Stream</TITLE>
          <COPYRIGHT>2009 Minnesota Public Radio</COPYRIGHT>
          <REF HREF="http://classicalstream2.publicradio.org/classical"/>
          <BANNER HREF="http://www.publicradio.org/applications/underwriters/images/prepend/content/joinnow.gif">
              <MOREINFO HREF = "https://contribute.publicradio.org/"></MOREINFO>
          </BANNER>
       </ENTRY>
    </ASX>

    As you can see, the first item in the playlist is NPR's obligatory call (**cough** commercial **cough**) for donations (http://ondemand2.publicradio.org/ondemand/joinnow.wma). The second is your actual stream URL (http://classicalstream2.publicradio.org/classical). You'll want to use the stream URL in your VLC command.

    Also, I have seen cases where VLC pukes on some ASF streams. Though I haven't confirmed this, it appears to be a bug with downsampling/resampling (http://mailman.videolan.org/pipermail/vlc-devel/2009-February/056823.html). In these cases, you may need to look that the 1.0.0 prerelease versions, which may not be available on your distro release (Fedora, for example, doesn't have it until 11). Good luck!

    UPDATE 10/27/09: It would appear that the precompiled RPMs offered on the VLC site for 1.0 or higher do not contain support for shout output. Not a big deal. Just download the source RPM (e.g., from http://download1.rpmfusion.org/free/fedora/development/source/SRPMS/) install the sources (rpm -Uvh vlc-1.0.3-0.1_rc.fc12.src.rpm), and edit the vlc.spec file (usually found in ~/rpmbuild/SPECS/). Look for a line that says "--enable-realrtsp \" and add a line below it that says "--enable-shout \". Save and close the file, then run "rpmbuild -ba vlc.spec". After it recompiles, install the updated RPMs (cd ~/rpmbuild/RPMS/x86_64/ ; yum --nogpgcheck reinstall vlc-core-1.0.3-0.1_rc.fc11.x86_64.rpm vlc-1.0.3-0.1_rc.fc11.x86_64.rpm). Make sure to alter the above paths to reflect your architecture, Fedora release, and vlc version.

    Palm Pre Release Date Hinted?

    Could this be a hint at the release date for the Palm Pre?

    http://blog.palm.com/palm/2009/04/sprints-new-pre-portal-news-videos-tweetsand-doughnuts.html

    I'm taking a shot at yes. Here's why it makes sense to me:

    - Why else would you put up a countdown to zero (Doughnut, btw) to such an obscure holiday?
    - As has been restated by Palm and Sprint repeatedly, the date falls in the first half of the year (albeit late).
    - It's a few weeks after the start of the just-announced Sprint vacation freeze
    - It's the weekend before WWDC, potentially stealing the iPhone 3.0 / next-gen iPhone thunder.

    Now, my only skepticism of the date is how close it lands to WWDC. Either the Pre will be a massive hit, and the buzz will be loud enough going into the following week to drown out the potential iPhone announcement, OR the Pre buzz quickly loses steam following launch, drowned out by the well-established Apple fanboy crowd. The potential for loss on this toss of the dice is pretty great.

    That's why I'm making one additional prediction: Palm drops another bomb on release day. Probably some yet-unseen killer app that the iPhone doesn't have. I'm guessing something that exploits the multitasking capabilities, and furthermore, can't be done via push. Palm needs something more just after the release to keep the unique multitasking abilities of the Pre in the front of people's minds right through the iPhone announcement.

    If I'm right, you can say you heard it here first.

    Update 5/20/2009: So close.