Skip to content

Instantly share code, notes, and snippets.

View mnojek's full-sized avatar

Mateusz Nojek mnojek

View GitHub Profile
@mnojek
mnojek / jenkins_transfer_tutorial.md
Last active April 22, 2021 17:55
How to move Jenkins from one drive to another on Windows

How to move Jenkns to another drive on Windows?

  1. Move entire Jenkins directory (typically located in C:\Program Files (x86)\Jenkins) to desired one (e.g. D:\Jenkins) - it can take some time
  2. Turn off Jenkins
    • Open cmd where it is installed (C:\Program Files (x86)\Jenkins) and run jenkins.exe stop
    • Open Services in Windows (Win key and type "Services") and find Jenkins service, right-click and click Stop
  3. Update environment variables
    • Search in Windows for 'environment variables'
    • Look for JENKINS_HOME in system variables and edit it
    • Change the value (in our case D:\Jenkins)
  4. Change service "Path to executable"
@mnojek
mnojek / pre-commit-rf-lint.sh
Last active July 8, 2021 12:59
Robot Framework syntax Git pre-commit hook
#!/bin/bash
# this hook checks quality of Robot Framework files using Robocop linter tool
# it runs only on changed and staged files with .robot or .resource extension
# any issue that is found will be notified and will block the commit operation
while read file; do
# do a check only on the robot files
if [[ "$file" =~ (.robot|.resource)$ ]]; then
robocop=$(robocop "$file")
status=$?
@mnojek
mnojek / pre-commit-lint-check.sh
Created July 8, 2021 12:49
Robot Framework and Python syntax git pre-commit hook
#!/bin/bash
# this hook checks quality of Robot Framework and Python files
# it runs only on changed and staged files with specific extensions
# any issue that is found will be notified and will block the commit
syntax_fail=false
while read file; do
# do a check only on the robot files
@mnojek
mnojek / rf-output-analyzer.py
Last active July 9, 2021 14:09
Robot Framework execution time analyzer
"""
The script analyzes output file from Robot Framework execution
and calculates total time spent on specific keyword and libraries.
This can help to optimize the code in places where the execution is longer.
It takes XML file and outputs the results into 2 separate CSV files:
- kw_stats.csv that includes time spent on each keyword
- lib_stats.csv that includes time spent on each library
Each file content is structured like this:
<keyword or library name>;<total time in seconds>
To run the script just provide the path to XML file:

Keybase proof

I hereby claim:

  • I am mnojek on github.
  • I am nojek (https://keybase.io/nojek) on keybase.
  • I have a public key ASBxbgnhErcWyiOj2GLY1T3ND06oKNJ7I6qLhNkX2y9Jvgo

To claim this, I am signing this object:

@mnojek
mnojek / .gitconfig_template
Created October 24, 2023 10:34
Fill in the user details and rename to .gitconfig before use
[user]
name = <Your Name>
email = <your@email.com>
username = <your_username>
[core]
# enable parallel index preload to speed up operations like "git diff" or "git status"
preloadindex = true
# treats a carriage-return at the end of line as part of the line terminator
fscache = true