Skip to content

Instantly share code, notes, and snippets.

View wsargent's full-sized avatar

Will Sargent wsargent

View GitHub Profile
@wsargent
wsargent / win10-dev.md
Last active March 21, 2024 04:27
Windows Development Environment for Scala

Windows 10 Development Environment for Scala

This is a guide for Scala and Java development on Windows, using Windows Subsystem for Linux, although a bunch of it is applicable to a VirtualBox / Vagrant / Docker subsystem environment. This is not complete, but is intended to be as step by step as possible.

Harden Windows 10

Read the entire Decent Security guide, and follow the instructions, especially:

@wsargent
wsargent / Directions for creating PEM files
Created August 1, 2018 18:03 — forked from dain/Directions for creating PEM files
Create Java KeyStore from standard PEM encoded private key and certificate chain files
# To regenerate the test key and certificates
# Generate an RSA private key and convert it to PKCS8 wraped in PEM
openssl genrsa 2048 | openssl pkcs8 -topk8 -inform pem -outform pem -nocrypt -out rsa.key
# Generate a certificate signing request with the private key
openssl req -new -key rsa.key -out rsa.csr
# Sign request with private key
openssl x509 -req -days 10000 -in rsa.csr -signkey rsa.key -out rsa.crt
@wsargent
wsargent / gist:1258640
Created October 3, 2011 07:46
Setting up a base vagrant box for Oracle
Install instructions for 10.2:
http://download.oracle.com/docs/cd/B19306_01/relnotes.102/b15666/toc.htm
http://download.oracle.com/docs/cd/B19306_01/install.102/b15667/toc.htm
[Required files]
10201_database_linux_x86_64.cpio.gz
10201_companion_linux_x86_64.cpio.gz
p6810189_10204_Linux-x86-64.zip
@wsargent
wsargent / docker_cheat.md
Last active August 31, 2023 12:10
Docker cheat sheet
package com.example
import com.tersesystems.echopraxia.api.{Condition => JCondition, _}
import com.tersesystems.echopraxia.plusscala.{DefaultLoggerMethods, Logger}
import com.tersesystems.echopraxia.plusscala.api.{FieldBuilder, _}
import scala.jdk.FunctionConverters.enrichAsJavaFunction
case class Foo(name: String, age: Int)
case class Bar(name: String, age: Int)
package fix
import scalafix.v1._
import scala.meta._
class RewriteToStructured extends SemanticRule("RewriteToStructured") {
override def fix(implicit doc: SemanticDocument): Patch = {
doc.tree.collect {
case logger@Term.Apply(Term.Select(loggerName, methodName), List(Term.Interpolate(Term.Name("s"), parts, args))) if matchesType(loggerName) =>
@wsargent
wsargent / deploy.sh
Created April 11, 2014 23:52 — forked from gre/deploy.sh
#!/bin/bash
REMOTE=play@SERVER_IP
REMOTE_APP=/home/play/PROJECT_NAME/
sbt stage || exit 1;
ssh $REMOTE "cd $REMOTE_APP; ./stop.sh";
rsync -va target/ $REMOTE:$REMOTE_APP/target
ssh $REMOTE "cd $REMOTE_APP; ./start.sh";
@wsargent
wsargent / Scala-Play-App-Docker-Deploy.md
Created July 15, 2016 00:21 — forked from IncludeSecurity/Scala-Play-App-Docker-Deploy.md
Deploying Scala Play Framework Applications on AWS Beanstalk using Docker containers
@wsargent
wsargent / genca.sh
Last active May 7, 2021 15:16
Generate a certificate authority and trust anchor keystore, using only keytool
#!/bin/bash
export PW=`cat password`
# Create a self signed key pair root CA certificate.
keytool -genkeypair -v \
-alias exampleca \
-dname "CN=exampleCA, OU=Example Org, O=Example Company, L=San Francisco, ST=California, C=US" \
-keystore exampleca.jks \
-keypass:env PW \