This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] { |