Skip to content

Instantly share code, notes, and snippets.

View daveneeley's full-sized avatar

Dave Neeley daveneeley

  • Salt Lake City, UT
View GitHub Profile
@daveneeley
daveneeley / gist:1603849
Created January 12, 2012 23:44 — forked from Porges/gist:1603793
Repro for StackOverflow #8609110
using System;
using System.ComponentModel;
using System.Diagnostics.Contracts;
using System.Linq.Expressions;
namespace ConsoleApplication
{
class MyViewModel<T> : INotifyPropertyChanged
{
/// <summary>
@daveneeley
daveneeley / console
Created June 3, 2015 18:50
Setting up a configuration profile for smtp
$ salt 'minion' smtp.send_msg '[email protected]' 'test message' profile='my_smtp_profile'
minion:
The minion function caused an exception: Traceback (most recent call last):
File "C:\salt\bin\lib\site-packages\salt\minion.py", line 1142, in _thread_return
return_data = func(*args, **kwargs)
File "C:\salt\bin\lib\site-packages\salt\modules\smtp.py", line 93, in send_msg
server = creds.get('smtp.server')
AttributeError: 'str' object has no attribute 'get'
$ salt 'minion' config.option my_smtp_profile -l all
@daveneeley
daveneeley / apache.sls
Created March 22, 2016 23:09
Use salt to install apache webserver from http://www.aixtools.net/index.php/httpd-2.2
download_bundle:
file.managed:
- name: /tmp/aixtools/aixtools.asf.httpd-2.2.bundle.tar.bz2
- source: http://download.aixtools.net/tools/asf/aixtools.asf.httpd-2.2.bundle.tar.bz2
- source_hash: sha256=837fb885c8de4755dac88bd7f11558e60b5bd21bc01b8758259b43737b844ea2
- makedirs: true
extract_bundle:
cmd.run:
- name: 'bzip2 -dc aixtools.asf.httpd-2.2.bundle.tar.bz2 | tar xf -'
@daveneeley
daveneeley / AddNewSPM.sh
Created September 1, 2017 19:04
Manage Salt Package Manager (spm) packages with Artifactory (POC)
##First download all existing packages to downloaded_spms.
##I'm doing this in a TeamCity build step.
##The packages themselves are in Artifactory.
if [ -d /srv/spm_build ]; then
rm -rf /srv/spm_build;
fi
spm create_repo downloaded_spms
spm build <formula name>
mv /srv/spm_build/*.spm downloaded_spms
#I believe this perl script can be excluded in newer salt versions because of https://github.com/saltstack/salt/pull/39434
@daveneeley
daveneeley / Vagrantfile
Last active November 9, 2017 19:01
vagrant + powershell + rsync + maybe hyperv
Vagrant.configure(2) do |config|
config.vm.box = "centos/7"
config.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__exclude: ".git"
end
@daveneeley
daveneeley / jfrog-cli-promote-baseline.ps1
Created May 14, 2019 00:01
Show that Artifactory jfrog-cli creates duplicate buildinfos and only the most recent can be used later
#this script proves that files that are uploaded by jfrog-cli will be promoted
#when there are no duplicate buildinfos
param (
$serverId,
$sourceRepo = "duplicate-buildinfos-source",
$promoteRepo = "duplicate-buildinfos-promote",
$buildName = "duplicate-buildinfos-build",
$buildNumber = (get-date -Format yyyyMMddss),
$repoPath = "$sourceRepo/$buildName/$buildNumber/"
)
@daveneeley
daveneeley / README.md
Last active July 1, 2019 22:25
jfrog-cli parallel download failure under ant on windows server

This gist sets up a problem reproduction with jfrog-cli on Windows Server 2012. See jfrog/jfrog-cli#407

  • Set up java and ant with scoop.sh or chocolatey
  • Download build.xml, installers.json, and documentation.json files to an empty directory
  • set environment variable ARTIFACTORY_URL to your artifactory instance
  • set environment variable ARTIFACTORY_API_KEY to your api key
  • run /path/to/ant from the directory containing the downloaded files
@daveneeley
daveneeley / valgrind_output_on_continue_with_v0.20.0
Last active July 5, 2019 18:04
git_filter + libgit2 valgrind output
valgrind --leak-check=full -v --track-origins=yes /path/to/git_filter/git_filter control.cfg continue
==30710== Memcheck, a memory error detector
==30710== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==30710== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==30710== Command: /path/to/git_filter/git_filter control.cfg continue
==30710==
--30710-- Valgrind options:
--30710-- --leak-check=full
--30710-- -v
--30710-- --track-origins=yes
@daveneeley
daveneeley / Bot.js
Last active May 5, 2020 01:35
Babel typeof recursion error with require and export
/* global require */
/* instanbul ignore next */
if (typeof(require) !== undefined) {
var Chat = require('./Help.js')['default'];
}
var Bot = {
onMessage: function(event) {
return "someaction"
}
};
@daveneeley
daveneeley / main.tf
Created March 18, 2023 12:35
Failed Retry on GET before PUT with terraform-provider-azapi
// This terraform script attempts to create function API Keys
// against an empty windows function app with no code deployed.
// WARNING: the script will print function keys to stdout for testing.
//
// The script fails the first time, but succeeeds the second time.
//
// The error is like the following. It occurs for both the primary and staging slots.
// The error states that GET is not allowed (presumably because the resource is new?).
// However, there is no GET method configured in this code.
//