Skip to content

Instantly share code, notes, and snippets.

View gkhays's full-sized avatar

Garve Hays gkhays

View GitHub Profile
@gkhays
gkhays / Top 25 Science Fiction Books.md
Last active May 20, 2022 07:09
Picks for the top 25 science fiction books

The Best 25 Science Fiction Ever Written

(Updated January 2016)

  • Dune, by Frank Herbert
  • The Book of the New Sun, by Gene Wolfe
  • The Moon is a Harsh Mistress, by Robert A. Heinlein
  • The Dispossessed, by Ursula K Le Guin
  • Hyperion, by Dan Simmons
  • Neuromancer, by William Gibson
  • The Stars My Destination, by Alfred Bester
@gkhays
gkhays / .block
Last active May 12, 2022 13:25
Oscillating Sine Wave Rendered with JavaScript
license: cc-by-4.0
@gkhays
gkhays / PasswordMask.java
Last active January 6, 2022 07:13
How to mask a password when input from the console. Contains a work-around for running within Eclipse; see Eclipse bug #122429.
package org.gkh;
import java.io.BufferedReader;
import java.io.Console;
import java.io.IOException;
import java.io.InputStreamReader;
public class ConsoleUtil {
/**
@gkhays
gkhays / Java-Mail.md
Last active January 5, 2022 19:31
How to use JavaMail to send email via an SMTP server. I was recently working with a server component that allowed for scheduling reports, which included email notification. I wanted to isolate the email notification portion. Check. :)

JavaMail

SMTP test driver using JavaMail version 1.5.2.

# SSL/TLS port: 465
# Otherwise: 587
smtp.host=smtp.mail.yahoo.com
smtp.port=465
smtp.useSsl=true

Deploy VM to vSphere using Template

This is a minimal vSphere VM deployment using pysphere as the Ansible vsphere_guest would call it.

The pysphere clone function takes a string value for the target VM name and a dictionary of managed object references (MORs) for the rest. I also find it helpful to set the debug output file as the 4th argument.

from pysphere import VIServer, VIProperty, MORTypes
server = VIServer()
server.connect(server_properties['vcenter_host'], server_properties['vcenter_user'], p, trace_file="debug.txt")

Go Go Godzilla

image

@gkhays
gkhays / TestTimeStampUtils.java
Last active June 2, 2021 12:06 — forked from kristopherjohnson/TimestampUtils.java
Methods for generating ISO 8601 timestamps in Java/Android
package net.kristopherjohnson.util.test;
import static org.junit.Assert.*;
import java.util.Date;
import net.kristopherjohnson.util.TimestampUtils;
import org.junit.Before;
import org.junit.Test;
@gkhays
gkhays / Create-and-Test.md
Last active July 17, 2020 05:13
Empryion Cheat Sheet

Build and Test in the Same Game

  1. Create a New survival game with the W/V ENABLED.
  2. Load game, press ` or ~ (left of the 1 key)
  3. type these commands: gm (god mode fast fly speed)
    cm (creative building)
    im (item Menu (h))
    sbp (Spawn any blueprint) Start Building.
  4. for testing do these commands again:
@gkhays
gkhays / docker-maintenance.sh
Created August 23, 2016 19:32 — forked from macropin/docker-maintenance.sh
Docker Maintenance Script
#!/usr/bin/env bash
#
# Docker Cleanup / Update Script
#
# Usage Example:
# curl --silent https://gist.githubusercontent.com/macropin/3d06cd315a07c9d8530f/raw | bash -s rm-dangling
#
set -e
@gkhays
gkhays / DevOps Primer.md
Last active June 1, 2020 14:57
Getting started with DevOps

Dev Ops Primer

Develop Operations or DevOps is a discipline that bridges software development and IT operations.

Tools of the trade