Automate picture and video offloading!

When I would come home from hunting and it came time to offload all the video and from my cameras I’d have to sit there and manually copy the files over and wait, then swap cards, manually copy and wait, I generally have 4 cards to offload upto 100GB of data at a time. So I decided to look into how to automate it all, first thing that came to mind was autorun but apparently it has been removed from usb devices in newer versions of windows. After come googling I came across a software that brings autorun back to windows, called “APO USB Autorun” [link to download below].

I decided to play around with this new software a bit and though to myself if each device just had a script on it that moved all the files over with an autorun function boom I could just pop the cards in and let it do its thing automatically!

One downside with this method is you have to use a USB card reader, and you have to plug the card reader in, to the usb port, not just plug the sd card into the reader, so keep that in mind.

Below is the code in its entirety what you want to do is make both files in the base directory of your SD card one named “filecopy.bat” and “autorun.inf” an easy way to do this is to right click in the directory and go to New>Text Document and replace the NewTextDocument.txt with the required file names.

After you have the files created open autorun.inf with notepad or notepad++ and paste this into it.


[autorun]
open=filecopy.bat

Save that file, then do the same for filecopy.bat


@echo off
::>>time and date stamp YYYYMMDD, HHMMSS and YYYY-MM-DD_HH-MM-SS
for /f "delims=" %%a in ('wmic OS Get localdatetime  ^| find "."') do set dt=%%a
set datestamp=%dt:~0,8%
set timestamp=%dt:~8,6%
set YYYY=%dt:~0,4%
set MM=%dt:~4,2%
set DD=%dt:~6,2%
set HH=%dt:~8,2%
set HH=%dt:~8,2%
set Min=%dt:~10,2%
set Sec=%dt:~12,2%
set stamp=%MM%-%DD%-%YYYY%
::uncomment next 2 lines to preview the date stamp
::echo %stamp%
::pause
::>>creates subfolder under date for camera, leave blank if you want all pictures in one directory
set camname=nikon
::>>destination location of your video files \cameraname\ should be uniquie per camera name so files are organized by camera
set servpath=\\server\pictures\%stamp%\%camname%\
::>>source location of video files %cd% automatically uses your sd cards drive letter including first slash E.G. G:\
set vidpath="%cd%DCIM\100NIKON"
::>> creates new directory in the offload folder with the date and camera subfolder
if not exist "%servpath%" mkdir "%servpath%"
::>> copies files from %vidpath% to %servpath%
copy "%vidpath%" "%servpath%"
::>> creates temp directory for text comparison files if it doesnt exist
if not exist "%cd%temp" mkdir %cd%temp\
::>>writing a text file containing all the file contents from vidpath and servpath
dir "%vidpath%" /-p /a-d /o:gn | FIND "/" > %cd%temp\DirContents.txt
dir "%servpath%" /-p /a-d /o:gn | FIND "/" > %cd%temp\servercp.txt
::>> comparing file contents of both directories to make sure they mattch before wiping the card
::>> then if file lists and sizes dont match it goes down to :files_differ and deletes temp folder and files from %vidpath%
fc /b %cd%temp\servercp.txt %cd%temp\DirContents.txt > nul
if errorlevel 1 goto files_differ
::>> if all files and filesizes match in %vidpath% and %servpath% then it deletes the originals from %vidpath% then removes temp folder
del /q "%vidpath%\*"
rmdir /q /s "%cd%temp"
::>> uncomment next line to get verification message
::msg %username% copy success!
exit
:files_differ
::>> if copy failed this removes the temp directory and the new subfolder in
rmdir /q/s "%cd%temp"
rmdir /q /s "%servpath%"
::>> uncomment next line to get fail message
::msg %username% Copy failed please retry
exit

it’s pretty much self explanatory the only things you need to touch are below, and I think I commented everything well enough.

  • set camname=nikon
  • set servpath=\server\pictures\%stamp%\%camname%\
  • set vidpath=”%cd%DCIM\100NIKON\”

“camname=camnamehere” This setting will only add a folder for a certain camera in the dated folder where pictures/videos are dumped. EG C:/pix/01/14/2020/camnamehere/ so you want to be sure to use different names on each SD card if you want them organized.
“set servpath=\server\pictures\%stamp%\%camname%\” This setting represents the base folder where you would like to dump pictures/videos to EG mines in a windows share on my server called pictures.
“set vidpath=”%cd%DCIM\100NIKON\”” This setting tells the script where your pictures are on the SD card. LEAVE %CD% and do not add a backslash after it this is a variable that automatically puts your drive letter in, so if your card looks like this on your pc D:\DCIM\100NIKON and that’s the folder the pictures are in that is what you will type “%cd%DCIM\100NIKON\”

Upon completion of configuring the batch file and the autorun.info file, go ahead and install “APO USB Autorun” which can be found HERE, unplug your card reader and plug it back in, it should start copying!

Tip, to do multiple at once, get a usb hub and multiple readers then just plug the hub in it should run the script on all drives when they are all detected.

Invoice Plane: mPDF taking a long time to generate pdf files remotely

I had an issue where if I was using my outside domain address to connect to the web server it would take roughly 4 minutes to generate a PDF after googling for what seemed like an eternity I saw something that caught my eye in a random discussion about mPDF not related to invoice plane.

So, firstly PDF’s generate fine when using a local address eg http://192.168.10.2/iplane but if i connected to it using wagex.org/iplane it would take minutes to generate a PDF or send an email with PDF attached.

SOLUTION: enable SSL on the web server and connect using https, yes its that simple that solved my issues all together.

dumb short topic i know, but holy cow it took me forever to find that fix and it had nothing to do with invoice plane so hopefully someone having the same issue finds this and it helps.

Thank you for reading!

Current Server Setup 2/18/2018

Man its changing quickly figured it deserved another post since I’ve added another server into the mix to handle the video camera recording. Reason being using Intel Quicksink on the newer Intel cpu’s takes a huge load off of the cpu and saves a ton in power consumption, also I wanted to learn how Active Directory and Domain Controllers worked.

Server 1:

The OG server is running server 2012 r2 Datacenter with hyper-v for the virtual machines.
For main storage there is an array of 5x 2TB hitachi drives in Raid 5. contacam has its own 1tb blue. There is a 2tb WD green I use to offload raw footage from my cameras onto, finally the operating system with the rest of the vm disks are on a WD Blue 1TB SSD

Continue reading “Current Server Setup 2/18/2018”

Setting up Transmission and OpenVPN on Debian using only CLI, with auto start and VPN up check script. Private Internet Access

To begin, lets start with installing Transmission and OpenVPN.
To install Transmission

sudo apt install transmission-daemon

Once it is installed you will want to access the web GUI from another machine so lets go into the settings.json and tweak a few things so you can access it. 

First we need to stop transmission 

sudo service transmission-daemon stop

Then with your favorite editor go ahead and open the settings file, I prefer nano so 

nano /etc/transmission-daemon/settings.json

We need to just change a couple lines, where I have 192.168.10.* type your lan range be it 192.161.* or 192.168.0.* the * is a wildcard that will let anyone on your lan access the transmission web-GUI.

“rpc-authentication-required”: false,
“rpc-bind-address”: “0.0.0.0”,
“rpc-enabled”: true,
“rpc-whitelist”: “192.168.10.*”,

Continue reading “Setting up Transmission and OpenVPN on Debian using only CLI, with auto start and VPN up check script. Private Internet Access”

How did I miss?

I think I have the buck I shot last year haunting me, I cannot for the life of me slow down and concentrate on what im doing, 3 weekends in a row shot and missed 3 deer from not taking an extra half a second to make sure im using the correct range marker in my scope that buck fever tho.

Hopefully i can get past this i had it really bad for 3 years with rifle, after i harvested my first deer i haven’t got buck fever with a rifle since. It’s pretty rough knowing that in the last 3 weekends i could have put 3 deer in the freezer but my nerves caused me to lose out. 

Two of the three deer ive shot at were at 30 yds and for some reason I used the 20 yd marker for both, shot went right under. Then the one i had at 20 yds…… i used the 30 yd marker. In practice I don’t have any issues ranging and shooting guess i just need more practice. Thanks for reading and watching! More videos coming soon.

Current Server Setup 11/1/2018

The server has changed in many ways since its first build with an old 775 socket celeron and 2gb of ram, to a dual xeon 771 setup, to a dual 6 coreopteron with 32gb of ram, back to a xeon 771 with 32gb of ram, and now its an i3-2120 i5-2400 with 16gb of ddr3 ram.

The server is running server 2012 r2 Datacenter with hyper-v for the virtual machines. here is a quick rundown of the virtual machines.

For main storage there is an array of 5x 2TB hitachi drives in Raid 5. contacam has its own 1tb blue, lancache has its own 300GB 10k velociraptor, there is a 500GB seagate I keep images of most of the vm’s on. finally the operating system with the rest of the vm disks are on a samsung 250GB samsung SSD.

Contacam: Running windows 10 ltsb and contacam software to manage my home security cameras. [4 cores 1GB-4GB dynamic meory]  
switched from contacam to motioneye in a docker, much less resources pretty cool webgui overall better imo.

switched from contacam to motioneye in a docker, much less resources pretty cool webgui overall better imo.

Continue reading “Current Server Setup 11/1/2018”

Crosstour CT9500 4K 20.0 MP action camera Review

Before we get started, here is an updated firmware I received from Crosstour to enable the menu item “beep” that turns off the beep sound every time you press a button. 
To flash the firmware simply copy all of the files inside the folder onto the microSD card, insert it into the camera and then power it on, a blue light will apear and flash some eventually the camera will come on all by itself do not take out the battery or mess with it while this process is taking place. After flashing the new firmware be sure to go into the settings and set defaults or else it causes funny issues like webcam function not working. 
CT9500-firmware-V2.1.0.3-A.zip
firmware update (mirror)

Here are some specs directly from Crosstour.

Video Resolution: 4K(30fps) 2.7K(30fps)1440P(60/30fps) 1080P(60/30fps) 720P(120/60fps)
Image Resolution: 20MP, 16MP, 12MP, 5MP, 3MP
Lens: 170°A+ high resolution wide-angle lens with Seven-layer glass F/1.8 large aperture and Sony IMX377 Sensor
Wi-Fi Connection:  Android/IOS supported
Battery: Two Removable 3.7V 1350mAh Li-ion batteris Waterproof Case
Depth Rating: 40m/131.3ft
Dimensions: 61*45*24mm/2.41″x1.78″x0.95″
Storage: 8 – 128GB micro SD card support(128GBMax) require Class 10+

Continue reading “Crosstour CT9500 4K 20.0 MP action camera Review”

DIY shotgun phone mount (revised for modifications)

To help with my hunting streams ive purchased a couple of tripods over the past couple years which are nice except when im moving around a bunch it can get tiresome to keep folding them up and down bending the legs or what ever, i was shopping around for some mounts on amazon but couldn’t really find anything that did what i wanted which was to clamp on and hold the camera out to the side and horizontal, on my rifle something that clamps on top wouldn’t be bad because i have a scope, on this i need line of sight down the barrel so i can aim. The best part is i had most of this stuff just lying around in the shop i only had to buy the hose clamps, so this cost about a buck.

REVISION: I had to add another hose clamp to hold it still, and the socket rail was too thin and flimsy made my phone vibrate all the time, so i replaced it with some 1/8″x1″ steel strap cut and bent to fit. I still need to find a way to more securely hold the phone on it fell out of the clamp about 75% of the time i shot.

Parts list:

  • 3/4″ pvc T fitting
  • metal bar from an old socket rail with the clips removed. 
  • 1/8″x1″  steel strap (the socket rail was too thin and flimsy)
  • 2x 1/4″ x 3/4″ bolts with nuts ny-lock is best for this application
  • 1x phone clamp this is what i used very tight spring loaded grip
  • 2X .75″ – 1.5″ hose clamp
  • 1/4″ drill bit + drill

Tools Used:

  • hacksaw
  • sandpaper
  • die grinder with cutoff wheel
  • 7/16 end wrenches
  • spray paint [flat colors for camo effect..ish]
  • flat head screw driver

Current Server Setup

The server has changed in many ways since its first build with an old 775 socket celeron and 2gb of ram, to a dual xeon 771 setup, to a dual 6 coreopteron with 32gb of ram, back to a xeon 771 with 32gb of ram, and now its an i3-2120 i5-2400 with 16gb of ddr3 ram.

The server is running server 2012 r2 Datacenter with hyper-v for the virtual machines. here is a quick rundown of the virtual machines.

For main storage there is an array of 5x 2TB hitachi drives in Raid 5. contacam has its own 1tb blue, lancache has its own 300GB 10k velociraptor, there is a 500GB seagate i keep images of most of the vm’s on. finally the operating system with the rest of the vm disks are on a samsung 250GB samsung SSD.

Contacam: Running windows 10 ltsb and contacam software to manage my home security cameras. [4 cores 1GB-4GB dynamic meory]

Docker host debian: running docker + cockpit for docker management. Below is a list of currently running dockers. [4 cores 4GB static memory]

  • Keepass: to hold my passwords for everything im getting old and have a hard time remembering everything
  • Plex Server: basically only use this to stream music to work, and to give my dad access to my movie / tv show libraries at his house.
  • Teamspeak 3 server: i was running a vm just for this moving it to a docker was kind of a learning experience but it works great even was able to transfer all my stuff from my windows install into it with a little tweaking. That server had been running since 2013 so i have alot of config into it didnt wanna lose that.
  • ubooquity: I recently tookup an interest in reading comics this utility is nice for both remote and local viewing of comics, really cool to browse it on the tv using fire tv 
  • Jackett: gives extra indexers for radarr, sonarr, and lidarr on my download server.. i ran it in there but jackett and windows didnt seem to get along well at all and constantly crashed.

Download Server: Running utorrent pro, radarr, sonarr, and lidarr to manage my movie, music, and tv show libraries does its job.. most of the time lol. [4 cores 1GB-4GBdynamic memory]

Lamp Stack: Running Turnkey’s Lamp stack iso, most amazing people saves so much repetitive work. runs my word press site, my invoicing software (simple invoices), and a few misc web utilities. [2 cores 768MB ram]

lancache: Running NGINX in CENTOS 7 based off of multiplays lancache it caches steam and origin downloads so when its accessed a second time (i have two gaming pc’s) the second download is as fast as it can push over gigabit (or read from disk in my case hope to get this on an SSD eventually). [4 cores 1GB-2GB dynamic memory]

Pi-hole: Running Debian and pi-hole dns server this gives network wide ad blocking, works like a charm. I did try this in a docker and it seemed unstable so i reverted back to its own vm. [512MB ram 1 core]