Skip to content

Instantly share code, notes, and snippets.

Build systems for people, not only for money

Daniil Yaroslavtsev daniilyar

Build systems for people, not only for money
Block or report user

Report or block daniilyar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
daniilyar / BOINC_Rosetta_home_Ubuntu_18
Last active Feb 15, 2020
How to install BOINC and start calculating for Rosetta@home on Ubuntu 18.04 LTS
View BOINC_Rosetta_home_Ubuntu_18
sudo -i
# install dependencies:
apt -qqy update && apt install -y --auto-remove libsm6 libxext6 libnotify-bin libcurl3 && apt -qqy clean
# Install BOINC:
cd /opt
wget -q -O
chmod ugo+x && ./ # Will print 'use /opt/BOINC/run_manager to start BOINC'
daniilyar / script.groovy
Last active Jul 16, 2019
Jenkins groovy script: get all builds started during a specific time
View script.groovy
// This example lists all job that were started on Jul 16, 2019 between 1:20 PM and 2:30 PM
String df = 'MMM dd, yyyy h:mm a'
long startTimestamp = Date.parse(df, 'Jul 16, 2019 1:20 PM').getTime()
long endTimestamp = Date.parse(df, 'Jul 16, 2019 2:30 PM').getTime()
Jenkins.instance.getAllItems(AbstractItem.class).each {
builds = it.getBuilds().byTimestamp(startTimestamp, endTimestamp)
if(!builds.isEmpty()) {
daniilyar /
Last active Jun 1, 2019
Script for refreshing the ECR secret in all Kubernetes namespaces
HELP_MSG="This script read the AWS credentials from the execution environment, get the docker-login scring by the AWS-CLI utility, creates the k8s secret with
this docker-login and add it as a a part of "imagePullSecrets" option to the 'default' serviceaccounts in all k8s namespaces.\n
Available arguments: '-s' for the name of the ECR secret will add, '-p' for the patchstring, '-h' for this message."
while getopts :r:p:s:a:h: option
case "${option}"
daniilyar /
Created May 16, 2019
AWS ECR token refresh script
HELP_MSG="This script read the AWS credentials from the execution environment and does the docker-login via the AWS-CLI utility.\n
Available arguments: '-s' for the name of the ECR secret will add, '-p' for the profile, '-h' for this message."
while getopts :r:p:h: option
case "${option}"
daniilyar / find_unused_jobs.groovy
Last active Apr 22, 2019
Jenkins Groovy script to find unused jobs. Unused means 'not built for more than X days'
View find_unused_jobs.groovy
import jenkins.model.Jenkins
import jenkins.model.JenkinsLocationConfiguration
String jobNameRegexp = ".*"
long maxThresholdDays = 30; // days
boolean ignoreDisabledJobs = true
def getLastBuildTime(Job job) {
def lastBuild = job.getLastBuild()
if(lastBuild == null) {
daniilyar / give-ssh.txt
Last active May 7, 2019
How to give me an SSH access to your Debian machine
View give-ssh.txt
sudo -i
apt-get -y install curl
useradd dyaroslavtsev -m -d /home/dyaroslavtsev -s /bin/bash
echo "dyaroslavtsev ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
mkdir -p /home/dyaroslavtsev/.ssh
curl -sL > /home/dyaroslavtsev/.ssh/authorized_keys
chown -R dyaroslavtsev:dyaroslavtsev /home/dyaroslavtsev
View public key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeh9PfEk8w+uEfw5Om4vkGVAaYG8G1NSDCwi13i8XYY8xlMFPHMtu+Wo9hmndvJmZAGEa2nMdhRZL0HxL+YQUWlScWnfz5CSh30di3vdojWBHPGbb4aTQm3UuxJHUuwoPeN79UUshW2RPcX7Mv+9RIU1sCc0YDYAsmbtpOrZ3YZMtQXxp87lv865voAbkoA+/SEDf6hVRFvOM8+qVajIrkCRGkXe2yEsJFNn2enTcxb3MveLGPZZeqiXGohDmn7JKl4NpMpmAGDeugeSWdJuzRtN/c8wKvxLZ6sPqp1sCctIvfsq85vKx3G5zcfjNvQ1xRyXDgtpfIngtkTmt5XZvV
View ES template for Spark metrics
"order": 0,
"template": "metrics-spark-*",
"settings": {
"index": {
"number_of_shards": "3",
"number_of_replicas": "1",
"refresh_interval": "15s"
daniilyar /
Last active Nov 16, 2019
AWS: check if there is no orphaned EBS snapshots (orphaned == not attached to any 'available' AMI)
set -e
daniilyar /
Created May 4, 2016
AWS: check if all reserved instances are in use by appropriate on-demand ones
set -e
RUNNING_INSTANCES=`aws ec2 describe-instances --region $REGION --filters Name=instance-state-name,Values=running --query Reservations[*].Instances[*].InstanceType --output text | sort | uniq -c | awk ' { t = $1; $1 = $2; $2 = t; print; } '`
# Example:
#m3.medium 11
#r3.large 3
You can’t perform that action at this time.