summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
authorFranck Cuny <fcuny@twitter.com>2017-11-07 08:47:26 -0800
committerFranck Cuny <fcuny@twitter.com>2017-11-07 08:47:26 -0800
commit28cadb970ca0b1ae6cde58d09eadb6af89999ddf (patch)
tree3f3d0096bc041ed74868872c43beb9612afebc75 /bin
parent[emacs] add scala-mode (diff)
downloademacs.d-28cadb970ca0b1ae6cde58d09eadb6af89999ddf.tar.gz
Remove bin, this is now in it's own repo
Diffstat (limited to 'bin')
-rwxr-xr-xbin/docker-gcp74
-rwxr-xr-xbin/get-fonts11
-rwxr-xr-xbin/json-pretty10
-rwxr-xr-xbin/md-preview24
-rwxr-xr-xbin/setup-go22
-rwxr-xr-xbin/touch-projects19
-rwxr-xr-xbin/tw-build33
-rwxr-xr-xbin/tw-get-hosts-from-job5
-rwxr-xr-xbin/tw-kestrel-active-queues25
-rwxr-xr-xbin/tw-mh-os7-report40
-rwxr-xr-xbin/tw-mh-split-mirrorset.py34
-rwxr-xr-xbin/tw-os7-report26
-rwxr-xr-xbin/tw-zk-delete-nodes12
-rwxr-xr-xbin/update-emacs8
14 files changed, 0 insertions, 343 deletions
diff --git a/bin/docker-gcp b/bin/docker-gcp
deleted file mode 100755
index 5aa9c2a..0000000
--- a/bin/docker-gcp
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/bin/bash
-
-GCP_PROJECT=${1:-fcuny-devel}
-DOCKER_MACHINE_NAME=${2:-gcp}
-
-COMMAND=$1
-
-usage() {
-  echo "$0: [create|start|stop|status|ssh|scp|tmux-status]" >&2
-  exit 1
-}
-
-__create() {
-  docker-machine create "${DOCKER_MACHINE_NAME}" \
-                 -d google \
-                 --google-project="${GCP_PROJECT}" \
-                 --google-machine-type n1-highcpu-4
-}
-
-__start() {
-  docker-machine start "${DOCKER_MACHINE_NAME}"
-}
-
-__stop() {
-  docker-machine stop "${DOCKER_MACHINE_NAME}"
-}
-
-__status() {
-  docker-machine status "${DOCKER_MACHINE_NAME}"
-}
-
-__ssh() {
-  docker-machine ssh "${DOCKER_MACHINE_NAME}"
-}
-
-__scp() {
-  echo "This is not implemented yet."
-  exit 2
-}
-
-__tmux-status() {
-  [ $(__status) == 'Running' ] && echo "Docker GCP up"
-}
-
-if [[ -z "${COMMAND}" ]]; then
-  usage
-fi
-
-case "${COMMAND}" in
-  create)
-    __create
-    ;;
-  start)
-    __start
-    ;;
-  stop)
-    __stop
-    ;;
-  status)
-    __status
-    ;;
-  ssh)
-    __ssh
-    ;;
-  scp)
-    __scp
-    ;;
-  tmux-status)
-    __tmux-status
-    ;;
-  *)
-    usage
-    ;;
-esac
diff --git a/bin/get-fonts b/bin/get-fonts
deleted file mode 100755
index 2d9571f..0000000
--- a/bin/get-fonts
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-
-OS=$(uname)
-
-if [[ "${OS}" == "Darwin" ]]; then
-  brew tap caskroom/fonts
-  brew cask reinstall font-dejavu-sans
-else
-  echo "I don't know how to install the font on ${OS}" 1>&2
-  exit 1
-fi
diff --git a/bin/json-pretty b/bin/json-pretty
deleted file mode 100755
index e536fd0..0000000
--- a/bin/json-pretty
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-
-URL=$1
-
-if [[ -z "${URL}" ]]; then
-  echo "usage: $0 <URL>"
-  exit 1
-fi
-
-curl -s "${1}" | python -m json.tool
diff --git a/bin/md-preview b/bin/md-preview
deleted file mode 100755
index 07d06e5..0000000
--- a/bin/md-preview
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-
-# Render a markdown file to HTML, as a preview.
-
-set -e
-
-INPUT="${1:-README.md}"
-OUTPUT="${2:-/tmp/output.html}"
-
-if [ ! -f "${INPUT}" ]; then
-  echo "You need to specify an input file" 1>&2
-  exit 1
-fi
-
-[ -e "${OUTPUT}" ] && rm "${OUTPUT}"
-
-pandoc -f markdown_github -c https://goo.gl/OVmlwT --self-contained -o "${OUTPUT}" "${INPUT}"
-
-if [ -e "${OUTPUT}" ]; then
-  open "${OUTPUT}"
-else
-  echo "Failed."
-  exit 1
-fi
diff --git a/bin/setup-go b/bin/setup-go
deleted file mode 100755
index 7b0f281..0000000
--- a/bin/setup-go
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-
-# This script is idempotent.
-
-# If GOPATH is set, check that it the path exists
-if [ -n "${GOPATH}" ]; then
-  if [ ! -d "${GOPATH}" ]; then
-    echo "$GOPATH is set but the directory does not exist."
-    exit 1
-  fi
-fi
-
-# Check the version
-version=$(go version)
-
-# Install extra tools
-
-# These one are for code completion
-go get -u github.com/nsf/gocode
-go get -u github.com/rogpeppe/godef
-go get -u golang.org/x/tools/cmd/guru
-go get -u golang.org/x/tools/cmd/goimports
diff --git a/bin/touch-projects b/bin/touch-projects
deleted file mode 100755
index 28f0819..0000000
--- a/bin/touch-projects
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/bash
-
-set -x
-set -e
-
-SOURCE="${HOME}/src/source"
-
-PROJECTS=(
-  eventbus/read-proxy
-  eventbus/provisioning
-  monitoring-configs
-  src/python/twitter
-  distributedlog
-  kestrel
-)
-
-for project in "${PROJECTS[@]}"; do
-  touch ${SOURCE}/${project}/.projectile
-done
diff --git a/bin/tw-build b/bin/tw-build
deleted file mode 100755
index da54fe5..0000000
--- a/bin/tw-build
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/bash
-
-SOURCE_ROOT="${HOME}/src/source"
-
-if [ ! -d "${SOURCE_ROOT}" ]; then
-  echo "It looks like ${SOURCE_ROOT} is not available."
-  exit 1
-fi
-
-TARGETS=(
-  'src/python/twitter/checkstyle:check'
-  'src/python/twitter/messaging/julep/:julep'
-  'src/python/twitter/messaging/oncall/:oncall'
-  'src/python/twitter/messaging/tools/:bookkeeper'
-  'src/python/twitter/messaging/tools/:bookkeeper-rereplicator'
-  'src/python/twitter/messaging/tools/:customers-requests'
-  'src/python/twitter/messaging/tools/:host-status'
-  'src/python/twitter/messaging/tools/:msg-config'
-  'src/python/twitter/messaging/tools/:partition-ownership'
-  'src/python/twitter/messaging/tools/:proxy-admin'
-  'src/python/twitter/messaging/xdc_replicator_check/:streams-to-replicate'
-  'src/python/twitter/ops/mesos/bin/:mesosops'
-)
-
-cd "${SOURCE_ROOT}"
-
-for target in "${TARGETS[@]}"; do
-  echo -n "Build $target"
-  ./pants -q binary "${target}"
-done
-
-echo "Done."
-
diff --git a/bin/tw-get-hosts-from-job b/bin/tw-get-hosts-from-job
deleted file mode 100755
index 6985bb6..0000000
--- a/bin/tw-get-hosts-from-job
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-JOB_NAME=$1
-
-aurora job status "${JOB_NAME}" |grep 'RUNNING on'|awk '{print $13}' | sort
diff --git a/bin/tw-kestrel-active-queues b/bin/tw-kestrel-active-queues
deleted file mode 100755
index 9cf85ce..0000000
--- a/bin/tw-kestrel-active-queues
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash
-
-CLUSTER="${1:-kestrel.prod.low_sla}"
-
-for zone in atla smf1; do
-  echo "querying $zone/$CLUSTER"
-
-  tmpfile=$(mktemp "/tmp/${CLUSTER}-${zone}.XXXXXX")
-  csvout="$(dirname $0)/${CLUSTER}-${zone}.csv"
-
-  # first filter the metrics we want
-  cql -z "${zone}" k "${CLUSTER}" "sd.${CLUSTER}" | grep -e 'get_items_hit' > "${tmpfile}"
-
-  # remove the csv output file if it exists
-  [ -e "${csvout}" ] && rm "${csvout}"
-
-  # then we build the csv
-  for queue in $(cat "${tmpfile}"); do
-    total_hits=$(cql -z "${zone}" q -d 86400 "sum(default(0, rate(ts(sum, ${CLUSTER}, members(sd.${CLUSTER}), ${queue}))))"|awk '{sum+=$8} END{print sum}')
-    queue_name=$(echo ${queue} | sed -e 's/^q\/\(.*\)\/.*$/\1/')
-    echo "${queue_name};${total_hits}" >> "${csvout}"
-  done
-
-  rm "${tmpfile}"
-done
diff --git a/bin/tw-mh-os7-report b/bin/tw-mh-os7-report
deleted file mode 100755
index 993a9b3..0000000
--- a/bin/tw-mh-os7-report
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/bash
-
-if [ ! hash osrpeort.pex 2>/dev/null ]; then
-  pushd .
-  cd "${HOME}/src/source"
-  ./pants binary src/python/twitter/corestorage/osreport
-  popd
-fi
-
-ROLES=(
-manhattan.prod.revenue
-manhattan.prod.athena
-manhattan.prod.zac.hourly
-manhattan.prod.blobstore
-manhattan.prod.zac.minutely.agents
-manhattan.prod.zac.index
-manhattan.prod.zac.frequent
-manhattan.prod.roslin
-manhattan.prod.starbuck
-manhattan.prod.adama
-manhattan.prod.jammer
-manhattan.prod.redwing
-manhattan.prod.baltar
-manhattan.prod.tory 
-manhattan.prod.omega
-manhattan.prod.zac.minutely.counters
-manhattan.prod.zac.frequent.agents
-manhattan.prod.cylon
-manhattan.prod.hotdog
-manhattan.prod.serina
-manhattan.prod.davis
-manhattan.prod.limiters
-manhattan.prod.zac.minutely
-manhattan.prod.zac.frequent.counters
-manhattan.prod.foster
-)
-
-for role in ${ROLES[@]}; do
-  osreport.pex report ${role}
-done
diff --git a/bin/tw-mh-split-mirrorset.py b/bin/tw-mh-split-mirrorset.py
deleted file mode 100755
index 4a3d228..0000000
--- a/bin/tw-mh-split-mirrorset.py
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env python
-
-import sys
-from collections import defaultdict
-
-
-def main():
-  input = sys.argv[1]
-  batch_number = sys.argv[2]
-  mms = {}
-
-  max_mmset_size = 0
-
-  with open(input, 'r') as f:
-    for l in f:
-      mm, hostname = l.rstrip().split(' ')
-      if mm not in mms:
-        mms[mm] = []
-      mms[mm].append(hostname)
-
-  max_mmset_size = max([len(mms[x]) for x in mms])
-
-  batches = {x: [] for x in range(0, max_mmset_size)}
-  for i in range(0, max_mmset_size):
-    for mm in mms:
-      if len(mms[mm]) -1 >= i:
-        batches[i].append(mms[mm][i])
-
-  for h in batches[int(batch_number)]:
-    print(h)
-
-
-if __name__ == '__main__':
-  main()
diff --git a/bin/tw-os7-report b/bin/tw-os7-report
deleted file mode 100755
index c003136..0000000
--- a/bin/tw-os7-report
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/bash
-
-if [ ! hash osrpeort.pex 2>/dev/null ]; then
-  pushd .
-  cd "${HOME}/src/source"
-  ./pants binary src/python/twitter/corestorage/osreport
-  popd
-fi
-
-ROLES=(
-  blobstore.prod.queue
-  deferredrpc
-  deferredrpc.staging
-  hosebird-kestrel
-  ibis.kestrel
-  kestrel
-  kestrel-low_sla
-  messaging.prod.bookkeeper
-  messaging.prod.distributedlog
-  rosette.kafka.prod
-  search-kestrel
-)
-
-for role in ${ROLES[@]}; do
-  osreport.pex report ${role}
-done
diff --git a/bin/tw-zk-delete-nodes b/bin/tw-zk-delete-nodes
deleted file mode 100755
index b5e995e..0000000
--- a/bin/tw-zk-delete-nodes
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-
-set -x
-set -e
-
-members=$(echo "ls /messaging/distributedlog/EventBus/" | zk-shell msgzookeeper.atla.twitter.com --run-from-stdin)
-
-for m in $members; do
-  if [[ $m =~ ^eventbus_system_loadtest_8_ ]]; then
-    echo "rmr /messaging/distributedlog/EventBus/$m" | zk-shell msgzookeeper.atla.twitter.com --run-from-stdin
-  fi
-done
diff --git a/bin/update-emacs b/bin/update-emacs
deleted file mode 100755
index 8f3a932..0000000
--- a/bin/update-emacs
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-
-if [ $(uname) != "Darwin" ]; then
-  echo "This script only works for OS X."
-  exit 1
-fi
-
-brew upgrade emacs --HEAD