Skip to content

Instantly share code, notes, and snippets.

View jbaruch's full-sized avatar
🎩
DevRel all the way

Baruch Sadogursky jbaruch

🎩
DevRel all the way
View GitHub Profile
@okunishinishi
okunishinishi / Remove all git tags
Created March 8, 2014 03:12
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
@hgomez
hgomez / upload2bintray.sh
Last active March 24, 2017 08:58
Sample script to upload RPM package to bintray
#!/bin/sh
#
# You should define BINTRAY_ACCOUNT and BINTRAY_APIKEY here or from the outside
# BINTRAY_ACCOUNT is you Bintray account and BINTRAY_APIKEY, API Key generated under your Bintray profile
# Redefine following variables to match your own usage
RPMS_DIR=RPMS/noarch
BINTRAY_ACCOUNT=hgomez
BINTRAY_REPO=devops-incubator-rpm
@sbates
sbates / cksum.rb
Last active December 10, 2015 08:19
using the artifactory plugin for generating sha256 checksums, I then wrote some provider code to figure it out on the fly. This keeps chef from having to download all the artifacts first and calculate their checksums; this really speeds up chef runs on slow network days and cuts down on the number of things downloading from our Artifactory server.
# Once we've made our custom calls to artifactory, we can use the built-in chef resource for remote_file to actually fetch the artifact
def download(remote_file_url)
# construct the filename and destination for remote file
remote_file_name = "#{new_resource.name}-#{new_resource.version}.#{new_resource.filetype}"
remote_file_destination = new_resource.artifact_target || ::File.join(Chef::Config[:file_cache_path], remote_file_name)
# construct the remote_file source
sha256_cksum = get_checksum(remote_file_url, "sha256")
Chef::Log.debug("checking sha256 checksum for #{new_resource.name}:#{sha256_cksum.inspect}")