Install Docker on Ubuntu 18.04

TonyW
Docker is very popular tool which creates container in the application development, same software, configuration will be packaged and used for testing and production. In this exercise, we will install docker in a Ubuntu server Check Ubuntu version lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.04.3 LTS Release: 18.04 Codename: bionic Update package sudo apt-get update Remove old version if exists sudo apt-get remove docker docker-engine docker.

Api test automation with mocha and chai

TonyW
Mocha is a JavaScript test framework running on Node.js and in the browser, which can be used for unit testing, and api and ui automated testing, here we will use it along with chai to do some api automated testing in nodejs with typescript. Packages We will install packages below with yarn add or npm install @types/chai-http @types/mocha @types/node chai chai-http mocha mochawesome ts-mocha ts-node typescript typings Writing tests Mocha BDD interface will be used to create the test case.

Reading and writing serial port data with PowerShell

TonyW
List com ports To see a list of available com ports, PS C:\> [System.IO.Ports.SerialPort]::getportnames()<br /> COM1<br /> COM2<br /> COM3 Read or write data To read or write data with given details, such as port, Baudrate etc. $port= new-Object System.IO.Ports.SerialPort COM3,9600,None,8,one $port.open() $port.WriteLine("some string data") $port.ReadLine() $port.Close() Write unix time I have a clock which accepts unix time for syncing the time, so I use script below to sync the time if the clock being off for few minutes after some time.

Download UFT script from ALM

TonyW
Usually we use ALM to manage our test cases, test script and resource files, which works very well, but when we consider to host the script in git, we have to download them to local and commit to git. In this exercise, I try to download UFT scripts and resource files in UFT with using ALM OTA , the OTA api reference can be found here, and here is the code.

Firebase login in docker toolbox

TonyW
The exercise is trying to resolve the Firebase login callback issue in docker; my system setup is VirtualBox with Docker toolbox. Let’s start with the login command: # firebase login Visit this URL on this device to log in: https://accounts.google.com/o/oauth2/auth?client_id=5635aa84335869-fgrhgmd47baqnekij5i8b5pr03ho849e6.apps.googleusercontent.com&scope=email%20openid%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloudplatformprojects.readonly%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Ffirebase%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform&response_type=code&state=547585715&redirect_uri=http%3A%2F%2Flocalhost%3A9005 Waiting for authentication… Then I copy the long URL, and paste it to a browser window in host machine, allow the FirebaseCLI access, the authentication is working fine, but failed at callback.

Add make to Git Bash on Windows

TonyW
Recently I need to use make command which is not packaged with Git Windows by default, and come across this git hub page, which mentioned how to add few commands to Git Bash on windows, this is quite handy and solved my problem. make Go to ezwinports. Download make-4.1-2-without-guile-w32-bin.zip (get the version without guile). Extract zip. Copy the contents to your Git\mingw64\ merging the folders, but do NOT overwrite/replace any existing files.

Software installation on multiple systems with PowerShell

TonyW
In this exercise, I will try to install a software on multiple systems with PowerShell, which could reduce some maintenance effort when we need to install or patch some software regularly. The way here is to copy installation file to c:\temp first to remote systems, then install it with remote session, and then check registry and see the installation details. $computers="computer1","computer2" $path="\\server1\sharefolder\TestInstall.msi" $computers | where{test-connection $_ -quiet -count 1} | ForEach-Object{ copy-item $path "\\$_\c$\temp" } Invoke-Command { dir c:\temp\TestInstall.

psake script in Visual Studio

TonyW
A sample project will be set up in Visual Studio for writing psake script, Create a new Class Library Project Install Nuget Package – psake Add a default.ps1 file with some test script, or that can be copied from packages\psake.x.x.0\tools\examples default.ps1 Execute the script: Import-Module .\packages\psake.4.6.0\tools\psake.psm1 Invoke-psake .\psake\default.ps1

Team City Meta-Runner for TOSCA CI

TonyW
In TOSCA Distributed Execution, we discussed how to integrate TOSCA Distributed Execution with Team City, which we have two steps for triggering the execution. Since we need to use them for multiple build configuration, so considering to wrap them one step with Team City Meta-Runner. The Meta-Runner can be extracted from an existing build configuration. In this case, open the build configuration to be extracted, and go to Actions -> Extract Meta-Runner, Enter or adjust values for Project, Name, ID, Description, and then click Extract button, then make changes if required.

Restore MSSQL Database

TonyW
Kill active sessions Firstly, it would be better to stop all the applications/services which are connecting to the Database which needs a restore. Then, kill the active sessions as this will block the restore process if there are any active sessions. use master; declare @kill varchar(max) = ''; select @kill = @kill + 'kill ' + convert(varchar(10),S.session_id) + ';' from sys.dm_exec_sessions S join master..sysprocesses P on P.spid = S.session_id where P.