Tuesday, May 31, 2016

driver_irql_not_less_or_equal (l1c63x64.sys)


Updated. June 2016. Method below do not really helps. Just leave a comment if in your case you have additional VPN adapters as it is in my case.

This situation happens on Windows 10 if i have integrated network adapter
"Qualcomm Atheros AR8151 PCI-E Gigabit Ethernet Controller (NDIS 6.30)"
on my Gigabyte GA-H77M-D3H motherboard:

In this case i have Microsoft driver installed:

I can hang my computer very easy on this Windows 10 machine by streaming some media via Google Chrome. Just wait five minutes and i have blue screen of death :(

The original driver provider has not released solution yet:
https://www.atheros-drivers.com/atheros-network-drivers.html

Lucky for me i found driver that satisfied my motherboard :
atheros_ar813x_ar815x_ar816x_v2.1.0.21_whql.zip
b6d6c49d2d037813372595a78bc4dff8
2bdf462f0f23febf10e0cfe802cd9b57bb1199ac

After this driver upgrade the situation now looks like:

Now my computer works without this blue screen :)

Monday, May 30, 2016

listener failed: zbx_tcp_listen() fatal error: unable to serve on any address [[-]:10050]

I have this message on CentOS 7.
I modified /etc/zabbix/zabbix_agentd.conf and restart zabbix service with:
systemctl restart zabbix-agent
Now the /var/log/zabbix/zabbix_agentd.log says:
listener failed: zbx_tcp_listen() fatal error: unable to serve on any address [[-]:10050]
Lets check if there are really all zabbix instances closed:
ps aux | grep zabbix
zabbix    1766  0.0  0.0  86844  1408 ?        S    May24   5:15 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]
zabbix    1767  0.0  0.0  86844  1404 ?        S    May24   5:19 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]
zabbix    1768  0.0  0.0  86844  1404 ?        S    May24   5:17 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]
I stopped the agent but the services are still running. How it is possible? never mind. Lets kill these processes:
kill 1766
kill 1767
kill 1768
Make sure there are not other instances running:
ps aux | grep zabbix
Start the agent:
systemctl start zabbix-agent

Sunday, May 29, 2016

Warning: Using a password on the command line interface can be insecure.

I have this message when i run mysql command with username and password directly from terminal:
Warning: Using a password on the command line interface can be insecure.
It is possible to move username and password to a seperated file for example:
cat > /etc/zabbix/mysqlconfig.cnf << EOF
[client]
user = whatever
password = whatever
host = whatever
EOF
Now i can run command with credentials:
mysql --defaults-extra-file=/etc/zabbix/mysqlconfig.cnf -P 3306 -s <<< ''

Saturday, May 28, 2016

Visual FoxPro ODBC Driver silent install

In this example I set the package to install only on Windows Server 2008 R2

Here comes silent-install.cmd:
@echo off
setlocal EnableDelayedExpansion
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set cv=Microsoft\Windows NT\CurrentVersion
set k={31821EFE-1B31-4744-9FB0-208F92BD7168}
if not "%ProgramFiles(x86)%"=="" set x=Wow6432Node\

reg query "%sw%\%cv%" /v ProductName | find "Windows Server 2008 R2" > nul 2>&1
if !errorlevel!==0 (
reg query "%sw%\%x%%u%\%k%" > nul 2>&1
if not !errorlevel!==0 (
%systemroot%\system32\msiexec.exe /i "%~dp0VFPODBC.msi" /qb
)
)

endlocal
To check other operating system names i use:
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName
Related files:
VFPODBC.msi
4fbb57a7efabde9925af86a239e5c93c
451c393875e5eaa0f4cb3e39a9f61e8956b74173

Friday, May 27, 2016

Thursday, May 26, 2016

Set up WinRM, GPO, Server 2012

Computer configuration -> Policies -> Administrative Templates ->
Windows Components -> Windows Remote Managment (WinRM) -> WinRM Service:

Set some IP exceptions:

Add new firewall rule:

Select predefined "Windows Remote Management" Service:

Set rule type:

Just allow Connection:

Open rule for editing:

Allow execution only from domain:


Celebrate!

Wednesday, May 25, 2016

PowerShell 4 silent install, detection rule


This script will install PowerShell 4.0 on Windows 7 or Server 2008 R2. If .NET Framework 4.5 is not installed then version 4.6.1 will be installed which also includes version 4.5

Save this packages:
Windows6.1-KB2819745-x64-MultiPkg.msu
84497bdd99690c50a8e67db19b0aa2ad
5d40d059b9ea7f1d596f608a07cca49e4537dc15
Windows6.1-KB2819745-x86-MultiPkg.msu
680a8b76da952df2308335ed128e2bbe
378bd9f96b8c898b86bb0c0b92f2c9c000748c5e
NDP461-KB3102436-x86-x64-AllOS-ENU.exe
864056903748706e251fec9f5d887ef9
83d048d171ff44a3cad9b422137656f585295866

In directory where PowerShell packages and .NET 4.6.1 installer are havin' a good time create silent-install.cmd with content:
@echo off
setlocal EnableDelayedExpansion

echo Looking for .NET 4.5

set sw=HKLM\SOFTWARE
set v4=Microsoft\.NETFramework\v4.0.30319
set ps=Microsoft\PowerShell
reg query "%sw%\%v4%" > nul 2>&1
if not !errorlevel!==0 goto dotnet45install
reg query "%sw%\%v4%\SKUs\.NETFramework,Version=v4.5" > nul 2>&1
if !errorlevel!==0 goto dotnet45exist

:dotnet45install
start /wait "" "%~dp0NDP461-KB3102436-x86-x64-AllOS-ENU.exe" /passive /norestart

:dotnet45exist

echo Looking for PowerShell 3.0 or highter..
echo.

reg query "%sw%\%ps%\3" > nul 2>&1
if not !errorlevel!==0 goto install
reg query "%sw%\%ps%\3\PowerShellEngine" /v PSCompatibleVersion | findstr "4.0"
if !errorlevel!==0 goto exit

:install

if not "%ProgramFiles(x86)%"=="" (
%systemroot%\system32\wusa.exe ^
"%~dp0Windows6.1-KB2819745-x64-MultiPkg.msu" /quiet /norestart
if !errorlevel!==3010 echo Computer restart is needed!
)

if "%ProgramFiles(x86)%"=="" (
%systemroot%\system32\wusa.exe ^
"%~dp0Windows6.1-KB2819745-x86-MultiPkg.msu" /quiet /norestart
if !errorlevel!==3010 echo Computer restart is needed!
)

:exit

echo end of script
echo.

endlocal

Tuesday, May 24, 2016

ActivePresenter 6 silent install

Download latest version:
https://atomisystems.com/activepresenter/

silnet-install.cmd
@echo off
setlocal EnableDelayedExpansion
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k={A2A40277-D807-4754-95A3-2F294C2C51D3}_is1
if not "%ProgramFiles(x86)%"=="" set x=Wow6432Node\
reg query "%sw%\%x%%u%\%k%" > nul 2>&1
if not !errorlevel!==0 (
for /f "tokens=*" %%a in ('dir /b "%~dp0ActivePresenter*.exe"') do (
echo ActivePresenter
start /wait "" "%~dp0%%a" /SILENT
)
) else echo ActivePresenter already installed!
endlocal

Monday, May 23, 2016

MKVToolNix silent install-uninstall

Download latest installers from http://www.fosshub.com/MKVToolNix.html
This particular example is tested on version 9.1.0

silent-install.cmd
@echo off
setlocal EnableDelayedExpansion
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k=MKVToolNix
if not "%ProgramFiles(x86)%"=="" (
:x64
reg query "%sw%\%u%\%k%" > nul 2>&1
if not !errorlevel!==0 (
for /f "tokens=*" %%a in ('dir /b "%~dp0mkvtoolnix-64bit*.exe"') do (
echo MKVToolNix
"%~dp0%%a" /S
)
) else echo MKVToolNix already exists!
goto exit
)
)
:x86
reg query "%sw%\%u%\%k%" > nul 2>&1
if not !errorlevel!==0 (
for /f "tokens=*" %%a in ('dir /b "%~dp0mkvtoolnix-32bit*.exe" ') do (
echo MKVToolNix
"%~dp0%%a" /S
)
) else echo MKVToolNix already exists!
:exit
endlocal
silent-uninstall.cmd
@echo off
setlocal EnableDelayedExpansion
set path=%path%;%~dp0
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k=MKVToolNix
if not "%ProgramFiles(x86)%"=="" set x=Wow6432Node\
reg query "%sw%\%x%%u%\%k%"
if !errorlevel!==0 (
for /f "tokens=*" %%a in ('^
reg query "%sw%\%x%%u%\%k%" /v UninstallString ^|
findstr "UninstallString" ^|
sed "s/UninstallString\|REG_SZ//g" ^|
sed "s/^[ \t]*//g" ^|
sed "s/\d034//g"') do (
"%%a" /S
)
)
:CheckUninstallKey
reg query "%sw%\%x%%u%\%k%" > nul 2>&1
if !errorlevel!==0 goto CheckUninstallKey
endlocal
To successfully work with uninstall methdod i need additional libraries:
libiconv2.dll | libintl3.dll | regex2.dll | sed.exe

To extract mkv files:
https://sourceforge.net/projects/mkvextractgui-2/files/

Wednesday, May 18, 2016

Intelligent radio with Raspberry Pi

I am still using my home radio to play some positive and inspiring music.

Later i have need to create some intelligent background in radio for example:
I want to inject some random speech between every two songs.
Another rule i want is that one song can be played only once a day. Same rule for Speeches.

I ended up to controlling this with simple mp3 file names for example:
Every file name which starts with "Speech" is not a song but a speech.
Every file name which not starts with "Speech" is a song.
So it is two separated lists in memory which i work with.

To implement this application i use following commands:
mpc update - reread the directory of music files

mpc ls - list all music files in music directory

mpc clear - clear the playlist

mpc ls | grep -v "^Speech" | sort --random-sort | tail -1 | mpc add - add one random song to playlist

mpc ls | grep "^Speech" | sort --random-sort | tail -1 | mpc add - add one random speach to playlist

mpc play - start playing playlist

mpc playlist - show the playlist

OK. I am not proud of this code but at least it get the job done.
I am very proud for commenting code as much as possible :)
#!/bin/sh

#it is 5:55 in the morning

#lets clean existing log file
> /var/log/mpd/mpd.log

#reread all files in music direcotry
mpc update

#make sure we do not repeat playlist
mpc repeat off

#do not play songs randomly
mpc random off

#clear all playlist
mpc clear

#we need to generate new song on playlist to play
generatenewsong=1

#list all songs in playlist without skits
allmusic=$(mpc ls | grep -v "^Speech")

#count how many songs is in playlist now
skaits=$(mpc playlist | wc -l)

#tell the intelect that we do not know what is the next song
nextsongok=0
afterskit=0

#stop playing when the playlist has reached 400 songs
until [ $skaits -gt 399 ]
do

#this happens only if the last song is playing
until [ $generatenewsong -eq 0 ]
do
echo The next song is not calculated yet. Lets do it now.

until [ $nextsongok -eq 1 ]
do

#randomly take one song from list
nextsong=$(echo "$allmusic" | sort --random-sort | tail -1)

#check if the song has not already played today
grep played /var/log/mpd/mpd.log | grep "$nextsong"
if [ $? -ne 0 ]; then
  echo "$nextsong is not played today"
  echo "Lets add $nextsong"
  echo "$nextsong" | mpc add
  nextsongok=1
  else
  echo "$nextsong has been already played"
  nextsongok=0
fi

done



#is this last song in playlist?
nr=$(mpc play | grep playing | sed "s/ /\n/g" | grep "#" | sed "s/#//")
playing=$(echo "$nr" | sed "s/\/.*$//")
all=$(echo "$nr" | sed "s/^.*\///")
if [ $playing -eq $all ]; then
  echo "Now the last song on playlist is playing"
  generatenewsong=1
  nextsongok=0
  else
  generatenewsong=0
fi

done

#is this last song in playlist?
nr=$(mpc play | grep playing | sed "s/ /\n/g" | grep "#" | sed "s/#//")
playing=$(echo "$nr" | sed "s/\/.*$//")
all=$(echo "$nr" | sed "s/^.*\///")
if [ $playing -eq $all ]; then
  echo "Now the last song on playlist is playing"
  generatenewsong=1
  nextsongok=0
  else
  generatenewsong=0
fi


#check if the last two songs include skit
last2songs=$(mpc playlist | tail -2)
echo "$last2songs" | grep "^derek\|^Radio Alise" > /dev/null
if [ $? -eq 0 ]; then
insertskit=0
else
insertskit=1
fi

while [ $insertskit -eq 1 ]
do
echo "Now it is time for skit.."

 hournow=$(date +%H)
 case "$hournow" in
 *)
 #be prepared for next skit
 nextskitok=0

  #lets take seach for next skit and make sure it is not played yet
  until [ $nextskitok -eq 1 ]
  do

  #look for all skits in mp3 direcotry
  allskits=$(mpc ls | grep "^Speech")

  #take randomly next skit
  nextskit=$(echo "$allskits" | sort --random-sort | tail -1)

   #make sure this skit is not played yet
   grep played /var/log/mpd/mpd.log | grep "$nextskit"
   if [ $? -ne 0 ]; then
     echo "$nextskit is not played today"
     nextskitok=1
     echo "Lets add $nextskit"
     echo "$nextskit" | mpc add
    else
     echo "$nextskit has been already played"
     nextskitok=0
   fi

  done
  
 ;;
 esac
insertskit=0
afterskit=0
done

until [ $afterskit -eq 1 ]
do

#randomly take one song from list
nextafterskit=$(echo "$allmusic" | sort --random-sort | tail -1)

#check if the song has not already played today
grep played /var/log/mpd/mpd.log | grep "$nextafterskit"
if [ $? -ne 0 ]; then
  echo "$nextafterskit is not played today"
  echo "Lets add $nextafterskit"
  echo "$nextafterskit" | mpc add
  afterskit=1
  generatenewsong=0
  else
  echo "$nextafterskit has been already played"
  afterskit=0
fi

done



sleep 5
echo "hello"

done
Project on github:
https://github.com/catonrug/radio-intelekts/blob/master/intelekts.sh

OUTEX.DLL is missing, workaround


I have this issue using Office 2002 (XP) on Windows Server 2008 R2.

In my situation i am using Excel 2002 and there is this visual basic function:
Application.Dialogs(xlDialogSendMail).Show
This function can send active and unsaved excel workbook directly to outlook application.
Actually it saves excel in background somewhere in temp.

I did not want to solve this case using outlook application so i redesign whole situation to use additional command line utility to send email and attach file to it.

At the end i solve this case by replacing Application.Dialogs(xlDialogSendMail).Show with
' put users home directory into variable
Set oShell = CreateObject("WScript.Shell")
strHomeFolder = oShell.ExpandEnvironmentStrings("%USERPROFILE%")

' put timestamp into the variable
timestamp = Format(Now(), "mmddyyyyHHMMSS")

' where the temp file is located
myreport = strHomeFolder & "\" & timestamp & ".xls"

' Save file as
ActiveWorkbook.SaveCopyAs (myreport)

MsgBox "You will be prompted to enter email address in next windows!"
' here i need to insert email input box and put the email into variable

' Now i will send email using sendEmail.exe client and attach myreport to it
    Dim strProgramName As String
    Dim strArgument As String

    strProgramName = "C:\sendEmail.exe"
    strArgument01 = "from@gmail.com"
    strArgument02 = "to@gmail.com" ' replace with variable
    strArgument03 = "Subject goes here"
    strArgument04 = "Message text"
    strArgument05 = "smtp.google.com"
    strArgument06 = myreport
    Call Shell("""" & strProgramName & """ -f""" & strArgument01 & """ -t""" & strArgument02 & """ -s""" & strArgument03 & """ -m""" & strArgument04 & """ -s""" & strArgument05 & """ -a""" & strArgument06 & """", vbNormalFocus)
Related:
http://caspian.dotconf.net/menu/Software/SendEmail/
http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v156.zip

Tuesday, May 17, 2016

Download all MagPi collection

Such a great way how to download all Mag Pi magazines:
mkdir -p ~/Downloads/MagPi
cd ~/Downloads/MagPi
wget https://raspberrypi.org/magpi-issues/MagPi{01..51}.pdf -q &
Now wait and look for content :)

Sunday, May 15, 2016

Replace IE11 prerequisites, slipstream, install.wim

It is May 2016 and if you follow original microsoft guidelines about Internet Explorer 11 prerequisites then later you will be prompted to install additional 250+ updates.

Another way is to calculate which updates are dead and replaced with newer ones. Here is what i have calculated. To work with this solution i need to create multiple directories. These directories let the slipstream scenario know the order in what the updates should be injected into install.wim.

if not exist c:\updates\KB2533552 md c:\updates\KB2533552
if not exist c:\updates\KB2533623 md c:\updates\KB2533623
if not exist c:\updates\KB2574819 md c:\updates\KB2574819
if not exist c:\updates\KB2670838 md c:\updates\KB2670838
if not exist c:\updates\KB2729094 md c:\updates\KB2729094
if not exist c:\updates\KB2847882 md c:\updates\KB2847882
Now:
save KB3020369 into c:\updates\KB2533552
This update is not directly related to any IE11 prerequisite. It is needed only for KB3153171.

save KB3153171 into c:\updates\KB2533623
This will take care of native Internet Explorer 11 prerequisite KB2533623 and optional updates KB2639308, KB2888049 and KB2882822.

save KB3125574 into c:\updates\KB2574819
This will take care of native IE11 prerequisites KB2731771, KB2786081, KB2834140.

save KB2670838 into c:\updates\KB2670838

save KB2729094 into c:\updates\KB2729094

save IE11-Windows6.1-x64-en-us.exe into c:\updates\KB2847882

Prepare Internet Explorer 11 package for slipstreaming:
for /f "tokens=*" %f in ('dir /b c:\updates\KB2847882 ^| find /v "IE-Win7.CAB"') do del c:\updates\KB2847882\%f
Now extract windows media to c:\iso

Create mounting directory:
if not exist c:\mount md c:\mount
mount image:
dism /mount-wim /wimfile:c:\iso\sources\install.wim /index:3 /mountdir:c:\mount
Slipstream all updates:
for /f "tokens=*" %p in ('dir /b c:\updates') do dism /image:c:\mount /add-package /packagepath:c:\updates\%p
Unmount image:
dism /unmount-wim /mountdir:c:\mount /commit
Truncate all unnecessary windows editions,:
"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\DISM\dism.exe" /Export-Image /SourceImageFile:c:\iso\sources\install.wim /SourceIndex:3 /DestinationImageFile:c:\install.wim /Compress:max && move /Y c:\install.wim c:\iso\sources
Create bootable iso file:
"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg\oscdimg.exe" -b"c:\iso\boot\etfsboot.com" -h -u2 -m -l"win7x64pro" "c:\iso" "c:\win7x64pro.iso"
Remove mounting directory:
if exist c:\mount rd c:\mount /Q /S
Remove iso directory:
if exist c:\iso rd c:\iso /Q /S

Saturday, May 14, 2016

Windows update slipstream cheat sheet

Install Deployment Tools from WAIK: adksetup.exe

Somehow extract windows iso file to c:\iso

Open Windows Command prompt in "Run As Administrator" mode

Move to the "Deployment and Imaging Tools Environment" location:
%systemdrive% && cd "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\DISM"
List all indexes of install.wim
dism /get-wiminfo /wimfile:c:\iso\sources\install.wim
List details about indexes 1 of install.wim
dism /get-wiminfo /wimfile:c:\iso\sources\install.wim /index:1
Create mounting directory:
if not exist c:\mount md c:\mount
Create updates directory:
if not exist c:\updates md c:\updates
Create update directories for Windows 7/2008 SP2 (kind of):
c: && cd c:\updates && md KB3020369 KB3125574
Create update directories for Internet Explorer 11 prerequisites:
c: && cd c:\updates && md KB2533623 KB2639308 KB2670838 KB2729094 KB2731771 KB2786081 KB2834140 KB2847882
Look if some Internet Explorer 11 prerequisites are superseded:
KB2533623 KB2639308 KB2670838 KB2729094 KB2731771 KB2786081 KB2834140

Download Internet Explorer 11 installer:
KB2847882

Mount 64-bit Windows 7 PROFESSIONAL image:
dism /mount-wim /wimfile:c:\iso\sources\install.wim /index:3 /mountdir:c:\mount
Mount 32-bit Windows 7 PROFESSIONAL image:
dism /mount-wim /wimfile:c:\iso\sources\install.wim /index:4 /mountdir:c:\mount
Mount 64-bit Windows 7 ULTIMATE image:
dism /mount-wim /wimfile:c:\iso\sources\install.wim /index:4 /mountdir:c:\mount
Mount 32-bit Windows 7 ULTIMATE image:
dism /mount-wim /wimfile:c:\iso\sources\install.wim /index:5 /mountdir:c:\mount
Mount Windows 10 image:
dism /mount-wim /wimfile:c:\iso\sources\install.wim /index:1 /mountdir:c:\mount
List and spilstream all updates:
for /f "tokens=*" %p in ('dir /b c:\updates') do dism /image:c:\mount /add-package /packagepath:c:\updates\%p
Unmount image:
dism /unmount-wim /mountdir:c:\mount /commit
Leave only 64-bit Windows 7 PROFESSIONAL image (index 3):
"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\DISM\dism.exe" /Export-Image /SourceImageFile:c:\iso\sources\install.wim /SourceIndex:3 /DestinationImageFile:c:\install.wim /Compress:max && move /Y c:\install.wim c:\iso\sources
Leave only 32-bit Windows 7 PROFESSIONAL image (index 4):
"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\DISM\dism.exe" /Export-Image /SourceImageFile:c:\iso\sources\install.wim /SourceIndex:4 /DestinationImageFile:c:\install.wim /Compress:max && move /Y c:\install.wim c:\iso\sources
Leave only 64-bit Windows 7 ULTIMATE image (index 4):
"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\DISM\dism.exe" /Export-Image /SourceImageFile:c:\iso\sources\install.wim /SourceIndex:4 /DestinationImageFile:c:\install.wim /Compress:max && move /Y c:\install.wim c:\iso\sources
Leave only 32-bit Windows 7 ULTIMATE image (index 5):
"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\DISM\dism.exe" /Export-Image /SourceImageFile:c:\iso\sources\install.wim /SourceIndex:5 /DestinationImageFile:c:\install.wim /Compress:max && move /Y c:\install.wim c:\iso\sources
Create 32-bit Windows 7 iso file on c:\ drive:
"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg\oscdimg.exe" -b"c:\iso\boot\etfsboot.com" -h -u2 -m -l"win7x86pro" "c:\iso" "c:\win7x86pro.iso"
Create 64-bit Windows 7 iso file c:\win7x64pro.iso:
"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg\oscdimg.exe" -b"c:\iso\boot\etfsboot.com" -h -u2 -m -l"win7x64pro" "c:\iso" "c:\win7x64pro.iso"
Create 32-bit Windows 7 iso file c:\win7x86pro.iso:
"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg\oscdimg.exe" -b"c:\iso\boot\etfsboot.com" -h -u2 -m -l"win7x86pro" "c:\iso" "c:\win7x86pro.iso"
Create 64-bit Windows 7 iso file c:\win7x64ultimate.iso:
"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg\oscdimg.exe" -b"c:\iso\boot\etfsboot.com" -h -u2 -m -l"win7x64ultimate" "c:\iso" "c:\win7x64ultimate.iso"
Create 32-bit Windows 7 iso file c:\win7x86ultimate.iso:
"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg\oscdimg.exe" -b"c:\iso\boot\etfsboot.com" -h -u2 -m -l"win7x86ultimate" "c:\iso" "c:\win7x86ultimate.iso"
Create 64-bit Windows 8.1 iso file c:\win81x64.iso:
"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg\oscdimg.exe" -b"c:\iso\boot\etfsboot.com" -h -u2 -m -l"win81x64" "c:\iso" "c:\win81x64.iso"
Create 32-bit Windows 8.1 iso file c:\win81x86.iso:
"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg\oscdimg.exe" -b"c:\iso\boot\etfsboot.com" -h -u2 -m -l"win81x86" "c:\iso" "c:\win81x86.iso"
Create 64-bit Windows 10 iso file c:\win10x64.iso:
"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg\oscdimg.exe" -b"c:\iso\boot\etfsboot.com" -h -u2 -m -l"win10x64" "c:\iso" "c:\win10x64.iso"
Create 32-bit Windows 10 iso file c:\win10x86.iso:
"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg\oscdimg.exe" -b"c:\iso\boot\etfsboot.com" -h -u2 -m -l"win10x86" "c:\iso" "c:\win10x86.iso"
Remove mount directory:
if exist c:\mount rd c:\mount /Q /S
Remove iso directory:
if exist c:\iso rd c:\iso /Q /S
Related files:
http://download.windowsupdate.com/d/msdownload/update/software/updt/2016/05/windows6.1-kb3125574-v4-x64_2dafb1d203c8964239af3048b5dd4b1264cd93b9.msu
http://download.windowsupdate.com/d/msdownload/update/software/updt/2016/05/windows6.1-kb3125574-v4-x86_ba1ff5537312561795cc04db0b02fbb0a74b2cbd.msu
https://download.microsoft.com/download/5/D/0/5D0821EB-A92D-4CA2-9020-EC41D56B074F/Windows6.1-KB3020369-x64.msu
https://download.microsoft.com/download/C/0/8/C0823F43-BFE9-4147-9B0A-35769CBBE6B0/Windows6.1-KB3020369-x86.msu

Friday, May 13, 2016

Error: 0x800736b5, 14005, Unattend.xml

I am using Windows 10 and i want to create Windows 7 media with integrated KB3125574. This update works like a service pack 2 for Windows 7 so it is a big deal.

In this scenario i am using Deployment Tools from Windows 10 AIK:
http://download.microsoft.com/download/3/8/B/38BBCA6A-ADC9-4245-BCD8-DAA136F63C8B/adk/adksetup.exe

Now i get this error:
Deployment Image Servicing and Management tool
Version: 10.0.10586.0

Image Version: 6.1.7601.17514

Processing 1 of 1 - Adding package r:\updates\KB3125574\X86-all-windows6.1-kb3125574-v4-x86_ba1ff5537312561795cc04db0b02fbb0a74b2cbd.msu
[===================        33.3%                          ]
r:\updates\KB3125574\X86-all-windows6.1-kb3125574-v4-x86_ba1ff5537312561795cc04db0b02fbb0a74b2cbd.msu: An error occurred applying the Unattend.xml file from the .msu package.
For more information, review the log file.
 Error: 0x800736b5

Error: 14005

The manifest file contains one or more syntax errors.

The DISM log file can be found at C:\WINDOWS\Logs\DISM\dism.log
Turns out that i also needed to integrate KB3020369 bofore i start execute KB3125574
Windows6.1-KB3020369-x64.msu
Windows6.1-KB3020369-x86.msu

Related files:
windows6.1-kb3125574-v4-x64_2dafb1d203c8964239af3048b5dd4b1264cd93b9.msu
windows6.1-kb3125574-v4-x86_ba1ff5537312561795cc04db0b02fbb0a74b2cbd.msu

Thursday, May 12, 2016

Disable windows defender, command line

This is tested and works on Windows 10.

Open Windows PowerShell in "Run As Administrator" mode.

Check real-time protection status of Windows Defender:
Get-MpPreference | FL *RealtimeMonitoring
Turn-off Windows Defender real-time protection with PowerShell:
Set-MpPreference -DisableRealtimeMonitoring $true
Check real-time protection status of Windows Defender:
Get-MpPreference | FL *RealtimeMonitoring
Turn-on Windows Defender real-time protection with PowerShell:
Set-MpPreference -DisableRealtimeMonitoring $false
Check real-time protection status of Windows Defender:
Get-MpPreference | FL *RealtimeMonitoring

Wednesday, May 11, 2016

Set bigger subject font size, Outlook 2013

Click on [View Settings] button:

Open [Conditional Formatting]:

Add new rule, write name and open [Condition...] section:

Select which field you want to modify:

Open [Font...] settings:

Set [Big] font size:

Tuesday, May 10, 2016

ActivePresenter 6 silent uninstall

silent-uninstall.cmd
@echo off
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k={A2A40277-D807-4754-95A3-2F294C2C51D3}_is1
if not "%ProgramFiles(x86)%"=="" set x=Wow6432Node\
for /f delims^=^"^ tokens^=2 %%a in ('^
reg query "%sw%\%x%%u%\%k%" /v UninstallString ^|
find "UninstallString"') do (
start /wait "" "%%a" /SILENT
)

Monday, May 9, 2016

Check MicroSD card for bad blocks, Windows

This is very fast method how to find absolute damaged MicroSD cards, SD cards or any other absolute broken USB media. This method will not 100% show that card is perfect, but it will show which cards are 100% useless. I use RMPrepUSB application.

Here is portable version: RMPrepUSB_Portable_v2.1.730.zip
44dc3d51d3be6d9b1255444fa4d710de
ecbeca09f9fc67072606d2041c9a2810978b4d9d

I extract this archive and execute:
RMPREPUSB.exe
At first launch i press [Refresh] and then [Quick Size Test]

Execute command:

Are you sure do delete all content inside?

Depending on MicroSD class type this can take five minutes or something:

This is one of sign that card is almost dead:

Another bad sign:

At the end this is bad sign:

If nothing bad happens the success story appears:

Sunday, May 8, 2016

Rename KB0000000, catalog.update.microsoft.com

This is my first interactive batch job which will do nothing but renaming downloaded directories from catalog.update.microsoft.com. for example if i have these names:
Cumulative Security Update for ActiveX Killbits for Windows Server 2008 R2 x64 Edition (KB2900986)
Cumulative Security Update for Internet Explorer 11 for Windows Server 2008 R2 for x64-based Systems (KB3154070)
Security Update for Windows Server 2008 R2 x64 Edition (KB2620704)
Update for Kernel-Mode Driver Framework version 1.11 (KB2685811)
Update for Windows Server 2008 R2 x64 Edition (KB2640148)
Windows 7 Service Pack 1 for x64-based Systems (KB976932)
And after i run the program i have:
KB2900986
KB3154070
KB2620704
KB2685811
KB2640148
KB0976932
I use an extra 0 to convert KB976932 to KB0976932 so i can later slipstream all updates in alphabetical/chronically order so i never have to deal with update prerequisites.

And now this code:
@echo off
setlocal EnableDelayedExpansion
set path=%path%;%~dp0

if "%1"=="" (
echo Enter directory name now where the updates are stored:
set /p d=
) else set d=%1

if "%d%"=="" (
echo you have to enter directory name to start!
pause
goto exit
)

if not exist "%~dp0%d%" (
echo the direcotry name %d% do not exist!
pause
goto exit
)

for /f "tokens=*" %%i in ('dir /b "%~dp0%d%"') do (
echo %%i | sed "s/^.*(\|)//g" | grep "^KB.......$" > nul 2>&1
if !errorlevel!==0 (
for /f "tokens=*" %%a in ('echo %%i ^|
sed "s/^.*(\|)//g" ^|
sed "s/.\{2\}/&0/"') do (
echo %~dp0%d%\%%i
ren "%~dp0%d%\%%i" "%%a"
)
)

echo %%i | sed "s/^.*(\|)//g" | grep "^KB........$" > nul 2>&1
if !errorlevel!==0 (
for /f "tokens=*" %%a in ('echo %%i ^|
sed "s/^.*(\|)//g" ^|
grep "^KB........$"') do (
echo %~dp0%d%\%%i
ren "%~dp0%d%\%%i" "%%a"
)
)

)

:exit

endlocal
Here are all project files:
https://github.com/catonrug/rename-kb0000000-directory/archive/master.zip

Saturday, May 7, 2016

Install .NET Framework and all updates via first run

Following my slipstream battle series and Windows 2008 server example i have to create exception update list which can not be slipstreamed in offline mode.

In this case it is pretty much all .Net Framework packages which pretty often need computer restart.

there are some guidelines how to work with this method:

1) Create x64 directory for all updates

2) Download all updates using Internet Explorer and site
http://catalog.update.microsoft.com/v7/site/Home.aspx

3) Rename all update directories and keep only the KB0000000 code like:
KB2533552
KB3102433
KB3122661
KB3127233
KB3136000
KB3142037
KB3143693
Now the code which i used for unattended install:
@echo off
setlocal EnableDelayedExpansion

net stop wuauserv
rd %systemroot%\SoftwareDistribution /Q /S

set u=%~dp0x64
if not exist %systemdrive%\updates.log echo. > %systemdrive%\updates.log

rem look for all directory names in [x64] directory
for /f "tokens=*" %%i in ('dir /b "%u%"') do (

rem look for all files in every KB0000000 directoryry
for /f "tokens=*" %%d in ('dir /b "%u%\%%i"') do (

rem look if this update has already executed on this system
type %systemdrive%\updates.log | findstr "%%i" > nul 2>&1
if not !errorlevel!==0 (

rem if this update has not been installed
echo installing %%i
rem set update statuss as installed
echo %%i >> %systemdrive%\updates.log

rem look for all msu and exe files in KB0000000 directory
for /f "tokens=*" %%z in ('dir /b "%u%\%%i\*.msu" "%u%\%%i\*.exe"') do (

rem if exe installer found
echo %%z | findstr ".exe" > nul 2>&1
if !errorlevel!==0 start /wait "" "%u%\%%i\%%z" /passive /norestart
if !errorlevel!==3010 goto needrestart

rem if msu installer found
echo %%z | findstr ".msu" > nul 2>&1
if !errorlevel!==0 %systemroot%\system32\wusa.exe "%u%\%%i\%%z" /quiet /norestart
if !errorlevel!==3010 goto needrestart

)
) else echo %%i already installed
)
)

net stop wuauserv
rd %systemroot%\SoftwareDistribution /Q /S

SC sdshow wuauserv
SC sdset wuauserv D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)

%systemroot%\system32\shutdown.exe -s -t 300

goto exit

rem some updates requieres restart to be completed
rem in this case the script will be repeated after reboot
:needrestart
reg add "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce" /v FirstRun /t REG_SZ /d "C:\Windows\Setup\Scripts\FirstRun.cmd" /f
%systemroot%\system32\shutdown.exe -r -t 60

:exit

endlocal

Friday, May 6, 2016

Internet Explorer 11 slipstream into Server 2008 R2

I have this original Windows Server 2008 R2 media disk:
en_windows_server_2008_r2_with_sp1_x64_dvd_617601.iso
8dcde01d0da526100869e2457aafb7ca
d3fd7bf85ee1d5bdd72de5b2c69a7b470733cd0a

This media do not have Internet Explorer 11 integrated. Challenge Accepted!

To work with this solution Deployment and Imaging Tools must be installed:
http://download.microsoft.com/download/3/8/B/38BBCA6A-ADC9-4245-BCD8-DAA136F63C8B/adk/adksetup.exe
This package works nicely on Windows 7, 8.1, 10

Now i take en_windows_server_2008_r2_with_sp1_x64_dvd_617601.iso
Inside this iso file in sources directory there is install.wim.
This install.wim include a lot of indexes this time:
1: Windows Server 2008 R2 SERVERSTANDARD
2: Windows Server 2008 R2 SERVERSTANDARDCORE
3: Windows Server 2008 R2 SERVERENTERPRISE
4: Windows Server 2008 R2 SERVERENTERPRISECORE
5: Windows Server 2008 R2 SERVERDATACENTER
6: Windows Server 2008 R2 SERVERDATACENTERCORE
7: Windows Server 2008 R2 SERVERWEB
8: Windows Server 2008 R2 SERVERWEBCORE
My goal is to slipstream Internet Explorer 11 just in "Windows Server 2008 R2 SERVERDATACENTER" edition only. It is index 5.

If i look in Internet Explorer 11 installing documentation then i see that there are lot of updates which must be slipstreamed before we actually touch the IE11 installer. Check this out: https://support.microsoft.com/en-us/kb/2847882

Some updates has been outdated and replaced with new ones:
kb2533623 has been replaced with kb3101746
kb2639308 has been replaced with kb3146706
kb2731771 has been replaced with kb2758857
kb2882822 has been replaced with kb3080149

Now i create few directories for all prerequisites and IE11 installer:
if not exist C:\u2k8r2\KB2533623 md C:\u2k8r2\KB2533623
if not exist C:\u2k8r2\KB2639308 md C:\u2k8r2\KB2639308
if not exist C:\u2k8r2\KB2670838 md C:\u2k8r2\KB2670838
if not exist C:\u2k8r2\KB2729094 md C:\u2k8r2\KB2729094
if not exist C:\u2k8r2\KB2731771 md C:\u2k8r2\KB2731771
if not exist C:\u2k8r2\KB2786081 md C:\u2k8r2\KB2786081
if not exist C:\u2k8r2\KB2834140 md C:\u2k8r2\KB2834140
if not exist C:\u2k8r2\KB2847882 md C:\u2k8r2\KB2847882
if not exist C:\u2k8r2\KB2882822 md C:\u2k8r2\KB2882822
if not exist C:\u2k8r2\KB2888049 md C:\u2k8r2\KB2888049
Now i need to download some files:
Save kb3146706 into C:\u2k8r2\KB2533623
Save kb3101746 into C:\u2k8r2\KB2639308
Save kb2670838 into C:\u2k8r2\KB2670838
Save kb2729094 into C:\u2k8r2\KB2729094
Save kb2758857 into C:\u2k8r2\KB2731771
Save kb2786081 into C:\u2k8r2\KB2786081
Save kb2834140 into C:\u2k8r2\KB2834140
Save IE11-Windows6.1-x64-en-us.exe into C:\u2k8r2\KB2847882
Save kb3080149 into C:\u2k8r2\KB2882822
Save kb2888049 into C:\u2k8r2\KB2888049

Lets get hands dirty now!

1) Open Deployment and Imaging environment in "Run As Administrator" mode

2) Extract Internet Explorer 11 installer:
C:\u2k8r2\KB2847882\IE11-Windows6.1-x64-en-us.exe /x:C:\u2k8r2\KB2847882
3) Leave only IE-Win7.CAB in KB2847882 directory:
for /f "tokens=*" %f in ('dir /b c:\u2k8r2\KB2847882 ^| find /v "IE-Win7.CAB"') do del c:\u2k8r2\KB2847882\%f
4) Extract en_windows_server_2008_r2_with_sp1_x64_dvd_617601.iso to c:\iso

5) Create mounting directory:
if not exist c:\mount md c:\mount
6) Mount install.wim to the mount point
dism /mount-wim /wimfile:c:\iso\sources\install.wim /index:5 /mountdir:c:\mount
7) Slipstream all packages in alphabetical order. This will take 10 minutes or something
for /f "tokens=*" %p in ('dir /b c:\u2k8r2') do dism /image:c:\mount /add-package /packagepath:c:\u2k8r2\%p
8) Unmount install.wim file:
dism /unmount-wim /mountdir:c:\mount /commit
9) Extract only the index you are really interested. This will allow to save few hundreds of megabytes.
"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\DISM\dism.exe" /Export-Image /SourceImageFile:c:\iso\sources\install.wim /SourceIndex:5 /DestinationImageFile:c:\install.wim /Compress:max
10) Overwite CD content:
move /Y c:\install.wim c:\iso\sources
11) In this step i usually inject Windows Server 2008 R2 DataCenter autounattend.xml into c:\iso. This step can be skipped.

12) Re-create bootable iso image:
"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg\oscdimg.exe" -b"c:\iso\boot\etfsboot.com" -h -u2 -m -lwin2k8r2 "c:\iso" "c:\win2k8r2ie11.iso"
13) Remove mounting directory:
if exist c:\mount rd c:\mount /Q /S
14) Remove iso directory:
if exist c:\iso rd c:\iso /Q /S
c:\win2k8r2ie11.iso is my new media with Internet Explorer 11 integrated.

Thursday, May 5, 2016

Uncheck "Automatically detect settings" in all new user accounts


I am so proud today.
There are lot of information out in the internet that eight bit (ninth element) is responsible for this in check box:

Not luckily for me this information was not helpful cause i have no luck to integrate this setting in group policy.

What i succeed is to integrate this setting in default user profile:
C:\Users\Default\NTUSER.DAT
To do it so i have to load C:\Users\Default\NTUSER.DAT and create absolute new key in:
Software\Microsoft\Windows\CurrentVersion\Internet Settings
Name: AutoDetect
Type: REG_DWORD
Data: 0

After unloading this hive, closing the registry editor and reopen it again i can very nicely see this key under:
HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Internet Settings

P.S.
If you do not understand how to work with C:\Users\Default\NTUSER.DAT then suck up all the experience from this post:

If you find this useful and you do not leave a comment then you will die.

If this was not helpful do not worry. You will live a very healthy life ;)

Wednesday, May 4, 2016

Slipstream .Net 3.5 into install.wim, Server 2008 R2

This is tested and works with:
en_windows_server_2008_r2_with_sp1_x64_dvd_617601.iso
8dcde01d0da526100869e2457aafb7ca
d3fd7bf85ee1d5bdd72de5b2c69a7b470733cd0a

To work with this solution deployment tools must be installed:
http://download.microsoft.com/download/6/A/E/6AEA92B0-A412-4622-983E-5B305D2EBE56/adk/adksetup.exe

1) Extract en_windows_server_2008_r2_with_sp1_x64_dvd_617601.iso to c:\iso

2) Open Deployment and Imaging environment in "Run As Administrator" mode

3) Create mounting directory (you can nicely select command with triple click):
if not exist c:\mount md c:\mount
4) Mount install.wim to the mount point
dism /mount-wim /wimfile:c:\iso\sources\install.wim /index:5 /mountdir:c:\mount
5) Enable .NET Framework 3.5.1 feature:
dism /image:c:\mount /enable-feature /featurename:NetFx3
6) Unmount install.wim file:
dism /unmount-wim /mountdir:c:\mount /commit
7) Extract only the index you are really interested. This will allow to save few hundreds of megabytes.
"C:\Program Files (x86)\Windows Kits\8.1\Assessment and Deployment Kit\Deployment Tools\amd64\DISM\dism.exe" /Export-Image /SourceImageFile:c:\iso\sources\install.wim /SourceIndex:5 /DestinationImageFile:c:\install.wim /Compress:max
8) Overwite CD content:
move /Y c:\install.wim c:\iso\sources
9) Re-create bootable iso image:
"C:\Program Files (x86)\Windows Kits\8.1\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg\oscdimg.exe" -b"c:\iso\boot\etfsboot.com" -h -u2 -m -lwin2k8r2 "c:\iso" "c:\win2k8r2.iso"
10) Remove mounting directory:
if exist c:\mount rd c:\mount /Q /S
11) Remove iso directory:
if exist c:\iso rd c:\iso /Q /S
P.S.:
This image has a lot of indexes so in this scenary it is only working with Data Center edition (index 5):
Index : 1 Windows Server 2008 R2 SERVERSTANDARD
Index : 2 Windows Server 2008 R2 SERVERSTANDARDCORE
Index : 3 Windows Server 2008 R2 SERVERENTERPRISE
Index : 4 Windows Server 2008 R2 SERVERENTERPRISECORE
Index : 5 Windows Server 2008 R2 SERVERDATACENTER
Index : 6 Windows Server 2008 R2 SERVERDATACENTERCORE
Index : 7 Windows Server 2008 R2 SERVERWEB
Index : 8 Windows Server 2008 R2 SERVERWEBCORE

Tuesday, May 3, 2016

Enable .NET 3.5 feature, Server 2008, command line

I am now playing with very original windows 2008 r2 iso image:
en_windows_server_2008_r2_with_sp1_x64_dvd_617601.iso
8dcde01d0da526100869e2457aafb7ca
d3fd7bf85ee1d5bdd72de5b2c69a7b470733cd0a

In a fresh Windows Server 2008 R2 installation there is no .NET 3.5 installed.
It is possible to query all .NET versions in registry by looking under:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP

To install .NET 3.5.1 from command line open command prompt in "Run As Administrator" mode and execute:
dism /online /enable-feature /featurename:NetFx3
That is it. One command. 10 seconds and i got it:

If i miss the case of feature name then i get error 0x800f080c.
So it is better to write NetFx3 and NOT netfx3:

At the end i make sure that .NET 3.5 is finally installed:

Monday, May 2, 2016

Server 2008 R2 DataCenter autounattend.xml

This is autounattend.xml is tested and works on:
en_windows_server_2008_r2_with_sp1_x64_dvd_617601.iso
8dcde01d0da526100869e2457aafb7ca
d3fd7bf85ee1d5bdd72de5b2c69a7b470733cd0a

Product key has been taken from:
http://technet.microsoft.com/en-us/library/jj612867.aspx

autounattend.xml
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="windowsPE">
        <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <InputLocale>en-US</InputLocale>
            <SystemLocale>en-US</SystemLocale>
            <UILanguage>en-US</UILanguage>
            <UserLocale>en-US</UserLocale>
        </component>
        <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <ImageInstall>
                <OSImage>
                    <InstallTo>
                        <DiskID>0</DiskID>
                        <PartitionID>1</PartitionID>
                    </InstallTo>
                    <WillShowUI>OnError</WillShowUI>
                    <InstallFrom>
                        <MetaData wcm:action="add">
                            <Key>/IMAGE/NAME</Key>
                            <Value>Windows Server 2008 R2 SERVERDATACENTER</Value>
                        </MetaData>
                    </InstallFrom>
                </OSImage>
            </ImageInstall>
            <UserData>
                <AcceptEula>true</AcceptEula>
                <FullName></FullName>
                <Organization></Organization>
                <ProductKey>
                    <WillShowUI>OnError</WillShowUI>
                    <Key>74YFP-3QFB3-KQT8W-PMXWJ-7M648</Key>
                </ProductKey>
            </UserData>
            <DiskConfiguration>
                <Disk wcm:action="add">
                    <CreatePartitions>
                        <CreatePartition wcm:action="add">
                            <Order>1</Order>
                            <Type>Primary</Type>
                            <Extend>true</Extend>
                        </CreatePartition>
                    </CreatePartitions>
                    <ModifyPartitions>
                        <ModifyPartition wcm:action="add">
                            <Extend>false</Extend>
                            <Format>NTFS</Format>
                            <Letter>C</Letter>
                            <Order>1</Order>
                            <PartitionID>1</PartitionID>
                            <Label>System</Label>
                        </ModifyPartition>
                    </ModifyPartitions>
                    <DiskID>0</DiskID>
                    <WillWipeDisk>true</WillWipeDisk>
                </Disk>
                <WillShowUI>OnError</WillShowUI>
            </DiskConfiguration>
        </component>
    </settings>
    <settings pass="oobeSystem">
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <UserAccounts>
                <LocalAccounts>
                    <LocalAccount wcm:action="add">
                        <Password>
                            <Value></Value>
                            <PlainText>true</PlainText>
                        </Password>
                        <Name>administrator</Name>
                        <Group>Administrators</Group>
                    </LocalAccount>
                </LocalAccounts>
            </UserAccounts>
            <AutoLogon>
                <Enabled>true</Enabled>
                <Username>Administrator</Username>
                <LogonCount>3</LogonCount>
            </AutoLogon>
            <FirstLogonCommands>
                <SynchronousCommand wcm:action="add">
                    <CommandLine>REG ADD &quot;HKLM\System\CurrentControlSet\Services\Netlogon\Parameters&quot; /v DisablePasswordChange /t REG_DWORD /d 1 /f</CommandLine>
                    <Description>Disable computer password change</Description>
                    <Order>1</Order>
                    <RequiresUserInput>true</RequiresUserInput>
                </SynchronousCommand>
     <SynchronousCommand wcm:action="add">
     <Order>2</Order>
     <Description>Run FirstRun.cmd</Description>
     <CommandLine>%WINDIR%\Setup\Scripts\FirstRun.cmd</CommandLine>
    </SynchronousCommand>
            </FirstLogonCommands>
        </component>
    </settings>
    <settings pass="specialize">
        <component name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon>
        </component>
        <component name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon>
        </component>
        <component name="Microsoft-Windows-IE-ESC" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <IEHardenAdmin>false</IEHardenAdmin>
            <IEHardenUser>false</IEHardenUser>
        </component>
        <component name="Microsoft-Windows-IE-InternetExplorer" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <SearchScopes>
                <Scope wcm:action="add">
                    <ScopeDefault>true</ScopeDefault>
                    <ScopeDisplayName>Google</ScopeDisplayName>
                    <ScopeKey>Google</ScopeKey>
                    <ScopeUrl>http://www.google.com/search?q={searchTerms}</ScopeUrl>
                </Scope>
            </SearchScopes>
            <DisableAccelerators>true</DisableAccelerators>
            <DisableFirstRunWizard>true</DisableFirstRunWizard>
            <Home_Page>about:blank</Home_Page>
        </component>
        <component name="Microsoft-Windows-IE-InternetExplorer" processorArchitecture="wow64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <SearchScopes>
                <Scope wcm:action="add">
                    <ScopeDefault>true</ScopeDefault>
                    <ScopeDisplayName>Google</ScopeDisplayName>
                    <ScopeKey>Google</ScopeKey>
                    <ScopeUrl>http://www.google.com/search?q={searchTerms}</ScopeUrl>
                </Scope>
            </SearchScopes>
            <DisableAccelerators>true</DisableAccelerators>
            <DisableFirstRunWizard>true</DisableFirstRunWizard>
            <Home_Page>about:blank</Home_Page>
        </component>
        <component name="Microsoft-Windows-TerminalServices-LocalSessionManager" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <fDenyTSConnections>false</fDenyTSConnections>
        </component>
        <component name="Networking-MPSSVC-Svc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <FirewallGroups>
                <FirewallGroup wcm:action="add" wcm:keyValue="RemoteDesktop">
                    <Group>Remote Desktop</Group>
                    <Profile>all</Profile>
                    <Active>true</Active>
                </FirewallGroup>
            </FirewallGroups>
        </component>
    </settings>
    <settings pass="offlineServicing">
        <component name="Microsoft-Windows-LUA-Settings" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <EnableLUA>false</EnableLUA>
        </component>
    </settings>
</unattend>

Sunday, May 1, 2016

Install DokuWiki on Raspberry Pi, nginx

This is tested on 2016-03-18-raspbian-jessie-lite.img image.
The following solution uses nginx web server.

Here is the thing i do:

Move to supper user:
sudo su
Create file install-dokuwiki.sh with content:
#update all repositories and install latest updates
apt-get update -y && apt-get upgrade

#install nginx web server
apt-get install nginx php5-fpm php5-cli php5-mcrypt php5-gd -y

#move to the home directory
cd

#Download dokuwiki from official home page
wget http://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz -O dokuwiki.tgz

#extract archive
tar -xvf dokuwiki.tgz

#set up nginx  
cat > /etc/nginx/sites-available/yourdomain.com << EOF
server {
server_name yourdomain.com;
listen 80;
root /var/www/yourdomain.com/;
access_log /var/log/nginx/yourdomain.com-access.log;
error_log /var/log/nginx/yourdomain.com-error.log;

index index.php index.html doku.php;
location ~ /(data|conf|bin|inc)/ {
      deny all;
}
location ~ /\.ht {
      deny  all;
}
location ~ \.php {
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)\$;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
}
}
EOF

#make symbolic limk
ln -s /etc/nginx/sites-available/yourdomain.com /etc/nginx/sites-enabled/yourdomain.com

#restart nginx server
/etc/init.d/nginx restart

#make direcotry
mkdir -p /var/www/yourdomain.com

#move to extracted content
cd ~/dokuwiki-*

#copy all content to your domain directory
cp -a . /var/www/yourdomain.com

#let nginx operate with this content
chown -R www-data:www-data /var/www/yourdomain.com

Set the file executable:
chmod +x install-dokuwiki.sh
Install:
./install-dokuwiki.sh
Another way is to install with git:
sudo su
apt-get install git -y
cd
git clone https://github.com/catonrug/install-dokuwiki-on-raspbian.git
cd install-dokuwiki-on-raspbian
chmod +x install.sh
./install.sh
I have Windows 10 operating system and to test if this working then i need to create new line in hosts file. So i:
Open notepad in "Run as administrator" mode
Open C:\Windows\System32\drivers\etc\hosts
write down new line which address to:
192.168.88.80 yourdomain.com
Open some browser and type:
http://yourdomain.com/install.php
P.S. It will not work out if you do not modify host file!

Blog Archive