Skip to content

Instantly share code, notes, and snippets.

View mikahanninen's full-sized avatar

Mika Hänninen mikahanninen

  • Robocorp
  • Finland
View GitHub Profile
@mikahanninen
mikahanninen / readme.md
Last active July 2, 2020 19:02
uploading artifact from roboworker run to custom server

Steps:

  1. modify package.yaml
  • add section environment.path, entrypoints
  • modify command section have only ./entrypoint.sh
  1. modify entrypoints/entrypoint.sh
  • make sure that python line matches below example
  • define files to you want to upload with curl

MODIFIED package.yaml

@mikahanninen
mikahanninen / gist:5d4789a7304c6d90fe16327fe59a28fc
Created June 12, 2020 07:14 — forked from simonw/gist:68d19a46e8edc2cd8c68
Fix "Do you want the application "python" to accept incoming network connections?" by code signing the python executable in your virtualenv - copied here in case https://www.darklaunch.com/2014/02/02/fix-do-you-want-the-application-python-to-accept-incoming-network-connections ever goes away.
With the OS X firewall enabled, you can remove the "Do you want the application "python" to accept incoming network connections?" message.
Create a self-signed certificate.
Open Keychain Access. Applications > Utilities > Keychain Access.
Keychain Access menu > Certificate Assistant > Create a Certificate...
Enter a Name like "My Certificate".
Select Identity Type: Self Signed Root
Select Certificate Type: Code Signing
Check the Let me override defaults box
@mikahanninen
mikahanninen / readme.md
Created June 11, 2020 12:05
Getting release info from Git commits

git log --pretty=format:"%ad%x09%s" | grep release: | grep -v Revert

@mikahanninen
mikahanninen / readme.md
Last active June 10, 2020 06:47
Library.Google initialization ways

library init method 1

library = Google()

And if using Robocloud Vault.

library.set_robocloud_vault(
    vault_name="googlecloud",
    vault_secret_key="servicecreds")
@mikahanninen
mikahanninen / listener.py
Last active June 8, 2020 12:00
simple RFW listener
ROBOT_LISTENER_API_VERSION = 3
def end_test(data, result):
print(f"\n{result.elapsedtime:} ms")
print(result.starttime)
print(result.endtime)
@mikahanninen
mikahanninen / listener.py
Last active June 8, 2020 11:37 — forked from shpaker/listener.py
Robot's listener v3 implementation
""" Robot's listener v3 implementation
For more information see:
http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#listener-version-3
"""
ROBOT_LISTENER_API_VERSION = 3
def start_suite(suite, result):
""" Called when a test suite starts.
@mikahanninen
mikahanninen / task.robot
Last active February 23, 2022 08:38
Running Selenium Keyword for element which needs to be in view
*** Settings ***
Library RPA.Browser.Selenium
*** Tasks ***
Lets scroll
Open Available Browser https://robotframework.org/SeleniumLibrary/SeleniumLibrary.html
${status} Run Keyword For Element in View Mouse Down name:Input Text
Capture Page Screenshot
*** Keywords ***
@mikahanninen
mikahanninen / pdfmod.py
Created May 11, 2020 06:53 — forked from jrsmith3/pdfmod.py
Convert specified pages from a PDF to png
"""
This script was used to create the figures for http://jrsmith3.github.io/sample-logs-the-secret-to-managing-multi-person-projects.html from a PDF file containing some old CMU sample logs.
"""
import PyPDF2
from wand.image import Image
import io
import os
@mikahanninen
mikahanninen / jupyter_logging.py
Last active November 1, 2020 16:32 — forked from wassname/jupyter_logging.py
simple logging for jupyter or python which outputs to stdout (or a console or terminal) and a log file
"""
In jupyter notebook simple logging to console
"""
import logging
import sys
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
# TO exclude log message from certain package
logging.getLogger("urllib3").setLevel(logging.WARNING)
@mikahanninen
mikahanninen / gist:4e46d589b3cac5e4b365fa6244f80e38
Last active March 27, 2020 07:20 — forked from ymirpl/gist:1052094
Python unicode e-mail sending
#coding: utf-8
from cStringIO import StringIO
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.header import Header
from email import Charset
from email.generator import Generator
import smtplib
# Example address data