Skip to content

Instantly share code, notes, and snippets.

@kcd83
kcd83 / Git-Import-SVN.ps1
Last active January 17, 2021 09:42 — forked from Gimly/Git-Import-SVN.ps1
Import a SVN repository into a Git repository, complete with branches and tags. Script inspired by the method described by StackOverflow answer http://stackoverflow.com/a/3972103/123597
Param(
[Parameter(Mandatory=$true, Position=1)]
[string]$SvnFolderPath,
[Parameter(Mandatory=$true, Position=2)]
[string]$TargetFolder,
[Parameter(Mandatory=$true, Position=3)]
[string]$GitUrl
)
git svn clone --stdlayout --no-metadata -A users.txt $SvnFolderPath "$TargetFolder-tmp"
@kcd83
kcd83 / docker_for_windows_terrform_apply_trace.log
Created August 15, 2018 02:16
Demo of Terraform sub-module bug inside Docker for Windows mounts
2018/08/15 02:09:10 [INFO] Terraform version: 0.11.7 41e50bd32a8825a84535e353c3674af8ce799161
2018/08/15 02:09:10 [INFO] Go runtime version: go1.10.1
2018/08/15 02:09:10 [INFO] CLI args: []string{"/bin/terraform", "apply"}
2018/08/15 02:09:10 [DEBUG] Attempting to open CLI config file: /root/.terraformrc
2018/08/15 02:09:10 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2018/08/15 02:09:10 [INFO] CLI command args: []string{"apply"}
2018/08/15 02:09:10 [TRACE] module source: "../modules/one"
2018/08/15 02:09:10 [TRACE] module source: "../modules/two"
2018/08/15 02:09:10 [TRACE] module source: "../one"
2018/08/15 02:09:10 [INFO] command: empty terraform config, returning nil
@kcd83
kcd83 / ansible_when_truthy_test.yml
Last active July 21, 2023 13:40
Test what vars evalute to true or false in Ansible 2.5
#!/usr/bin/env ansible-playbook
---
- name: Test truthiness
hosts: localhost
gather_facts: False
vars:
truthy_vars:
# TRUE
- True
- 1
@kcd83
kcd83 / gist:79030f14be869f4884d0
Last active August 29, 2015 14:01 — forked from tehranian/gist:7123269
Allow SSH on ports other than 22 and create the directory
#!/bin/bash
# High-performance, native SSH implementation for Jenkins SSH slaves. Jenkins'
# standard turn-key SSH slave implementation uses an embedded, "pure Java"
# implementation of SSH (https://github.com/jenkinsci/trilead-ssh2).
# That standard implementation combines all of the convenience of a pure Java
# implementation with all of the "performance" of a pure Java implementation :P
# If your distributed build process generates large build artifacts like ISOs,
# VM images, Vagrant boxes, etc, then you will see a substantial benefit from
@kcd83
kcd83 / encrypt_data_bag.rb
Created August 14, 2013 03:29
Standalone script for encrypting a json file data bag into an encrypted data bag for opscode chef .
#!/usr/bin/env ruby
if ARGV.length < 2
puts "usage: #{$0} databag.json new_encrypted_databag.json [encrypted_data_bag_secret]"
exit(1)
end
databag_file = ARGV[0]
out_file = ARGV[1]
if ARGV.length >= 3