Warning! This doc is pretty outdated, I'm rewriting it right now and I'll update this as soon as it's done.
First, install the Go compiler from Google's Go Website: https://golang.org/dl/
func main() { | |
var jsonBuffer = []byte(`{"my_key":"My Value."}`) | |
req, _ := http.NewRequest("POST", "http://api.mycompany.com", bytes.NewBuffer(jsonBuffer)) | |
req.Header.Set("Content-Type", "application/json") | |
client := &http.Client{} | |
resp, err := client.Do(req) | |
if err != nil { |
First, install the Go compiler from Google's Go Website: https://golang.org/dl/
#!/bin/sh | |
# Starts a bash within a container running on Kubernetes while initializing | |
# the terminal type to xterm and the size to your actual terminal size. Makes | |
# it possible to have vi, more, etc work in a usable way until PR #25273 is | |
# merged. Derived from a snip by Hubert Chen (https://github.com/hubt) | |
if [ "$1" = "" ]; then | |
echo "Usage: kbash.sh {pod} [container]" | |
exit 1 | |
fi |
# Python code sample to listen to TCP multicast traffic on | |
# port 67 (?), which should be traffic destined to a DHCP server | |
# that will listen to multicast on that port. | |
# Tested on OSX. | |
import socket | |
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) | |
# Next line might or might not work, depending on your platform. |
# This bashrc is aimed at clustered CoreOS marchines running on | |
# VMware. It will display the IP of the ens192 VMware interface | |
# in the prompt, which is useful to identify the host in a cattle | |
# type cluster. | |
if [[ $- != *i* ]] ; then | |
# Shell is non-interactive. Be done now! | |
return | |
fi |
// === BEGIN === | |
[Unit] | |
Description=Datadog Agent | |
After=multi-user.target | |
[Service] | |
Type=idle | |
ExecStart=/the_path/.datadog-agent/bin/agent | |
Restart=always |
# Stop all local containers | |
docker stop $(docker ps -a) | |
# Remove all local containers | |
docker rm $(docker ps -a -q) |
# To disable WiFi and Bluetooth on a Raspberry Pi 3, there is | |
# no other way (yet) than to add this file to the modprobe.d | |
# folder (/etc/modprobe.d/raspi-blacklist.conf) | |
# Prevents WiFi: | |
blacklist brcmfmac | |
blacklist brcmutil | |
# Prevents Bluetooth: | |
blacklist btbcm |
import "github.com/briandowns/spinner" | |
someSillySet := []string{"🐶", "🐱", "🐭", "🐹", "🐰", "🐻", "🐼", "🐨", "🐯", "🦁"} | |
s := spinner.New(someSillySet, 100*time.Millisecond) | |
// or | |
s := spinner.New(spinner.CharSets[9], 75*time.Millisecond) | |
s.Start() | |
defer s.Stop() |
# Insightful instructions, originally posted by Xynova (https://github.com/xynova) | |
# Make socat directories | |
mkdir -p /opt/bin/socat.d/bin /opt/bin/socat.d/lib | |
# Create socat wrapper | |
cat << EOF > /opt/bin/socat | |
#! /bin/bash | |
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/opt/bin | |
LD_LIBRARY_PATH=/opt/bin/socat.d/lib:$LD_LIBRARY_PATH exec /opt/bin/socat.d/bin/socat "\$@" |