Skip to content

Instantly share code, notes, and snippets.

View millerjp's full-sized avatar

Johnny Miller millerjp

View GitHub Profile

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@millerjp
millerjp / sstable_load.sh
Created March 14, 2016 19:23
wrapper for sstableloader to load one file at a time, rename and moved completed to directory
#!/bin/bash
#This is the directory that teh sstables will be palce into load - the table name is also going to be changed from v2 to v4
WORKING_DIR=/somecompany/cassandra/data/sstable_loading_dir/someks/sometable_v4
COMPLETED_DIR=/somecompany/cassandra/data/sstable_completed_dir
mkdir -p $COMPLETED_DIR
mkdir -p $WORKING_DIR
rm -rf $WORKING_DIR/*
@millerjp
millerjp / nativeReport.sh
Last active March 11, 2016 09:47
Workout and count which hosts are connecting on the cassandra native port
#!/bin/bash
# Scipt to count connected hosts on port, preform nslookup of hosts and output details
#
HOSTNAME=`hostname`
PORT=$1
IP_HOSTS_COUNT=`netstat -tn | 'next unless(/^tcp\s+\d+\s+\d+\s+\S+?:${PORT}\s+(\S+)?:/); print "$1\n";' | sort | uniq -c | awk '{print "tohost\t",$1,"\t"$2,"\tfromhost\n"}'`
while read -r line; do
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
@millerjp
millerjp / disk-setup.sh
Last active September 15, 2015 08:54 — forked from tobert/disk-setup.sh
#!/bin/bash
# DANGER: ALL DATA WILL BE DELETED
# assumes disk order is consistent
# [email protected] 2015-05-09
export PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
die () { echo "FATAL: $*"; exit 1; }
@millerjp
millerjp / gist:58495a4b0f09890ec273
Last active August 29, 2015 14:22
After replacing trackpad on W540, add this to /usr/share/X11/xorg.conf.d/20-thinkpad.conf on Mint 17.1 to get middle button scrolling working
Section "InputClass"
Identifier "Touchpad/TrackPoint"
MatchProduct "PS/2 Generic Mouse"
MatchDriver "evdev"
Option "EmulateWheel" "1"
Option "EmulateWheelButton" "2"
Option "Emulate3Buttons" "0"
Option "XAxisMapping" "6 7"
Option "YAxisMapping" "4 5"
EndSection
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCY71NBkMacD4iWj659MJGLlXNwQSh0cphqRTVDT15q2P/L0tPpsb1CW0WyBC43UqVDHq0ndULglJCuRzw4HiGdpT9kQrxXPh2sXHBpQ1DWaZiWIE0a+Sw8u5BebCvZggjzvxxScIPqdf9JEy/EpjhMsjn8DGNjeJ8kCfeGME6c5AS7TDoAuLIkAK6RBNtyuRFN7ppHEpCfgpE8LgcO6lU7FIiZjfYvFvndpOH/GMgbJ0ag6uapS1J4TpbdIrQK1GmkaM69kIGtZWRnIM70wv/Fkb4zfGmAdS9DLtoeGV2xgHLRP4389BXoYfR+OWBrRvM3lK+A0N47lhDPcsMjwXnR johnny@jpm
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDExDUp8u4PsYOZPNcG4JZdl9BsdrnEO5oihr/OecqZlkdTAr/yq9w9EJjVrTgygeybveLI4pJZYeeVwsFRFFQdaJtEcFBfwrIi+Lwv5g6fewi1Ung2kF9U3pyD8QvM80G+Hvzzu3Fu2e9djvhyM6btHd8EN5oiZwdLzd510mhkuQ== [email protected]
# Get command-line help.
newtab -h
# Simpy open new tab.
newtab
# Open new tab and execute command (quoted parameters are supported).
newtab ls -l "$Home/Library/Application Support"
# Open a new tab with a given working directory and execute a command;
# Double-quote the command passed to `eval` and use backslash-escaping inside.
newtab eval "cd ~/Library/Application\ Support; ls"
# Open new tab, execute commands, close tab.
@millerjp
millerjp / gist:d943ae9e570212776ca9
Created May 23, 2014 07:57
Newtab OSX terminal utility script
# Opens a new tab in the current Terminal window and optionally executes a command.
# When invoked via a function named 'newwin', opens a new Terminal *window* instead.
newtab() {
# If this function was invoked directly by a function named 'newwin', we open a new *window* instead
# of a new tab in the existing window.
local funcName=$FUNCNAME
local targetType='tab'
local targetDesc='new tab in the active Terminal window'
local makeTab=1