This file contains 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
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 { |
This file contains 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/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 |
This file contains 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
// === BEGIN === | |
[Unit] | |
Description=Datadog Agent | |
After=multi-user.target | |
[Service] | |
Type=idle | |
ExecStart=/the_path/.datadog-agent/bin/agent | |
Restart=always |
This file contains 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
# Stop all local containers | |
docker stop $(docker ps -a) | |
# Remove all local containers | |
docker rm $(docker ps -a -q) |
This file contains 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
# 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 |
This file contains 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
s := fmt.Sprintf("%.4f", 10/6.0)[0:5] |
This file contains 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
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() |
This file contains 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 ( | |
"archive/tar" | |
"bytes" | |
"io" | |
"log" | |
"os" | |
"github.com/blakesmith/ar" |
This file contains 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
[[ $_ == $0 ]] && echo "This script should probably be sourced." |
This file contains 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
# 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 "\$@" |
OlderNewer