Find directories that DON'T contain a file

July 27th, 2016

Exact file:

find base_dir -mindepth 2 -maxdepth 2 -type d '!' -exec test -e "{}/cover.jpg" ';' -print

Multiple Extensions:

find base_dir -mindepth 2 -maxdepth 2 -type d '!' -exec sh -c 'ls -1 "{}"|egrep -i -q "^cover\.(jpg|png)$"' ';' -print

tar/gzip and gunzip/untar in the same pipe

July 27th, 2016

tar/gzip

tar cvf - files_to_tar | gzip > tarfile.tar.gz

gunzip/untar

gzip -d < tarfile.tar.gz | tar xvf -

2013 Mustang Information

May 19th, 2016

Rebuild your own battery packs

March 6th, 2016

I have roughly 10 DeWalt 18v battery packs which are on their way out.  Run time is significantly reduced from original.  At market prices, it's going to cost over $500 to replace these - yikes!  I ran across some DIY rebuild instructions and originally was going to go for rebuilding them with soldered on tabs.  The more I looked into it, however, it turns out that the heat from soldering the tabs can have a significant negative impact on the batteries - even potentially causing them to explode.  So, I found some DIY information on making a low cost battery tab spot welder from the transfrormer out of a microwave oven.  This looks like a solid way to fix up my DeWalt battery packs for significantly less than the originals.  At half or less of that price, I would be able to rebuild them more frequently and still come out ahead.  I also believe this could be used to rebuild laptop batteries (of which I have many) for additional savings.  

Below are links to the various pages with details on the processes.  I have yet to do this but have acquired the transformer and am in process of building the spot welder.

DIY Guides
Rebuilding NiCd Rechargable Battery Packs
How to rebuild a Dewalt 14.4v battery pack
How to rebuild an 18 volt DeWalt Battery

YouTube
How to replace Dewalt Cordless Drill battery cells
How to Make The Metal Melter
DIY Ebike Battery Spot Welded MOT
homemade battery tab spot welder

eBay
50 x SubC Sub C 2800mAh 1.2V NiCd Rechargeable Battery w/ Tab White USA Stock
ni-cd sub c 1.2v 2400mah
tenergy batteries
nickel battery tabs

Guides
DIY Bettery Tab resistance fine-spot welder
DIY Bettery Tab resistance fine-spot welder - Electrode and Battery Clamps
DIY Bettery Tab resistance fine-spot welder - Electrode Holder
How to Make the Metal Melter 

Mount SMB/CIFS share within a Docker container

January 18th, 2016

https://lime-technology.com/forum/index.php?topic=38770.0

/boot/config/go file

# Wait ~ 90 seconds for network to come alive before proceeding

logger "Waiting for network services to come alive ~90 seconds"
echo "Waiting for network services to come alive ~90 seconds"

for COUNTER in {1..90}
do
        sleep 1

        if ping -c 1 192.168.1.62 > /dev/null 2>&1
        then
                break
        else
                echo "Server_B not available yet... Retry # $COUNTER"
                logger "Server_B not available yet... Retrying # $COUNTER"
        fi
done

# Mount the shares if the network is active

if ping -c 1 192.168.1.62 > /dev/null 2>&1
then
        logger "Network active - mounting shares from SERVER_B"
        echo "Network active - mounting shares from SERVER_B"

        mkdir /mnt/server_b_movies
        mkdir /mnt/server_b_television
        mkdir /mnt/server_b_books

# Mount the shares

        mount -t cifs //192.168.1.62/Movies /mnt/server_b_movies -o username=server_a,password=srv020,dir_mode=0777,file_mode=0777
        mount -t cifs //192.168.1.62/Television /mnt/server_b_television -o username=server_a,password=srv020,dir_mode=0777,file_mode=0777
        mount -t cifs //192.168.1.62/Ebooks /mnt/server_b_books -o username=server_a,password=srv020,dir_mode=0777,file_mode=0777
 
else
        logger "Network not active - SERVER_B shares will not be mounted"
        echo "Network not active - SERVER_B shares will not be mounted"
fi