Posts

Showing posts with the label bash

Using ffmpeg to split MOD movie files.

Image
My wife and I recently purchased a Panasonic SDR-H40 for capturing video of our son and daughter, after our Canon MiniDV crapped out last year. It was disappointing when the Canon failed again...TWO times this thing decides to get tape debris caught in the heads. This was the most delicate camera ever owned, and captured excellent quality footage, but I will NEVER buy another tape-based machine. The Panasonic falls short in the quality department as compared to the Canon, and we knew that going in. The maximum video quality is 10mbps, which seems to be pretty good quality on a laptop. I haven't tried it on a analog TV yet. Image via CrunchBase I needed to post these clips on YouTube for family and friends located in various parts of the planet, and rapidly discovered that the MOD files stored on the SDR-H40 can be accessed easily as plugging in the USB card, and waiting for udev to automatically mount it on my shiny new installation of Ubuntu. I discovered that t...

NPI Search Redundancy

Most healthcare professionals know at this point that all providers of health care, require NPI (National Provider Identifier) numbers. Without one, it will become increasingly difficult for claims to be paid by commercial payers, and impossible to collect medicare and medicaid payments. Since we are a coding/billing/collection/management agency, we have frequented the NPPES (National Plan & Provider Enumeration System) to lookup NPI information. Unfortunately, there have been brief periods of downtime of the site, causing us to implement our own solution: a backup of the registry. I have a daily cron job that downloads the NPI database, push it into MySQL, giving us an albeit slow, but accurate access to an off-line version of this data. The shell script below performs the retrieval: #!/bin/sh WORKDIR="/srv/htdocs/npi" LOG="$WORKDIR/npi.log" MONTH=`date +%b` LASTMONTH=`date +%b --date='1 month ago'` YEAR=`date +%Y` URL="http://nppesdata.cms.h...

Homegrown Remote Assistance

Back in 2004, we were looking for a cheap way of providing remote desktop support to our customers. This would serve a few purposes: Reducing or eliminating trip charges to the customers. Providing instant support to our customers. Reducing the cost to my employer who was paying us mileage. Using a ShuttleBox as a server, I set about installing FreeBSD and configuring vncserver to run in a sort of Terminal Services mode. I used FVWM as the windows manager, since it is lightweight and simple to modify. Many projects use this for kiosks and the like because of it's ease of configuration. I set up a fvwm2rc file that would be placed in /etc/skel/.fvwm2rc so that when each user account was set up, it would already be setup for use. # this is a bare bones sample .fvwm2rc/system.fvwm2rc file for fvwm. # It should be customized before install. See other sample .fvwm2rc files # for hints, as well as pointers from the various links on the official # fvwm web page (see the FAQ). EdgeR...

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/...

SSH and Samba

One of my tasks was to set up a Campaign office in downtown Racine, to house our Development Office. Their primary role was to raise money for the new Racine Art Museum. I set up SBC DSL, small office package for the connection to the web. Parked a Linux firewall/file-server/proxy server in front of the workstations to protect them from the baddies ;-). It was an old 233mhz machine I picked up for change, and worked like a champ. I bullet-proofed it with scripts and tutorials from Dranch and his work with TrinityOS. Great job David! I also use Tripwire , a great project. I needed to provide some sort of method to provide these users access to our file server at our main office, where we were being supplied with SBS DSL, but this time the service came with a 5 port router, and all external IP's were NAT'd to internal addresses in the router. I wanted to use FreeS/WAN , but I was having too much trouble punching a hole through the router, so I used SSH and Samba. I setup a co...