Simple collection of Groovy scripts to help me maintain some Jenkins systems.
See also https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Script+Console
| #!/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 |
Simple collection of Groovy scripts to help me maintain some Jenkins systems.
See also https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Script+Console
| #!/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/"$//' > rawlist | |
| grep 'http' rawlist | xargs -i curl -s -w '\n' {} | sed -r 's/^.*"(AAC|MP3)","Url": "//'| sed 's/",".*//' > interm | |
| cInterm=1 | |
| let "cRaw=1" | |
| OUTPUT="${1}.m3u" |
| ############################################################################################################### | |
| # 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 |
| #!/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 |
| swagger: '2.0' | |
| info: | |
| title: title | |
| description: description | |
| version: 2.0.0 | |
| host: '--' | |
| schemes: | |
| - https | |
| basePath: /v2 |
| #!/bin/bash | |
| set -e | |
| # check requirements | |
| REQS=( curl jq ) | |
| for REQ in ${REQS[@]} | |
| do | |
| which ${REQ} >/dev/null |
| #!/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 |
| 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! |