Skip to content

Instantly share code, notes, and snippets.

View Voronenko's full-sized avatar
turning coffee into code since late 90s

Vyacheslav Voronenko

turning coffee into code since late 90s
View GitHub Profile
@Voronenko
Voronenko / gitlab-PR-existance-detection.yml
Created December 30, 2020 13:08
Snippet to detect if PR is opened against this branch
script:
- export MERGEREQ=$(git ls-remote ${CI_REPOSITORY_URL} refs/merge-requests/[0-9]*/head | awk "/$CI_BUILD_REF/"'{print $2}' | cut -d '/' -f3)
- echo $MERGEREQ
- set +e
- '[ -z "$MERGEREQ" ] && echo "PR NOT DETECTED" && exit 0'
- '[ ! -z "$MERGEREQ" ] && echo "PR DETECTED"'
- set -e
ffmpeg -i inputvideo.mp4 -i inputsound.mp3 -map 0:v -map 1:a -c:v copy -shortest output.mp4
@Voronenko
Voronenko / java_container_check.sh
Created December 14, 2020 14:10
Basic illustration of docker support in jdk 11 container
docker run -it openjdk:11-jdk bash
root@3411b7f04046:/# java -XX:+PrintFlagsFinal -version | grep ContainerSupport
bool UseContainerSupport = true {product} {default}
root@3411b7f04046:/# jshell
jshell> Runtime.getRuntime().availableProcessors()
$1 ==> 8
jshell> Runtime.getRuntime().totalMemory()
$2 ==> 264241152
$ docker run -it --cpus 2 --memory 1G openjdk:11-jdk
jshell> Runtime.getRuntime().availableProcessors()
@Voronenko
Voronenko / Readme.md
Last active December 4, 2020 09:27
Centos6 farewell

Centos 6 expired on 30th November 2020 You have to edit the CentOS-Base.repo to point to vault every where or set up a proxy to change the search to the vault Index of /6.10 https://vault.centos.org/6.10/

in the repo file change everywhere

name=CentOS-6.10 - Base
@Voronenko
Voronenko / .markdownlint.json
Last active December 2, 2020 08:38
Some monstrous pre-commit config
{
"default": true,
"line_length": false,
"no-bare-urls": false,
"no-inline-html": false
}
@Voronenko
Voronenko / HUAWEI_E3531.sh
Created November 18, 2020 08:00 — forked from elacheche/HUAWEI_E3531.sh
Little script to enable HUAWEI E3531 on Ubuntu
sudo apt-get update && sudo apt-get install usb-modeswitch && v=$(lsusb | grep "Huawei" | awk '{ print $6 }' | awk -F: '{ print $1 }'); p=$(lsusb | grep "Huawei" | awk '{ print $6 }' | awk -F: '{ print $2 }'); sudo usb_modeswitch -v $v -p $p -M '55534243123456780000000000000011062000000100000000000000000000'
@Voronenko
Voronenko / shell_graceful.sh
Last active November 13, 2020 15:15
Quite funny shell selection one liner - from best to ugly
sh -c zsh; if [ "$?" -eq "127" ]; then bash; if [ "$?" -eq "127" ]; then ash; if [ "$?" -eq "127" ]; then sh; fi; fi; fi
@Voronenko
Voronenko / Dockerfile
Last active November 6, 2020 19:59
Pairing session notes
FROM continuumio/miniconda3
ENV BASE_DIR /opt
ENV NOTEBOOKS_HOME ${BASE_DIR}/notebooks
ENV SPARK_HOME ${BASE_DIR}/spark
ENV PYSPARK_DRIVER_PYTHON ipython
ENV PATH ${SPARK_HOME}/bin:${SPARK_HOME}/sbin:${PATH}
# Python Packages
RUN conda update -n base conda && \
#!/usr/bin/env bash
# Credits to https://gist.github.com/nathan-muir/9c81eeaed9200d367ab227ccef13b602
# Get a local copy of the destination project state
cd project_dest
terraform state pull > remote.tfstate
# Move from the SRC project to the DEST project