Sunday, September 27, 2015

What is Credential Guard?

It is a new feature in Windows 10 but only available in Windows 10 Enterprise or Windows 10 Education. This is meant to beef up on security. It protects the core kernel from malware by not allowing taking control of the machine remotely.
Credential Guard provides isolation for the secrets held in Local Security Authority in the older systems by a virtualization based security. Data stored by virtualization is not accessible to the rest of the OS. Credit Guard has no device drivers but hosts a reduced subset of OS binaries needed for security only. Of course the binaries are signed with trusted certificates.

The Credential Guard feature depends on the Hypervisor.  Here is a high-level overview of Credential Guard(virtualization based security).


(https://technet.microsoft.com/en-us/library/mt483740%28v=vs.85%29.aspx)

The Credit Guard offers the following features/solutions:
Hardware security Credentials Guard takes advantage of platform security features, such as Secure Boot and virtualization to increase security.

•Virtualization-based security Windows services can run in a protected environment that is isolated from the running operating system.

•Better protection against advanced persistent threats Credential Guard does this by securing domain user's credentials in the virtualization-based security environment. Malware running in the operating system, even with administrative privileges, cannot extract secrets that are protected by virtualization-based security.

•Manageability You can manage Credential Guard by using Group Policy, WMI, from a command prompt, and Windows PowerShell.
The following virtualization extensions are required to support virtualization-based security:
•Intel VT-x or AMD-V
•Second Level Address Translation
It run only on X64 Bit platforms.
Watch this video from Channel 9:

How do you install PHP on Windows 7 Ultimate SP1?


Installing PHP using Windows Platform Installer (wpilauncher.exe) gives you instant access to working with PHP. In this post Web Platform Installer version 5.0 was used to install PHP version 5.6

Step 1: Download Web Platform Installer, the version used here is 5.0. After launching the WebPI search for php as shown. This has the latest products/services/programs for web platform.


php56_01.png

Step 2: Click on PHP 5.6.0 (9/7/2014).  On Windows 7 (x64) Ultimate you do have IIS and not IIS Express.

Click Add button and click Install at the bottom of the window.

Note the items to be installed by clicking the link at the bottom. The following window is displayed showing 3 items should you decide to install.


php56_02.png

Step 3: Close the item list window. Click Install. The previous window appears as shown with more controls.

php56_03.png

Here you need to accept license terms.

Step 4: Click I Accept. Install begins and a number of required items are installed showing progress as shown.
Microsoft ODBC Driver 11 for SQL Server.
Microsoft Drivers 3.2 for PHP  v5.6 for SQLServer
Installing Php5.3.28(?)
PHP Manager for IIS
Installing PHP 5.6.0


php56_04.png

After a while you get the Finish window showing installed products as shown:


php56_05.png

Step 5: Click Finish on Web Platform Installer 5.0.
You are done.

Launch the Internet Information Services and you see that Web Platform Installer is added to the Managemen Section.

If you were to run a PHP file such as phpinfo.php you will run into this error:


php56_06.png

Now open Programs & Features in Control Panel. Click Turn on/off window programs to turn on:
The following window gets displayed:


php56_07.png

The node for CGI is not checked. This is needed to work with IIS.  Place check mark for CGI and Click OK.

Microsoft Windows MSG appears that it is making changes. This may run for quite sometime depending on your computer.

php56_08.png

After sometime the Microsoft Windows MSG goes away.

Now try to bring up phpinfo.php in your browser in the IIS window and Presto! PHP now can be processed by the IIS using the FastCgiModule (only part of page shown here).


php56_09.png

Notice that the "Handler Mappings" now has PHP-Via_FastCGI and PHP53_via_FastCGI

php56_10.png

Notice that you have FastCGIModule in Add Module Mappings list:


php56_11.png






Friday, September 25, 2015

What does php.exe found in the PHP directory do?

It is the command line processor that processes a file with the .PHP extension as shown here:
------------------------------
C:\Windows\system32>php "C:\inetpub\wwwroot\phpinfo.php" > "C:\info"
----------------------------
The PHP processor processes the provied php file and the command line directs the result to a file "info'

The input file phpinfo.php is as shown here:
----------
phpinfo();
?>

----------
The above file is typed into Notepad and saved with the extension ".PHP".

Here is the beginning section of the long file 'info' opened in Windows Word program.
-------------------------
phpinfo()
PHP Version => 5.4.14

System => Windows NT HODENTEKWIN7 6.1 build 7601 (Windows 7 Ultimate Edition Service Pack 1) i586
Build Date => Apr 10 2013 21:15:43
Compiler => MSVC9 (Visual C++ 2008)
Architecture => x86
Configure Command => cscript /nologo configure.js  "--enable-snapshot-build" "--enable-debug-pack" "--disable-zts" "--disable-isapi" "--disable-nsapi" "--without-mssql" "--without-pdo-mssql" "--without-pi3web" "--with-pdo-oci=C:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8=C:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8-11g=C:\php-sdk\oracle\instantclient11\sdk,shared" "--with-enchant=shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet=shared" "--with-mcrypt=static" "--disable-static-analyze" "--with-pgo"
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => C:\Windows
Loaded Configuration File => C:\Program Files (x86)\iis express\PHP\v5.4\php.ini
Scan this dir for additional .ini files => (none)
Additional .ini files parsed => (none)
PHP API => 20100412
PHP Extension => 20100525
Zend Extension => 220100525
Zend Extension Build => API220100525,NTS,VC9
PHP Extension Build => API20100525,NTS,VC9
Debug Build => no
Thread Safety => disabled
Zend Signal Handling => disabled
Zend Memory Manager => enabled
Zend Multibyte Support => provided by mbstring
IPv6 Support => enabled
DTrace Support => disabled

Thursday, September 24, 2015

How to get around 'HTTP 503 Error: Service not available' error in IIS 7.5 on Windows 7.1 SP1?

My localhost (the default website) has not been active for a longtime and I wanted to test a PHP script. To my dismay, I could not even browse to the IISStart.htm that is on all installations. I got the following error.

503Error_01

I am using a Toshiba Satellite laptop X64 with Windows 7 Ultimate with SP1. I had various programs running while writing the book on SQL Server Reporting Services 2012 such as PHP, SharePoint Server, etc. It is possible I had tweaked items around a lot.

I stopped and started the server and the problem remained. There was a fix in stackoverflow site pertaining to this error.

 
To get this going, I had to make some changes to the advanced settings of the Application pools by clicking the Application Pools as shown:


503Error_02.png
 
Clicking Advanced Settings displays the following:
503Error_03.png

As suggested the Load User Profile was changed to FALSE. I restarted the server and the 503 Error was displayed when I browsed the IISStart.htm as in the first image above.

Then I looked at the Application Pools status and realized that the DefaultappPool had stopped.

503Error_04.png

When I started it the 503 Error went away and i could display the IISStart.htm page.


503Error_05.png

I went back to Advanced Settings and the 'Load User Profile' was set to TRUE. Changing to FALSE did not produce the 503 error. 

I looked at what this settings meant and here  is a screen shot. This sets the mode to IIS 6.0

503Error_06.png


 

How long does it take to install Windows 10 on a tablet?

The tablet I have which has Windows 8.1 on it is the Toshiba Encore 2 WT-10A. It is a pretty good tablet and there is a brief review here.

I started installing Windows 10 by clicking the Windows icon (the Windows logo) in the notification area at the bottom of the screen. If you had registered before hand you would have this icon.

The installation started immediately by downloading the required files. This really took long on my Wi-Fi connection and finished after 1:30 hours. Then there was a chekcing phase after which the installation started.
You get a warning that the computer may restart several times during the installation. The installation took something like 45 minutes.

There were no error messages and it was smooth. After the installation an express setting was chosen and there was no need to do anything else. Most of the earlier apps were still there.

Windows 10 looks much better than the Windows 8.1 and Microsoft Edge (ME and not IE) looks nice with all its features. ME is not a browser supported by Google sites.

Here are some screen shots taken during installation with a camera.



 

Wednesday, September 23, 2015

How to create a CSV file?

The present post describes creating a Comma Separated Value (CSV) file using Microsoft Excel.

CSV files are very popular and frequently used data transformation formats since legacy data are usually of this type. In recent times XML and JSON formatted data has replaced them.

However, there is a whole lot of legacy data that needs to be loaded on to more recent databases. Hence, every database vendor provides a program to accomplish this conversion. Also programs exist which takes a CSV file and convert it into an XML file. Perhaps this is another route one can take in data conversions for legacy data.

You can create a CSV file using Microsoft Excel in all versions.
Here is an example of a CSV file.
------------
First Name,Last Name,AGE,Rent
Chris ,Langer,40,2500
Jean,Simmons,80,1200
Tom ,Higgins,35,4000

--------------
The first row in the above are headers (providing column names) and the rest is data.

Step 1:
Create an Excel file as shown by typing in the cell entries after launching the Microsoft Excel (herein Excel 2010).

namesExcel.png

Step 2:
Click File to display drop-down. You will be saving the file as names in the CSV format.


ExcelSaveAs.png

 
Step 3: Click Save As to open the Save As dialog as shown. You have a variety of options to choose from. Pick MS-DOS (CSV )as the Excel file type as shown.


ExcelSaveOptions

 
Step 4:
Provide a name for the file and accept the default folder. You get the following warning:

Excel Permissions

Accept the provided location (My Documents) by cliking Yes. The document gets saved to the location.

 A word of caution. If you have multiple sheets (usually when launched there will be three sheets). Delete the two extra sheets and just keep one sheet. You will get an error message if you have more than one sheet while saving it as a CSV file.

Tuesday, September 22, 2015

How do I know a file exists (in R programming)?

If you access the help file on your computer on which you installed R then you can find the information at this link here:

http://127.0.0.1:12506/library/base/html/list.files.html

File information can be found here:
http://127.0.0.1:12506/library/base/html/file.info.html

I had a file names.csv (I had mistaken about its extension being .CSV, it was actually names.xls.csv) which I wanted to know if it exists. Then I used the following commands:

> file.exists("C:/")                Does C:\ folder exists (you should not use the backward slash)?
[1] TRUE

> file.exists("C:/eula.3082")  I know eula.3082 exists but... The reason is perhaps permissions
[1] FALSE

> file.exists("C:/inetpub")     Does C:\inetpub exist?
[1] TRUE

> file.exists("C:/USERS")       Does C:\Users exist?
[1] TRUE

> file.exists("C:/USERS/names.csv")  Does C:\Users\names.csv exist?
[1] FALSE
oops!
> file.exists("C:/USERS/JFA.jpg")       Does C\USERS/JFA.jpg exist?
[1] TRUE

I created a CSV file in EXCEL and made sure it was saved as a CSV by opening it in Notepad.

> file.exists("C:/USERS/mysorian/Documents/names2.csv")  Does C:\USERS\names2.csv?
[1] TRUE

> file.info("C:/USERS/mysorian/Documents/names2.csv")   Provide info on the file C:/USERS/mysorian/Documents/names2.csv
                                       size isdir mode               mtime               ctime
C:/USERS/mysorian/Documents/names2.csv   98 FALSE  666 2015-09-22 16:42:20 2015-09-22 16:42:20
                                                     atime exe
C:/USERS/mysorian/Documents/names2.csv 2015-09-22 16:42:20  no

Listing files in a directory

Also,  if you know the directory you can list all the files as in the following:
--------
Error: could not find function "List.files"  -- R language is case sensitive
> list.files("C:/USERS/mysorian/documents") List the files in the directory in quotes

  [1] "__VSDeploymentFailure__.txt"                     
  [2] "~$ADI_gREETINGS.dotx"                            
  [3] "~$TrustRelated.xlsx"                             
  [4] "04092013 ConsolidatedDetails.xls"                
  [5] "3rd beneficiary details_sept15_2014.dotx"        
  [6] "4mysorian.xlsx"                                  
  [7] "Advanced SQL TOP.dot"                            
  [8] "AdvisoryMichiko.xlsx"                            
  [9] "AdvWksCustomer.rdl"                              
 [10] "Allow connections to this computer.pdf"          
 [11] "Ameritrade2014.csv"                              
 [12] "ApnStub.exe"                                     
 [13] "ArcGIS Explorer"  

How are numerical quantites handled in R language?

Numeric is the basic data type to represent numbers n the R language. Decimal is the  default computational data type in R.

You assign a decimal value using the following:
> x=3.1429  Assigns a value 3.1429 to a variable x

> x               Print to screen the value of x

[1] 3.1429     Value is printed
>
Arithmetic Operations:

> 2*x          -What is 2 times x?
[1] 6.2858

> 2+x        -What is 2 added to x?
[1] 5.1429

> x-1         -What is 1 taken away from x?
[1] 2.1429

> x/2         -What is x divided into two?
[1] 1.57145

> x=3.1419
> x^2            -What is x raised to power 2
[1] 9.871536

> x^x            -What is x raised to itself
[1] 36.4862
>
>
> sqrt (x^x)  -Square root of x raised to itself
[1] 6.040381
This is a screen shot of how you use the GUI to carry out the above computations:

RGUI.png

So how would you assign an integer value to a varible y?

You do so by using the integer function as shown in the following:

> y=as.integer(6)    Assign an integer value of 6 to y
> y                          Print y to screen
[1] 6

> class(y)                Print the class name for y
[1] "integer"

> is.integer(y)          test whether y is an integer
[1] TRUE
>
Another way to declare a integer constant is to use an L after the integer you want to declare:

> z=4L       -using L after the number declares it as an integer

> class(z)   -test the data type of z
[1] "integer"

You can force a decimal value to an integer but cannot force a string to an integer!

> y=as.integer("John")  Trying to make "John" to an integer
Warning message:
NAs introduced by coercion   Message from R. R does not like it.
>
R can handle all the mathematical functions you have used in your highschool maths like trgnometric, logarthmic fucntions as well.

Find more about numeric constants in your library that gets  installed with R installation by issuing the command in R as shown here:
>NumericConstants

Which opens up (https://127.0.0.1:xxx/library/base/html/NumericConstatns.html

Can R handle complex numbers?

Yes it can handle complex numbers. Complex numbers can have real and imaginary parts like in,
1+2i, where 1 is the real part and 2i is imaginary

Here is how it is used

> x=1+2i  -x is a complex number with real and imaginary parts (it hasto be 2i and not i2)
> y=1-2i  -y is another complex number with real and imaginary parts

> x*y        -What happens when you multiply them?
[1] 5+0i    -you get a real number (real part is 5 and imaginary component is zero
>

Can you install Microsoft Movie Maker on Windows 10?

The answer is yes. Yes, you can.

It comes as a bundle in Windows Essentials 2012. I think if you installed it on Windows 8.1 before upgrading to Window 10, it should still work. However, you may download Windows Essentials 2012 once again and install from the bundle you need not install all the items in the Windows Essentials, you can pick and choose.

Get Windows Essentials 2012 (wlsetup-web.exe) from here:
http://windows.microsoft.com/en-us/windows/get-movie-maker-download

Note: You may not be able to get this file as it is no longer supported.

I have not tried this but you may try this link (the marketing manager indicated this link):
http://www.freemake.com/how_to/free_movie_maker


Microsoft site does not mention that it can be installed on Windows 10, but in fact, it does and works without any errors.

Here are some screenshots from my most recent installation:

In this screen, you choose what to install.

 Once installed you can find the app in All Apps under the 'M' category.


 Here is mp4 video imported into the movie maker.


You cannot directly import from your phone, you need to get it on your computer.

Good luck!


Learn how to reduce the size of a video and clean it up with Movie Maker:
http://hodentekhelp.blogspot.com/2015/08/how-do-you-reduce-size-of-video.html

Wednesday, September 16, 2015

Can you create a Windows Form with PowerShell and embed an image?

You can do this create in PowerShell. Create the new FORM and new  PICTUREBOX objects using the New-Object syntax.

Let us take a image flower.jpg (320x240) and place this image in a PictueBox control on a Windows Form.
PictureBoxe's top, left, width and height can be set. Similarly form's width and height and the title's text can be set.

Here is the complete code:
----
$image = [System.Drawing.Image]::Fromfile('C:\Users\mysorian\Desktop\flower.png')    
$pictureBox = new-object Windows.Forms.PictureBox  --instantiates a PictureBox $pictureBox.width=320
$pictureBox.height=240
$pictureBox.top=100
$pictureBox.left=100
$pictureBox.Image=$image

 $Form = New-Object Windows.Forms.Form   --instantiates a new form $Form.Text = "PowerShell Form"                     --sets the text for the form $Form.Width = 600
 $Form.Height = 600
 $form.Controls.add($pictureBox)                   --adds the PictureBox to the form $Form.Add_Shown({$Form.Activate()})
 $Form.ShowDialog()

-------------
This should bring up this form with the image:

 

Tuesday, September 15, 2015

How to access OData service with LINQ?

Open Data Protocol (OData) relates to creation and use of RESTful APIs. OData uses URIs to identify resources on the Internet. The generic syntax for accessing the root of such service is http://host/Service. OData is built upon HTTP, ATOMPub and JSON.

An example of such a resource is the Northwind Service:

http://services.odata.org/northwind/northwind.svc/

LINQ, short for Language Integrated Query, provides an object oriented approach to not only querying relational databases but also any kind of source such as XML, Collection of objects, etc.

Want to know more about LINQ, go here.
Accessing OData with LinqPad.

Launch LinqPad (version used here is v4.55.03) and click on Add Connection link shown here:


OData_02.png

Choose Data Context window opens.


OData_03.png

Click WCF Data Services 5.5 (OData 3) and Click Next.
 In the WCF Data Conneciton 5.5 window type in the URI as shown (you have seen what this is earlier). Leave username and password blank. You can get to the XML or the JSON formatted resources. Remembering this connection is OK for the next time you come here.

Hit Test with Default(XML) checked. Your connection gets populated as shown.


OData_04.png

In the Query pane, Click on Connection and choose the option shown. As to query language you have a number of options.


Odata_05.png

I have just chosen SQL as the language to query. It looks like the driver does not support SQL.


Odata_06.png

Change the language option to C# Expression. Query for Employees table contents as shown:

Odata_07.png

Here is another select statement choosing two columns from Customers table:

OData_08.png

You can easily query OData using C#, but this interface does not support SQL.

You can easily connect to OData using PowerBI, review this post:
http://hodentek.blogspot.com/2015/09/poweer-bi-using-data-from-odata-web.html

Can you install R (version 3.2.2) programming executable on Windows 10 computer?

Yes you can.

You need to download the program from here. Double clicking will let you begin installing. The installation is quite fast on Windows 10. Accept all the defaults during installation unless you need to customize. You can see all the steps in my previous installation on a Windows 7 (x64) laptop here.
After installation you will find two shortcuts as shown:

RforWindows10.png

One of them is a shortcut for the x64bit program and the other shortcut R i386 3.2.2 is a x32bit program. Probably you only need one of them. The x64 version shortcut gets added to the Start.


Sunday, September 13, 2015

What is Windows Journal, where can I find it?

Windows Journal is installed when you install Windows 10. It is a very cool program. I wish it had more options to export the notes.

I have been using Notepad for writing notes for a long time. I have neither been attracted to OneNote nor have I found Notepad 8 an attractive substitute for Notepad which remained as Notepad for all versions of Windows. Notepad 8 made its debut in Windows 8, but frankly it was quite bad.
Windows 10 comes, out-of-the bxo with a program called Windows Journal. This is quite a good one and its presence may not be quite obvious.

Click on All apps and scroll down to letter W. You can see Windows Journal after expanding Windows Accessories (3rd from bottom).


WJ_00

When you click this you will be greeted with a message. The message window is on top of the Windows Journal's default note, Note1 as shown.

WJ_01

You agree to install and click Yes. It might require permission and after which the driver is installed.


WJ_02

It is now ready to use. You can insert text (after clicking Insert | Textbox) and start typing in the box. You can format it anyway you want, size, font, color etc. You can insert an image from your computer or you can sketch out something with the minimalist drawing tools. Here is an example of what I did.

WJ_03

You can save it and it gets saved to the Notes folder as shown. Of course you can choose another location.
WJ-04

You an also send it over to someone by email as, a journal note (opened by Windows Journal of the receiver);a web page (,mht) that you cannot edit; or a black and white image(.tiff)

Do not forget to check out the Help menu item.

I think this is a cool tool since Notepad was lacking in some many features and MS Word had too many less used features.

What is a good way to learn R language?

There are many ways one can learn as Internet provides a whole lot of options from free sites to sites where you can
pay and register to learn.
R language has come to focus because it can be used to carry out Data Analysis as it has strong statistical basis.
Using R one can work with graphics as well. This means the analyzed data can be pictorially displayed in terms of
graphs and charts for data visualization.
Microsoft SQL Server 2016 will have built-in support for R language and it goes without saying that learning R
programming has great value.
One way, I can think of,  is to download the R programming interface on to your computer and start from there.

Downloading and Installing R language executable for Windows 7?

While it is available for Unix/Linux, it is also available for Windows (both x32bit and x64bit). You can download the latest version here (R-3.2.2-win.exe) . The version you will be downloading is R 3.2.2 for Windows (32/64) 62MB. A small file for the complicated things it does.

Here are some download/install screen shots for those who like:

If you are installing for the first time choose that option after you access the download link above.

Rforwindows01
 
The set up for R on Windows needs to be selected:


Rforwindows04

Complete the Installation wizard screens and you are done.

You can invoke it from the desktop shortcut as shown here and the R-GUI will be displayed as shown:

Rforwindows08

It can also be invoked from Command Line and it will be easier if add the directory of the R installation (C:\Program Files\R\R-3.2.2\bin;) to the Path in your environment variables set up.

After adding the above directory to the Path in environmental variables, you can launch R as shown here:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
C:\Users\mysorian>R
R version 3.2.2 (2015-08-14) -- "Fire Safety"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> q()
Save workspace image? [y/n/c]: n

Now you are ready to rock and roll. You could also use the GUI shown previously (previous image).

If you enter help.start() either from GUI as shown here.

R_helpstart.png

You can also do this from command line. Note that as shown above help.Start() would produce an error as R language happens to be case sensitive, it has to be help.start().

In both cases help appears in a browser window hosted on your local IIS as shown.


This is all for today. Visit here again for more on R programming.