Skip to content

Instantly share code, notes, and snippets.

View gravcat's full-sized avatar

Nick Thieling gravcat

View GitHub Profile
@gravcat
gravcat / art-api-deploy-item.sh
Last active March 22, 2016 23:27
artifactory deploy artifact example
curl --user username:password --upload-file "/home/user/path/to/file.zip" -H"X-Checksum-Sha1:1EFC9E5F84D4713CB7304625FE0CB2A1F39709A4" -H"X-Checksum-Md5:B32BB2F9317DCE938CC8A34742D4EF8D" -X PUT "https://yourartifactoryserver.com/artifactory/some-repository-local/exact/desired/path/file.zip"
@gravcat
gravcat / art-api-set-props.sh
Last active June 13, 2016 19:36
artifactory set properties example
curl -X PUT -u username:password "https://yourartifactoryserver.com/artifactory/api/storage/some-repository-local/exact/desired/path/file.zip?properties=foo=bar|a%20spaced%20%key=somevalue|version=1.2.3.4|someweird\=value=foo\=bar
@gravcat
gravcat / bamboo-agent
Created September 19, 2016 15:39 — forked from yatesr/bamboo-agent
Init script for starting/stopping a bamboo agent
#!/bin/bash
# bamboo-agent Init script for running bamboo agent
#
# chkconfig: 2345 98 02
#
# description: Starts and stops bamboo agent
# This is just a delegator to the Bamboo agent script.
USER=bamboo
AGENT_HOME=/home/$USER/bamboo-agent-home/bin
@gravcat
gravcat / bamboo-agent.sh
Created September 19, 2016 16:07
Bamboo agent service script which is unpacked by the remote agent jar found in Bamboo 5.9.3.
#! /bin/sh
#
# Copyright (c) 1999, 2006 Tanuki Software Inc.
#
# Java Service Wrapper sh script. Suitable for starting and stopping
# wrapped Java applications on UNIX platforms.
#
#-----------------------------------------------------------------------------
@gravcat
gravcat / check-linuxos.psm1
Created June 2, 2017 16:39
a powershell function to check whether or not you are running in a linux (or linux-like) environment. powershell on linux is a thing now
<# -----------------------------------------------------------------------------
Check-LinuxOS()
.Description
Check whether or not a host you are running from is Linux. WMI is not yet
available in the PowerShell alpha.
----------------------------------------------------------------------------- #>
function Check-LinuxOS {
$ErrorActionPreference = "SilentlyContinue" # Prevents stop when Windows explodes with uname call
@gravcat
gravcat / bootstrap-w10-orch.ps1
Last active September 25, 2017 05:23
get chocolatey pkg mgr to install openssh, then configure locally for sshd usage
<# -----------------------------------------------------------------------------
bootstrap_w10_orch.ps1
.Description
Get a Windows 10 box into a state where SSH is ready and available.
Also try to get Windows Subsystem for Linux (WSL) prepped and ready.
When run via CSE, this script is downloaded into:
C:\Packages\...
# to be run in any normal user-spawned powershell prompt
Start-Process powershell -Verb runas -argumentlist "& lxrun /install /y"
# must be run in administrator context
param (
[String] $path, # file or folder
[String] $perm, # fullcontrol, read, write, etc
[String] $action = "allow" #allow or deny
[String] $user
)
$arguments = $user, $perm, $action
#requires –runasadministrator
try
{
& choco -h
}
catch
{
# If chocolatey help wasn't available, invoke expression to install from Chocolatey.org
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
}
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#