.comment-link {margin-left:.6em;}

IntTech

Monday, February 10, 2014

Size of MySql Databases

This seems to work pretty well.
 SELECT table_schema "DB Name", 
   sum( data_length + index_length ) / 1024 / 1024 "DB Size in MB" 
   FROM information_schema.TABLES GROUP BY table_schema ; 

Bookmark and Share

Sunday, January 26, 2014

Fixing ^M in text using VIM

It is easiest to select your text block in visual mode, "v".  Then enter s/^M/\r/g. 
Keys for this is v for visual mode, then use cursor movement to select the text. 
Then : to give a prompt that looks like :'<,'>. 

Then s/ to give the s/^M, the rest should be self explanatory. 

Bookmark and Share

Wednesday, July 14, 2010

Chrome Feature

Just learned about the chrome://plugins/ feature for chrome browser. Works on Mac too!

Bookmark and Share

Saturday, June 26, 2010

Windows 7 Undock and Hibernate

New job has me using Windows 7 on a laptop. It seems less stable than Windows 2000. It has an undock feature on the "shutdown" menu. The problem is that 90% of the time I undock, I also want the laptop to hibernate. The other 10% of the time I want to undock to carry my laptop to a meeting. There is no "undock and hibernate" option separate from the plan undock on the menu. To do it properly you would have to undock, pop open the laptop and select hibernate. A real pain...

So thinking like a unix user, I figured there must be a way to do this on the command line. And here we go a short bat file to undock and hibernate. Copy the following lines and put them in a file. I called it gohome.bat.

: This Undocks
C:\Windows\System32\rundll32 cfgmgr32.dll,CM_Request_Eject_PC
:: Then we Hibernate
C:\Windows\System32\rundll32.exe powrprof.dll,SetSuspendState 0,1,0
Hibernation has to be enabled for the last line to hibernate. Now I just double click the bat file on my desk top, and I'm off.

Bookmark and Share

Friday, March 26, 2010

Compressing or Removing Old Logs


The following is useful for compressing or removing files based on name.
 find $path -name "$LogFileRegEx" -exec $compress_rm {} \; & 

And this works for removing files based on age.
find $path -mtime $DaysToOld -exec rm {} \;

And they can be combined if needed.

Bookmark and Share

Tuesday, February 16, 2010

Make Eclipse faster on Mac OS X

Copied from my other blog: pwbrewer.blogspot.com
Taken from this page on eclipse.dzone.com.

After you downloaded the Eclipse package, decompress it. Locate your Eclipse.app.
Right-click it and select Show Package Contents.
Under Contents/MacOS, locate the eclipse.ini file. Open it with a text editor.
At the end of the file, add two lines:
-XX:+UseParallelGC
-XX:+UseCompressedOops

Save and close the file.

To that I would add the server option to the same file:
-server

And I suggest changing the following settings:
--launcher.XXMaxPermSize
256m
-XX:MaxPermSize=256m
-Xms64m
-Xmx512m

Bookmark and Share

Tuesday, December 01, 2009

WHERE IN - MySQL

My attemps to confirm this in the MySQL documentation turned up no hits. However the following does work in MySQL.
mysql> delete from vendors where key IN (13, 2);

Bookmark and Share

Google