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 / bootstrap
Last active October 27, 2015 09:10
bootstrap
#!/bin/sh
#http://bit.ly/slavkobox
curl -sSL http://bit.ly/slavkodotfiles > bootstrap.sh && chmod +x bootstrap.sh && ./bootstrap.sh
curl -L http://bit.ly/voronenko | bash -s
@Voronenko
Voronenko / README.md
Created November 16, 2015 08:31 — forked from dnozay/_Jenkins+Script+Console.md
jenkins groovy scripts collection.
@Voronenko
Voronenko / backup-github.sh
Last active June 4, 2016 23:55 — forked from rodw/backup-github.sh
A simple script to backup an organization's GitHub repositories, wikis and issues. Especially useful, once you get errors like One of our mostly harmless robots has suspicions about your ### organization. Because of that, it’s hidden your organization from the public. If you’d like to have your ### organization reinstated, please contact support.
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files
GHBU_ORG=${GHBU_ORG-"<CHANGE-ME>"} # the GitHub organization whose repos will be backed up
# (if you're backing up a user's repos instead, this should be your GitHub username)
GHBU_UNAME=${GHBU_UNAME-"<CHANGE-ME>"} # the username of a GitHub account (to use with the GitHub API)
GHBU_PASSWD=${GHBU_PASSWD-"<CHANGE-ME>"} # the password for that account
GHBU_GITHOST=${GHBU_GITHOST-"github.com"} # the GitHub hostname (see comments)
GHBU_PRUNE_OLD=${GHBU_PRUNE_OLD-true} # when `true`, old backups will be deleted
###genm3uplaylist.sh
# Execute ./genm3uplaylist.sh SOURCE
# the output will be SOURCE.m3u
grep 'http' "$1" | sed 's/\t//' | tr -d '\r' | xargs -i curl -s -w '\n' {} | grep StreamUrl | sed 's/^[^[]*description/description/' | sed -r 's/(,"Logo").*//' | sed 's/,"broadcast".*,"StreamUrl":/,"StreamUrl":/' | sed -r 's/,"Premium.*//' | grep http | sed 's/","/\n/' | sed 's/description":"/#EXTINF:-1\ group-title="radio"\ radio="true",/' | sed 's/StreamUrl":"//' | sed 's/"$//' &gt; rawlist
grep 'http' rawlist | xargs -i curl -s -w '\n' {} | sed -r 's/^.*"(AAC|MP3)","Url": "//'| sed 's/",".*//' &gt; interm
cInterm=1
let "cRaw=1"
OUTPUT="${1}.m3u"
@Voronenko
Voronenko / configure_apcupsd
Created March 26, 2016 15:35 — forked from gschora/configure_apcupsd
configuring apcupsd to suspend all running VM and then shutdown the esxi 5.5 u1 host
###############################################################################################################
# these are instructions for automating the suspend and shutdown of esxi vm's and host in case of a
# power failure.
# works with apc smartups 750xl and esxi 5.5u1
###############################################################################################################
0# make a new VM and install Ubuntu-Server on it
1# install apcupsd
apt-get install apcupsd
@Voronenko
Voronenko / travis_build_trigger.sh
Created April 24, 2016 12:17
travis build trigger
#!/bin/bash
## References for triggering builds using Travis CI API
# https://docs.travis-ci.com/user/triggering-builds
# If any commands fail, we want the shell script to exit immediately.
set -e
# Verify input params
if [ "$#" -ne 3 ]; then
@Voronenko
Voronenko / swagger.yml
Created May 17, 2016 08:09
Basic swagger yml template
swagger: '2.0'
info:
title: title
description: description
version: 2.0.0
host: '--'
schemes:
- https
basePath: /v2
@Voronenko
Voronenko / Check requirements demo.sh
Created June 14, 2016 20:49
Portions of the script which checks software for presence
#!/bin/bash
set -e
# check requirements
REQS=( curl jq )
for REQ in ${REQS[@]}
do
which ${REQ} >/dev/null
@Voronenko
Voronenko / gitlab_get_last_artifact.sh
Created June 15, 2016 07:41
gitlab_get_last_artifact.sh
#!/bin/bash
# credits https://gitlab.com/morph027/gitlab-ci-helpers/blob/master/get-last-successful-build-artifact.sh
set -e
# don't forget to send ref
# BASE_URL=https://zzz.githost.io/
# PRIVATE_TOKEN=aaaaaaaa
# STAGE=build
# PROJECT=5
@Voronenko
Voronenko / gitlab_new_user.sh
Last active August 8, 2016 10:57
Gitlab New User
cd /home/git/gitlab && sudo -u git -H bundle exec rails console production
user = User.create(:username => 'user1',
:name => 'Test',
:password => '12345678',
:password_confirmation => '12345678',
:email => '[email protected]',
:admin => true)
user.save!