Determine the Windows PowerShell version

To reliably display the version of the Windows PowerShell engine

  1. Open a PowerShell command window,
  2. Execute the command,
    $PSVersionTable.PSVersion

    PS C:\WINDOWS\system32> $PSVersionTable.PSVersion

    Major Minor Build   Revision
    —–   —–   ——-  ——-
    5       1        16299  64

  3. If no value is displayed, the version is 1.0, as it does not have the referenced variable.

How to create a slideshow in Drupal 7

To create a slideshow in Drupal 7

Create a Slideshow content

  1. Log into Drupal as administrator
  2. In the top menu select Content and Add content
  3. On the Add Content page select Slideshow
  4. On the Create Slideshow page enter the title of the page, and populate the fields for the images. Click the Choose File to upload the image.
  5. Click the Add another item button to add the next image.
  6. Write down the Node ID from the address bar. You will refer to it in the slideshow module,
  7. Click the Save button at the bottom to save the page.

Create a Structure for the slideshow

  1. In the top menu select Structure, and on the page click View,
  2. If there is an existing slideshow with the required settings
    1. Clone it,
    2. Enter a new name for the view,
  3. If you need a new slideshow type
    1. Click the Add view from template link,
    2. Click the add button in the Image Gallery line,
    3. Enter a name for the new view and click the Continue button,
  4. Click the Content: Nid (=) link to select the images uploaded in the content section above,
  5. Enter the Node ID you saw in the address line above and click the Apply button,
  6. To set the block name click the block name link,
  7. Enter a block name,
  8. Click the Save button to save the view.

Add the slideshow to a page

  1. Add the page to the menu, navigate to it, and copy the page address to the clipboard that follows the domain name,
  2. In the main menu select Structure, and on the Structure page select Blocks,
  3. Find the block In the Disabled section and in the drop-down select Content. The block will jump to the Content section,
  4. Find the bock in the Content section and click the configure link,
  5. In the REGION SETTINGS section select Content in the drop-down,
  6. On Pages tab of the Visibility settings section select the Only the listed pages radio button, and enter the address of the page,
  7. On the block configuration page click the Save block button.
  8. On the Blocks page click the Save blocks button.

Edit the slideshow

Log into the site as an administrator

To add or delete pictures

  1. In the upper left corner click the Edit link.

To edit the slideshow settings

  1. Move the mouse above the slideshow,
  2. In the upper right corner click the gear icon,
  3. Select the edit page from the menu.

How to install a Drupal module

To install a Drupal module

  1. Download the Drupal module from the www.drupal.org website,
  2. Unzip the module,
  3. With an FTP client upload the module directory to sites/all/modules/contrib
  4. Log into the Drupal site as administrator,
  5. In the menu select Modules,
  6. Click the switch next to the module name to turn it ON. The orange switch label reminds you to save the changes.
  7. Click the Save configuration button in the lower left corner,
  8. The green ON switch indicates that the module has been successfully enabled.

How to create a Docker repository in Artifactory

Artifactory supports multiple repository types, Docker is one of them. To create a new Docker repository in Artifactory

Set the Custom Base URL of the Artifactory server

From the Artifactory documentation at https://www.jfrog.com/confluence/display/RTF/Configuring+NGINX

“When using an HTTP proxy, the links produced by Artifactory, as well as certain redirects contain the wrong port and use the http instead of https”

  1. On the left side select Admin,
  2. Under Configuration on the General page enter the actual URL you use to access the Artifactory server and click the Save button.

Create one virtual Docker repository for all of your Docker repositories

As recommended by the Artifactory documentation at https://www.jfrog.com/confluence/display/RTF/Configuring+a+Reverse+Proxy#ConfiguringaReverseProxy-DockerReverseProxySettings
create one virtual Docker repository to aggregate all other Docker repositories, so only this repository has to be set up on the reverse proxy server.

  1. On the left side select Admin,
  2. In the Repositories section on the Virtual page click New,
  3. Select the Docker package type,
  4. Enter a name for the repository,
  5. Command-click (CTRL-click on Windows) the configure reverse proxy link to open it in a new tab and generate the script to set up the reverse proxy server,

Create the reverse proxy script

  1. In the Configuration section on the Reverse Proxy page fill out the form. If the reverse proxy server will be installed on the Artifactory server, write localhost in the Internal Hostname field.

    If you use a load balancer in front of the Artifactory server that also contains the SSL certificate you don’t need to enable the HTTPS protocol. If you use wildcard certificate you can select the Sub Domain reverse proxy method.

Save the Virtual repository

  1. On the New Virtual repository tab click Next at the bottom of the page,
  2. The Advanced tab shows the name of the Docker Registry
  3. Click the Save & Finish button to create the repository.

Create the Docker local repository

The local Docker repository will store the Docker images

  1. On the left side select Admin,
  2. In the Repositories section on the Local page click New,
  3. Select the Docker package type,
  4. Enter a name for the repository and click Next,
  5. The Advanced tab shows the address of the repository using the reverse proxy,
  6. Click the Save & Finish button to create the repository.

 

How to transfer an Atlassian Confluence wiki space to another server

Confluence is one of the most popular Wikis with a great user interface. To export and transfer an Atlassian Confluence wiki to another server

  1. Log into the Atlassian Confluence wiki as an administrator,
  2. In the lower left corner click the gear icon and select Content Tools,
  3. On the Export tab select the XML radio button and click Next,
  4. Select Custom Export and click the Export button at the bottom of the page,
  5. The export process starts,
  6. Click the link to download the export file,

Atom text editor configuration

Configure Atom

Turn off auto-indent on paste to stop Atom reformatting your code.

  1. In the Atom menu select Preferences
  2. On the left side select Editor
    • Uncheck Auto Indent On Paste
    • Check Show Indent Guide
    • Set Tab Type to soft to place 2 spaces when you press the tab key

Atom language packs

Atom language packs help you with code completion.

Install language packs

  1. In the Atom menu select Preferences…
  2. On the left select Install, and type the name of the language pack into the text box and hit enter. Click the Install button to install the language pack.
    – language-chef
    – language-inspec

How to use language packs

  1. Start to type the name of the resource, and a list appears with the matching resources.
  2. Select the resource in the list with the cursor keys and press tab to insert the code snippet
  3. Make the appropriate changes to customize the resource.

 

Deploy a WAR file of a Java web application on the Apache Tomcat web server

There are two ways to deploy a WAR file of a Java web application on the Apache Tomcat web server

Using the command line

  1. Copy the WAR file into the webapps folder of the Tomcat installation directory,
  2. Make sure the CATALINA_HOME environment variable points to the Tomcat directory (not the bin subdirectry)
  3. Open a Terminal window or Command Prompt,
  4. Navigate to the bin directory of the Tomcat web server installation directory,
  5. Execute
    startup
  6. Tomcat will unzip the war file into a directory named after the WAR file and display the message similar to this.

    C:\Program Files\apache-tomcat-8.5.23\bin>startup
    Using CATALINA_BASE: “C:\Program Files\apache-tomcat-8.5.23”
    Using CATALINA_HOME: “C:\Program Files\apache-tomcat-8.5.23”
    Using CATALINA_TMPDIR: “C:\Program Files\apache-tomcat-8.5.23\temp”
    Using JRE_HOME: “C:\Program Files\Java\jre-9.0.1”
    Using CLASSPATH: “C:\Program Files\apache-tomcat-8.5.23\bin\bootstrap.jar;C:\Program Files\apache-tomcat-8.5.23\bin\tomcat-juli.jar”C:\Program Files\apache-tomcat-8.5.23\bin>

Using the Tomcat user interface

  1. Remote into the web server,
  2. Copy the WAR file to a temp directory,
  3. Open the Tomcat web user interface at http://localhost:8080/manager
  4. Log in with the credentials specified for the manager-gui role in the tomcat-users.xml file of the conf Tomcat folder,
  5. In WAR file to deploy section click the Choose File button and select the WAR file,
  6. Click the Deploy button,
  7. Tomcat will unzip the war file into a directory named after the WAR file in the webapps folder of the Tomcat installation directory.

Create a WAR file for a Java web application in NetBeans

Configure the web application

Add the web.xml file

The wb.xml file contains the web application configuration values for the webserver. I has to be in the WEB-INF directory of the web applicaion. To add the web.xml file to your NetBeans Java web application

  1. Right-click the Netbeans project, and select New -> Other
  2. In the New File window select XML -> XML Document, and click the Next button,
  3. In the New XML Document window enter web.xml as the name of the file, and click the Browse… button to select the location,
  4. Select the src\main\webapp\WEB-INF folder, and click the Select Folder button,
  5. In the New XML Document window click the Next button,
  6. In the New File window keep the Well-formed Document radio button selected and click the Finish button,
  7. NetBeans creates the XML file in the Web PAges WEB-INF folder on the web project.

Build the WAR file

To create a WAR file for a Java web application in NetBeans 8.2

  1. In the NetBeans IDE select the Files tab,
  2. Right-click the pom.xml file and select Run Maven > Goals…
  3. In the Run Maven window enter compile war:war into the Goals field,
  4. Select the Remember as checkbox and enter Compile war for the name,
  5. The WAR file is generated in the target directory of the Java web project.
  6. The next time you want to build the WAR file, the Compile war option will be visible in the Run Maven menu.

Tomcat web server configuration

When you install the Apache Tomcat web server there are some configuration settings you need to make to be able to administer and use it.

Administrator user accounts

When you install the Apache Tomcat web server there is no admin user account specified, so nobody can log into the admin web user interface. To add an admin user account

  1. Remote into the web server
  2. Open the Tomcat user configuration file at
    1. On Linux at $TOMCAT_HOME/conf/tomcat-users.xml
    2. On Windows at C:\Program Files\apache-tomcat-…\conf\tomcat-users.xml
  3. Add an admin user
    <tomcat-users>
    <!--
      <role rolename="tomcat"/>
      <role rolename="role1"/>
      <user username="tomcat" password="tomcat" roles="tomcat"/>
      <user username="both" password="tomcat" roles="tomcat,role1"/>
      <user username="role1" password="tomcat" roles="role1"/>
    -->
    
    	<role rolename="manager-gui"/>
    	<user username="admin" password="admin" roles="manager-gui"/>
    
    </tomcat-users>
  4. Restart the Tomcat service for the change to take effect.

Firewall

With the default settings, Tomcat is accessible on port 8080. To be able to use the web applications served by Tomcat, open port 8080 on the local firewall.

Enable PowerShell execution in Windows

The default settings of Windows disable the PowerShell script execution. This protects your computer in case a malicious PowerShell script would try to make changes on your machine. The same settings prevent you from executing your own automation scripts too.

To enable PowerShell script execution

in Windows 10

  1. Click the Windows button and type powershell into the text box,
  2. Right-click the Windows PowerShell item and select Run as administrator,
  3. In the User Account Control window click the Yes button,
  4. In the PowerShell window execute
    Set-ExecutionPolicy unrestricted

     

  5. Press Y and the Enter key to enable the PowerShell script execution.

in Windows 7

  1. Click the Windows button and type powershell into the text box,
  2. Right-click the Windows PowerShell item and select Run as administrator,
  3. In the User Account Control window click the Yes button,
  4. In the PowerShell window execute
    Set-ExecutionPolicy unrestricted