Skip to content

Instantly share code, notes, and snippets.

View stamler's full-sized avatar

Dean Stamler stamler

View GitHub Profile
#!/bin/bash
# Create the env
conda create --name ml
conda activate ml
conda install -c apple tensorflow-deps
# versions matter. confirm here
# https://developer.apple.com/metal/tensorflow-plugin/
pip install tensorflow-macos==2.9.0
@stamler
stamler / install_splunk.sh
Created December 10, 2014 21:17
Install Splunk Enterprise 6.2 on CentOS 7 Minimal as a non-root user systemd service and enable syslog on port 514 and http on port 80
#!/bin/bash
# Install Splunk 6.2 on CentOS 7 as a non-root user service that runs on boot with
# systemd. This script also opens the firewall to allow syslog on UDP port 514. Since
# we're running Splunk as non-root, this port is then forwarded to 5514. Configuring a
# syslog input in slunk on UDP 514 will gather this data. Must be run as root
# Create Account
useradd splunk
groupadd splunk
@stamler
stamler / 47_complex_cube_root.go
Created August 6, 2013 19:01
Exercise 47 (Complex Cube Root) from tour.golang.org
package main
import "fmt"
import "math/cmplx"
// #47, Complex cube roots
// Cbrt returns a complex128 that is the cube
// root of its lone argument
func Cbrt(x complex128) complex128 {
z := 1.0 + 0i
@stamler
stamler / 43_fibonacci_closure.go
Created August 6, 2013 19:00
Exercise 43 (Fibonacci Closure) from tour.golang.org
package main
import "fmt"
// #43, A Fibonacci closure
// fibonacci is a function that returns
// a function that returns an int.
func fibonacci() func() int {
x, y := 1, 0
return func() int {
@stamler
stamler / 40_maps_exercise.go
Created August 6, 2013 18:59
Exercise 40 (Maps) from tour.golang.org
package main
import (
"code.google.com/p/go-tour/wc"
"strings"
)
// #40: Maps Exercise
func WordCount(s string) map[string]int {
output := make(map[string]int)
@stamler
stamler / 35_slices_exercise.go
Created August 6, 2013 18:58
Exercise 35 (Slices) from tour.golang.org
package main
import "code.google.com/p/go-tour/pic"
// #35 Slices Exercise
func Pic(dx, dy int) [][]uint8 {
result := make([][]uint8, dy)
for i := range result {
result[i] = make([]uint8, dx)
for j := range result[i] {