Skip to content

Instantly share code, notes, and snippets.

View rms1000watt's full-sized avatar

Ryan M Smith rms1000watt

View GitHub Profile
@markuskont
markuskont / Vagrantfile
Last active December 28, 2023 03:42
Set up basic cuda/tensorflow/gpuR env with vagrant-libvirt and vfio pci-passthrough
# -*- mode: ruby -*-
# vi: set ft=ruby :
LIBVIRT_POOL = 'fast'
Vagrant.configure("2") do |config|
config.vm.box = "generic/ubuntu1604"
config.vm.synced_folder ".", "/vagrant", type: "nfs", nfs_udp: false
#config.vm.synced_folder "../../datastore/spindle/ML/datasets/", "/mnt", type: "nfs", nfs_udp: false
config.vm.network "private_network", :dev => "br0", :mode => 'bridge', :ip => "192.168.17.25"
@macco-chewy
macco-chewy / InstallHashicorpPackerOnCentOS.md
Last active January 6, 2018 01:13
Installation Instructions for Packer on CentOS - Easy but with one caveat

Introduction

I was introduced to Packer by one of my coworkers, @rms1000watt, while describing my setup at home. I have a SMB network full of various appliance servers running as VMs on an ESXi server. Since I'm not a datacenter brimming with the cash to pay for vCenter or Puppet premium recipes I've been hand-rolling my VMs. But, NO LONGER!!! Enter Packer (and Terraform, et cetera).

Install It!

The details for installation are covered at https://www.packer.io/intro/getting-started/install.html. Just download your flavor, unzip, and move the binary to your folder of choice. I chose /usr/local/bin/packer.

The Caveat

Turns out all Redhat-based distros (maybe all distros?) with cracklib installed already have a binary called packer. So, if you get an error running packer similar to the following...

@BretFisher
BretFisher / docker-for-mac.md
Last active April 26, 2024 09:38
Getting a Shell in the Docker Desktop Mac VM

2021 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1


### autoscale.tf
data "template_file" "userdata" {
template = "${file("templates/userdata.tpl")}"
vars {
region = "${var.region}"
file_system_id = "${aws_efs_file_system.prod-efs.id}"
}
}
resource "aws_launch_configuration" "mig5-prod-lc" {
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active March 6, 2024 18:14
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@ericflo
ericflo / proxy.go
Last active April 17, 2024 21:27
Golang TCP Proxy
package proxy
import (
"io"
"net"
"sync"
log "github.com/Sirupsen/logrus"
)