Skip to content

Instantly share code, notes, and snippets.

View Hrissimir's full-sized avatar

Hrissimir Hrissimir

  • HEDSolutions
  • Bulgaria
View GitHub Profile
@Hrissimir
Hrissimir / GitHub-SetupSSH-Instructions.txt
Last active July 3, 2021 03:10
GitHub: SetupSSH Instructions
1. Check for exisiting keys using:
ls -al ~/.ssh
2. When none are existing you'll get:
ls: cannot access '/home/USER/.ssh': No such file or directory
3. Generate new ssh key:
package cucumber_selenium.plugins;
import io.cucumber.plugin.ConcurrentEventListener;
import io.cucumber.plugin.event.EventPublisher;
import io.cucumber.plugin.event.HookTestStep;
import io.cucumber.plugin.event.TestRunStarted;
import io.cucumber.plugin.event.TestCaseStarted;
import io.cucumber.plugin.event.TestStepStarted;
import io.cucumber.plugin.event.TestStepFinished;
package cucumber_selenium.plugins;
import io.cucumber.plugin.event.HookTestStep;
import io.cucumber.plugin.event.PickleStepTestStep;
import io.cucumber.plugin.event.TestCaseFinished;
import io.cucumber.plugin.event.TestCaseStarted;
import io.cucumber.plugin.event.TestRunFinished;
import io.cucumber.plugin.event.TestRunStarted;
import io.cucumber.plugin.event.TestStepStarted;
import io.cucumber.plugin.event.TestStepFinished;
# ============================ https://github.com/github/gitignore/raw/main/Java.gitignore ============================
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
@Hrissimir
Hrissimir / Python.gitignore
Last active August 16, 2022 22:44
United .gitignore for Python projects (sources links in comments)
# ---------- https://github.com/github/gitignore/raw/main/Python.gitignore ----------
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
@Hrissimir
Hrissimir / recurring_events.py
Created March 7, 2020 16:09
Simplified creation of sized datetime sequence with desired frequency.
from datetime import datetime
from typing import List
from dateutil.rrule import (
rrule,
YEARLY,
MONTHLY,
WEEKLY,
DAILY,
HOURLY,
@Hrissimir
Hrissimir / open_exchange.py
Created March 8, 2020 18:00
Cached currency rates conversion using openexchangerates.org to reduce API calls and stay with the free subscription.
"""Cached interaction with openexchangerates.org API"""
import json
import logging
import os
from datetime import datetime, timedelta
from pathlib import Path
from tempfile import gettempdir
from typing import Dict, Optional
import requests
@Hrissimir
Hrissimir / .bash_aliases
Last active April 25, 2020 00:21
Collection of useful bash aliases. (put in ~/.bash_aliases
# simplified update
alias update='sudo apt update && sudo apt upgrade'
# properly call autoremove
alias autoremove='sudo apt-get autoremove --purge'
# view nework stats
alias view-running-services='sudo systemctl list-units --type=service --state=running'
alias view-network-connections='sudo netstat -ltup && sudo netstat -tup'
alias view-network-sockets='sudo ss -ltupn && sudo ss -tupn'
@Hrissimir
Hrissimir / log4j.properties
Created April 27, 2020 06:16
Sample log4j properties
# Root logger option
log4j.rootLogger=DEBUG, file, stdout
# Direct log messages to a log file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File= execution.log
log4j.appender.file.MaxFileSize=10MB
log4j.appender.file.MaxBackupIndex=10
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %t [%c{1}:%L] %m%n
# Direct log messages to stdout
// build.gradle -> dependencies:
// implementation 'org.slf4j:slf4j-api:1.7.30'
// implementation 'org.slf4j:slf4j-log4j12:1.7.30'
// implementation 'org.apache.commons:commons-lang3:3.10'
// implementation 'commons-io:commons-io:2.7'
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.slf4j.Logger;