Server:Server Status

Improving the Motorola Blink Baby Monitor/Camera

So we recently purchased the Motorola Blink1 Wifi Baby Monitor (Is this the first blog post acknowledging the baby? He's due any day!) and it's neat hardware with SHIT software. Straight up, it doesn't do most things you would want. I'm working to reverse engineer this and make it workable...particularly on linux. Before I start...MAD PROPS to Simon Aldrich, whose article laid the foundation to what I'm trying to do here. This got me started: Hacking the Motorola Blink 1 Baby Monitor (Part 1) and Hacking the Motorola Blink 1 Baby Monitor (Part 2) Read more »

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Movie Theater Room Sound Panels

So we're making a movie theater room and it's set up and going well. The walls need some panels to break up the sound reflection, and rather than do curtains I wanted to do something geeky. I saw some bleach shirt techniques in reddit, but since I got felt for the texture and you can't bleach that, I used white fabric paint. I made 11 canvases, then cut black felt to fit, then traced out the logos on parchment paper, cut them out, ironed them onto the felt, then sprayed the relief pattern on. After painting, I had to wait 72 hours, then washed them, then mounted them to the canvas frames I built.

Take a look! Here's the room all together, see if you can guess the logos!

IMG_20131126_211101

IMG_20131126_211041

IMG_20131126_211035

IMG_20131126_211029

IMG_20131126_211024

IMG_20131126_211013

IMG_20131126_211001

IMG_20131126_210954

IMG_20131126_210948

IMG_20131126_210943

This is the blank canvas; I ran out of paint for the Matrix one before the first movie in the room.

IMG_20131126_211047

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Using Firefox as a Thin-App for a Specific Web-Site

Objective:

Certain websites were coded to use features and be optimized for Mozilla?s Firefox Browser. These websites utilize strict W3C HTML components which do not render properly in Internet Explorer, or rely heavily on javascript code which runs sluggishly across all versions of Internet Explorer (and impacts the system performance in other applications). Due to the organization?s security policy, the only browser allowed is Internet Explorer. Firefox is specifically disallowed for the following reasons:

  1. Patching ? Firefox updates frequently (every 6 weeks) and as a result keeping it up to date creates support overhead for the various desktop teams.
  2. Management ? Firefox is not natively customizable through Group Policy, and Mozilla?s recommendation is to configure the browser through scripting. This conflicts with our existing management and DSO compliance policies.
  3. Compatibility ? If Firefox becomes the default browser on user machines, it may create compatibility issues with other apps that require Internet Explorer, specifically certain clinical applications.
  4. Testing ? All existing production applications have been tested against the enterprise standard browser. Compounding on previous compatibility concerns, existing production applications may have to undergo testing against an additional production scenario.

Some of the above mentioned concerns are mitigated with a modified installation of Firefox that prevents the user from opening other pages, navigating away from hard-coded URLs, and removing identifying information that the program is actually running inside Firefox. The procedure for creating such a Firefox Thin-App for a web-app is defined below.

Read more »

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Bash Script to Clip Ripped Home Movies

Bash script I wrote to assist in clipping home movies. Still some more to do, but here's a summary.

Particularly useful was the code I used to find the difference under bash between start and end points using date...and keeping the result in a format ffmpeg could understand.

#!/bin/bash<br /> #&nbsp;<br /> #&nbsp;Title:&nbsp;HomeMoviesClipper.sh<br /> #&nbsp;Description:&nbsp;Use&nbsp;ffmpeg&nbsp;to&nbsp;split&nbsp;raw&nbsp;home&nbsp;movie&nbsp;captures&nbsp;into&nbsp;clips<br /> #&nbsp;Original&nbsp;Author:&nbsp;Joseph&nbsp;Gullo&nbsp;(surfrock66)&nbsp;(surfrock66@surfrock66.com)<br /> #<br /> #&nbsp;This&nbsp;script&nbsp;works&nbsp;with&nbsp;a&nbsp;very&nbsp;specific&nbsp;set&nbsp;of&nbsp;constraints&nbsp;and&nbsp;formats&nbsp;to&nbsp;<br /> #&nbsp;&nbsp;take&nbsp;raw&nbsp;video&nbsp;captures&nbsp;and&nbsp;split&nbsp;them&nbsp;into&nbsp;clips&nbsp;of&nbsp;events.&nbsp;&nbsp;Each&nbsp;of&nbsp;<br /> #&nbsp;&nbsp;these&nbsp;movies&nbsp;was&nbsp;captured,&nbsp;using&nbsp;a&nbsp;Dazzle&nbsp;USB&nbsp;video&nbsp;capture&nbsp;device,&nbsp;<br /> #&nbsp;&nbsp;into&nbsp;h264&nbsp;video&nbsp;and&nbsp;mp3&nbsp;audio,&nbsp;using&nbsp;VLC.&nbsp;&nbsp;These&nbsp;original&nbsp;tapes&nbsp;were&nbsp;<br /> #&nbsp;&nbsp;typically&nbsp;close&nbsp;to&nbsp;2&nbsp;hours&nbsp;long,&nbsp;however&nbsp;capture&nbsp;was&nbsp;often&nbsp;left&nbsp;to&nbsp;run,&nbsp;<br /> #&nbsp;&nbsp;creating&nbsp;videos&nbsp;that&nbsp;were&nbsp;8+&nbsp;hours&nbsp;long.&nbsp;&nbsp;The&nbsp;capture&nbsp;device&nbsp;produced&nbsp;<br /> #&nbsp;&nbsp;video&nbsp;that&nbsp;was&nbsp;480x480&nbsp;and&nbsp;audio&nbsp;that&nbsp;only&nbsp;contains&nbsp;1&nbsp;channel&nbsp;(recorded&nbsp;<br /> #&nbsp;&nbsp;through&nbsp;stereo),&nbsp;and&nbsp;the&nbsp;output&nbsp;video&nbsp;will&nbsp;retain&nbsp;this.&nbsp;&nbsp;The&nbsp;desired&nbsp;<br /> #&nbsp;&nbsp;format&nbsp;is&nbsp;high-bitrate&nbsp;h264&nbsp;and&nbsp;aac&nbsp;audio,&nbsp;encapsulated&nbsp;in&nbsp;.mp4&nbsp;files.&nbsp;<br /> #&nbsp;&nbsp;This&nbsp;script&nbsp;also&nbsp;works&nbsp;within&nbsp;a&nbsp;predictable&nbsp;directory&nbsp;environment&nbsp;<br /> #&nbsp;&nbsp;because&nbsp;of&nbsp;how&nbsp;specific&nbsp;the&nbsp;task&nbsp;is,&nbsp;and&nbsp;because&nbsp;I'm&nbsp;a&nbsp;lazy&nbsp;bastard&nbsp;<br /> #&nbsp;&nbsp;that&nbsp;doesn't&nbsp;want&nbsp;to&nbsp;code&nbsp;bunch&nbsp;of&nbsp;directory&nbsp;logic.&nbsp;&nbsp;The&nbsp;script&nbsp;first&nbsp;<br /> #&nbsp;&nbsp;queries&nbsp;the&nbsp;input&nbsp;file,&nbsp;then&nbsp;works&nbsp;on&nbsp;this&nbsp;file&nbsp;recursing&nbsp;the&nbsp;steps&nbsp;<br /> #&nbsp;&nbsp;for&nbsp;each&nbsp;clip.&nbsp;&nbsp;Each&nbsp;clip&nbsp;requires&nbsp;an&nbsp;output&nbsp;name,&nbsp;a&nbsp;start&nbsp;timecode&nbsp;<br /> #&nbsp;&nbsp;(formatted&nbsp;hh:mm:ss.nnn)&nbsp;and&nbsp;an&nbsp;ending&nbsp;timecode.&nbsp;&nbsp;This&nbsp;is&nbsp;part&nbsp;of&nbsp;<br /> #&nbsp;&nbsp;some&nbsp;of&nbsp;the&nbsp;headache,&nbsp;as&nbsp;ffmpeg&nbsp;processes&nbsp;clips&nbsp;with&nbsp;a&nbsp;start&nbsp;time&nbsp;<br /> #&nbsp;&nbsp;and&nbsp;a&nbsp;duration,&nbsp;meaning&nbsp;you&nbsp;have&nbsp;to&nbsp;do&nbsp;the&nbsp;difference&nbsp;math&nbsp;yourself.&nbsp;&nbsp;<br /> #&nbsp;&nbsp;I&nbsp;take&nbsp;care&nbsp;of&nbsp;this&nbsp;in&nbsp;there.&nbsp;&nbsp;After&nbsp;producing&nbsp;a&nbsp;clip,&nbsp;the&nbsp;script&nbsp;<br /> #&nbsp;&nbsp;will&nbsp;ask&nbsp;the&nbsp;user&nbsp;if&nbsp;they&nbsp;want&nbsp;to&nbsp;create&nbsp;another&nbsp;clip&nbsp;from&nbsp;the&nbsp;same&nbsp;<br /> #&nbsp;&nbsp;source&nbsp;file,&nbsp;at&nbsp;which&nbsp;it&nbsp;recurses&nbsp;through&nbsp;a&nbsp;prompting&nbsp;loop.&nbsp;&nbsp;The&nbsp;<br /> #&nbsp;&nbsp;script&nbsp;also&nbsp;can&nbsp;be&nbsp;run&nbsp;from&nbsp;the&nbsp;command&nbsp;line...however&nbsp;in&nbsp;CLI&nbsp;mode,&nbsp;<br /> #&nbsp;&nbsp;the&nbsp;intent&nbsp;is&nbsp;to&nbsp;NOT&nbsp;allow&nbsp;the&nbsp;script&nbsp;to&nbsp;re-prompt&nbsp;for&nbsp;additional&nbsp;cips&nbsp;<br /> #&nbsp;&nbsp;from&nbsp;the&nbsp;same&nbsp;source&nbsp;video.<br /> #&nbsp;<br /> #&nbsp;The&nbsp;script&nbsp;can&nbsp;optionally&nbsp;take&nbsp;4&nbsp;command&nbsp;line&nbsp;arguments:<br /> #&nbsp;&nbsp;1)&nbsp;The&nbsp;filename&nbsp;for&nbsp;the&nbsp;source&nbsp;video,&nbsp;without&nbsp;extension<br /> #&nbsp;&nbsp;2)&nbsp;The&nbsp;desired&nbsp;resulting&nbsp;clip&nbsp;name,&nbsp;without&nbsp;extension<br /> #&nbsp;&nbsp;3)&nbsp;The&nbsp;start&nbsp;timecode&nbsp;for&nbsp;the&nbsp;clip,&nbsp;format&nbsp;hh:mm:ss.nnn<br /> #&nbsp;&nbsp;4)&nbsp;The&nbsp;end&nbsp;timecode&nbsp;for&nbsp;the&nbsp;clip,&nbsp;format&nbsp;hh:mm:ss.nnn<br /> #<br /> #&nbsp;Variables:<br /> #&nbsp;&nbsp;INPUTFILE&nbsp;-&nbsp;Input&nbsp;video&nbsp;filename,&nbsp;without&nbsp;extension<br /> #&nbsp;&nbsp;OUTPUTFILE&nbsp;-&nbsp;Clip&nbsp;output&nbsp;filename,&nbsp;without&nbsp;extension<br /> #&nbsp;&nbsp;STARTTIME&nbsp;-&nbsp;Clip&nbsp;starting&nbsp;timecode,&nbsp;format&nbsp;hh:mm:ss.nnn<br /> #&nbsp;&nbsp;ENDTIME&nbsp;-&nbsp;Clip&nbsp;ending&nbsp;timecode,&nbsp;format&nbsp;hh:mm:ss.nnn<br /> #&nbsp;&nbsp;NANODIFF&nbsp;-&nbsp;Difference&nbsp;between&nbsp;start&nbsp;and&nbsp;end&nbsp;timecode,&nbsp;in&nbsp;milliseconds<br /> #&nbsp;&nbsp;NUMSECS&nbsp;-&nbsp;Timecoe&nbsp;difference&nbsp;in&nbsp;whole&nbsp;seconds<br /> #&nbsp;&nbsp;NUMNANO&nbsp;-&nbsp;Timecode&nbsp;difference&nbsp;remainder&nbsp;in&nbsp;milliseconds<br /> #&nbsp;&nbsp;REPLY&nbsp;-&nbsp;Flag&nbsp;for&nbsp;checking&nbsp;if&nbsp;the&nbsp;script&nbsp;should&nbsp;create&nbsp;another&nbsp;clip<br /> #&nbsp;&nbsp;CLIFLAG&nbsp;-&nbsp;Flag&nbsp;set&nbsp;if&nbsp;command&nbsp;line&nbsp;mode&nbsp;is&nbsp;detected,&nbsp;to&nbsp;prevent&nbsp;prompting<br /> #<br /> <br /> #&nbsp;Prompt&nbsp;the&nbsp;user&nbsp;for&nbsp;all&nbsp;parameters,&nbsp;by&nbsp;asking&nbsp;for&nbsp;the&nbsp;source&nbsp;clip&nbsp;name,&nbsp;then&nbsp;calling<br /> #&nbsp;&nbsp;the&nbsp;function&nbsp;which&nbsp;prompts&nbsp;for&nbsp;the&nbsp;clip&nbsp;info.&nbsp;&nbsp;This&nbsp;can&nbsp;safely&nbsp;call&nbsp;the&nbsp;clip-info&nbsp;<br /> #&nbsp;&nbsp;prompting&nbsp;function,&nbsp;as&nbsp;this&nbsp;should&nbsp;only&nbsp;be&nbsp;used&nbsp;once&nbsp;per&nbsp;execution,&nbsp;if&nbsp;at&nbsp;all.<br /> PROMPTFULL()&nbsp;{<br /> &nbsp;&nbsp;echo&nbsp;"---What&nbsp;is&nbsp;the&nbsp;source&nbsp;video&nbsp;name?&nbsp;(No&nbsp;Extension)&nbsp;(Inside&nbsp;/home/surfrock66/Videos/HomeMoviesRaw/):"<br /> &nbsp;&nbsp;#&nbsp;First&nbsp;point&nbsp;of&nbsp;possible&nbsp;declaration&nbsp;for&nbsp;INPUTFILE<br /> &nbsp;&nbsp;read&nbsp;INPUTFILE<br /> &nbsp;&nbsp;#&nbsp;Execute&nbsp;the&nbsp;PROMPCLIP&nbsp;function<br /> &nbsp;&nbsp;PROMPTCLIP<br /> }<br /> <br /> #&nbsp;Prompt&nbsp;the&nbsp;user&nbsp;for&nbsp;the&nbsp;clip&nbsp;name,&nbsp;start&nbsp;time,&nbsp;and&nbsp;end&nbsp;time.&nbsp;&nbsp;<br /> PROMPTCLIP()&nbsp;{<br /> &nbsp;&nbsp;echo&nbsp;"---What&nbsp;is&nbsp;the&nbsp;output&nbsp;filename&nbsp;for&nbsp;this&nbsp;clip?&nbsp;(No&nbsp;Extension):"<br /> &nbsp;&nbsp;#&nbsp;First&nbsp;point&nbsp;of&nbsp;possible&nbsp;declaration&nbsp;for&nbsp;OUTPUTFILE<br /> &nbsp;&nbsp;read&nbsp;OUTPUTFILE<br /> &nbsp;&nbsp;echo&nbsp;"---What&nbsp;is&nbsp;the&nbsp;timecode&nbsp;for&nbsp;the&nbsp;start&nbsp;of&nbsp;this&nbsp;clip?&nbsp;(##:##:##.###):"<br /> &nbsp;&nbsp;#&nbsp;First&nbsp;point&nbsp;of&nbsp;possible&nbsp;declaration&nbsp;for&nbsp;STARTTIME<br /> &nbsp;&nbsp;read&nbsp;STARTTIME<br /> &nbsp;&nbsp;echo&nbsp;"---What&nbsp;is&nbsp;the&nbsp;timecode&nbsp;for&nbsp;the&nbsp;end&nbsp;of&nbsp;this&nbsp;clip?&nbsp;(##:##:##.###):"<br /> &nbsp;&nbsp;#&nbsp;First&nbsp;point&nbsp;of&nbsp;possible&nbsp;declaration&nbsp;for&nbsp;ENDTIME<br /> &nbsp;&nbsp;read&nbsp;ENDTIME<br /> }<br /> <br /> #&nbsp;This&nbsp;function&nbsp;handles&nbsp;the&nbsp;timecode&nbsp;calculations&nbsp;to&nbsp;find&nbsp;the&nbsp;clip&nbsp;duration,&nbsp;<br /> #&nbsp;&nbsp;then&nbsp;executes&nbsp;the&nbsp;actial&nbsp;ffmpeg&nbsp;command.<br /> PROCESSVID()&nbsp;{<br /> &nbsp;&nbsp;#&nbsp;Calculate&nbsp;the&nbsp;actuall&nbsp;difference,&nbsp;in&nbsp;milliseconds&nbsp;(but&nbsp;we'll&nbsp;call&nbsp;them&nbsp;<br /> &nbsp;&nbsp;#&nbsp;&nbsp;nanoseconds,&nbsp;because&nbsp;that's&nbsp;how&nbsp;the&nbsp;date&nbsp;command&nbsp;works)&nbsp;between&nbsp;the&nbsp;<br /> &nbsp;&nbsp;#&nbsp;&nbsp;start&nbsp;time&nbsp;and&nbsp;end&nbsp;time.&nbsp;&nbsp;This&nbsp;relies&nbsp;heavily&nbsp;on&nbsp;the&nbsp;"date"&nbsp;command.&nbsp;&nbsp;<br /> &nbsp;&nbsp;#&nbsp;&nbsp;It&nbsp;can&nbsp;convert&nbsp;formatted&nbsp;timecodes&nbsp;between&nbsp;different&nbsp;format&nbsp;<br /> &nbsp;&nbsp;#&nbsp;&nbsp;conventions,&nbsp;but&nbsp;to&nbsp;go&nbsp;from&nbsp;something&nbsp;resembling&nbsp;a&nbsp;standard&nbsp;video&nbsp;<br /> &nbsp;&nbsp;#&nbsp;&nbsp;editing&nbsp;timecode&nbsp;to&nbsp;a&nbsp;raw&nbsp;nanosecond&nbsp;count&nbsp;is&nbsp;a&nbsp;PAIN&nbsp;IN&nbsp;THE&nbsp;ASS.&nbsp;&nbsp;<br /> &nbsp;&nbsp;#&nbsp;&nbsp;This&nbsp;strips&nbsp;out&nbsp;the&nbsp;amount&nbsp;of&nbsp;hours&nbsp;in&nbsp;milliseconds,&nbsp;then&nbsp;the&nbsp;number&nbsp;<br /> &nbsp;&nbsp;#&nbsp;&nbsp;of&nbsp;minutes&nbsp;in&nbsp;milliseconds,&nbsp;then&nbsp;the&nbsp;number&nbsp;of&nbsp;seconds&nbsp;in&nbsp;milliseconds,&nbsp;<br /> &nbsp;&nbsp;#&nbsp;&nbsp;then&nbsp;the&nbsp;number&nbsp;of&nbsp;nanoseconds&nbsp;in&nbsp;milliseconds.&nbsp;&nbsp;It&nbsp;then&nbsp;adds&nbsp;them&nbsp;<br /> &nbsp;&nbsp;#&nbsp;&nbsp;together,&nbsp;creates&nbsp;a&nbsp;full&nbsp;millisecond&nbsp;count&nbsp;for&nbsp;the&nbsp;start&nbsp;an&nbsp;end&nbsp;time,&nbsp;<br /> &nbsp;&nbsp;#&nbsp;&nbsp;and&nbsp;then&nbsp;finds&nbsp;the&nbsp;difference,&nbsp;in&nbsp;milliseconds.<br /> &nbsp;&nbsp;NANODIFF=$(($(($(($(date&nbsp;-d&nbsp;$ENDTIME&nbsp;+%-H)&nbsp;<em>&nbsp;3600000))&nbsp;+&nbsp;$(($(date&nbsp;-d&nbsp;$ENDTIME&nbsp;+%-M)&nbsp;</em>&nbsp;60000))&nbsp;+&nbsp;$(($(date&nbsp;-d&nbsp;$ENDTIME&nbsp;+%-S)&nbsp;<em>&nbsp;1000))&nbsp;+&nbsp;$(($(date&nbsp;-d&nbsp;$ENDTIME&nbsp;+%-N)&nbsp;/&nbsp;1000000))))&nbsp;-&nbsp;$(($(($(date&nbsp;-d&nbsp;$STARTTIME&nbsp;+%-H)&nbsp;</em>&nbsp;3600000))&nbsp;+&nbsp;$(($(date&nbsp;-d&nbsp;$STARTTIME&nbsp;+%-M)&nbsp;<em>&nbsp;60000))&nbsp;+&nbsp;$(($(date&nbsp;-d&nbsp;$STARTTIME&nbsp;+%-S)&nbsp;</em>&nbsp;1000))&nbsp;+&nbsp;$(($(date&nbsp;-d&nbsp;$STARTTIME&nbsp;+%-N)&nbsp;/&nbsp;1000000))))))<br /> &nbsp;&nbsp;#&nbsp;Convert&nbsp;the&nbsp;resulting&nbsp;difference,&nbsp;in&nbsp;millisecodns,&nbsp;into&nbsp;seconds<br /> &nbsp;&nbsp;NUMSECS=$(($NANODIFF&nbsp;/&nbsp;1000))<br /> &nbsp;&nbsp;#&nbsp;Convert&nbsp;the&nbsp;reaminder&nbsp;of&nbsp;the&nbsp;resulting&nbsp;difference,&nbsp;in&nbsp;milliseconds,<br /> &nbsp;&nbsp;#&nbsp;&nbsp;to&nbsp;milliseconds<br /> &nbsp;&nbsp;NUMNANO=$(($NANODIFF&nbsp;%&nbsp;1000))<br /> &nbsp;&nbsp;#&nbsp;Print&nbsp;out&nbsp;the&nbsp;ffmpeg&nbsp;command&nbsp;that&nbsp;is&nbsp;generated,&nbsp;mostly&nbsp;for&nbsp;debugging<br /> &nbsp;&nbsp;echo&nbsp;"\nCommand:&nbsp;ffmpeg&nbsp;-i&nbsp;\"/home/surfrock66/Videos/HomeMoviesRaw/$INPUTFILE.mp4\"&nbsp;-ss&nbsp;$STARTTIME&nbsp;-t&nbsp;$NUMSECS.$NUMNANO&nbsp;-vcodec&nbsp;libx264&nbsp;-b&nbsp;1500k&nbsp;-s&nbsp;480x480&nbsp;-acodec&nbsp;libfaac&nbsp;-ab&nbsp;192k&nbsp;-ac&nbsp;1&nbsp;-threads&nbsp;8&nbsp;\"/home/surfrock66/Videos/HomeMoviesRaw/$INPUTFILE/$OUTPUTFILE.mp4\"\n"<br /> &nbsp;&nbsp;#&nbsp;Execute&nbsp;the&nbsp;ffmpeg&nbsp;command,&nbsp;this&nbsp;is&nbsp;the&nbsp;big&nbsp;kahuna.<br /> &nbsp;&nbsp;ffmpeg&nbsp;-i&nbsp;"/home/surfrock66/Videos/HomeMoviesRaw/$INPUTFILE.mp4"&nbsp;-ss&nbsp;$STARTTIME&nbsp;-t&nbsp;$NUMSECS.$NUMNANO&nbsp;-vcodec&nbsp;libx264&nbsp;-b&nbsp;1500k&nbsp;-s&nbsp;480x480&nbsp;-acodec&nbsp;libfaac&nbsp;-ab&nbsp;192k&nbsp;-ac&nbsp;1&nbsp;-threads&nbsp;8&nbsp;"/home/surfrock66/Videos/HomeMoviesRaw/$INPUTFILE/$OUTPUTFILE.mp4"<br /> }<br /> <br /> #&nbsp;Start&nbsp;of&nbsp;the&nbsp;main&nbsp;script.&nbsp;&nbsp;Section&nbsp;1:&nbsp;Input&nbsp;validation<br /> #&nbsp;&nbsp;Check&nbsp;that&nbsp;there&nbsp;is&nbsp;a&nbsp;first&nbsp;parameter.&nbsp;&nbsp;If&nbsp;not,&nbsp;Prompt&nbsp;the&nbsp;user&nbsp;for&nbsp;the<br /> #&nbsp;&nbsp;&nbsp;parameters.&nbsp;&nbsp;If&nbsp;there&nbsp;is&nbsp;one,&nbsp;validate&nbsp;the&nbsp;rest&nbsp;of&nbsp;the&nbsp;params,&nbsp;then&nbsp;<br /> #&nbsp;&nbsp;&nbsp;either&nbsp;prompt&nbsp;the&nbsp;user,&nbsp;or&nbsp;use&nbsp;the&nbsp;passed&nbsp;params.<br /> if&nbsp;[&nbsp;-z&nbsp;"$1"&nbsp;]<br /> then<br /> &nbsp;&nbsp;#&nbsp;Call&nbsp;the&nbsp;prompt&nbsp;function,&nbsp;including&nbsp;asking&nbsp;for&nbsp;the&nbsp;source&nbsp;video<br /> &nbsp;&nbsp;PROMPTFULL<br /> else<br /> &nbsp;&nbsp;#&nbsp;Assuming&nbsp;the&nbsp;first&nbsp;parameter&nbsp;exists,&nbsp;check&nbsp;for&nbsp;parameters&nbsp;2,3,&nbsp;and<br /> &nbsp;&nbsp;#&nbsp;&nbsp;4.&nbsp;&nbsp;I'm&nbsp;not&nbsp;validating&nbsp;these&nbsp;strings,&nbsp;mostly&nbsp;because&nbsp;ffmpeg&nbsp;will&nbsp;<br /> &nbsp;&nbsp;#&nbsp;&nbsp;flip&nbsp;out&nbsp;if&nbsp;there's&nbsp;something&nbsp;wrong&nbsp;with&nbsp;them...as&nbsp;you&nbsp;know,&nbsp;it's<br /> &nbsp;&nbsp;#&nbsp;&nbsp;quite&nbsp;verbose.<br /> &nbsp;&nbsp;if&nbsp;[&nbsp;-z&nbsp;"$2"&nbsp;-o&nbsp;-z&nbsp;"$3"&nbsp;-o&nbsp;-z&nbsp;"$4"&nbsp;]<br /> &nbsp;&nbsp;then<br /> &nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;If&nbsp;any&nbsp;parameters&nbsp;are&nbsp;invalid,&nbsp;prompt&nbsp;for&nbsp;them&nbsp;all.&nbsp;Even&nbsp;if&nbsp;param&nbsp;1<br /> &nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp;is&nbsp;successfully&nbsp;detected,&nbsp;re-ask&nbsp;for&nbsp;it.&nbsp;&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;"--Parameters&nbsp;are&nbsp;incomplete,&nbsp;switching&nbsp;to&nbsp;prompt&nbsp;mode."<br /> &nbsp;&nbsp;&nbsp;&nbsp;PROMPTFULL&nbsp;<br /> &nbsp;&nbsp;else<br /> &nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Pass&nbsp;all&nbsp;the&nbsp;command&nbsp;line&nbsp;parameters&nbsp;to&nbsp;the&nbsp;variables<br /> &nbsp;&nbsp;&nbsp;&nbsp;INPUTFILE="$1"<br /> &nbsp;&nbsp;&nbsp;&nbsp;OUTPUTFILE="$2"<br /> &nbsp;&nbsp;&nbsp;&nbsp;STARTTIME="$3"<br /> &nbsp;&nbsp;&nbsp;&nbsp;ENDTIME="$4"<br /> &nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Change&nbsp;the&nbsp;flag&nbsp;to&nbsp;indicate&nbsp;later&nbsp;that&nbsp;this&nbsp;initiated&nbsp;by&nbsp;CLI<br /> &nbsp;&nbsp;&nbsp;&nbsp;CLIFLAG="yes"<br /> &nbsp;&nbsp;fi<br /> fi<br /> <br /> #&nbsp;Create&nbsp;the&nbsp;default&nbsp;output&nbsp;directory,&nbsp;if&nbsp;it's&nbsp;not&nbsp;already&nbsp;created<br /> if&nbsp;[&nbsp;!&nbsp;-d&nbsp;/home/surfrock66/Videos/HomeMoviesRaw/$INPUTFILE&nbsp;];&nbsp;then<br /> &nbsp;&nbsp;mkdir&nbsp;/home/surfrock66/Videos/HomeMoviesRaw/$INPUTFILE<br /> fi<br /> <br /> #&nbsp;Now...initiate&nbsp;the&nbsp;final&nbsp;video&nbsp;processing<br /> #&nbsp;&nbsp;Declare&nbsp;and&nbsp;initiate&nbsp;the&nbsp;REPLY&nbsp;flag...can&nbsp;be&nbsp;set&nbsp;to&nbsp;anything&nbsp;byt&nbsp;n/N<br /> REPLY="y"<br /> #&nbsp;As&nbsp;long&nbsp;as&nbsp;the&nbsp;REPLY&nbsp;flag&nbsp;isn't&nbsp;n&nbsp;or&nbsp;N,&nbsp;repeat&nbsp;the&nbsp;loop<br /> while&nbsp;[&nbsp;"$REPLY"&nbsp;!=&nbsp;"n"&nbsp;]&nbsp;&&&nbsp;[&nbsp;"$REPLY"&nbsp;!=&nbsp;"N"&nbsp;]<br /> do<br /> &nbsp;&nbsp;#&nbsp;Call&nbsp;the&nbsp;function&nbsp;PROCESSVID<br /> &nbsp;&nbsp;PROCESSVID<br /> &nbsp;&nbsp;#&nbsp;Check&nbsp;to&nbsp;see&nbsp;if&nbsp;the&nbsp;script&nbsp;was&nbsp;run&nbsp;with&nbsp;command&nbsp;line&nbsp;parameters,<br /> &nbsp;&nbsp;#&nbsp;&nbsp;If&nbsp;not,&nbsp;issue&nbsp;a&nbsp;bunch&nbsp;of&nbsp;logic&nbsp;to&nbsp;see&nbsp;if&nbsp;we&nbsp;want&nbsp;to&nbsp;re-run&nbsp;the<br /> &nbsp;&nbsp;#&nbsp;&nbsp;code&nbsp;for&nbsp;new&nbsp;clips<br /> &nbsp;&nbsp;if&nbsp;[&nbsp;-z&nbsp;"$CLIFLAG"&nbsp;]<br /> &nbsp;&nbsp;then<br /> &nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Now&nbsp;that&nbsp;we&nbsp;know&nbsp;the&nbsp;script&nbsp;was&nbsp;run&nbsp;in&nbsp;prompt&nbsp;mode,&nbsp;ask&nbsp;the&nbsp;user<br /> &nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp;if&nbsp;they&nbsp;want&nbsp;to&nbsp;make&nbsp;another&nbsp;clip,&nbsp;repeating&nbsp;this&nbsp;loop<br /> &nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;"---Would&nbsp;you&nbsp;like&nbsp;to&nbsp;create&nbsp;another&nbsp;clip&nbsp;from&nbsp;this&nbsp;input&nbsp;video?&nbsp;{Y/n}"<br /> &nbsp;&nbsp;&nbsp;&nbsp;read&nbsp;REPLY<br /> &nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;[&nbsp;"$REPLY"&nbsp;!=&nbsp;"n"&nbsp;]&nbsp;&&&nbsp;[&nbsp;"$REPLY"&nbsp;!=&nbsp;"N"&nbsp;]<br /> &nbsp;&nbsp;&nbsp;&nbsp;then<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PROMPTCLIP<br /> &nbsp;&nbsp;&nbsp;&nbsp;fi<br /> &nbsp;&nbsp;#&nbsp;If&nbsp;it&nbsp;was&nbsp;run&nbsp;by&nbsp;command&nbsp;line,&nbsp;essentially&nbsp;abort&nbsp;the&nbsp;loop,<br /> &nbsp;&nbsp;#&nbsp;&nbsp;and&nbsp;the&nbsp;script.<br /> &nbsp;&nbsp;else<br /> &nbsp;&nbsp;&nbsp;&nbsp;REPLY="n"<br /> &nbsp;&nbsp;fi<br /> done<br />

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Critical Excel Macro

I use excel constantly, and some things I require are freezing panes, autofitting the columns, adding auto filters, and standardizing the row heights. Here's the code for the macro I use, and I shortcut it with Ctrl+J.

Sub MakeSpreadsheetReadable()
'
' MakeSpreadsheetReadable Macro
' Macro recorded 5/23/2011 by Gullo, Joseph T. *HS
'
' Keyboard Shortcut: Ctrl+j
'
    Rows("1:1").Select
    Selection.AutoFilter
    Range("A2").Select
    ActiveWindow.FreezePanes = True
    ActiveWindow.Zoom = 70
    Cells.Select
    Cells.EntireColumn.AutoFit
    Selection.RowHeight = 12.75
End Sub
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -