Tuesday, July 31, 2012

Mac OS Grab Screencapture defaults

# Grab File type for screen captures 
defaults write com.apple.screencapture type -string [png,jpg,pdf...]
# Grab Screen capture folder 
defaults write com.apple.screencapture location [~/Desktop/]
# Grab Screenshot file name 
defaults write com.apple.screencapture name -string
# Grab Screenshot file format 
defaults write com.apple.screencapture type -string
# Grab Show shadows on captured windows 
defaults write com.apple.screencapture disable-shadow -boolean-neg


Example:
#!/bin/bash
defaults write com.apple.screencapture type -string PNG
defaults write com.apple.screencapture location ~/Desktop/ScreenShots
# reset the ui server
killall SystemUIServer



Friday, July 27, 2012

awstats nano tutorial... for members only

For my own pleasure... mini-tut...
Signings-MacBook-Pro:tools mememe$ cat x
  530  cd tools/
  530  perl awstats-configure.pl
[see dialog at the end of the post - and made the link to the access file to a symlink access-current.log]
  531  cd wwwroot/cgi-bin/
  532  ls -rtl
  533  vi awstats.ease-webserver1.conf 
[Change the DirData="/Users/mememe/.awstats" location for the database]
  538  ln -s /Users/mememe/ease/20120726-was1p-access.log /Users/mememe/ease/access-current.log
  539  perl awstats.pl -config=ease-webserver1
  541  cd ../..
  542  cd tools/
  545  perl awstats_buildstaticpages.pl -config=ease-webserver1 -awstatsprog=/Users/mememe/Downloads/awstats-7.0/wwwroot/cgi-bin/awstats.pl 
 

myhost:tools mememe$ pwd
/Users/mememe/Downloads/awstats-7.0/tools
myhost:tools mememe$ perl awstats_configure.pl

----- AWStats awstats_configure 1.0 (build 1.9) (c) Laurent Destailleur -----
This tool will help you to configure AWStats to analyze statistics for
one web server. You can try to use it to let it do all that is possible
in AWStats setup, however following the step by step manual setup
documentation (docs/index.html) is often a better idea. Above all if:
- You are not an administrator user,
- You want to analyze downloaded log files without web server,
- You want to analyze mail or ftp log files instead of web log files,
- You need to analyze load balanced servers log files,
- You want to 'understand' all possible ways to use AWStats...
Read the AWStats documentation (docs/index.html).

-----> Running OS detected: Mac OS
Warning: AWStats standard directory on Mac OS X is '/Library/WebServer/awstats'.
If you want to use standard directory, you should first move all content
of AWStats distribution from current directory:
/Users/mememe/Downloads/awstats-7.0
to standard directory:
/Library/WebServer/awstats
And then, run configure.pl from this location.
Do you want to continue setup from this NON standard directory [yN] ? y

-----> Check for web server install

Enter full config file path of your Web server.
Example: /etc/httpd/httpd.conf
Example: /usr/local/apache2/conf/httpd.conf
Example: c:\Program files\apache group\apache\conf\httpd.conf
Config file path ('none' to skip web server setup):
> none

Your web server config file(s) could not be found.
You will need to setup your web server manually to declare AWStats
script as a CGI, if you want to build reports dynamically.
See AWStats setup documentation (file docs/index.html)

-----> Update model config file '/Users/mememe/Downloads/awstats-7.0/wwwroot/cgi-bin/awstats.model.conf'
  File awstats.model.conf updated.

-----> Need to create a new config file ?
Do you want me to build a new AWStats config/profile
file (required if first install) [y/N] ? y

-----> Define config file name to create
What is the name of your web site or profile analysis ?
Example: www.mysite.com
Example: demo
Your web site, virtual server or profile name:
> ease-webserver1

-----> Create config file '/Users/mememe/Downloads/awstats-7.0/wwwroot/cgi-bin/awstats.ease-webserver1.conf'
 Config file /Users/mememe/Downloads/awstats-7.0/wwwroot/cgi-bin/awstats.ease-webserver1.conf created.

-----> Add update process inside a scheduler
Sorry, configure.pl does not support automatic add to cron yet.
You can do it manually by adding the following command to your cron:
/Users/mememe/Downloads/awstats-7.0/wwwroot/cgi-bin/awstats.pl -update -config=ease-webserver1
Or if you have several config files and prefer having only one command:
/Users/mememe/Downloads/awstats-7.0/tools/awstats_updateall.pl now
Press ENTER to continue... 


A SIMPLE config file has been created: /Users/mememe/Downloads/awstats-7.0/wwwroot/cgi-bin/awstats.ease-webserver1.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for 'ease-webserver1' with command:
> perl awstats.pl -update -config=ease-webserver1
You can also build static report pages for 'ease-webserver1' with command:
> perl awstats.pl -output=pagetype -config=ease-webserver1

Press ENTER to finish...

myhost:tools mememe$ 

myhost:tools mememe$ perl awstats_buildstaticpages.pl -config=mvndev.ground.fedex.com -awstatsprog=/Users/mememe/Downloads/awstats-7.0/wwwroot/cgi-bin/awstats.pl 

For a break down of all the requests per hour of day....
Signings:~ mememe$ cd ~/awstats/wwwroot/cgi-bin/
Signings:cgi-bin mememe$ rm -fr ~/.awstats/* && rm ~/ease/current.log && ln -s ~/ease/access_log.Q112073000 ~/ease/current.log && perl awstats.pl -config=ease-webserver1 -databasebreak=hour -month=all

$ rm ~/ease/current.log && ln -s ~/ease/access_log.Q112073100 ~/ease/current.log && perl awstats.pl -config=ease-webserver1 -month=all

Signings:~ mememe$  cd ~/awstats/tools/
Signings:tools mememe$ perl awstats_buildstaticpages.pl -config=ease-webserver1 -awstatsprog=/Users/akaan/awstats/wwwroot/cgi-bin/awstats.pl -month=all

$ rm awstats.ease-webserver1.* && perl awstats_buildstaticpages.pl -config=ease-webserver1 -awstatsprog=/Users/akaan/awstats/wwwroot/cgi-bin/awstats.pl -month=07


Friday, July 20, 2012

Set a blazingly fast keyboard repeat rate (cursor movement) in Terminal MacOSX

(plagiarized from http://hints.macworld.com/article.php?story=20090823193018149) Everybody knows that you can get a pretty fast keyboard repeat rate by changing a slider on the Keyboard tab of the Keyboard & Mouse System Preferences panel. But you can make it even faster! In Terminal, run this command:
defaults write NSGlobalDomain KeyRepeat -int 0
Then log out and log in again. The fastest setting obtainable via System Preferences is 2 (lower numbers are faster), so you may also want to try a value of 1 if 0 seems too fast. You can always visit the Keyboard & Mouse System Preferences panel to undo your changes. You may find that a few applications don't handle extremely fast keyboard input very well, but most will do just fine with it.

Thursday, July 19, 2012

Capture Contents from Match until the end of the file - in perl

I want the classpath that is set in the manifest.mf
Class-Path:  mscorlib.jar Microsoft.VisualBasic.jar rdVbScriptTranslat
 or.jar js.jar rdsuperscript.jar System.Xml.jar rt.jar System.jar Syst
 em.Data.jar System.Web.jar rt.jar J2SE.Helpers.jar rt.jar fop.jar
The whole file is
$ cat META-INF/MANIFEST.MF 
Manifest-Version: 1.0
VMW-Assembly: c%3A%5CReportDev%5CVB%5CrdXslFoTemplate%5Cbin%5CDebug_Ja
 va%5CrdXslFoTemplate.dll
Created-By: MainSoft Inc
Version-Date: Mon 02/20/06 15:49:54.479
Assembly-Version: 1.0.0.0
Build-Version: 2.2.0.130
Class-Path:  mscorlib.jar Microsoft.VisualBasic.jar rdVbScriptTranslat
 or.jar js.jar rdsuperscript.jar System.Xml.jar rt.jar System.jar Syst
 em.Data.jar System.Web.jar rt.jar J2SE.Helpers.jar rt.jar fop.jar

$ 
What to do.... make the 3 dot match and make the last match \cD which is code for end of file....
$ find . -name 'rdXsl*.jar' -type f | while read dir; do [ -f META-INF/MANIFEST.MF ] && rm -f META-INF/MANIFEST.MF;unzip -q $dir META-INF/MANIFEST.MF; cat META-INF/MANIFEST.MF | perl -ne 'print if /^Class-Path/ ... /\cD/' ; done;

JDBC Version Driver - Can you tell me?

Some drivers for JDBC have a marvelous mechanisms for telling what the version is.... you can either guess or ask the driver or even decompile.... Ask the driver: DB2- jt400.jars
$ java -cp ../jt400-7.7.1.jar utilities.AboutToolbox

IBM Toolbox for Java:
Open Source Software, JTOpen 7.7, codebase 5770-SS1 V7R1M0.07 built=20120531 @FB
Supports JDBC version 3.0
Toolbox driver version 9.8 

Monday, July 16, 2012

Hidden Chronicles Feed Item Click All

I like Hidden Chronicles however the zygna feed on the right side where you can reap rewards and help others ..... I found it too tedious to go thru the list over and over click click click ... oops missed the button... ie waste of time... so how can I automate this... I'm using Chrome and used the extension "Script Injector". Then "Manage Scripts" and "create a new script" insertion with the following (Based on the css and design of July 2012... )
document.getElementById('zui_tab_gameActivity').ondblclick=function() {
  alert('starting feed reaping');
  var allTags=document.getElementsByClassName('zui_button_zdc'), i=0, e;
while(e=allTags[i++])
{
  e.click();
};  
};
So it will look like this
AFter that "create a rule" for autoloading.
Now reload the Zynga page and the double click on the red highlighted area called "Game Activity" and all your feeds will be reaped and rewarded. You will be able to do this for both z-Friends and Everybody.... ENJOY.

Friday, July 6, 2012

Converting SHP files to KML with GDAL command line SHP2KML

There is a lot of crappy software around claiming to be able to convert.... but :-( none of it is true... now fasten your seat belts.. I wrestled with it on Mac OSX so please forgive my ignorance to the other OS' First of all download the GDAL framework, and then let the magic begin Get your cadestral files from your local gis data provider.. unzip the files and let the transformation begin...
  657  /Library/Frameworks/GDAL.framework/Programs/ogr2ogr -f KML VTPARCELS_Westford2008.kml VTPARCELS_Westford2008.shp 
  658  ls -rlt
  659  history
  660  ls -rlt
  661  cd ../vtparcels_essextown2011
  662  /Library/Frameworks/GDAL.framework/Programs/ogr2ogr -f KML VTPARCELS_EssexTown2011.kml VTPARC.shp