Wednesday, February 26, 2014

Finding section where can change password in PayPal

To change the password you have actually move cursor to the "Profile",
Ignore the new sub menu that appears and actually still click on "Profile"

This reminds me first time when i have to enter product key for Windows Vista. On the CD case there is serial number with dashes and i have to figure out that i do not need to enter dash symbol when enter product key.

Tuesday, February 25, 2014

Turn on and off java cache, windows, command line


Settings are kept under %userprofile%\AppData\LocalLow\Sun\Java\Deployment\deployment.properties
and under registry HKCU\Software\AppDataLow\Software\JavaSoft\DeploymentProperties

When java cache is off then deployment.properties includes:
deployment.cache.enabled=false
reg add "HKCU\Software\AppDataLow\Software\JavaSoft\DeploymentProperties" ^
/v deployment.cache.enabled /t REG_SZ /d "false" /f
When java cache is on then deployment.properties excludes:
deployment.cache.enabled=false
reg delete "HKCU\Software\AppDataLow\Software\JavaSoft\DeploymentProperties" ^
/v deployment.cache.enabled /f
Check for java cache status
@echo off
setlocal EnableDelayedExpansion
ver | find "Version 5." > nul 2>&1
if !errorlevel!==0 (
set dp=%appdata%\Sun\Java\Deployment\deployment.properties
) else (
set dp=%userprofile%\AppData\LocalLow\Sun\Java\Deployment\deployment.properties
)
if not exist %dp% echo No customization found. Default config used instead. & goto end
type "%dp%" | find "deployment.cache.enabled=false" > nul 2>&1
if !errorlevel!==0 echo Java cache is disabled
if not !errorlevel!==0 echo Java cache is enabled 
endlocal
:end
pause
Turn on java cache. This only works if Java control panel is opened at least once.
@echo off
setlocal EnableDelayedExpansion
ver | find "Version 5." > nul 2>&1
if !errorlevel!==0 (
set dp=%appdata%\Sun\Java\Deployment\deployment.properties
) else (
set dp=%userprofile%\AppData\LocalLow\Sun\Java\Deployment\deployment.properties
)
if not exist %dp% echo No customization found. Default config used instead. & goto end
type "%dp%" | find "deployment.cache.enabled=false" > nul 2>&1
if !errorlevel!==0 (
type "%dp%" | find /V "deployment.cache.enabled=false" > "%temp%\java.deployment.properties.tmp"
move /Y "%temp%\java.deployment.properties.tmp" "%dp%"
reg delete "HKCU\Software\AppDataLow\Software\JavaSoft\DeploymentProperties" ^
/v deployment.cache.enabled /f
)
endlocal
:end
pause
Turn off java cache. This only works if Java control panel is opened at least once.
@echo off
setlocal EnableDelayedExpansion
ver | find "Version 5." > nul 2>&1
if !errorlevel!==0 (
set dp=%appdata%\Sun\Java\Deployment\deployment.properties
) else (
set dp=%userprofile%\AppData\LocalLow\Sun\Java\Deployment\deployment.properties
)
if not exist %dp% echo No customization found. Default config used instead. & goto end
type "%dp%" | find "deployment.cache.enabled=false" > nul 2>&1
if not !errorlevel!==0 (
echo deployment.cache.enabled=false>> "%dp%"
reg add "HKCU\Software\AppDataLow\Software\JavaSoft\DeploymentProperties" ^
/v deployment.cache.enabled /t REG_SZ /d "false" /f
)
endlocal
:end
pause
Related:
http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/jcp/properties.html

Process Monitor cartridges

This is cartridge for RegSetValue under HKLM
reg add "HKCU\Software\Sysinternals\Process Monitor" /v "FilterRules" /t REG_BINARY /d 0102000000779c0000000000000118000000520065006700530065007400560061006c007500650000000000000000000000879c000004000000010c00000048004b004c004d005c0000000000000000000000 /f
reg add "HKCU\Software\Sysinternals\Process Monitor" /v "EulaAccepted" /t REG_DWORD /d 1 /f

Cartridge for Java settings in for currently logged user
reg add "HKCU\Software\Sysinternals\Process Monitor" /v "FilterRules" /t REG_BINARY /d 0102000000779c0000000000000118000000520065006700530065007400560061006c007500650000000000000000000000879c000004000000015600000048004b00430055005c0053006f006600740077006100720065005c0041007000700044006100740061004c006f0077005c0053006f006600740077006100720065005c004a0061007600610053006f006600740000000000000000000000 /f
reg add "HKCU\Software\Sysinternals\Process Monitor" /v "EulaAccepted" /t REG_DWORD /d 1 /f

Reset to Process Monitor defaults
reg delete "HKCU\Software\Sysinternals\Process Monitor" /f
reg add "HKCU\Software\Sysinternals\Process Monitor" /v "EulaAccepted" /t REG_DWORD /d 1 /f
Related:
http://download.sysinternals.com/files/ProcessMonitor.zip

Sunday, February 23, 2014

Friday, February 21, 2014

List connected network printers in user session

This will list exact sharing name of printer. Complete network address of printer.
Useful to know before re-install user environment.

Files needed:
http://gnu.catonrug.net/grep.exe
http://gnu.catonrug.net/libiconv2.dll
http://gnu.catonrug.net/libintl3.dll
http://gnu.catonrug.net/regex2.dll
http://gnu.catonrug.net/sed.exe

list.cmd
@echo off
set s=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\Client Side Rendering Print Provider\Servers
set path=%path%;~dp0
setlocal EnableDelayedExpansion

for /f %%a in ('^
reg query "%s%" ^|
sed "s/.*\\Servers\\//g;" ^|
grep -v "^$"') do (
for /f %%b in ('^
reg query "%s%\%%a\Printers" ^|
sed "s/.*\\Printers\\//g;" ^|
grep -v "^$"') do (
reg query "%s%\%%a\Printers\%%b\DsSpooler" > nul 2>&1
if !errorlevel!==0 for /f "tokens=*" %%c in ('^
reg query "%s%\%%a\Printers\%%b\DsSpooler" /v "url" ^|
grep -v "HKEY_LOCAL_MACHINE" ^|
sed "s/REG_SZ\|url//g" ^|
sed "s/^[ \t]*//g" ^|
sed "s/http://g;s/\//\\/g;"') do (
echo %%c
)

)

)
endlocal
pause
sed "s/.*\\Servers\\//g;" cut the output line content from line start till \Servers\
grep -v "^$" - remove empty lines
grep -v "HKEY_LOCAL_MACHINE" - remove lines which includes HKEY_LOCAL_MACHINE
sed "s/REG_SZ\|url//g" - deletes all REG_SZ and url
sed "s/^[ \t]*//g" - remove all white spaces and tabs at the start of line
sed "s/http://g;s/\//\\/g;" - deletes all http:; replace / with \

To list just the name use list.names.cmd
@echo off
set path=%path%;~dp0
reg query HKCU\Printers\Connections | sed "s/.*Connections\\//g;" | sed "s/,/\\/g;" | grep -v "^$"
pause

Related:
List locally installed printers on remote machine
Set group policy user logon or computer startup script to run locally

Wednesday, February 19, 2014

ST31000524NS RAID 0 test

Single
By comparing disk position from 5% with 95% the write performance is completely different.

RAID 0 was created with hardware raid with stripe size 128kb

If the block size for write is 4kb then the write is very similar in booth tests and the result is write at 45 mb per second.

A system shutdown is in progress.(1115)

You used shutdown -m \\%1 -r -t 0 -f to restart remote machine and receive:

To ensure the computer are not restarted use psexec \\%1 net statistics server to look for boot time:
http://live.sysinternals.com/Tools/psexec.exe

If computer is not restarted try to kill winlogon service with pskill \\%1 winlogon
http://live.sysinternals.com/Tools/pskill.exe

If no success then determine which process takes memory with psexec \\%1 tasklist

kill the process for example with pskill \\%1 TrustedInstaller

Once you kill the right process the computer will go in reboot instantly cause you launch the shutdown command like hour ago.

In all examples replace %1 with your remote computer name.

Sunday, February 16, 2014

Saturday, February 15, 2014

Embed mp4 file in html, mediaplayer.swf

<embed 
src="https://googledrive.com/host/0BzzcyicPqpWWbGNjUElkbWpGRk0?file=http%3a%2f%2f" 
width="800" 
height="620" 
allowfullscreen="true" />
For 800x600 video you need to add additional 20px to height for progress bar.

Yes! - It is https

https://googledrive.com/host/0BzzcyicPqpWWbGNjUElkbWpGRk0 is direct link for mediaplayer.swf
1ab8dc4b223ca2adfcfb67e17a20605f
fbfafda66b80d087f6bf4dd1af0a947a6fd5adcc

File name must be entered by converting any
: with %3a and any
/ with %2f

Friday, February 14, 2014

Create archive, detect duplicate files

7z version 7.20 supports duplicate file check.
If you make a copy of file,
rename to something else and
move into a sub directory
then the second files size will be not added to the whole size of archive.

Screenshot represents the one same file with different file names.
The size included in archive summary is counted only once. This is awesome.

This is huge advantage for 7-zip unless other archiver types include this option

If the archive is created from jpg or mp3 there is a possibility that also ISO CD/DVD image archive can beat such popular type as RAR.

Using ImgBurn this can can be implemented by selecting "Optimize duplicate files".


PeaZip can create 7z archive but the 7z libraries included in version 5.2.1 is in beta and do not support duplicate files
You need to update 7z.exe and 7z.dll in C:\Program Files\PeaZip\res\7z if want to support duplicate file solution.
Once you overwrite back the stable 7z.exe and 7z.dll with version 9.20 then also PeaZip 7z file type will support duplicate file check.

Blog Archive