Search This Blog

2007-03-15

PCAnywhere tips & tricks

Access remote workstations by calling their domain names through the command line

PCAnywhere could be configured easily for accessing large number of Remoted Desktops. The “keys” to the access of each workstations are stored in configuration *.CHF types of files stored by default in the C:\Documents and Settings\All Users\Application Data\Symantec\pcAnywhere\Remote” folder. Once the files are named with the domain names the a configuration setting improvement could speed the access to each station, so that each domain name of an workstation would become an command (those are accessed at least 100 times per day in regular administration work). The idea is to create batch files for the starting of each workstation, by referring to its *.CHF file. The PCAnywhere support pages provide the following call:
"C:\Program Files\Symantec\pcAnywhere\Winaw32.exe" [params] [pathToCHFfile]
So for each workstation the following call could be stored in a batch file:
cmd /c start /max "C:\Program Files\Symantec\pcAnywhere\Winaw32.exe" "C:\Documents and Settings\All Users\Application Data\Symantec\pcAnywhere\Remotes\Workstations
DomainName.CHF"
and the name of the file could be saved as the Domain Name of the workstation. Of course if the naming convention is standard and there are more than 4 stations to be accessed so the writing of those batch files could be automated.

Here is the batch file for writing:
:: CREATES CMD FILES FOR STARTING CHF FILES
:: THIS ROW STARTS SOME CHF FILE BY ACCOSSIOATING IT WITH PCANYWHERE EXECUTABLE
:: cmd /c start /max "C:\Program Files\Symantec\pcAnywhere\Winaw32.exe" "C:\Documents and Settings\All Users\Application Data\Symantec\pcAnywhere\Remotes\1USD01070.CHF"
:: SETTINGS
set CHFDir=C:\Documents and Settings\All Users\Application Data\Symantec\pcAnywhere\Remotes
set RunDir=C:\temp\UTILS

:: FOR EACH CHF IN THE CHF DIRECTORY PUT THE COMMAND INTO SEPARATE FILE
for /f "tokens=1 delims=." %%i in ('dir "%CHFDir%\*.chf" /b') do (
echo start /max "C:\Program Files\Symantec\pcAnywhere\Winaw32.exe" "C:\Documents and Settings\All Users\Application Data\Symantec\pcAnywhere\Remotes\%%i.CHF" > "%RunDir%\%%i.cmd"
)

Windows tips and tricks - add some often used entries into the Run dialor

::NOW AFTER WINLOGO + R , drop down dialog with the most oftenly used commands will appear
::REQUIRESS THE REG UTILITY AND TEXTPAD, BUT YOU GOT THE LOGIC SO ADJUST TO YOUR
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /v "a" /d "shutdown -f -r -t 00" /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /v "b" /d "shutdown -f -s -t 00" /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /v "c" /d "firefox http://gmail.google.com" /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /v "d" /d "firefox http://www.youtube.com/my_playlists" /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /v "e" /d "regjump \"1" /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /v "f" /d "textpad \"C:\Temp\Kikkulas\HTML_CHEATSHEET.html\"\1" /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /v "g" /d "textpad \"C:\Temp\Kikkulas\cmdCheatSheet.cmd\"\1" /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /v "h" /d "textpad \"C:\Temp\Kikkulas\PerlCheatSheat.pl\"\1" /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /v "i" /d "textpad \"C:\Temp\UTILS\exctract.pl\"\1" /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /v "j" /d "textpad \"C:\Documents and Settings\%userName%\Desktop\\Good_Morning.cmd\"\1" /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /v "k" /d "textpad \"C:\temp\regs_and_hacks\\run.cqf\"\1" /f

2007-03-14

How to change , enable , disable NetBios over TCP

SOURCES:
http://techtasks.com/code/viewbookcode/1199

# This code enables/disables the Netbios over TCP/IP setting.
# ------ SCRIPT CONFIGURATION ------

use Win32::OLE qw(in);

use constant SET_NETBIOS => 1;
# 0 = Use setting from DHCP; 1 = Enable; 2 = Disable
$strComputer = '.';
# ------ END CONFIGURATION ---------

$objWMIService = Win32::OLE->GetObject('winmgmts:\\\\' . $strComputer . '\\root\\cimv2');
$colNicConfigs = $objWMIService->ExecQuery('SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True');

foreach my $objNicConfig (in $colNicConfigs) {
$intNetBIOS = $objNicConfig->SetTCPIPNetBIOS(SET_NETBIOS);
print $objNicConfig->Description . ': successfully set NetBIOS over TCP/IP to ' . SET_NETBIOS, "\n";
}

2007-03-13

REGISTRY TWEAKS

Windows Registry Editor Version 5.00

;HOW TO IMPORT SILENTLY A REGISTRY FROM A FILE

;REMEMBER TO SAVE ALLWAYS YOUR REG FILES IN ANSI
;reg import /s C:\temp\the_name_of_the_file.reg
;HOW TO GO TO SPECIFIC KEY
;DOWNLOAD REGJUMP regjump "[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TypedURLs]"
;This line adds prioritizing to IRQ requests;
;avoids accedential rebooting if IRQ is shared

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\PriorityControl]
"IRQ8Priority"=dword:00000001

;PUT THE NAME OF THE COMMANDS YOU WOULD LIKE NOT TO TYPE
;FROM THE START - RUN
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TypedURLs]
"url1"="firefox http://www.youtube.com/my_playlists"
"url2"="firefox http://gmail.google.com"
"url3"="C:\\Program Files\\Opera\\opera.exe g toSearch"
"url4"="firefox http://www.google.com/search?hl=en&q= typeHereTheWordToSearch"
;Note the space before typeHereTheWordToSearch if yount to have several words
;ANOTHER CACHE FOR THE RUN MENU
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU]
"a"="shutdown -f -s -t 00"
"b"="shutdown -f -r -t 00"
"c"="opera g toSearch"

;THE FOLLOWING ARE HISTORY KEYS, FOR TYPED URLS ,LAST DOCUMENTS ETC
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TypedURLs]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\LastVisitedMRU]
[HKEY_CURRENT_USER\Software\Microsoft\Search Assistant\ACMru]

[HKEY_CLASSES_ROOT\*\shell\cmdhere]
@="Cmd&Here"

[HKEY_CLASSES_ROOT\*\shell\cmdhere\command]
@="cmd.exe /c start cmd.exe /k pushd \"%L\\..\""

[HKEY_CLASSES_ROOT\Folder\shell\cmdhere]
@="Cmd&Here"

[HKEY_CLASSES_ROOT\Folder\shell\cmdhere\command]
@="cmd.exe /c start cmd.exe /k pushd \"%L\""

;add a command line functionality from Start - Run with Opera on Windows
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\opera.exe]
@="C:\\Program Files\\Opera\\opera.exe"
"Path"="C:\\Program Files\\Opera"

make the fastest google search ever possible

::Create the following batch file in a folder of your path
::==================================================COPYPASTESTART
start /max "opera" "C:\Program Files\Opera\Opera.exe" "%1 %2 %3 %4 %5 %6 %7%8 %9"
exit
::start /min would start it minimized
::==================================================COPYPASTESTOP

::name it opera.cmd ::this way wou would not have to remember the "" 's while passing the parameters
::BUT THIS IS DIRTY METHOD HERE IS THE IMPROVED ONE !!!!!

=====================================COPYPASTESTART
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\opera.exe]
@="C:\\Program Files\\Opera\\opera.exe"
"Path"="C:\\Program Files\\Opera"

=====================================COPYPASTESTOP




OR TROUGH THE COMMAND LINE (requeres the req utility ... )
=====================================COPYPASTESTART
::ADD A PROGRAM TO BE ACCESSIBLE FROM COMMAND LINE
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\opera.exe" /ve /d "C:\Program Files\Opera\opera.exe" /f
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\opera.exe" /v "Path" /d "C:\Program Files\Opera" /f
=====================================COPYPASTESTOP

::Now press Windows Logo Key + R and type opera g what do you want to search from google

Note: 9 words should be enough for beginning ; )
::or search your hard drive from Winloggo + R
::find a file which has the string settings under the C:\temp folder and open the results
cmd /c WHERE /R C:\Temp *settings* >list.txt&list.txt

::NOT TO MENTION THE FASTEST PERL SEARCH WITH
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /v "p" /d "opera \"g site:http://www.unix.org.ua/orelly/perl TOSEARCH\"\1" /f

How to download stuff from Internet efficiently

get wget
FROM
http://www.gnu.org/order/ftp.html

:: use with care


start /min "put some title here" cmd /c wget -r http://theSite1/I_would_/like/to/get/recursively

start /min "put some title here" cmd /c wget -r http://theSite2/I_would_/like/to/get/recursively

start /min "put some title here" cmd /c wget -r http://theSite3/I_would_/like/to/get/recursively



WELL THIS WILL NOT WORK FOR SURE IF ROBOTS ARE DISABLED ON THE SITE ...

Tip: combined with the GetAdd utility from this blog and Opera you could download most of the sites in your current session, which allow you to with couple simple hacks in Textpad

2007-03-09

Efficient usage of Word

First of all - you cannot understand this before you have realized the styles and format copying in all Office applications.

So here is the problem - you have more than 20 pages work in Word and you would like to navigate them fast and efficiently.
Well use the keyboard and format from the very beginning correctly.
You could copy formatting the Ctrl + Shift + C and paste it with Ctrl + Shift + V
Than Alt + V , D to , up and down with the arraw keys , than F6 , back to text , write sometning , back F6 go back to the Table of Contents , arrow keys , than Alt + F5 to go back ....
Alt + V , Z , P - spare your ice and use the whole area of the screen for viewing ..
Of course those were for the English version of Word ....

Tip F6 is also for the Help viewer
in Adobe Acrobat usually the F4 is used (example of non-compliency in GUI navigation )

Ok here is the bonus: favorite Windows shortcuts
Alt + Tab - spare you right hand from the mouse
Alt + F4 - Close the active window (spare the right hand I said ; )
Arrow keys - navigate trough active items
Ctrl + Tab - switch MDI windows (the tabs in Firefox ; )
WinLogo + Tab - cycle the taskbar items (WinLog is the key between you left Control and Alt , has the window on it ; ), after an item is selected , press Enter and with the arrows keys (if you have more than 5 window on it select the proper one )
WinLogo + E - open Explorer
WinLogo + R - open run dialog (for example try WinLogo + R . type firefox http://gmail.google.com

Shift + F10 - the same as pressing the right button on the mouse , for god sake I said you spare the right hand ; )
Alt + F or Alt + X - closes , exits the current application

Ctrl ++ - get bigger (with - smaller )fonts , or Ctrl + the wheel in the mouse

And finally WinLogo + R , type shutdown -f -s -t 00

UPS !

2007-03-07

Get set Windows Time remotely

use Win32::OLE qw(in);

my $datetime = Win32::OLE->new("WbemScripting.SWbemDateTime") or die ;
my $machine = shift @ARGV or ".";
$machine =~ s/^[\\\/]+//;
my $wmiservices = Win32::OLE->GetObject("winmgmts:{impersonationLevel=impersonate,(security)}//$machine") or die ;
foreach my $os ( in( $wmiservices->InstancesOf("Win32_OperatingSystem")))
{
print "Last Boot Time:".$os->{LastBootUpTime}."\n";
print "Current time:".$os->{LocalDateTime}."\n";
$datetime->{Value} = $os->{LocalDateTime};
printf( "Current Time: %02d-%02d-%04d at %02d:%02d:%02d\n", $datetime->{Month}, $datetime->{Day}, $datetime->{Year}, $datetime->{Hours}, $datetime->{Minutes}, $datetime->{Seconds} );
print "Setting time + 2 hours:";
$datetime->{Hours} += 2;
printf( "Current Time: %02d-%02d-%04d at %02d:%02d:%02d\n", $datetime->{Month}, $datetime->{Day}, $datetime->{Year}, $datetime->{Hours}, $datetime->{Minutes}, $datetime->{Seconds} );
print "\tHard value: $datetime->{Value}\n";
$Result = $os->SetDateTime($datetime->{Value});
print "Result: $Result\n";
}

Let the wiser talk - Roth Consulting Perl scripts repository and links

SOURCES:
http://www.roth.net/perl/scripts/
dada

http://dada.perl.it/

ENJOY

2007-03-05

About dictionaries

The more I write my thesis the more I understand that it is extremely important to understand , store and recheck alway the meaning of words and phrases (especially if English does not happen to be your mother tongue)
So:
http://www.dictionary.com

For example:
quotient

coefficient

2007-03-03

exec on Windows

::echo all *.exe and *.txt files recursively in cmd
for /f %i in ('dir *.exe *.txt /s /b') do @echo %i

Labels

perl (41) Cheat Sheet (25) how-to (24) windows (14) sql server 2008 (13) linux (12) oracle (12) sql (12) Unix (11) cmd windows batch (10) mssql (10) cmd (9) script (9) textpad (9) netezza (8) sql server 2005 (8) cygwin (7) meta data mssql (7) metadata (7) bash (6) code generation (6) Informatica (5) cheatsheet (5) energy (5) tsql (5) utilities (5) excel (4) future (4) generic (4) git cheat sheet (4) html (4) perl modules (4) programs (4) settings (4) sh (4) shortcuts (4) поуки (4) принципи (4) Focus Fusion (3) Solaris (3) cool programs (3) development (3) economy (3) example (3) freeware (3) fusion (3) logging (3) morphus (3) mssql 2005 (3) nuclear (3) nz (3) parse (3) python (3) sftp (3) sofware development (3) source (3) sqlplus (3) table (3) vim (3) .Net (2) C# (2) China (2) GUI (2) Google (2) GoogleCL (2) Solaris Unix (2) architecture (2) ascii (2) awk (2) batch (2) cas (2) chrome extensions (2) code2html (2) columns (2) configuration (2) conversion (2) duplicates (2) excel shortcuts (2) export (2) file (2) free programs (2) informatica sql repository (2) linux cheat sheet (2) mssql 2008 (2) mysql (2) next big future (2) nsis (2) nz netezza cheat sheet (2) nzsql (2) ora (2) prediction (2) publish (2) release management (2) report (2) security (2) single-click (2) sqlserver 2005 (2) sqlserver 2008 (2) src (2) ssh (2) template (2) tools (2) vba (2) video (2) xlt (2) xml (2) youtube videos (2) *nix (1) .vimrc (1) .virmrc vim settings configs (1) BSD license (1) Bulgaria (1) Dallas (1) Database role (1) Dense plasma focus (1) Deployment (1) ERP (1) ExcelToHtml (1) GD (1) GDP (1) HP-UX (1) Hosting (1) IDEA (1) INC (1) IT general (1) ITIL management bullshit-management (1) IZarc (1) Java Web Start (1) JavaScript anchor html jquery (1) Khan Academy (1) LINUX UNIX BASH AND CYGWIN TIPS AND TRICKS (1) Linux Unix rpm cpio build install configure (1) Linux git source build .configure make (1) ListBox (1) MIT HYDROGEN VIRUS (1) OO (1) Obama (1) PowerShell (1) Run-time (1) SDL (1) SIWA (1) SOX (1) Scala (1) Services (1) Stacks (1) SubSonic (1) TED (1) abstractions (1) ansible hosts linux bash (1) ansible linux deployment how-to (1) ansible yum pip python (1) apache (1) apache 2.2 (1) application life cycle (1) architecture input output (1) archive (1) arguments (1) avatar (1) aws cheat sheet cli (1) aws cli (1) aws cli amazon cheat sheet (1) aws elb (1) backup (1) bash Linux open-ssh ssh ssh_server ssh_client public-private key authentication (1) bash perl search and replace (1) bash stub (1) bin (1) biofuels (1) biology (1) books (1) browser (1) bubblesort (1) bugs (1) build (1) byte (1) cas_sql_dev (1) chennai (1) chrome (1) class (1) claut (1) cmdow (1) code generation sqlserver (1) command (1) command line (1) conf (1) confluence (1) console (1) convert (1) cool programs windows free freeware (1) copy paste (1) copy-paste (1) csv (1) ctags (1) current local time (1) cygwin X11 port-forwarding mintty xclock Linux Unix X (1) cygwin bash how-to tips_n_tricks (1) cygwin conf how-to (1) data (1) data types (1) db2 cheat sheet (1) db2 starter ibm bash Linux (1) debt (1) diagram (1) dictionaries (1) digital (1) disk (1) disk space (1) documentation (1) dos (1) dubai (1) e-cars (1) electric cars (1) electricity (1) emulate (1) errors (1) exponents (1) export workflow (1) extract (1) fast export (1) fexp (1) file extension (1) file permissions (1) findtag (1) firewall (1) for loop (1) freaky (1) functions (1) fusion research (1) german (1) git gitlab issues handling system (1) google cli (1) google code (1) google command line interface (1) gpg (1) ha (1) head (1) helsinki (1) history (1) hop or flop (1) host-independant (1) how-to Windows cmd time date datetime (1) ibm db2 cognos installation example db deployment provisioning (1) ideas (1) image (1) informatica oracle sql (1) informatica repo sql workflows sessions file source dir (1) informatica source files etl (1) install (1) isg-pub issue-tracker architecture (1) it management best practices (1) java (1) jump to (1) keyboard shortcuts (1) ksh (1) level (1) linkedin (1) linux bash ansible hosts (1) linux bash commands (1) linux bash how-to shell expansion (1) linux bash shell grep xargs (1) linux bash tips and t ricks (1) linux bash unix cygwin cheatsheet (1) linux bash user accounts password (1) linux bash xargs space (1) linux cheat-sheet (1) linux cheatsheet cheat-sheet revised how-to (1) linux how-to non-root vim (1) linux ssh hosts parallel subshell bash oneliner (1) london (1) make (1) me (1) metacolumn (1) metadata functions (1) metaphonre (1) method (1) model (1) movie (1) multithreaded (1) mysql cheat sheet (1) mysql how-to table datatypes (1) n900 (1) nano (1) neteza (1) netezza bash linux nps (1) netezza nps (1) netezza nps nzsql (1) netezza nz Linux bash (1) netezza nz bash linux (1) netezza nz nzsql sql (1) netezza nzsql database db sizes (1) non-password (1) nord pol (1) nps backup nzsql schema (1) number formatting (1) nz db size (1) nz table count rows (1) nzsql date timestamp compare bigint to_date to_char now (1) on-lier (1) one-liners (1) one-to-many (1) oneliners (1) open (1) open source (1) openrowset (1) openssl (1) oracle PL/SQL (1) oracle Perl perl (1) oracle installation usability (1) oracle number formatting format-model ora-sql oracle (1) oracle templates create table (1) oracle trigger generic autoincrement (1) oracle vbox virtual box cheat sheet (1) oracle virtual box cheat sheet (1) outlook (1) parser (1) password (1) paths (1) perl @INC compile-time run-time (1) perl disk usage administration Linux Unix (1) perl modules configuration management (1) permissions (1) php (1) picasa (1) platform (1) postgreSQL how-to (1) powerShell cmd cygwin mintty.exe terminal (1) ppm (1) predictions (1) prices (1) principles (1) productivity (1) project (1) prompt (1) proxy account (1) public private key (1) publishing (1) putty (1) qt (1) read file (1) registry (1) relationship (1) repository (1) rm (1) scala ScalaFmt (1) scp (1) scripts (1) scsi (1) search and replace (1) sed (1) sendEmail (1) sh stub (1) shortcuts Windows sql developer Oracle (1) sidebar (1) silicon (1) smells (1) smtp (1) software development (1) software procurement (1) sofware (1) sort (1) sql script (1) sql_dev (1) sqlcmd (1) sqlite (1) sqlite3 (1) sshd (1) sshd cygwin (1) stackoverflow (1) stored procedure (1) stub (1) stupidity (1) subroutines (1) svn (1) sysinternals (1) system design (1) tail (1) tar (1) temp table (1) templates (1) teradata (1) terminal (1) test (1) testing (1) theory (1) thorium (1) time (1) tip (1) title (1) tmux .tmux.conf configuration (1) tmux efficiency bash (1) tool (1) ui code prototyping tips and tricks (1) umask Linux Unix bash file permissions chmod (1) url (1) urls (1) user (1) utility (1) utils (1) vb (1) vbox virtual box cheat sheet (1) vim perl regex bash search for string (1) vim recursively hacks (1) vim starter (1) vim-cheat-sheet vim cheat-sheet (1) vimeo (1) visual stuio (1) warsaw (1) wiki (1) wikipedia (1) window (1) windows 7 (1) windows 8 (1) windows programs (1) windows reinstall (1) windows utility batch perl space Windows::Clipboard (1) wisdoms (1) workflow (1) worth-reading (1) wrapper (1) xp_cmdshell (1) xslt (1) youtube (1)

Blog Archive

Translate with Google Translate

My Blog List