Skip to content

Instantly share code, notes, and snippets.

Avatar

Dave Neeley daveneeley

  • Salt Lake City, UT
View GitHub Profile
@daveneeley
daveneeley / Bot.js
Last active May 5, 2020
Babel typeof recursion error with require and export
View Bot.js
/* global require */
/* instanbul ignore next */
if (typeof(require) !== undefined) {
var Chat = require('./Help.js')['default'];
}
var Bot = {
onMessage: function(event) {
return "someaction"
}
};
@daveneeley
daveneeley / valgrind_output_on_continue_with_v0.20.0
Last active Jul 5, 2019
git_filter + libgit2 valgrind output
View valgrind_output_on_continue_with_v0.20.0
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 / README.md
Last active Jul 1, 2019
jfrog-cli parallel download failure under ant on windows server
View README.md

This gist sets up a problem reproduction with jfrog-cli on Windows Server 2012. See https://github.com/jfrog/jfrog-cli/issues/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 / jfrog-cli-promote-baseline.ps1
Created May 14, 2019
Show that Artifactory jfrog-cli creates duplicate buildinfos and only the most recent can be used later
View jfrog-cli-promote-baseline.ps1
#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 / Vagrantfile
Last active Nov 9, 2017
vagrant + powershell + rsync + maybe hyperv
View Vagrantfile
Vagrant.configure(2) do |config|
config.vm.box = "centos/7"
config.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__exclude: ".git"
end
@daveneeley
daveneeley / AddNewSPM.sh
Created Sep 1, 2017
Manage Salt Package Manager (spm) packages with Artifactory (POC)
View AddNewSPM.sh
##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
View apache.sls
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 / console
Created Jun 3, 2015
Setting up a configuration profile for smtp
View console
$ salt 'minion' smtp.send_msg 'user2@myserver.com' '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 / gist:1603849
Created Jan 12, 2012 — forked from Porges/gist:1603793
Repro for StackOverflow #8609110
View gist:1603849
using System;
using System.ComponentModel;
using System.Diagnostics.Contracts;
using System.Linq.Expressions;
namespace ConsoleApplication
{
class MyViewModel<T> : INotifyPropertyChanged
{
/// <summary>
You can’t perform that action at this time.