Skip to content

Instantly share code, notes, and snippets.

View dbathgate's full-sized avatar

Darren Bathgate dbathgate

  • VMware Tanzu (by Broadcom)
  • New York
View GitHub Profile
@dbathgate
dbathgate / TAS_IWA_AD_SETUP.md
Last active December 18, 2023 20:22
Setup a gMSA to be used the Integrated Windows Auth (IWA) feature of Tanzu Application Service (TAS)

Create Kds Root key that's active immediately

Add-KdsRootKey -EffectiveTime (Get-Date).AddHours(-10)

Create an AD group to associate gMSA and user to

New-ADGroup -Name "Tas01 Authorized Accounts" -SamAccountName "Tas01Accounts" -GroupScope DomainLocal
# Setup Swap space
mkswap /dev/sda1
swapon /dev/sda1
# Format and mount root volume
mkfs.ext4 /dev/sda2
mount /dev/sda2 /mnt
# Install arch packages (base and base-devel)
pacstrap /mnt base base-devel
@dbathgate
dbathgate / flannel-and-etcd-with-docker.sh
Last active April 20, 2021 18:39
Basic flannel and etcd setup
#!/bin/bash
###### Install and run Etcd #############
curl --location https://github.com/coreos/etcd/releases/download/v3.1.5/etcd-v3.1.5-linux-amd64.tar.gz | tar -xz
cp etcd-v3.1.5-linux-amd64/etcd /usr/local/bin/
cp etcd-v3.1.5-linux-amd64/etcdctl /usr/local/bin/
mkdir /var/lib/etcd
@dbathgate
dbathgate / disk-speed-tests.sh
Last active January 29, 2017 19:48
Disk Speed Tests
# Writes
nohup dd if=/dev/zero of=/disk1/file.bin bs=5G count=1 oflag=direct </dev/null > disk1.out &
nohup dd if=/dev/zero of=/disk2/file.bin bs=5G count=1 oflag=direct </dev/null > disk2.out &
#Reads
sync ; echo 3 > /proc/sys/vm/drop_caches
nohup dd if=/disk1/file.bin of=/dev/null bs=8k </dev/null > disk1_read.out &
nohup dd if=/disk2/file.bin of=/dev/null bs=8k </dev/null > disk2_read.out &
@dbathgate
dbathgate / HadoopWithKerberosAuthentication.java
Created October 21, 2016 03:08
Authenticating to Hadoop with Kerberos and accessing HDFS files in Java
import java.io.IOException;
import org.apache.commons.io.IOUtils;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.LocatedFileStatus;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.RemoteIterator;
import org.apache.hadoop.hdfs.DistributedFileSystem;
import org.apache.hadoop.security.UserGroupInformation;
@dbathgate
dbathgate / vpc-ip-address-to-container-amazon.sh
Last active July 7, 2022 14:13
Assign VPC addresses to Docker containers associated as secondary IP addresses to an ENI in AWS
# Description: How to assign VPC addresses to Docker containers associated as secondary IP addresses to an ENI in AWS
# Operating System: Amazon Linux AMI 2016.09.1 (HVM)
# Prerequisites:
# - Assign N number of secondary IP addresses to network interface on Docker host
# - Each new container requires additional assignment of secondary IP addresses
# - Containers can be launched with --net=none to avoid adding a Docker networked NIC (docker run --net=none -d imageId)
# Credit to https://github.com/jpetazzo/pipework for steps on linking IP address
################# Setup Bridge of eth0 ######################
yum install bridge-utils -y
@dbathgate
dbathgate / install-scylla-on-aws-with-dpdk.sh
Last active March 29, 2023 12:44
Installing ScyllaDB in AWS with DPDK enabled
# Installing ScyllaDB in AWS with DPDK enabled
# Prerequisites:
# - Red Hat Enterprise Linux 7.2 (HVM)
# - Instance type that supports enhanced networking (see http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/enhanced-networking.html#enhanced_networking_instance_types)
# - Secondary NIC installed via Network Interfaces in AWS
# - Instance type with 2 hard drives for RAID0 array
########## DO THIS FIRST ################
# Fetch the latest linux kernel
yum update -y
@dbathgate
dbathgate / quick-install-scylla-aws.sh
Last active March 25, 2019 02:29
Installing ScyllaDB cluster in AWS with RAID0 array
# Installing ScyllaDB cluster in AWS with RAID0 array
# Prerequisites:
# - CentOS 7 (x86_64) with Updates HVM (available on AWS Marketplace)
# - Instance type with 2 hard drives for RAID0 array
SEED="10.0.0.11"
CLUSTER_NAME="Scylla Cluster"
PRIVATE_IP=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4)
######### Create RAID0 Array ############
@dbathgate
dbathgate / quick-install-cassandra-aws.sh
Last active August 25, 2016 14:38
Installing Cassandra 2.1.x cluster in AWS with RAID0 array
# Installing Cassandra 2.1.x cluster in AWS with RAID0 array
# Prerequisites:
# - CentOS 7 (x86_64) with Updates HVM (available on AWS Marketplace)
# - Instance type with 2 hard drives for RAID0 array
CLUSTER_NAME="Drb Cluster"
SEED="10.0.0.11"
PRIVATE_IP=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4)
######### Create RAID0 Array ############
@dbathgate
dbathgate / simple-install-scylla-aws.sh
Last active June 28, 2022 09:04
Quick start install of ScyllaDB for Amazon Web Services
# Quick start install of ScyllaDB for Amazon Web Services
# Tested using AMI 'CentOS 7 (x86_64) with Updates HVM' available on the AWS Marketplace
# Script should be run as 'root' user
# Need a file system formatted in XFS
# Assumes device is set to '/dev/xvdb'
umount /dev/xvdb
mkfs.xfs -f -K /dev/xvdb
mkdir /var/lib/scylla
mount /dev/xvdb /var/lib/scylla