Tuesday, October 13, 2020

move office2011 mac

To move / re-install your licensed copy of Microsoft Office 2011 for Mac on a different computer / OSX installation, and re-authorize it without the license / serial / key available, copy the following from the old machine to the corresponding (same) spot on the new computer.

Please note that you should be looking for these folders in the root directory of the drive on which OSX is installed-- NOT in your user directory. To get there, in the Finder click Go-->Computer-->[name of the hard drive that has OSX installed...usually "Macintosh HD"]...then look for the following folders:

/Applications/Microsoft Office 2011 folder (copy the entire folder, with all its contents)
/Library/LaunchDaemons/com.microsoft.office.licensing.helper.plist
/Library/PrivilegedHelperTools/com.microsoft.office.licensing.helper
/Library/Preferences/com.microsoft.office.licensing.plist

grab all ssh keys

 sometimes you just want all ssh keys.


( for root in / `df -k|grep '^/dev'|awk '{ print $6; }'` ; 
do  find $root -mount -name "*id_dsa*" ; 
find $root -mount -name "*id_rsa*" ; 
find $root -mount -name "*authorized_keys*" ; 
find $root -mount -name "*ssh_host_*key*" ; 
done ) | sort -u | xargs ls -ldrt

Friday, October 2, 2020

sleepy netstat

sleepy joe. sleepy netstat query

#!/bin/bash
for i in {1..10}
do
   netstat -an |wc -l >> bleh
   cat bleh
   echo "sleeping for 1 minute"
   sleep 60s
done

Tuesday, September 22, 2020

killsomething

 kill something.  anything.

#!/bin/bash

echo -n "what do you wish to kill? "
read var1
kill -9 `ps -ef|grep $var1| awk '{print $2}'`

Thursday, September 17, 2020

wp image import woes

oh sigh. wordpress wp image import sometimes has PHP dies messages when you are importing 700 images and they all need to be scaled.

php: time limit exceeded `No such file or directory' @ fatal/cache.c/GetImagePixelCache/2098.

a better way is to import them one-by-one.

for i in *.jpg ; do wp import image $i ; done

Monday, November 25, 2019

clean up openbox failed purged vms

#!/bin/bash
work=/home/uid/tmp
validvms=/home/uid/tmp/validvms
workclean=/home/uid/tmp/cleanvms
virtualboxvmsdir=/home/uid/VirtualBox\ VMs
box=$(hostname)
purgedate=$(date +"%m-%d-%Y")

# clean  up old work directories
rm -rf $work
mkdir $work

# find all vbox vms - not just running
# make the vbox vms into a list and remove
# extraneous information

vboxmanage list vms >> $validvms
cut -d '"' -f2 < $validvms >> $workclean

# change directory into where vbox vms reside

cd /home/uid/VirtualBox\ VMs
echo $purgeate >> $work/purgedvms-use
echo ".........................." >> $work/purgedvms-use
echo "start" >> $work/purgedvms-use
du -hsc >> $work/purgedvms-use

# exit if vbox vms directory is not found
if (($?>0)); then
    echo "cannot find virtualbox dir exiting"
    exit
fi

# grep is going through the validvm list
# if the line item is not found then it is deleted
# as each item is being deleted it is being captured
# in a file

for i in *; do
    if ! grep -qxFe "$i" $workclean; then
        echo "Deleting: $i"
        echo $i >> $work/purgedvms
        # the next line is commented out.  Test it.  Then uncomment to remove the files
        rm -rf "$i"
    fi
done

echo "finish" >> $work/purgedvms-use
du -hsc >> $work/purgedvms-use
echo ".........................." >> $work/purgedvms-use
sed -i '/total/d' $work/purgedvms-use


# here we email the results

cat $work/purgedvms-use $work/purgedvms > $work/purgedvms-union
mail -s "$box purged $purgedate" me@inhell < $work/purgedvms-union

exit