Skip to content

Instantly share code, notes, and snippets.

View rms1000watt's full-sized avatar

Ryan M Smith rms1000watt

View GitHub Profile
@rms1000watt
rms1000watt / install-nvidia-docker-ubuntu-16.04
Last active June 27, 2018 14:38
Install Cuda + Docker + Nvidia Docker on Ubuntu 16.04
#!/usr/bin/env bash
# https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#verify-you-have-cuda-enabled-system
# https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#ubuntu-installation
# https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=debnetwork
# https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions
# https://docs.docker.com/install/linux/docker-ce/ubuntu/
# https://github.com/NVIDIA/nvidia-docker
echo "Install gcc"
@rms1000watt
rms1000watt / main.go
Created June 22, 2018 17:57
Generate and Test OpenSSL DNS SAN on Linux in Golang
package main
import (
"fmt"
"net/http"
)
func mainHandler(w http.ResponseWriter, r *http.Request) {
fmt.Println("Success 1")
w.Write([]byte("Success 2"))
@rms1000watt
rms1000watt / go_http_client_test.go
Last active June 22, 2018 16:46
Golang HTTP Client Test
// Courtesy of: https://stackoverflow.com/a/37549527/2330648
package main
import (
"net/http"
"net/http/httptest"
"testing"
)
@rms1000watt
rms1000watt / list-ip-addresses-on-local-network.sh
Created June 21, 2018 15:01
List IP Addresses on Local Network
arp -a
@rms1000watt
rms1000watt / ssh-with-password-or-key-only.sh
Last active August 10, 2018 21:28
SSH with Password Only or with Key Only
# Password only
ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no [email protected]
# Key only
ssh -o IdentitiesOnly=yes -i ~/.ssh/server.key [email protected]
@rms1000watt
rms1000watt / encrypt-pdfs.py
Created June 12, 2018 15:51
Encrypt PDFs with Python PyPDF2
#!/usr/bin/env python3
import os
import glob
import getpass
import argparse
from PyPDF2 import PdfFileWriter, PdfFileReader
@rms1000watt
rms1000watt / compose-k8s.sh
Created May 11, 2018 21:15
Convert Docker-Compose config to Kubernetes config and connect to private AWS ECR repo
# Install everything
brew install kompose kubectl
brew cask install minikube virtualbox
# Start minikube
minikube start
# Convert
kompose convert -o k8s.yml
@rms1000watt
rms1000watt / readme.md
Last active September 26, 2018 20:25
bash interview questions
@rms1000watt
rms1000watt / Dockerfile
Created May 3, 2018 17:55
Docker In Docker Proper
FROM docker:18.03.0-ce-dind
COPY . /work
WORKDIR /work
RUN apk add -U bash git python jq openssl util-linux apache2-utils gettext curl py2-pip && \
pip install awscli docker-compose
ENTRYPOINT ["/work/entrypoint.sh"]
@rms1000watt
rms1000watt / bash-in-docker-for-mac.sh
Created April 30, 2018 20:57
bash in docker for mac
docker run -it --rm --privileged --pid=host justincormack/nsenter1