Skip to content

Instantly share code, notes, and snippets.

View pbelskiy's full-sized avatar

Petr Belskiy pbelskiy

View GitHub Profile
@amatellanes
amatellanes / oracle_java8.sh
Last active June 8, 2021 23:37
Install Oracle Java 8 on Ubuntu 14.04 LTS (Trusty Tahr)
sudo add-apt-repository ppa:webupd8team/java;
sudo apt-get update;
sudo apt-get install oracle-java8-installer;
sudo update-alternatives --config java;
java -version;
@datagrok
datagrok / README.md
Last active June 5, 2024 10:29
What happens when you cancel a Jenkins job

When you cancel a Jenkins job

Unfinished draft; do not use until this notice is removed.

We were seeing some unexpected behavior in the processes that Jenkins launches when the Jenkins user clicks "cancel" on their job. Unexpected behaviors like:

  • apparently stale lockfiles and pidfiles
  • overlapping processes
  • jobs apparently ending without performing cleanup tasks
  • jobs continuing to run after being reported "aborted"
@jonfk
jonfk / virtualenv.adoc
Last active February 28, 2023 02:22
Python Virtualenv Cheatsheet

Virtualenv Cheatsheet

  1. Create a virtualenv

    $ virtualenv env
  2. Activate

@mosquito
mosquito / README.md
Last active July 24, 2024 14:40
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/docker-compose@.service. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
@tbutts
tbutts / tmux-migrate-options.py
Last active February 29, 2024 08:11
For tmux configs: Merge deprecated/removed -fg, -bg, and -attr options into the -style option
#!/usr/bin/env python
# vim: set fileencoding=utf-8
#
# USAGE:
# Back up your tmux old config, run the script and redirect stdout to your conf
# file. Example:
#
# $ cp ~/.tmux.conf ~/.tmux.conf.orig
# $ python ./tmux-migrate-options.py ~/.tmux.conf.orig > ~/.tmux.conf
#
@novikov-nsa
novikov-nsa / solid_in_python.md
Created June 20, 2021 07:35 — forked from welel/solid_in_python.md
SOLID принципы с примерами на Python

S.O.L.I.D принципы с примерами на Python

Примечания
  • Под клиентами подразумеваются программные сущности, использующие другие программные сущности.

  • Этот файл является переводом статьи с сайта medium.com пользователя DeeKey, ссылка в завершении файла.

@ZhouYang1993
ZhouYang1993 / radix_sort.py
Created December 26, 2022 22:08
Mastering Radix Sort in Python: A Visual Guide
def radix_sort(arr):
"""
Radix sort starting from the least significant digit(LSD)
:param arr: The list needs to be sorted
:return: A sorted list
"""
# Find the maximum number of digits in the list
max_digits = max([len(str(x)) for x in arr])
# Set the base (radix) to 10