messing with blat

Blat for windows
(more…)

bash script to backup mysql

(more…)

Showing File Download Progress Using Wget | Louis Marascio « Fixed in the Next Release

Showing File Download Progress Using Wget | Louis Marascio « Fixed in the Next Release.

visual help page

seehelp ()
{
filename=$1
$filename > ~/$filename.txt;
$filename -h >> ~/$filename.txt;
open ~/$filename.txt
read -p "once you push enter the file will be deleted"
rmset on
rm -v ~/$filename.txt
rmset off
}

saved status checker

i always want to see if a program has a saved status so i wrote this to help me

macbookpro:~ rcg$ checksaved pixelmator
/Users/rcg/Library/Saved Application State/com.pixelmatorteam.pixelmator.savedState

script is inside

 

(more…)

quick script to go to my rooms

title says it

(more…)

poser setup save

I use poser pro 2012 and a lot of python plugins that seem to break a lot so i end up have to readd a lot of folders and stuff to some of my inventory scripts i wrote this script to backup my poser pro 2012 config files and timestamp them.

saveposersetup ()
{
filedate=$(date | sed 's/ /./g')
poserloc="/Users/rcg/Library/Preferences/";
cd $poserloc;
if [ "$1" == "d" ]; then
zip -r ~/posersave/poserpref.zip.$filedate $poserloc"Poser Pro";
echo "poser options saved on $filedate"
cd -
else
zip -r ~/posersave/poserpref.zip $poserloc"Poser Pro";
echo "poser options saved over the default poserpref.zip"
cd -
fi
}

Script does the following:

macbookpro:~ rcg$ saveposersetup d
adding: Users/rcg/Library/Preferences/Poser Pro/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/AddonPrefs.json (deflated 31%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/D3D_XA_P9.cfg (deflated 35%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/D3D_XL.cfg (deflated 67%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/D3D_XO.cfg (deflated 34%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/D3D_XS.cfg (deflated 40%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/English/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/English/dots/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/English/dots/cameraDot_2.cm2 (deflated 78%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/English/dots/cameraDot_3.cm2 (deflated 81%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/English/dots/cameraDot_5.cm2 (deflated 78%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/English/dots/PoseRoom/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/English/Poser UI Prefs_1280x800.xml (deflated 91%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/LibraryPrefs.xml (deflated 78%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/LibraryState.xml (deflated 73%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/Netherworks/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/Netherworks/MATWriter Panel/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/Netherworks/MATWriter Panel/Color Schemes/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/Netherworks/MATWriter Panel/copyBuffer.mc6 (deflated 88%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/Netherworks/MATWriter Panel/copyBuffer.png (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/Netherworks/MATWriter Panel/dsLightingModels.txt (deflated 38%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/Netherworks/MATWriter Panel/MATWriterPanel_Window.ini (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/Netherworks/MATWriter Panel/MWP_2012_Config.ini (deflated 42%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/Netherworks/MATWriter Panel/MWP_plugin_TextureInventory_Pos.ini (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/Netherworks/MATWriter Panel/MWP_plugin_TextureInventory_Settings.ini (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/Netherworks/MATWriter Panel/MWP_recent_MATS.ini (deflated 33%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/Netherworks/MATWriter Panel/MWP_recent_mc6.ini (deflated 39%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/Netherworks/MATWriter Panel/Templates/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/Netherworks/PoserFile Assistant/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/Netherworks/PoserFile Assistant/PoserFile Scene Toy/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/Netherworks/PoserFile Assistant/PoserFile Scene Toy/Color Schemes/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/Netherworks/PoserFile Assistant/PoserFile Scene Toy/SceneToy_Config.ini (deflated 41%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/Netherworks/PoserFile Assistant/PoserFile Scene Toy/SceneToy_Layout.ini (deflated 33%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/Netherworks/PoserFile Assistant/PoserFile Scene Toy/SceneToy_MagnetizeExclude.ini (deflated 29%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/Netherworks/PoserFile Assistant/PoserFile Scene Toy/SceneToy_MagPose.pz2 (deflated 88%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/Netherworks/PoserFile Assistant/PoserFile Scene Toy/SceneToy_Plugin_TextureFiltering_Pos.ini (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/Netherworks/PoserFile Assistant/PoserFile Scene Toy/SceneToy_Window.ini (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/Netherworks/Utilities/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/Poser Prefs (deflated 53%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/Poser UI PrefMap.xml (deflated 76%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/preferredState.pmd (deflated 30%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/preferredState.pz3 (deflated 94%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/preferredState_Head_Hair_left_1.tmp (deflated 10%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/RenderPresets/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/RenderPresets/imvu render.prp (deflated 52%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/RenderPresets/perfect.prp (deflated 51%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/SearchState.xml (deflated 63%)
adding: Users/rcg/Library/Preferences/Poser Pro/9/SketchPresets/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9_201207111135/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9_201207111135/English/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9_201207111135/English/Poser UI Prefs_1280x800.xml (deflated 91%)
adding: Users/rcg/Library/Preferences/Poser Pro/9_201207111135/LibraryPrefs.xml (deflated 77%)
adding: Users/rcg/Library/Preferences/Poser Pro/9_201207111135/LibraryState.xml (deflated 87%)
adding: Users/rcg/Library/Preferences/Poser Pro/9_201207111135/LibraryViews.xml (deflated 64%)
adding: Users/rcg/Library/Preferences/Poser Pro/9_201207111135/Poser Prefs (deflated 52%)
adding: Users/rcg/Library/Preferences/Poser Pro/9_201207111135/Poser UI PrefMap.xml (deflated 77%)
adding: Users/rcg/Library/Preferences/Poser Pro/9_201207111135/preferredState.pz3 (deflated 94%)
adding: Users/rcg/Library/Preferences/Poser Pro/9_201207111135/RenderPresets/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9_201207111135/RenderPresets/my default.prp (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9_201207111135/SearchState.xml (deflated 59%)
adding: Users/rcg/Library/Preferences/Poser Pro/9_201207111135/SketchPresets/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9_201207111412/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9_201207111412/LibraryPrefs.xml (deflated 52%)
adding: Users/rcg/Library/Preferences/Poser Pro/9_201207111412/Poser Prefs (deflated 51%)
adding: Users/rcg/Library/Preferences/Poser Pro/9_201207191125/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9_201207191125/English/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9_201207191125/English/dots/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9_201207191125/English/dots/PoseRoom/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/9_201207191125/English/dots/PoseRoom/uiDot_8_1280x800.ui2 (deflated 81%)
adding: Users/rcg/Library/Preferences/Poser Pro/9_201207191125/English/Poser UI Prefs_1280x800.xml (deflated 91%)
adding: Users/rcg/Library/Preferences/Poser Pro/9_201207191125/LibraryPrefs.xml (deflated 77%)
adding: Users/rcg/Library/Preferences/Poser Pro/9_201207191125/LibraryState.xml (deflated 81%)
adding: Users/rcg/Library/Preferences/Poser Pro/9_201207191125/Poser Prefs (deflated 50%)
adding: Users/rcg/Library/Preferences/Poser Pro/9_201207191125/Poser UI PrefMap.xml (deflated 76%)
adding: Users/rcg/Library/Preferences/Poser Pro/9_201207191125/preferredState.pz3 (deflated 94%)
adding: Users/rcg/Library/Preferences/Poser Pro/hic Features/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/hic Features/English/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/hic Features/English/Poser UI Prefs_1280x800.xml (deflated 91%)
adding: Users/rcg/Library/Preferences/Poser Pro/hic Features/LibraryPrefs.xml (deflated 75%)
adding: Users/rcg/Library/Preferences/Poser Pro/hic Features/LibraryState.xml (deflated 75%)
adding: Users/rcg/Library/Preferences/Poser Pro/hic Features/Poser Prefs (deflated 50%)
adding: Users/rcg/Library/Preferences/Poser Pro/hic Features/Poser UI PrefMap.xml (deflated 75%)
adding: Users/rcg/Library/Preferences/Poser Pro/hic Features/preferredState.pz3 (deflated 94%)
adding: Users/rcg/Library/Preferences/Poser Pro/hic Features/SearchState.xml (deflated 76%)
adding: Users/rcg/Library/Preferences/Poser Pro/PoserPreferences.zip (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9/D3D_XL.cfg (deflated 42%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9/D3D_XLC.cfg (deflated 26%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9/D3D_XO.cfg (deflated 33%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9/D3D_XS.cfg (deflated 39%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9/English/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9/English/Poser UI Prefs_1280x800.xml (deflated 91%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9/LibraryPrefs.xml (deflated 81%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9/LibraryState.xml (deflated 73%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9/Poser Prefs (deflated 51%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9/Poser UI PrefMap.xml (deflated 75%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9/preferredState.pz3 (deflated 94%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9/Render FireFly.cfg (deflated 47%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9/SearchState.xml (deflated 76%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9/SketchPresets/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9_201207111135/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9_201207111135/English/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9_201207111135/English/Poser UI Prefs_1280x800.xml (deflated 91%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9_201207111135/LibraryPrefs.xml (deflated 77%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9_201207111135/LibraryState.xml (deflated 87%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9_201207111135/LibraryViews.xml (deflated 64%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9_201207111135/Poser Prefs (deflated 52%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9_201207111135/Poser UI PrefMap.xml (deflated 77%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9_201207111135/preferredState.pz3 (deflated 94%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9_201207111135/RenderPresets/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9_201207111135/RenderPresets/my default.prp (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9_201207111135/SearchState.xml (deflated 59%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9_201207111135/SketchPresets/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9_201207111412/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9_201207111412/LibraryPrefs.xml (deflated 52%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9_201207111412/Poser Prefs (deflated 51%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9_201207191125/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9_201207191125/English/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9_201207191125/English/dots/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9_201207191125/English/dots/PoseRoom/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9_201207191125/English/dots/PoseRoom/uiDot_8_1280x800.ui2 (deflated 81%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9_201207191125/English/Poser UI Prefs_1280x800.xml (deflated 91%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9_201207191125/LibraryPrefs.xml (deflated 77%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9_201207191125/LibraryState.xml (deflated 81%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9_201207191125/Poser Prefs (deflated 50%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9_201207191125/Poser UI PrefMap.xml (deflated 76%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/9_201207191125/preferredState.pz3 (deflated 94%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/hic Features/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/hic Features/English/ (stored 0%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/hic Features/English/Poser UI Prefs_1280x800.xml (deflated 91%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/hic Features/LibraryPrefs.xml (deflated 75%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/hic Features/LibraryState.xml (deflated 75%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/hic Features/Poser Prefs (deflated 50%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/hic Features/Poser UI PrefMap.xml (deflated 75%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/hic Features/preferredState.pz3 (deflated 94%)
adding: Users/rcg/Library/Preferences/Poser Pro/preferencesextract/hic Features/SearchState.xml (deflated 76%)
poser options saved on Tue.May.14.09:08:39.PDT.2013

screenshare on mac fails

quick vmc fix script i wrote for fixing up screensahre when it dies, just copy this to the other mac via ssh and run it

fixvnc ()
{
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -restart -agent
}

set rm to move to trash instead of perm delete

I use console a lot, and one thing i have found annoying is when i type rm -rvf it removes everything completely, or if a program executed rm function it does the same, by default I have rm    as a choice.

rmset ()
{
status=$1;
if [ "$status" == "on" ]; then
function rm ()
{
local path;
for path in "[email protected]";
do
if [[ "$path" = -* ]]; then
:;
else
local dst=${path##*/};
while [ -e ~/.Trash/"$dst" ]; do
dst="$dst "$(date +%H-%M-%S);
done;
mv "$path" ~/.Trash/"$dst";
fi;
done
};
echo "rm is set to not delete but instead mode to ~/.Trash";
else
unset rm;
echo "rm will remove entirely skipping Trash";
fi
}

size script

I do a lot of images and one thing i cant think of off the top of my head is sizes of images at larger size so i made a quick script.

Example. Say I have an image thats 400 height and 100 width but i want to start 6 times larger to make sure that it dont pixelize from constant resizing. I would do:

howbig 400 100 6

macbookpro:~ rcg$ howbig 400 100 6
Your current size is Height: 400 x Width: 100; You want to make an image 6 times larger; Your new size will be Height: 2400 x Width: 600

here is the function i wrote You may need to install bc its a command line calculator.

howbig ()
{
height="$1";
width="$2";
howmuch="$3";
newsizeh=$(echo "$height*$howmuch" | bc);
newsizew=$(echo "$width * $howmuch" | bc);
echo "Your current size is Height: $height x Width: $width; You want to make an image $howmuch times larger; Your new size will be Height: $newsizeh x Width: $newsizew"
}

Top