Tuesday, December 31, 2013

aMule for Puppy linux

These packages are tested with slacko 5.6 puppy linux and precise 5.7.1 puppy linux and Wary 5.5 puppy linux.

http://slackware.cs.utah.edu/pub/slackware/slackware-14.0/slackware/d/binutils-2.22.52.0.2-i486-2.txz
http://slackware.cs.utah.edu/pub/slackware/slackware-14.0/slackware/l/libpng-1.4.12-i486-1.txz needed only for precise and wary
http://slackware.cs.utah.edu/pub/slackware/slackware-14.0/slackware/l/libjpeg-v8a-i486-1.txz needed only for wary puppy
http://slackware.cs.utah.edu/pub/slackware/slackware-14.0/slackware/d/gcc-g++-4.7.1-i486-1.txz needed only for wary puppy
http://slackware.cs.utah.edu/pub/slackware/slackware-14.0/slackware/l/glibc-2.15-i486-7.txz needed only for wary puppy

To automatically get job done install
http://slackware.cs.utah.edu/pub/slackware/slackware-14.0/slackware/a/pkgtools-14.0-noarch-2.tgz
Then run
wget http://slackware.cs.utah.edu/pub/slackware/slackware-14.0/slackware/d/binutils-2.22.52.0.2-i486-2.txz
installpkg binutils-2.22.52.0.2-i486-2.txz
wget http://slackware.cs.utah.edu/pub/slackware/slackware-14.0/slackware/d/gcc-g++-4.7.1-i486-1.txz
installpkg gcc-g++-4.7.1-i486-1.txz
wget http://slackware.cs.utah.edu/pub/slackware/slackware-14.0/slackware/l/glibc-2.15-i486-7.txz
installpkg glibc-2.15-i486-7.txz
wget http://slackware.cs.utah.edu/pub/slackware/slackware-14.0/slackware/l/libjpeg-v8a-i486-1.txz
installpkg libjpeg-v8a-i486-1.txz
wget http://slackware.cs.utah.edu/pub/slackware/slackware-14.0/slackware/l/libpng-1.4.12-i486-1.txz
installpkg libpng-1.4.12-i486-1.txz
installpkg libupnp-1.6.17-i486-1_SBo.tgz
installpkg cryptopp-5.6.1-i486-2_SBo.tgz
installpkg wxGTK-2.8.12-i486-3_SBo.tgz
installpkg aMule-2.3.1-i486-1_SBo.tgz
Puppy linux mirror
https://drive.google.com/drive/folders/0Bw6O2bpd3mobdzBZcTF1TS1NOHc

Sunday, December 29, 2013

Sunday, December 22, 2013

Friday, December 20, 2013

Install Python2 with mechanize and BeautifulSoup module for windows

Go to python.org and grab latest Python2 installer for windows

Or use exact file for this tutorial
http://www.python.org/ftp/python/2.7.6/python-2.7.6.msi
ac54e14f7ba180253b9bae6635d822ea
c5d71f339f7edd70ecd54b50e97356191347d355

Download mechanize module:
http://pypi.python.org/packages/source/m/mechanize/mechanize-0.2.5.zip
a497ad4e875f7506ffcf8ad3ada4c2fc
541a840abe38d11a9c3c796c4173f14fd24b45f7

Download BeautifulSoup module:
http://www.crummy.com/software/BeautifulSoup/bs4/download/4.3/beautifulsoup4-4.3.1.tar.gz
508095f2784c64114e06856edc1dafed
59db0ac4c38f44111bfd5c2e642753b9dd52b75f

Download files with python mechanize

When you open http://www.superantispyware.com/portablescannertech.html
And click on the big red button..
It gets redirected to http://www.superantispyware.com/sasportable.php
Which detects web browser existence and then generates random download link which only is alive few minutes.

Somehow wget can not ask the php file to retrieve download link. How sad.

There is possibility to use python together with mechanize module which works like command line web browser

I have created portable python version with mechanize module
mirror: https://drive.google.com/uc?export=download&id=0BxmEiwnrWfmmSkRuSDdPNnpGY28
dedd679c505cbe6946f5b9439be93ee0
9fbdcef0f05f7f2a6c72dd5835910e323bd96f29

However to automatically download portable version of superantispyware you can use python with mechanize module.

And here is the code you need to get portable superantispyware version:
get-sas-portable.py
from mechanize import Browser
br = Browser()

br.set_handle_robots( False )
br.addheaders = [('User-agent', 'Firefox')]

f = br.retrieve('http://www.superantispyware.com/sasportable.php',"portablescanner.exe")[0]
To implement this in windows batch file you must use
python.exe get-sas-portable.py

Create portable python2 with mechanize

This will create portable version of python2 together with mechanize module.
Later you can call python.exe with python program.
Finally this will let you embed python code in windows batch file. Kind of.

Download portable python installer at http://portablepython.com/

Download mechanize module at https://pypi.python.org/pypi/mechanize/
or use file in just the file in tutorial
http://pypi.python.org/packages/source/m/mechanize/mechanize-0.2.5.zip
a497ad4e875f7506ffcf8ad3ada4c2fc
541a840abe38d11a9c3c796c4173f14fd24b45f7

Install just the core files from Python portable installer

From mechanize-0.2.5.zip archive select only mechanize directory
and extract it to Lib\site-packages in python portable directory

Here is the result
http://drive.google.com/uc?export=download&id=0BxmEiwnrWfmmSkRuSDdPNnpGY28

echo %date% in format YYYY-MM-DD, windows command line

You can use additional date.exe library from
http://gnuwin32.sourceforge.net/downlinks/coreutils-bin-zip.php
Here is direct link: http://gnu.catonrug.net/date.exe

For example if you want to echo %date% in format yyyy-mm-dd then use
for /f "tokens=*" %%d in ('"%~dp0date.exe" +%%Y-%%m-%%d') do (
echo %%d
)
date.exe must be side by side together with batch file

Related:
http://linux.die.net/man/1/date

Thursday, December 19, 2013

Query Alexa traffic rank, save history

Based on my first alexa rank report i create another one with auto save history function.
+ This will output only global ranks.
history.cmd
@echo off
set path=%path%;%~dp0
set site=catonrug.net
cls
for %%g in (^
catonrug.net ^
opensourcepack.blogspot.com ^
raymond.cc ^
maketecheasier.com ^
makeuseof.com) do (
echo %%g
for /f "tokens=*" %%f in ('^
wget -qO- http://www.alexa.com/siteinfo/%%g#trafficstats ^|
awk "/Alexa web traffic metrics are available via/{f=1} /Last 7 days/{f=0;print} f" ^|
sed "s/ \|\d034>\|<\//\n/g" ^|
grep "^[0-9,]" ^|
head -1') do (
if not exist "%userprofile%\.alexa\%%g" md "%userprofile%\.alexa\%%g" 
for /f "tokens=*" %%d in ('"%~dp0date.exe" +%%Y-%%m-%%d') do (
if not exist "%userprofile%\.alexa\%%g\%%d.log" (
echo %%d %%g %%f> "%userprofile%\.alexa\%%g\%%d.log"
)
)
)
for /f "tokens=*" %%h in ('dir /b "%userprofile%\.alexa\%%g\"') do (
type "%userprofile%\.alexa\%%g\%%h"
)
echo.
)
pause
All files together:
https://github.com/catonrug/query-alexa-rank-from-windows/archive/master.zip

Screenshot (showing only one day):

Wednesday, December 18, 2013

Firefox remote silent install

Download Firefox setup at
https://www.mozilla.org/en-US/firefox/all/

Rename firefox setup file to something like firefox.exe

Copy this firefox.exe to remote machine
for example place it on \\remote-machine\c$\install

Extract psexec.exe from http://live.sysinternals.com/Tools/psexec.exe

After you get psexec.exe. Move the file to your local %systemroot%\System32

Open windows command prompt in "Run as administrator" mode

Launch the command
psexec \\remote-machine c:\install\firefox.exe /S
Accept EULA
You can also skip the EULA screen with
psexec /accepteula \\remote-machine c:\install\firefox.exe /S
Finally you got output
If you got error code 0 then the Firefox is successfully installed on remote machine

Tuesday, December 17, 2013

Query Alexa traffic rank via command line

@echo off
set path=%path%;%~dp0
cls
for %%g in (catonrug.net raymond.cc maketecheasier.com www.shoutmeloud.com opensourcepack.blogspot.com) do (
for /f "tokens=*" %%f in ('^
wget -qO- http://www.alexa.com/siteinfo/%%g#trafficstats ^|
awk "/Alexa web traffic metrics are available via/{f=1} /Last 7 days/{f=0;print} f" ^|
sed "s/ \|\d034>\|<\//\n/g" ^|
grep "^[0-9,]" ^|
head -1') do (
echo %%g %%f
)
)
pause
All files together:
https://github.com/catonrug/query-alexa-rank-from-windows/archive/master.zip

Screenshot:

Sunday, December 15, 2013

Wednesday, December 11, 2013

Create Windows XP bootable iso, command line, mkisofs

This file includes iso command line utility mkisofs.exe and all needed libraries:
http://freefr.dl.sourceforge.net/project/cdrtoolswin/1.0/Binaries/CDR-Tools.exe
f7e0a537f83259d736c998b5157b22f8
2d7e1cae539cf911e39ec5ded64fe0af6ea27b29

Extract something like c:\CDR-Tools

Extract Windows XP source files to c:\CDR-Tools\src

Copy Windows XP boot file nt5boot.bin to c:\CDR-Tools\src
http://bootcd.narod.ru/nt5boot.bin
ce05c025433085b7e856e7214f7ce8b1
21d494d1d1565a99593635a2ca7ef1b9f549040a

Move to directory where mkisofs.exe and all needed libraries is havin' a good time

mkisofs -relaxed-filenames -d -D -N -J -R -b nt5boot.bin -no-emul-boot -boot-load-size 4 -o winxpbootcd.iso src

Related:
http://bootcd.narod.ru/nemkisofs_e.htm

Office 2013 first run

1) To remove "First things first." screen
Add to user logon script
reg add "HKCU\Software\Microsoft\Office\15.0\Common\General" /v shownfirstrunoptin /t REG_DWORD /d 1 /f
2) To remove "Welcome to your new Office." screen
Add to user logon script
reg add "HKCU\Software\Microsoft\Office\15.0\FirstRun" /v BootedRTM /t REG_DWORD /d 1 /f
3) To keep "Welcome to your new Office." screen but remove intro video
Add to user logon script
reg add "HKCU\Software\Microsoft\Office\15.0\FirstRun" /v disablemovie /t REG_DWORD /d 1 /f

4) To disable to "Help Improve Proofing Tools"
reg add "HKCU\Software\Microsoft\Office\15.0\Common\PTWatson" /v PTWOptIn /t REG_DWORD /d 1 /f<

5) To disable "Customer Experience Improvement Program"
reg add "HKCU\Software\Microsoft\Office\15.0\Common" /v qmenable /t REG_DWORD /d 1 /f

All together:
reg add "HKCU\Software\Microsoft\Office\15.0\Common\General" /v shownfirstrunoptin /t REG_DWORD /d 1 /f
reg add "HKCU\Software\Microsoft\Office\15.0\FirstRun" /v BootedRTM /t REG_DWORD /d 1 /f
reg add "HKCU\Software\Microsoft\Office\15.0\FirstRun" /v disablemovie /t REG_DWORD /d 1 /f
reg add "HKCU\Software\Microsoft\Office\15.0\Common\PTWatson" /v PTWOptIn /t REG_DWORD /d 1 /f
reg add "HKCU\Software\Microsoft\Office\15.0\Common" /v qmenable /t REG_DWORD /d 1 /f

Monday, December 9, 2013

Set group policy user logon or computer startup script to run locally

This is example how to convert group policy script with sed support to run locally.

This example can be run from UNC path.

All directory content (files who are got an extension) will be copied to %temp%\listpath sub directory and run from there.

After the script ends the %temp%\listpath will be removed.
@echo off
setlocal EnableDelayedExpansion
set t=%temp%\listpath
for /f "delims=:,tokens=1" %%f in ('echo %temp%') do (
echo %~dp0 | "%~dp0grep.exe" "^%%f.*" > nul 2>&1
if not !errorlevel!==0 (
if not exist "%t%" md "%t%"
xcopy /i /c /r /s /y "%~dp0*.*" "%t%"
if exist "%t%" for /f "delims=" %%g in ('dir /b "%t%\*.cmd"') do call "%t%\%%g"
exit /b
)
)
cls
set path=%path%;%~dp0
echo %path% | sed "s/;/\n/g" | sed "$d"
endlocal
pause
if exist "%t%" rd "%t%" /Q /S
This whole point of the program echo %path% | sed "s/;/\n/g" | sed "$d" is to show user all environment %path% variables in nice list. This is one example how powerful is sed.

Only one *.cmd file can be in directory

Find out if script is launched locally, not from UNC path

Since i discover a beautiful method how to support sed, awk, grep in windows command prompt.
The problem came out that sed do not support to run from UNC path on Windows XP.

Here is how yo implement check if script is located locally.
@echo off
setlocal EnableDelayedExpansion
for /f "delims=:,tokens=1" %%f in ('echo %temp%') do (
echo %~dp0 | "%~dp0grep.exe" "^%%f.*"
if not !errorlevel!==0 echo script is not located locally
)
endlocal
pause
grep is needed to place side by side with batch file
http://gnu.catonrug.net/grep.exe

echo %~dp0 | "%~dp0grep.exe" "^%%f.*" will check if the disk drive of %temp% (for example "C:\Users\Administrator\AppData\Local\Temp" is first/same letter in the path where batch file is located.

Sunday, December 8, 2013

Start VirtualBox machine automatically at computer startup, windows

Go to C:\Program Files\Oracle\VirtualBox and create something like autostart.cmd

autostart.cmd content
"%~dp0VBoxManage.exe" startvm "proxy"
"proxy" is name of Virtual machine

For hidden startup use
VBoxManage startvm --type headless "DC"
where "DC" is name of Virtual machine. For example Domain Controller

Copy the autostart.cmd

Explore startup programs for current user:

Past the shortcut of autostart.cmd!

Thursday, December 5, 2013

Delete registry keys that begins with, search pattern

I am reading manual that i should got to HKEY_CLASSES_ROOT and delete all keys that begins with:
ORAMMCPMON10
ORCLSSO.
source: http://docs.oracle.com/html/B13804_02/deinstall.htm

There are not exact keys listed, just only the starting pattern.

There must be a way to automatize the key search and deleting based on specified search pattern.

Single pattern search
@echo off
set path=%path%;%~dp0
setlocal EnableDelayedExpansion
set k=HKCR
set s=ORAMMCPMON

for /f "delims=" %%f in ('^
echo %k%^|
sed "s/\\/\\\\/g;s/\./\\\./g"') do set k2=%%f

for /f "delims=" %%f in ('^
echo %s%^|
sed "s/\\/\\\\/g;s/\./\\\./g"') do set s2=%%f

for /f "delims=" %%f in ('^
reg query "%k%" ^|
grep -i "%k2%\\%s2%.*" ') do (
echo %%f
)

endlocal
pause
This code will actually only list full key names based on search pattern.
If you really want to delete then just replace echo %%f with reg delete "%%f" /f

Substitute \ with \\ and
. with \. is really needed to convert keys like
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.3g to
HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\\.3g
This is needed for grep to understand the pattern.

grep -i means not case sensitive.

.* at the end in search pattern means that this may not be the end of pattern. There can be anything farther.

Tuesday, December 3, 2013

winpe.wim download

Windows Preinstallation Environment boot image is included in

32-bit
http://download.microsoft.com/download/9/9/F/99F5E440-5EB5-4952-9935-B99662C3DF70/adk/Installers/690b8ac88bc08254d351654d56805aea.cab
d0c9601b0c25b57116dc797842cbd945
0f3447aabccde837cb125e2cf15ddd37c285b9a1
winpe.wim
bd4c97dd1d42b24638cc64c02588d8eb
5e916415301325e93b901cce7b334a51c6516f35

64-bit
http://download.microsoft.com/download/9/9/F/99F5E440-5EB5-4952-9935-B99662C3DF70/adk/Installers/6d3c63e785ac9ac618ae3f1416062098.cab
55853d33eee687abb52c79f997479f54
a1ddc8d69bb68fa25055e25fcd3c082d3f70c274
winpe.wim
791d4a4a567c71338c6dd4ff8124e8f1
e6a617b554544842d7af54f46815b62611c12f28

Related
http://download.microsoft.com/download/9/9/F/99F5E440-5EB5-4952-9935-B99662C3DF70/adk/adksetup.exe

Monday, December 2, 2013

More base content - longer sidebar

If the base content is not so height then hide some content on sidebar.
<head>
<script src='http://code.jquery.com/jquery-1.9.1.js'/>
<script>
$(document).ready(function(){
if ( 3000 > $("#content").height() ) {
document.getElementById("HTML9").style.display = "none";
document.getElementById("HTML10").style.display = "none";
}
});
</script>
</head>
If the base content is pretty height then show more content on sidebar.
If you open page with more content then there will be more Advertisements.
Like in Registry based application audit

Open xlsx, docx, pptx with free microsoft tools

You do not need to pay about additional microsoft office program if you want to only view or print documents.

To open xls or xlsx install
http://download.microsoft.com/download/e/a/9/ea913c8b-51a7-41b7-8697-9f0d0a7274aa/ExcelViewer.exe
mirror: https://drive.google.com/uc?export=download&id=0BxmEiwnrWfmmV2hiZUlWNGlZZTA
cb4f2202fc368af9476effed5cc7b8a4
610cdc9a6684a5ef57ee5b4c1ca127384f3fb7e1
Service pack: http://download.microsoft.com/download/7/1/F/71F3318A-3D88-447C-8AFB-9C3DDEEEB3FE/excelviewer2007sp3-kb2526302-fullfile-en-us.exe
mirror: https://drive.google.com/uc?export=download&id=0BxmEiwnrWfmmdjNqVGlVWG0xeGc
df16f0c83d87465e5f7ee332c64f7861
a9497f832a36a62c0eb668626ea60d5dd1a9fe38

To open doc install
http://download.microsoft.com/download/6/a/6/6a689355-b155-4fa7-ad8a-dfe150fe7ac6/wordview_en-us.exe
mirror: https://drive.google.com/uc?export=download&id=0BxmEiwnrWfmmckRhaW40NmxnX1k
ef59dc6b88eab99362b3ba4982f1a4cb
e6dfdc8a1545d45ef5840ba513a5c4036bf154bc
Service pack: http://download.microsoft.com/download/2/e/5/2e5b8726-017f-4b2a-9f71-de6dba53025a/WordViewer2003SP3-KB934736-FullFile-ENU.exe
mirror: https://drive.google.com/uc?export=download&id=0BxmEiwnrWfmmeFNmTUZ6cjJwZUk
380501f6796efa5334d103b05e53ec9e
fe52a9eacc13b10670e3f31097c390898c08a131

To support docx you need to also install
http://download.microsoft.com/download/9/2/2/9222D67F-7630-4F49-BD26-476B51517FC1/FileFormatConverters.exe
mirror: https://drive.google.com/uc?export=download&id=0BxmEiwnrWfmmRU1nNzNRLVU5YUU
40c3c9289349265246c29407a3cbf19a
455b076bc8c805225f65c8935378d2c3906c4ec2
Service pack:
http://download.microsoft.com/download/D/2/9/D2906267-82B7-4F8C-B1D8-B24C461A5653/compatibilitypacksp3-kb2526297-fullfile-en-us.exe
mirror: https://drive.google.com/uc?export=download&id=0BxmEiwnrWfmmek92V2IwZDVvZEk
ea2c8f69b18a76eabb81d65113bc4429
1fa2f5931a7bafe0801c00dde0bdece98211c0f0

To open ppt and pptx install
http://download.microsoft.com/download/E/6/7/E675FFFC-2A6D-4AB0-B3EB-27C9F8C8F696/PowerPointViewer.exe
mirror: https://drive.google.com/uc?export=download&id=0BxmEiwnrWfmmM2tNT1hnSWlMbTg
35ff8ebbea457ba426b47ff6d8377284
ab48a8ebac88219c84f293c6c1e81f1a0f420da6
Service pack: http://download.microsoft.com/download/B/4/A/B4AAC00B-E1D8-4DEB-AF7A-844BF59E464A/ppviewersp2010-kb2687456-fullfile-x86-en-us.exe
mirror: https://drive.google.com/uc?export=download&id=0BxmEiwnrWfmmUUJ5bFVYc0FPNFU
cbeec0d7ea669e26c9c4d53a84edd692
f87ae5da79d810f997cdefa1229ea9eab0ceddaa


For silent install use
"%~dp0wordview_en-us.exe" /quiet /norestart
"%~dp0WordViewer2003SP3-KB934736-FullFile-ENU.exe" /Q
"%~dp0PowerPointViewer.exe" /quiet /norestart
"%~dp0ppviewersp2010-kb2687456-fullfile-x86-en-us.exe" /quiet /norestart
"%~dp0ExcelViewer.exe" /quiet /norestart
"%~dp0excelviewer2007sp3-kb2526302-fullfile-en-us.exe" /quiet /norestart
"%~dp0FileFormatConverters.exe" /quiet /norestart
"%~dp0compatibilitypacksp3-kb2526297-fullfile-en-us.exe" /quiet /norestart

Sunday, December 1, 2013