Posts

Output MS Publisher to PRN files

I needed a method to programatically check a series of directories for .pub and save as .prn for later batch processing to .pdf through Distiller. There were hundreds, and I just couldn't make myself do it by hand... After a little Googling, I found some useful code snippets from MS, and Google groups. Comments and credits were left intact in the functions I borrowed, as well as my own. Hope someone finds this as useful as I did. Option Explicit Function GetFiles(strPath As String, _ dctDict As Scripting.Dictionary, _ Optional blnRecursive As Boolean) As Boolean ' This procedure returns all the files in a directory into ' a Dictionary object. If called recursively, it also returns ' all files in subfolders. Dim fsoSysObj As Scripting.FileSystemObject Dim fdrFolder As Scripting.Folder Dim fdrSubFolder As Scripting.Folder Dim filFile As Scripting.Fil...

Automated CD Burning using AutoMount

One recent project for my employer was to create a headless (pc with no keyboard, mouse, or monitor) CD burner that automagically detects an inserted flash card, renames the files, and burns them to a CD along with a Flash Projector application that plays the images on PC's or Mac's. My solution was to use the AutoFS automounter daemon, and shell scripts. Much of the scripting ideas borrowed heavily from the BashBurn project. The hardware used was commodity workstations, and a 9-in-one flashcard reader configured as a SCSI device. See the following articles for interesting info: http://www.grack.com/news/2003/Atech9-in-1CardReader.html http://www.cs.sfu.ca/~ggbaker/personal/cf-linux The file test.sh is run by cron every 20 seconds, piping the command through sleep: * * * * * root sleep 0; /usr/local/copydisk/test.sh && sleep 20; /usr/local/copydisk/test.sh && sleep 40; /usr/local/copydisk/test.sh Test.sh contents: #!/bin/bash if [ -f /usr/local/copydisk/...

Windows VBS Automated Maintenance Scripts

I had a need to automate a number of tasks for remote administration, and used Visual Basic Scripting and Windows Scripting Host Objects, since I am fairly comfortable with VB/VBA. This is an automated defragmentation script that uses dirms.exe, a defragmentation utility found here . Option Explicit Dim FSO, Drive, oShell, WshShell, BtnCode, rtn, hd, stComp Set WshShell = WScript.CreateObject("WScript.Shell") Set FSO = CreateObject("Scripting.FileSystemObject") Set oShell = WScript.CreateObject ("WScript.shell") '''' ''''''''''''''''''' DIRMS.EXE USAGE ' dirms c -q : Do free space evaluation, defragment, and quickly move files to the front of the drive ' dirms c DEFRAG -q : Defragment files only ' dirms c CoMpAcT -q : C ompact only ' dirms c COMFRAG -q : Perform partial compaction (quickly) on all fragmented files ' dirms c COMFRAG c:\filena...

Linux screensaver for Windows

WOW, this is cool. A Linux screensaver for Windows . Gotta try this out, and impress my co-workers... ;).

Database updates

I needed a method to update a database application across a WAN, and found that I could do this with my Linux firewalls, and Windows batch scripting. The topology is this: Win2k Svr -> Linux FW -> Internet Win2k Svr batch file: @ECHO OFF SET _LOGFILE=mydb.log Net Stop "SQL Anywhere - mydb" >> "%_LOGFILE%" ATTRIB -R "C:\Program Files\mydb Software\mydb\mydb.db" ATTRIB -R "C:\Program Files\mydb Software\mydb\mydb.log" NET USE Z: \\win2ksvr\home\backup\backup\mydb admpass /USER:domain\admin FOR /F "tokens=2,3,4 delims=/ " %%i in ('DATE /T') do set d=%%k%%i%%j FOR /F "tokens=1,2,3 delims=:. " %%i in ('TIME /T') do set t=%%i%%j%%k XCOPY "C:\Program Files\mydb Software\mydb\mydb.log" Z: CALL :REPORT %ERRORLEVEL% "C:\Program Files\mydb Software\mydb\mydb.log" XCOPY "C:\Program Files\mydb Software\mydb\mydb.db" Z: CALL :REPORT %ERRORLEVEL% "C:\Program Files\mydb Softwar...

Time to add to this blog

I can't believe it's been this long, and that I've neglected this blog for such a long time. Oh well, I'll just make it my scratch pad for tech notes.

New job!!!

Got a new job at techWorks as a Tecnology Architect. I am STOKED! Can't wait to start. I will be a hired-tech-gun for 10-15 clients. They call, I respond and repair/deploy/whatever-is-nesessary. This will be a great experience for me, and I'm sure I'll be introduced to many new things. I'm pretty much a sponge for technology, so this will suit me fine. They have two offices, one in Wauwatosa, which is where I will work, and one in Madison. They are a new company, but very forward thinking, and growing rapidly. I was very impressed by the things that the president of the company had to say concerning the work-ethic and the importance of maintaining a good working relationship with the customer. This was embossed on my brain early in my working career, so I should fit right in. More next week!