SQL to check Bitbucket user permission

Bitbucket permission can be assigned at project level or repository level for a group and user. The SQL (MSSQL Server) below can be used to check all projects & repositories permission for a given user, include the access assigned to an individual user or a group. with repo_access as ( select distinct p.id as "Project ID", p.name as "Project Name", r.name as "Repo Name", cu.id as "User ID (Individual)", cu.user_name as "Username (Individual)", Concat(cu.

Retrieve and Export BitBucket server users

Sometimes, we wish to check if a BitBucket user has actually used his account or not. There is a post Query for inactive or idle users which has explained few different ways. I will try the API method. In this exercise, I try to achieve few things below with Python Send request to BitBucket server and get the list of users Convert the Unix timestamp to readable date time Export the user data to a csv file This is the sample code to get the information and export to csv file.

Install Docker on Ubuntu 18.04

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

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

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

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

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

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

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

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