Skip to content

Instantly share code, notes, and snippets.

@jameskyle
jameskyle / s3client.scala
Last active June 8, 2023 22:48
Dynamic bucket lookup and cross region copy object support.
import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider
import software.amazon.awssdk.regions.Region
import software.amazon.awssdk.services.s3.S3Client
import software.amazon.awssdk.services.s3.model.{S3Exception,CopyObjectRequest,CopyObjectResponse,HeadBucketRequest}
import scala.util.{Try,Success,Failure}
/**
Cross region copy object example with region code discovery for a bucket.
**/
@jameskyle
jameskyle / manual bonding configuration.sh
Created June 26, 2012 20:04
manual bonding configuration
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
@jameskyle
jameskyle / gitconfig
Created March 10, 2022 21:51
Aliasess and short cuts for git.
[user]
name = <name>
email = <email>
username = <username>
[color]
branch = auto
diff = auto
status = auto
[color "branch"]
@JsonIgnoreProperties(ignoreUnknown = true)
@Value
public class JsonExample {
@NonFinal
@JsonView(SerializedViews.Response.class)
boolean broken;
@NonFinal
@JsonView(SerializedViews.Response.class)
Boolean working;
#include <iostream>
using namespace std;
void overloaded(int a) {
cout << "This is an int: " << a << endl;
}
void overloaded(double a) {
cout << "This is a double: " << a << endl;
unbind-key C-b
set-option -g prefix C-s
bind-key C-s last-window
bind s send-prefix
# large history
set-option -g history-limit 100000
# enable mouse mode
library(caret)
set.seed(300)
wine.r <- read.csv('https://archive.ics.uci.edu/ml/machine-learning-databases/wine-quality/winequality-red.csv', sep=';')
wine.w <- read.csv('https://archive.ics.uci.edu/ml/machine-learning-databases/wine-quality/winequality-white.csv', sep=';')
wine.r$style <- "red"
wine.w$style <- "white"
@jameskyle
jameskyle / openssl.cnf.ini
Last active September 11, 2018 11:58
An openssl.cnf template for version >= 1.x
HOME =$ENV::HOME
RANDFILE =$ENV::HOME/.rnd
[ ca ]
default_ca =CA_default
[ CA_default ]
dir =$ENV::ROOT
certs =$dir
@jameskyle
jameskyle / certs.sh
Last active June 7, 2017 18:46
Generating CA, Server, & Client Certificates
#!/bin/bash
###############################################################################
# NOTICE: This script is intended to be used in conjunction with a openssl.cnf
# template such as this one:
# https://gist.github.com/jameskyle/8106d4d5c6dfa5395cef
# (C) Copyright 2014 James A. Kyle.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.