From 9353c33abad9a486c67ea8bc82e06b37d3b36a92 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sat, 19 Jan 2019 10:39:46 -0800 Subject: clean up. Removed scripts and some configs, they will be in their own repo. --- Makefile | 41 ++++ agignore | 5 + aspell.en.pws | 16 ++ bashrc | 54 +++++ configs/aurora/fio.aurora | 32 --- configs/aurora/hello-job.aurora | 21 -- configs/aurora/smf1-test-cron-job.aurora | 17 -- configs/rcs/Makefile | 41 ---- configs/rcs/agignore | 5 - configs/rcs/aspell.en.pws | 16 -- configs/rcs/bashrc | 54 ----- configs/rcs/ctags | 25 -- configs/rcs/emacs.d/init.el | 343 --------------------------- configs/rcs/gitconfig | 20 -- configs/rcs/gitignore | 24 -- ctags | 25 ++ emacs.d/init.el | 343 +++++++++++++++++++++++++++ gitconfig | 20 ++ gitignore | 24 ++ playgrounds/aurora/fio.aurora | 45 ---- playgrounds/aurora/hello-job.aurora | 22 -- playgrounds/aurora/iperf.aurora | 37 --- playgrounds/aurora/smf1-test-cron-job.aurora | 17 -- playgrounds/fio-bench.tgz | Bin 1189 -> 0 bytes playgrounds/fio/rand-read.fio | 16 -- playgrounds/fio/rand-write.fio | 14 -- playgrounds/fio/runner.sh | 60 ----- playgrounds/fio/seq-read.fio | 14 -- playgrounds/fio/seq-rw.fio | 17 -- playgrounds/fio/seq-write.fio | 14 -- scripts/bastion | 3 - scripts/cqlmetrics | 11 - scripts/cqlq | 17 -- scripts/ipmi | 3 - 34 files changed, 528 insertions(+), 888 deletions(-) create mode 100644 Makefile create mode 100644 agignore create mode 100644 aspell.en.pws create mode 100755 bashrc delete mode 100644 configs/aurora/fio.aurora delete mode 100644 configs/aurora/hello-job.aurora delete mode 100644 configs/aurora/smf1-test-cron-job.aurora delete mode 100644 configs/rcs/Makefile delete mode 100644 configs/rcs/agignore delete mode 100644 configs/rcs/aspell.en.pws delete mode 100755 configs/rcs/bashrc delete mode 100644 configs/rcs/ctags delete mode 100644 configs/rcs/emacs.d/init.el delete mode 100644 configs/rcs/gitconfig delete mode 100644 configs/rcs/gitignore create mode 100644 ctags create mode 100644 emacs.d/init.el create mode 100644 gitconfig create mode 100644 gitignore delete mode 100644 playgrounds/aurora/fio.aurora delete mode 100644 playgrounds/aurora/hello-job.aurora delete mode 100644 playgrounds/aurora/iperf.aurora delete mode 100644 playgrounds/aurora/smf1-test-cron-job.aurora delete mode 100644 playgrounds/fio-bench.tgz delete mode 100644 playgrounds/fio/rand-read.fio delete mode 100644 playgrounds/fio/rand-write.fio delete mode 100755 playgrounds/fio/runner.sh delete mode 100644 playgrounds/fio/seq-read.fio delete mode 100644 playgrounds/fio/seq-rw.fio delete mode 100644 playgrounds/fio/seq-write.fio delete mode 100755 scripts/bastion delete mode 100755 scripts/cqlmetrics delete mode 100755 scripts/cqlq delete mode 100755 scripts/ipmi diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e71e986 --- /dev/null +++ b/Makefile @@ -0,0 +1,41 @@ +INTO = $(HOME) + + +INSTALL = \ + agignore \ + aspell.en.pws \ + bashrc \ + ctags \ + emacs.d \ + gitconfig \ + gitignore + + +INSTALLED = $(patsubst %,$(INTO)/.%,$(INSTALL)) +LN = @ln -sf + +$(INTO)/.% : % + @[ ! -e $@ ] || [ -h $@ ] || mv -f $@ $@.bak + $(LN) $(PWD)/$< $@ + +$(HOME)/.ssh/authorized_keys: + @curl https://github.com/fcuny.keys -o $(HOME)/.ssh/authorized_keys + +$(HOME)/workspace: + @mkdir -p $(HOME)/workspace/ + +.PHONY: git +git: + @git config --local user.email "franck.cuny@gmail.com" + @git config --local user.name "Franck Cuny" + +.PHONY: check-dead +check-dead: + @find ~ -maxdepth 1 -name '.*' -type l -exec test ! -e {} \; -print + +.PHONY: clean-dead +clean-dead: + @find ~ -maxdepth 1 -name '.*' -type l -exec test ! -e {} \; -delete + +.PHONY: install +install: $(INSTALLED) $(HOME)/workspace $(HOME)/.ssh/authorized_keys diff --git a/agignore b/agignore new file mode 100644 index 0000000..afeb483 --- /dev/null +++ b/agignore @@ -0,0 +1,5 @@ +/go/pkg +*.js +*.css +*.pdf +*.git diff --git a/aspell.en.pws b/aspell.en.pws new file mode 100644 index 0000000..5525b9f --- /dev/null +++ b/aspell.en.pws @@ -0,0 +1,16 @@ +personal_ws-1.1 en 15 +IP +DistributedLog +distributedlog +filesystems +DeferredRPC +Cuny +koalabird +cql +lumberjaph +mesos +easyviz +DHCPD +TSS +EventBus +SRE diff --git a/bashrc b/bashrc new file mode 100755 index 0000000..16d0c9b --- /dev/null +++ b/bashrc @@ -0,0 +1,54 @@ +export EDITOR="emacsclient -nw" +export HISTFILE= +export LANG="en_US.UTF-8" +export LC_ALL="$LANG" +export LC_CTYPE="$LANG" +export PAGER="less" +export TZ=America/Los_Angeles +export GOPATH="${HOME}/workspace/go" + +[ -z "$PS1" ] && return + +# prompts +export PS1="\w % " + +RC_DIR=$(dirname $(readlink ${BASH_SOURCE[0]})) + +# finally, build the path and source a few files +__add_to_path_if_exists() { + [ -d "$1" ] && export PATH="$1:$PATH" +} + +__source_file_if_exists() { + [ -s "$1" ] && source "$1" +} + +__add_to_path_if_exists "${HOME}/workspace/bin" +__add_to_path_if_exists "${GOPATH}/bin" +__add_to_path_if_exists "${RC_DIR}/../../scripts/" + +__source_file_if_exists "/opt/google-cloud-sdk/path.bash.inc" +__source_file_if_exists "/opt/google-cloud-sdk/completion.bash.inc" + +# Twitter paths +__add_to_path_if_exists "${HOME}/workspace/git.twitter.biz/source/dist" +__add_to_path_if_exists "/opt/twitter/opt/go/libexec/bin" +__add_to_path_if_exists "/opt/twitter/bin" +__source_file_if_exists "/opt/twitter/rvm/scripts/rvm" + +alias cp="cp -i" +alias l="ls" +alias la="ls -a" +alias ll="ls -lh" +alias lt="ls -lhtr" +alias mv="mv -i" +alias rm="rm -i" + +alias g="git" +alias s="cd ~/workspace/git.twitter.biz/source" + +alias gomesosbuild="ssh -A smf1-egu-15-sr1.prod.twitter.com" + +alias smf1pending='curl -s https://aurora-smf1.twitter.biz/pendingtasks | jq .' +alias atlapending='curl -s https://aurora-atla.twitter.biz/pendingtasks | jq .' + diff --git a/configs/aurora/fio.aurora b/configs/aurora/fio.aurora deleted file mode 100644 index c91095e..0000000 --- a/configs/aurora/fio.aurora +++ /dev/null @@ -1,32 +0,0 @@ -downloadFIO = Process( - name='download-fio', - cmdline='curl -o fio.rpm https://svn.twitter.biz/rpms/fio.x86_64/RPMS/x86_64/fio-1.50-2.twitter.x86_64.rpm' -) - -extractFIO = Process( - name='extract-fio', - cmdline='rpm2cpio fio.rpm | cpio -idmv' -) - -runFIO = Process( - name='run-fio', - cmdline='./usr/bin/fio --name=writefile --size=8G --filesize=8G --filename=./fiotestfsync --bs=4k --nrfiles=1 --fsync=1 --randrepeat=0 --rw=write --refill_buffers --end_fsync=1 --iodepth=200 --ioengine=libaio --runtime=240', -) - -jobs = [ - Service( - cluster='smf1-test', - environment='devel', - role='fcuny', - name='fio', - task=Task( - processes=[downloadFIO, extractFIO, runFIO], - resources=Resources(cpu=10, ram=4096 * MB, disk=10 * GB), - constraints=order(downloadFIO, extractFIO, runFIO) - ), - instances=4, - constraints={ - 'base_platform': 'f4ww', - } - ) -] diff --git a/configs/aurora/hello-job.aurora b/configs/aurora/hello-job.aurora deleted file mode 100644 index e0758a3..0000000 --- a/configs/aurora/hello-job.aurora +++ /dev/null @@ -1,21 +0,0 @@ -hello_date = Process( - name='hello-date', - cmdline='while true; do date; sleep 10; done' -) - -jobs = [ - Service( - cluster='smf1', - environment='devel', - role='fcuny', - name='hello-date', - task=Task( - processes=[hello_date], - resources=Resources(cpu=10, ram=1024 * MB, disk=512 * MB) - ), - instances=1, - constraints={ - 'host': 'smf1-feq-33-sr1', - } - ) -] diff --git a/configs/aurora/smf1-test-cron-job.aurora b/configs/aurora/smf1-test-cron-job.aurora deleted file mode 100644 index 3ade1b4..0000000 --- a/configs/aurora/smf1-test-cron-job.aurora +++ /dev/null @@ -1,17 +0,0 @@ -# A cron job that runs every 5 minutes. -jobs = [ - Job( - cluster = 'smf1-test', - role = 'fcuny', - environment = 'test', - name = 'cron_hello_world-trashing', - cron_schedule = '*/5 * * * *', - constraints = { - 'host': 'smf1-fki-17-sr1', - }, - instances=10, - task = SimpleTask( - 'cron_hello_world', - 'echo "Hello world from cron, the time is now $(date --rfc-822)"'), - ), -] diff --git a/configs/rcs/Makefile b/configs/rcs/Makefile deleted file mode 100644 index e71e986..0000000 --- a/configs/rcs/Makefile +++ /dev/null @@ -1,41 +0,0 @@ -INTO = $(HOME) - - -INSTALL = \ - agignore \ - aspell.en.pws \ - bashrc \ - ctags \ - emacs.d \ - gitconfig \ - gitignore - - -INSTALLED = $(patsubst %,$(INTO)/.%,$(INSTALL)) -LN = @ln -sf - -$(INTO)/.% : % - @[ ! -e $@ ] || [ -h $@ ] || mv -f $@ $@.bak - $(LN) $(PWD)/$< $@ - -$(HOME)/.ssh/authorized_keys: - @curl https://github.com/fcuny.keys -o $(HOME)/.ssh/authorized_keys - -$(HOME)/workspace: - @mkdir -p $(HOME)/workspace/ - -.PHONY: git -git: - @git config --local user.email "franck.cuny@gmail.com" - @git config --local user.name "Franck Cuny" - -.PHONY: check-dead -check-dead: - @find ~ -maxdepth 1 -name '.*' -type l -exec test ! -e {} \; -print - -.PHONY: clean-dead -clean-dead: - @find ~ -maxdepth 1 -name '.*' -type l -exec test ! -e {} \; -delete - -.PHONY: install -install: $(INSTALLED) $(HOME)/workspace $(HOME)/.ssh/authorized_keys diff --git a/configs/rcs/agignore b/configs/rcs/agignore deleted file mode 100644 index afeb483..0000000 --- a/configs/rcs/agignore +++ /dev/null @@ -1,5 +0,0 @@ -/go/pkg -*.js -*.css -*.pdf -*.git diff --git a/configs/rcs/aspell.en.pws b/configs/rcs/aspell.en.pws deleted file mode 100644 index 5525b9f..0000000 --- a/configs/rcs/aspell.en.pws +++ /dev/null @@ -1,16 +0,0 @@ -personal_ws-1.1 en 15 -IP -DistributedLog -distributedlog -filesystems -DeferredRPC -Cuny -koalabird -cql -lumberjaph -mesos -easyviz -DHCPD -TSS -EventBus -SRE diff --git a/configs/rcs/bashrc b/configs/rcs/bashrc deleted file mode 100755 index 302472a..0000000 --- a/configs/rcs/bashrc +++ /dev/null @@ -1,54 +0,0 @@ -export EDITOR="emacsclient -nw" -export HISTFILE= -export LANG="en_US.UTF-8" -export LC_ALL="$LANG" -export LC_CTYPE="$LANG" -export PAGER="less" -export TZ=America/Los_Angeles -export GOPATH="${HOME}/workspace/go" - -[ -z "$PS1" ] && return - -# prompts -export PS1="\h:\w % " - -RC_DIR=$(dirname $(readlink ${BASH_SOURCE[0]})) - -# finally, build the path and source a few files -__add_to_path_if_exists() { - [ -d "$1" ] && export PATH="$1:$PATH" -} - -__source_file_if_exists() { - [ -s "$1" ] && source "$1" -} - -__add_to_path_if_exists "${HOME}/workspace/bin" -__add_to_path_if_exists "${GOPATH}/bin" -__add_to_path_if_exists "${RC_DIR}/../../scripts/" - -__source_file_if_exists "/opt/google-cloud-sdk/path.bash.inc" -__source_file_if_exists "/opt/google-cloud-sdk/completion.bash.inc" - -# Twitter paths -__add_to_path_if_exists "${HOME}/workspace/git.twitter.biz/source/dist" -__add_to_path_if_exists "/opt/twitter/opt/go/libexec/bin" -__add_to_path_if_exists "/opt/twitter/bin" -__source_file_if_exists "/opt/twitter/rvm/scripts/rvm" - -alias cp="cp -i" -alias l="ls" -alias la="ls -a" -alias ll="ls -lh" -alias lt="ls -lhtr" -alias mv="mv -i" -alias rm="rm -i" - -alias g="git" -alias s="cd ~/workspace/git.twitter.biz/source" - -alias gomesosbuild="ssh -A smf1-egu-15-sr1.prod.twitter.com" - -alias smf1pending='curl -s https://aurora-smf1.twitter.biz/pendingtasks | jq .' -alias atlapending='curl -s https://aurora-atla.twitter.biz/pendingtasks | jq .' - diff --git a/configs/rcs/ctags b/configs/rcs/ctags deleted file mode 100644 index 3d83cd1..0000000 --- a/configs/rcs/ctags +++ /dev/null @@ -1,25 +0,0 @@ ---recurse=yes ---exclude=.git,.pants.d ---exclude=log ---languages=-javascript,-html ---append ---tag-relative=yes - ---langdef=Go ---langmap=Go:.go ---regex-Go=/func([ \t]+\([^)]+\))?[ \t]+([a-zA-Z0-9_]+)/\2/d,func/ ---regex-Go=/type[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/d,type/ ---regex-Go=/var[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/d,var/ - ---langdef=scala ---langmap=scala:.scala ---regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private[^ ]*|protected)?[ \t]*class[ \t]+([a-zA-Z0-9_]+)/\4/c,classes/ ---regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private[^ ]*|protected)?[ \t]*object[ \t]+([a-zA-Z0-9_]+)/\4/c,objects/ ---regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private[^ ]*|protected)?[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*case class[ \t]+([a-zA-Z0-9_]+)/\6/c,case classes/ ---regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private[^ ]*|protected)?[ \t]*case object[ \t]+([a-zA-Z0-9_]+)/\4/c,case objects/ ---regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private[^ ]*|protected)?[ \t]*trait[ \t]+([a-zA-Z0-9_]+)/\4/t,traits/ ---regex-scala=/^[ \t]*type[ \t]+([a-zA-Z0-9_]+)/\1/T,types/ ---regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy|private[^ ]*(\[[a-z]*\])*|protected)[ \t]*)*def[ \t]+([a-zA-Z0-9_]+)/\4/m,methods/ ---regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy|private[^ ]*|protected)[ \t]*)*val[ \t]+([a-zA-Z0-9_]+)/\3/l,constants/ ---regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy|private[^ ]*|protected)[ \t]*)*var[ \t]+([a-zA-Z0-9_]+)/\3/l,variables/ ---regex-scala=/^[ \t]*package[ \t]+([a-zA-Z0-9_.]+)/\1/p,packages/ diff --git a/configs/rcs/emacs.d/init.el b/configs/rcs/emacs.d/init.el deleted file mode 100644 index 2506a77..0000000 --- a/configs/rcs/emacs.d/init.el +++ /dev/null @@ -1,343 +0,0 @@ -;; Initialize the package system first of all. -(require 'package) - -(setq package-archives '(("melpa" . "https://melpa.org/packages/"))) - -(defvar fcuny-path-emacs-var (expand-file-name "var" user-emacs-directory) - "Path to some files for Emacs.") - -(defvar fcuny-path-emacs-elpa (expand-file-name "elpa" fcuny-path-emacs-var) - "Path to elpa's local files.") - -;; where to store the packages -(setq package-user-dir fcuny-path-emacs-elpa) - -;; initialize it -(package-initialize) - -;; if use-package is not present, we install it -(unless (package-installed-p 'use-package) - (package-refresh-contents) - (package-install 'use-package)) - -(require 'use-package) - -(defvar fcuny/bookmarks-dir (expand-file-name "bookmarks" fcuny-path-emacs-var) - "Path to save the bookmarks") - -(defvar fcuny/custom-settings (expand-file-name "emacs-custom.el" fcuny-path-emacs-var) - "Path to emacs custom variables.") - -(defun fcuny/rename-this-buffer-and-file () - "Renames current buffer and file it is visiting." - (interactive) - (let ((name (buffer-name)) - (filename (buffer-file-name)) - (read-file-name-function 'read-file-name-default)) - (if (not (and filename (file-exists-p filename))) - (error "Buffer '%s' is not visiting a file!" name) - (let ((new-name (read-file-name "New name: " filename))) - (cond ((get-buffer new-name) - (error "A buffer named '%s' already exists!" new-name)) - (t - (rename-file filename new-name 1) - (rename-buffer new-name) - (set-visited-file-name new-name) - (set-buffer-modified-p nil) - (message "File '%s' successfully renamed to '%s'" name (file-name-nondirectory new-name)))))))) - -(defun fcuny/check-work-machine-p () - "Returns t if this is a work machine" - (string-match "tw-mbp.*" (system-name))) - -(defun fcuny/remove-mysql-columns () - "Removes | from text. This is useful when I want to drop the column separator from some text coming from a mysql query." - (interactive) - (if (region-active-p) - (replace-regexp "\s?|\s?" "" nil (region-beginning) (region-end)) - (replace-regexp "\s?|\s?" ""))) - -;; set utf-8 as the default encoding -(prefer-coding-system 'utf-8-unix) -(set-terminal-coding-system 'utf-8) -(set-keyboard-coding-system 'utf-8) - -;; alias yes-or-no to y-or-n -(fset 'yes-or-no-p 'y-or-n-p) - -(setq auto-save-default nil) ;; don't auto save files -(setq auto-save-list-file-prefix nil) ;; no backups -(setq create-lockfiles nil) ;; don't use a lock file -(setq custom-file fcuny/custom-settings) ;; where to save custom settings -(setq make-backup-files nil) ;; really no backups -(setq minibuffer-message-timeout 0.5) ;; How long to display an echo-area message -(setq next-screen-context-lines 5) ;; scroll 5 lines at a time -(setq require-final-newline t) ;; ensure newline exists at the end of the file -(setq ring-bell-function 'ignore) ;; really no bell -(setq tab-always-indent 'complete) ;; when using TAB, always indent -(setq visible-bell nil) ;; no bell -(setq column-number-mode t) ;; show column number in the mode line -(setq-default indent-tabs-mode nil) ;; turn off tab indentation -(setq-default cursor-type 'hbar) ;; cursor is a horizontal bar -(setq bookmark-default-file fcuny/bookmarks-dir) ;; where to save bookmarks -(setq bookmark-save-flag 1) ;; save bookmarks when emacs qui -(setq vc-handled-backends nil) ;; don't use the VC backend, it's too slow with source -(setq-default delete-by-moving-to-trash t) ;; delete files by moving them to the trash -(setq initial-scratch-message "") ;; empty scratch buffer - -(custom-set-variables - '(tool-bar-mode nil) - '(scroll-bar-mode nil) - '(use-file-dialog nil) - '(use-dialog-box nil) - '(blink-cursor-mode nil) - '(inhibit-startup-screen t) - '(inhibit-startup-message t) - '(inhibit-startup-echo-area-message t)) - -(use-package frame - :bind (("C-c C-m" . toggle-frame-fullscreen)) - :config - (progn - (defun fcuny/setup-frame(&optional frame) - (fringe-mode '(10 . 10)) - (setq-default frame-title-format "%b") - (set-face-attribute 'default nil :height 150 :weight 'normal :width 'normal :font "Source Code Pro") - (when (eq system-type 'darwin) - (setq ns-use-native-fullscreen nil) - (setq mac-allow-anti-aliasing t))) - (fcuny/setup-frame))) - -(use-package general - :config - (general-define-key - "M-j" 'join-line)) - -;;; emacs hygiene - -(use-package midnight - :config - (midnight-mode t)) - -(use-package server - :hook (after-init . server-start)) - -(use-package exec-path-from-shell - :ensure t - :if (memq window-system '(mac ns)) - :config - (exec-path-from-shell-initialize)) - -;;; general editing - -(use-package ace-window - :ensure t - :bind (("C-x o" . ace-window))) - -(use-package recentf - :config - (recentf-mode 1) - (setq recentf-max-saved-items 500 - recentf-save-file (expand-file-name "var/recentf" user-emacs-directory))) - -(use-package autorevert - :config - (setq global-auto-revert-non-file-buffers t) - (setq auto-revert-verbose nil) - (global-auto-revert-mode t)) - -(use-package hl-line - :config - (set-face-background 'hl-line "#E0EBF5") - (global-hl-line-mode t)) - -(use-package uniquify - :defer 5 - :config - (setq uniquify-ignore-buffers-re "^\\*") ; don't muck with special buffers - (setq uniquify-buffer-name-style 'forward) - (setq uniquify-separator "/")) - -;;; files navigation - -(use-package ag - :ensure t - :bind (:map ag-mode-map - ("p" . compilation-previous-error) - ("n" . compilation-next-error) - ("N" . compilation-next-file) - ("P" . compilation-previous-file)) - :custom - (ag-highlight-search t) - (ag-reuse-buffers t) - (ag-reuse-window t)) - -(use-package dired - :defer t - :bind (("C-x C-d" . dired) - ("C-x C-j" . dired-jump)) - :init - (setq-default dired-dwim-target t) - (setq-default dired-listing-switches "--group-directories-first -alh") - (setq dired-recursive-deletes 'always) - (setq dired-recursive-copies 'always) - - (let ((gls (executable-find "/opt/twitter/bin/gls"))) - (when gls (setq insert-directory-program gls)))) - -(use-package ibuffer - :bind ("C-x C-b" . ibuffer)) - -;;; general text editing - -(use-package flyspell - :hook ((text-mode . flyspell-mode) - (prog-mode . flyspell-prog-mode)) - :config - (setq ispell-dictionary "en_US") - - (when (executable-find "aspell") - (setq ispell-program-name "aspell" - ispell-list-command "--list")) - - (use-package flyspell-correct - :after (flyspell) - :commands (flyspell-correct-word-generic - flyspell-correct-previous-word-generic) - :bind (:map flyspell-mode-map - ("C-;" . flyspell-correct-previous-word-generic)))) - -(use-package whitespace - :custom - (whitespace-style '(face trailing)) - (show-trailing-whitespace t) - :hook (whitespace-mode)) - -(use-package electric-pair-mode - :commands electric-pair-mode - :init (add-hook 'prog-mode-hook 'electric-pair-mode)) - -(use-package paren - :ensure t - :custom - (show-paren-delay 0) - :config - (show-paren-mode 1)) - -;;; text formats - -(use-package markdown-mode - :ensure t - :after (flyspell) - :commands (markdown-mode gfm-mode) - :mode (("README\\.md\\'" . gfm-mode) - ("\\.md\\'" . gfm-mode) - ("\\.markdown\\'" . gfm-mode))) - -;;; source control - -(use-package magit - :ensure t - :after (flyspell) - :hook ((magit-mode . hl-line-mode)) - :bind (("C-x g s" . magit-status)) - :config - (setq git-commit-summary-max-length 50) - (setq git-commit-fill-column 72) - (setq git-commit-turn-on-auto-fill t)) - -;;; prog mode - -(use-package flycheck - :ensure t - :custom - (flycheck-idle-change-delay 2)) - -(use-package lisp-mode - :bind - (("C-c C-e" . eval-buffer) - ("C-c C-r" . eval-region))) - -(use-package make-mode - :config - (add-hook 'makefile-mode-hook (lambda () (setq-local tab-width 2)))) - -(use-package go-mode - :ensure t - :after (exec-path-from-shell) - :hook (go-mode . fcuny/go-mode-setup) - :init - (defun fcuny/go-mode-setup () - (setq tab-width 4) - (add-hook 'before-save-hook 'gofmt-before-save)) - :config - (when (memq window-system '(mac ns)) - (exec-path-from-shell-copy-env "GOPATH"))) - -(use-package python - :mode (("\\.py$" . python-mode) - ("BUILD\\'" . python-mode)) - :commands python-mode - :custom (python-indent-offset 2)) - -(use-package sh-script - :mode ("bashrc" . sh-mode) - :hook (after-save . executable-make-buffer-file-executable-if-script-p) - :config - (setq-default sh-indentation 2 - sh-basic-offset 2)) - -;;; configurations - -(use-package dockerfile-mode - :ensure t - :mode "Dockerfile[a-zA-Z.-]*\\'") - -(use-package gitconfig-mode - :ensure t - :defer 5) - -(use-package puppet-mode - :ensure t - :bind (:map puppet-mode-map - ("C-c |" . puppet-align-block))) - -(use-package yaml-mode - :ensure t) - -(use-package json-mode - :after (flyspell flycheck) - :custom - (json-reformat:indent-width 2) - (js-indent-level 2) - :hook ((json-mode . flyspell-prog-mode) - (json-mode . flycheck-mode)) - :init - (if (fcuny/check-work-machine-p) - (add-to-list 'auto-mode-alist '("\\.workflow$" . json-mode)))) - -(use-package protobuf-mode - :after (flyspell flycheck) - :ensure t - :hook ((protobuf-mode . flyspell-prog-mode) - (protobuf-mode . flycheck-mode))) - -(use-package counsel - :ensure t - :init (counsel-mode 1) (ivy-mode 1) - :bind - (("M-x" . counsel-M-x) - ("C-s" . counsel-grep-or-swiper) - ("C-x C-f" . counsel-find-file) - ("C-x C-r" . counsel-recentf) - ("C-c f" . counsel-git) - ("C-c s" . counsel-git-grep) - ("C-c /" . counsel-ag) - ("C-x r l" . counsel-bookmark)) - :custom - (counsel-find-file-at-point t) - (ivy-use-virtual-buffers t) - (ivy-count-format "(%d/%d) ") - (ivy-height 10) - :config - (use-package swiper :ensure t)) diff --git a/configs/rcs/gitconfig b/configs/rcs/gitconfig deleted file mode 100644 index 8914029..0000000 --- a/configs/rcs/gitconfig +++ /dev/null @@ -1,20 +0,0 @@ -[color] - ui = true - -[push] - default = simple - -[core] - whitespace = trailing-space,space-before-tab - excludesfile = ~/.gitignore - -[branch] - autosetuprebase = remote - -[include] - path = ~/.gitconfig.private - -[http] - postBuffer = 524288000 -[url "https://source.developers.google.com/p/fcuny-code/r/"] - insteadOf = gcloud: diff --git a/configs/rcs/gitignore b/configs/rcs/gitignore deleted file mode 100644 index c8124cb..0000000 --- a/configs/rcs/gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# osx stuff -.DS_Store -Icon - -# ide -.idea -*.iml -/env/* - -# python stuff -.flake8rc -*pyc - -# ctags stuff -TAGS -tags - -# emacs stuff -.projectile -.dir-locals.el -.pytest_cache/ - -.reviewboardrc -ui/package-lock.json diff --git a/ctags b/ctags new file mode 100644 index 0000000..3d83cd1 --- /dev/null +++ b/ctags @@ -0,0 +1,25 @@ +--recurse=yes +--exclude=.git,.pants.d +--exclude=log +--languages=-javascript,-html +--append +--tag-relative=yes + +--langdef=Go +--langmap=Go:.go +--regex-Go=/func([ \t]+\([^)]+\))?[ \t]+([a-zA-Z0-9_]+)/\2/d,func/ +--regex-Go=/type[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/d,type/ +--regex-Go=/var[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/d,var/ + +--langdef=scala +--langmap=scala:.scala +--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private[^ ]*|protected)?[ \t]*class[ \t]+([a-zA-Z0-9_]+)/\4/c,classes/ +--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private[^ ]*|protected)?[ \t]*object[ \t]+([a-zA-Z0-9_]+)/\4/c,objects/ +--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private[^ ]*|protected)?[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*case class[ \t]+([a-zA-Z0-9_]+)/\6/c,case classes/ +--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private[^ ]*|protected)?[ \t]*case object[ \t]+([a-zA-Z0-9_]+)/\4/c,case objects/ +--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private[^ ]*|protected)?[ \t]*trait[ \t]+([a-zA-Z0-9_]+)/\4/t,traits/ +--regex-scala=/^[ \t]*type[ \t]+([a-zA-Z0-9_]+)/\1/T,types/ +--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy|private[^ ]*(\[[a-z]*\])*|protected)[ \t]*)*def[ \t]+([a-zA-Z0-9_]+)/\4/m,methods/ +--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy|private[^ ]*|protected)[ \t]*)*val[ \t]+([a-zA-Z0-9_]+)/\3/l,constants/ +--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy|private[^ ]*|protected)[ \t]*)*var[ \t]+([a-zA-Z0-9_]+)/\3/l,variables/ +--regex-scala=/^[ \t]*package[ \t]+([a-zA-Z0-9_.]+)/\1/p,packages/ diff --git a/emacs.d/init.el b/emacs.d/init.el new file mode 100644 index 0000000..e0b0a44 --- /dev/null +++ b/emacs.d/init.el @@ -0,0 +1,343 @@ +;; Initialize the package system first of all. +(require 'package) + +(setq package-archives '(("melpa" . "https://melpa.org/packages/"))) + +(defvar fcuny-path-emacs-var (expand-file-name "var" user-emacs-directory) + "Path to some files for Emacs.") + +(defvar fcuny-path-emacs-elpa (expand-file-name "elpa" fcuny-path-emacs-var) + "Path to elpa's local files.") + +;; where to store the packages +(setq package-user-dir fcuny-path-emacs-elpa) + +;; initialize it +(package-initialize) + +;; if use-package is not present, we install it +(unless (package-installed-p 'use-package) + (package-refresh-contents) + (package-install 'use-package)) + +(require 'use-package) + +(defvar fcuny/bookmarks-dir (expand-file-name "bookmarks" fcuny-path-emacs-var) + "Path to save the bookmarks") + +(defvar fcuny/custom-settings (expand-file-name "emacs-custom.el" fcuny-path-emacs-var) + "Path to emacs custom variables.") + +(defun fcuny/rename-this-buffer-and-file () + "Renames current buffer and file it is visiting." + (interactive) + (let ((name (buffer-name)) + (filename (buffer-file-name)) + (read-file-name-function 'read-file-name-default)) + (if (not (and filename (file-exists-p filename))) + (error "Buffer '%s' is not visiting a file!" name) + (let ((new-name (read-file-name "New name: " filename))) + (cond ((get-buffer new-name) + (error "A buffer named '%s' already exists!" new-name)) + (t + (rename-file filename new-name 1) + (rename-buffer new-name) + (set-visited-file-name new-name) + (set-buffer-modified-p nil) + (message "File '%s' successfully renamed to '%s'" name (file-name-nondirectory new-name)))))))) + +(defun fcuny/check-work-machine-p () + "Returns t if this is a work machine" + (string-match "tw-mbp.*" (system-name))) + +(defun fcuny/remove-mysql-columns () + "Removes | from text. This is useful when I want to drop the column separator from some text coming from a mysql query." + (interactive) + (if (region-active-p) + (replace-regexp "\s?|\s?" "" nil (region-beginning) (region-end)) + (replace-regexp "\s?|\s?" ""))) + +;; set utf-8 as the default encoding +(prefer-coding-system 'utf-8-unix) +(set-terminal-coding-system 'utf-8) +(set-keyboard-coding-system 'utf-8) + +;; alias yes-or-no to y-or-n +(fset 'yes-or-no-p 'y-or-n-p) + +(setq auto-save-default nil) ;; don't auto save files +(setq auto-save-list-file-prefix nil) ;; no backups +(setq create-lockfiles nil) ;; don't use a lock file +(setq custom-file fcuny/custom-settings) ;; where to save custom settings +(setq make-backup-files nil) ;; really no backups +(setq minibuffer-message-timeout 0.5) ;; How long to display an echo-area message +(setq next-screen-context-lines 5) ;; scroll 5 lines at a time +(setq require-final-newline t) ;; ensure newline exists at the end of the file +(setq ring-bell-function 'ignore) ;; really no bell +(setq tab-always-indent 'complete) ;; when using TAB, always indent +(setq visible-bell nil) ;; no bell +(setq column-number-mode t) ;; show column number in the mode line +(setq-default indent-tabs-mode nil) ;; turn off tab indentation +(setq-default cursor-type 'hbar) ;; cursor is a horizontal bar +(setq bookmark-default-file fcuny/bookmarks-dir) ;; where to save bookmarks +(setq bookmark-save-flag 1) ;; save bookmarks when emacs qui +(setq vc-handled-backends nil) ;; don't use the VC backend, it's too slow with source +(setq-default delete-by-moving-to-trash t) ;; delete files by moving them to the trash +(setq initial-scratch-message "") ;; empty scratch buffer + +(custom-set-variables + '(tool-bar-mode nil) + '(scroll-bar-mode nil) + '(use-file-dialog nil) + '(use-dialog-box nil) + '(blink-cursor-mode nil) + '(inhibit-startup-screen t) + '(inhibit-startup-message t) + '(inhibit-startup-echo-area-message t)) + +(use-package frame + :bind (("C-c C-m" . toggle-frame-fullscreen)) + :config + (progn + (defun fcuny/setup-frame(&optional frame) + (fringe-mode '(10 . 10)) + (setq-default frame-title-format "%b") + (set-face-attribute 'default nil :height 160 :weight 'normal :width 'normal :font "Source Code Pro") + (when (eq system-type 'darwin) + (setq ns-use-native-fullscreen nil) + (setq mac-allow-anti-aliasing t))) + (fcuny/setup-frame))) + +(use-package general + :config + (general-define-key + "M-j" 'join-line)) + +;;; emacs hygiene + +(use-package midnight + :config + (midnight-mode t)) + +(use-package server + :hook (after-init . server-start)) + +(use-package exec-path-from-shell + :ensure t + :if (memq window-system '(mac ns)) + :config + (exec-path-from-shell-initialize)) + +;;; general editing + +(use-package ace-window + :ensure t + :bind (("C-x o" . ace-window))) + +(use-package recentf + :config + (recentf-mode 1) + (setq recentf-max-saved-items 500 + recentf-save-file (expand-file-name "var/recentf" user-emacs-directory))) + +(use-package autorevert + :config + (setq global-auto-revert-non-file-buffers t) + (setq auto-revert-verbose nil) + (global-auto-revert-mode t)) + +(use-package hl-line + :config + (set-face-background 'hl-line "#E0EBF5") + (global-hl-line-mode t)) + +(use-package uniquify + :defer 5 + :config + (setq uniquify-ignore-buffers-re "^\\*") ; don't muck with special buffers + (setq uniquify-buffer-name-style 'forward) + (setq uniquify-separator "/")) + +;;; files navigation + +(use-package ag + :ensure t + :bind (:map ag-mode-map + ("p" . compilation-previous-error) + ("n" . compilation-next-error) + ("N" . compilation-next-file) + ("P" . compilation-previous-file)) + :custom + (ag-highlight-search t) + (ag-reuse-buffers t) + (ag-reuse-window t)) + +(use-package dired + :defer t + :bind (("C-x C-d" . dired) + ("C-x C-j" . dired-jump)) + :init + (setq-default dired-dwim-target t) + (setq-default dired-listing-switches "--group-directories-first -alh") + (setq dired-recursive-deletes 'always) + (setq dired-recursive-copies 'always) + + (let ((gls (executable-find "/opt/twitter/bin/gls"))) + (when gls (setq insert-directory-program gls)))) + +(use-package ibuffer + :bind ("C-x C-b" . ibuffer)) + +;;; general text editing + +(use-package flyspell + :hook ((text-mode . flyspell-mode) + (prog-mode . flyspell-prog-mode)) + :config + (setq ispell-dictionary "en_US") + + (when (executable-find "aspell") + (setq ispell-program-name "aspell" + ispell-list-command "--list")) + + (use-package flyspell-correct + :after (flyspell) + :commands (flyspell-correct-word-generic + flyspell-correct-previous-word-generic) + :bind (:map flyspell-mode-map + ("C-;" . flyspell-correct-previous-word-generic)))) + +(use-package whitespace + :custom + (whitespace-style '(face trailing)) + (show-trailing-whitespace t) + :hook (whitespace-mode)) + +(use-package electric-pair-mode + :commands electric-pair-mode + :init (add-hook 'prog-mode-hook 'electric-pair-mode)) + +(use-package paren + :ensure t + :custom + (show-paren-delay 0) + :config + (show-paren-mode 1)) + +;;; text formats + +(use-package markdown-mode + :ensure t + :after (flyspell) + :commands (markdown-mode gfm-mode) + :mode (("README\\.md\\'" . gfm-mode) + ("\\.md\\'" . gfm-mode) + ("\\.markdown\\'" . gfm-mode))) + +;;; source control + +(use-package magit + :ensure t + :after (flyspell) + :hook ((magit-mode . hl-line-mode)) + :bind (("C-x g s" . magit-status)) + :config + (setq git-commit-summary-max-length 50) + (setq git-commit-fill-column 72) + (setq git-commit-turn-on-auto-fill t)) + +;;; prog mode + +(use-package flycheck + :ensure t + :custom + (flycheck-idle-change-delay 2)) + +(use-package lisp-mode + :bind + (("C-c C-e" . eval-buffer) + ("C-c C-r" . eval-region))) + +(use-package make-mode + :config + (add-hook 'makefile-mode-hook (lambda () (setq-local tab-width 2)))) + +(use-package go-mode + :ensure t + :after (exec-path-from-shell) + :hook (go-mode . fcuny/go-mode-setup) + :init + (defun fcuny/go-mode-setup () + (setq tab-width 4) + (add-hook 'before-save-hook 'gofmt-before-save)) + :config + (when (memq window-system '(mac ns)) + (exec-path-from-shell-copy-env "GOPATH"))) + +(use-package python + :mode (("\\.py$" . python-mode) + ("BUILD\\'" . python-mode)) + :commands python-mode + :custom (python-indent-offset 2)) + +(use-package sh-script + :mode ("bashrc" . sh-mode) + :hook (after-save . executable-make-buffer-file-executable-if-script-p) + :config + (setq-default sh-indentation 2 + sh-basic-offset 2)) + +;;; configurations + +(use-package dockerfile-mode + :ensure t + :mode "Dockerfile[a-zA-Z.-]*\\'") + +(use-package gitconfig-mode + :ensure t + :defer 5) + +(use-package puppet-mode + :ensure t + :bind (:map puppet-mode-map + ("C-c |" . puppet-align-block))) + +(use-package yaml-mode + :ensure t) + +(use-package json-mode + :after (flyspell flycheck) + :custom + (json-reformat:indent-width 2) + (js-indent-level 2) + :hook ((json-mode . flyspell-prog-mode) + (json-mode . flycheck-mode)) + :init + (if (fcuny/check-work-machine-p) + (add-to-list 'auto-mode-alist '("\\.workflow$" . json-mode)))) + +(use-package protobuf-mode + :after (flyspell flycheck) + :ensure t + :hook ((protobuf-mode . flyspell-prog-mode) + (protobuf-mode . flycheck-mode))) + +(use-package counsel + :ensure t + :init (counsel-mode 1) (ivy-mode 1) + :bind + (("M-x" . counsel-M-x) + ("C-s" . counsel-grep-or-swiper) + ("C-x C-f" . counsel-find-file) + ("C-x C-r" . counsel-recentf) + ("C-c f" . counsel-git) + ("C-c s" . counsel-git-grep) + ("C-c /" . counsel-ag) + ("C-x r l" . counsel-bookmark)) + :custom + (counsel-find-file-at-point t) + (ivy-use-virtual-buffers t) + (ivy-count-format "(%d/%d) ") + (ivy-height 10) + :config + (use-package swiper :ensure t)) diff --git a/gitconfig b/gitconfig new file mode 100644 index 0000000..8914029 --- /dev/null +++ b/gitconfig @@ -0,0 +1,20 @@ +[color] + ui = true + +[push] + default = simple + +[core] + whitespace = trailing-space,space-before-tab + excludesfile = ~/.gitignore + +[branch] + autosetuprebase = remote + +[include] + path = ~/.gitconfig.private + +[http] + postBuffer = 524288000 +[url "https://source.developers.google.com/p/fcuny-code/r/"] + insteadOf = gcloud: diff --git a/gitignore b/gitignore new file mode 100644 index 0000000..c8124cb --- /dev/null +++ b/gitignore @@ -0,0 +1,24 @@ +# osx stuff +.DS_Store +Icon + +# ide +.idea +*.iml +/env/* + +# python stuff +.flake8rc +*pyc + +# ctags stuff +TAGS +tags + +# emacs stuff +.projectile +.dir-locals.el +.pytest_cache/ + +.reviewboardrc +ui/package-lock.json diff --git a/playgrounds/aurora/fio.aurora b/playgrounds/aurora/fio.aurora deleted file mode 100644 index b26debf..0000000 --- a/playgrounds/aurora/fio.aurora +++ /dev/null @@ -1,45 +0,0 @@ -downloadFIO = Process( - name='download-fio', - cmdline='curl -o fio.rpm https://svn.twitter.biz/rpms/fio.x86_64/RPMS/x86_64/fio-1.50-2.twitter.x86_64.rpm' -) - -installBenchs = Packer.install( - 'fio-bench', - role = 'fcuny', - version = 'latest' -) - -mvFIO = Process( - name='move-fio', - cmdline='mv fio/* . && rm -rf fio', -) - -extractFIO = Process( - name='extract-fio', - cmdline='rpm2cpio fio.rpm | cpio -idmv' -) - -runFIO = Process( - name='run-fio', - cmdline='./runner.sh', -) - -jobs = [ - Job( - cluster='smf1', - role='fcuny', - environment='devel', - name='fio', - task=Task( - processes=[downloadFIO, extractFIO, runFIO, installBenchs, mvFIO], - resources=Resources(cpu=4, ram=4096 * MB, disk=10 * GB), - constraints=order(installBenchs, mvFIO, downloadFIO, extractFIO, runFIO) - ), - instances=3, - constraints={ - 'base_platform': 'f4ww', - 'dedicated': '*/manhattan', - 'host': 'limit:1', - } - ) -] diff --git a/playgrounds/aurora/hello-job.aurora b/playgrounds/aurora/hello-job.aurora deleted file mode 100644 index a825fdb..0000000 --- a/playgrounds/aurora/hello-job.aurora +++ /dev/null @@ -1,22 +0,0 @@ -hello_date = Process( - name='hello-date', - cmdline='while true; do date; sleep 10; done' -) - -jobs = [ - Service( - cluster='smf1', - environment='devel', - role='fcuny', - name='hello-date', - task=Task( - processes=[hello_date], - resources=Resources(cpu=10, ram=1024 * MB, disk=512 * MB) - ), - instances=1, - constraints={ - 'host': 'smf1-fki-16-sr1', - 'dedicated': '*/manhattan', - } - ) -] diff --git a/playgrounds/aurora/iperf.aurora b/playgrounds/aurora/iperf.aurora deleted file mode 100644 index e071bd2..0000000 --- a/playgrounds/aurora/iperf.aurora +++ /dev/null @@ -1,37 +0,0 @@ -class StandardProfile(Struct): - environment=Default(String, 'prod') - tier=Default(String, 'preferred') - -DevelProfile = StandardProfile( - environment = 'devel', - tier = 'preemptible', -) - -api = Process( - name = 'iperf', - cmdline = '/usr/bin/iperf3 -s -p {{thermos.ports[http]}}' -) - -task = Task( - name = api.name(), - resources = Resources(cpu = 1.0, ram = 4 * GB, disk = 1 * GB), - processes = [api] -) - -service_template = Service( - role='fcuny', - name = 'iperf', - environment='{{profile.environment}}', - task = task, - instances = 3, - contact = 'fcuny@twitter.com', - announce=Announcer(), - tier ='{{profile.tier}}', - constraints={ - 'host': 'smf1-bgr-27-sr1', - } -) - -jobs = [ - service_template(cluster='smf1-test').bind(profile=DevelProfile()), -] diff --git a/playgrounds/aurora/smf1-test-cron-job.aurora b/playgrounds/aurora/smf1-test-cron-job.aurora deleted file mode 100644 index 3ade1b4..0000000 --- a/playgrounds/aurora/smf1-test-cron-job.aurora +++ /dev/null @@ -1,17 +0,0 @@ -# A cron job that runs every 5 minutes. -jobs = [ - Job( - cluster = 'smf1-test', - role = 'fcuny', - environment = 'test', - name = 'cron_hello_world-trashing', - cron_schedule = '*/5 * * * *', - constraints = { - 'host': 'smf1-fki-17-sr1', - }, - instances=10, - task = SimpleTask( - 'cron_hello_world', - 'echo "Hello world from cron, the time is now $(date --rfc-822)"'), - ), -] diff --git a/playgrounds/fio-bench.tgz b/playgrounds/fio-bench.tgz deleted file mode 100644 index 06ff644..0000000 Binary files a/playgrounds/fio-bench.tgz and /dev/null differ diff --git a/playgrounds/fio/rand-read.fio b/playgrounds/fio/rand-read.fio deleted file mode 100644 index 8d473af..0000000 --- a/playgrounds/fio/rand-read.fio +++ /dev/null @@ -1,16 +0,0 @@ -[global] -name=fio-rand-RW -filename=./data/fio-rand-RW -rw=randrw -rwmixread=60 -rwmixwrite=40 -bs=4K -direct=0 -numjobs=4 -time_based=1 -runtime=900 - -[file1] -size=8G -ioengine=libaio -iodepth=16 diff --git a/playgrounds/fio/rand-write.fio b/playgrounds/fio/rand-write.fio deleted file mode 100644 index 5564414..0000000 --- a/playgrounds/fio/rand-write.fio +++ /dev/null @@ -1,14 +0,0 @@ -[global] -name=fio-rand-write -filename=./data/fio-rand-write -rw=randwrite -bs=4K -direct=0 -numjobs=4 -time_based=1 -runtime=900 - -[file1] -size=8G -ioengine=libaio -iodepth=16 diff --git a/playgrounds/fio/runner.sh b/playgrounds/fio/runner.sh deleted file mode 100755 index 8df8895..0000000 --- a/playgrounds/fio/runner.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh - -## Helper script to run fio tests and generate reports - -DATA_DIR=./data -LOG_DIR=./logs -REPORT_DIR=./reports - -FIO_BIN=./usr/bin/fio -if [ "${2}x" != "x" ]; then - FIO_BIN=${2} -fi - -FIOS_LIST=$(ls *.fio) -NOW_EPOCH=$(date +"%s") -LOG_DIR_READS=${LOG_DIR}/reads -LOG_DIR_WRITES=${LOG_DIR}/writes - -# create required directories -mkdir -p ${DATA_DIR} - -if [ -d "${REPORT_DIR}" ]; then - echo "Report directory exists, archiving using current timestamp: ${NOW_EPOCH}" - mv ${REPORT_DIR} ${REPORT_DIR}_${NOW_EPOCH} -fi -mkdir -p ${REPORT_DIR} - -if [ -d "${LOG_DIR}" ]; then - echo "Log directory exists, archiving using current timestamp: ${NOW_EPOCH}" - mv ${LOG_DIR} ${LOG_DIR}_${NOW_EPOCH} -fi -mkdir -p ${LOG_DIR_WRITES} -mkdir -p ${LOG_DIR_READS} - -# run all fios in sequential order -for i in $(echo ${FIOS_LIST} | tr " " "\n") -do - echo -e "\nStarting fio test ${i}..." - ${FIO_BIN} ./${i} --output ${REPORT_DIR}/${i}.out - - mv *read*.log ${LOG_DIR_READS}/ - mv *write*.log ${LOG_DIR_WRITES}/ - - rm -f data/* # delete created fio files after each run - - echo "Completed fio test ${i}." -done - -# plot reports to svg -FIO_PLOT_BIN=./usr/bin/fio_generate_plots -if type "${FIO_PLOT_BIN}" > /dev/null && type "gnuplot" > /dev/null; then - - echo "fio_generate_plots is installed generating svg reports based on fio logs" - - ( cd ${LOG_DIR_READS} && for f in *.log; do mv $f ${f/.[1-3]/}; done && ${FIO_PLOT_BIN} "All-Reads" ) - ( cd ${LOG_DIR_WRITES} && for f in *.log; do mv $f ${f/.[1-3]/}; done && ${FIO_PLOT_BIN} "All-Writes" ) - - mv ${LOG_DIR_READS}/*.svg ${REPORT_DIR}/ - mv ${LOG_DIR_WRITES}/*.svg ${REPORT_DIR}/ -fi diff --git a/playgrounds/fio/seq-read.fio b/playgrounds/fio/seq-read.fio deleted file mode 100644 index c3225a3..0000000 --- a/playgrounds/fio/seq-read.fio +++ /dev/null @@ -1,14 +0,0 @@ -[global] -name=fio-seq-reads -filename=./data/fio-seq-reads -rw=read -bs=256K -direct=1 -numjobs=1 -time_based=1 -runtime=900 - -[file1] -size=8G -ioengine=libaio -iodepth=16 diff --git a/playgrounds/fio/seq-rw.fio b/playgrounds/fio/seq-rw.fio deleted file mode 100644 index 81c50e7..0000000 --- a/playgrounds/fio/seq-rw.fio +++ /dev/null @@ -1,17 +0,0 @@ -[global] -name=fio-seq-RW -filename=./data/fio-seq-RW -rw=rw -rwmixread=60 -rwmixwrite=40 -bs=256K -direct=0 -numjobs=4 -time_based=1 -runtime=900 - -[file1] -size=8G -ioengine=libaio -iodepth=16 - diff --git a/playgrounds/fio/seq-write.fio b/playgrounds/fio/seq-write.fio deleted file mode 100644 index 88fbeaa..0000000 --- a/playgrounds/fio/seq-write.fio +++ /dev/null @@ -1,14 +0,0 @@ -[global] -name=fio-seq-write -filename=./data/fio-seq-write -rw=write -bs=256K -direct=0 -numjobs=1 -time_based=1 -runtime=900 - -[file1] -size=8G -ioengine=libaio -iodepth=16 diff --git a/scripts/bastion b/scripts/bastion deleted file mode 100755 index 1ae0629..0000000 --- a/scripts/bastion +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -ssh nest.smfc.twitter.com diff --git a/scripts/cqlmetrics b/scripts/cqlmetrics deleted file mode 100755 index db3db6a..0000000 --- a/scripts/cqlmetrics +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -service=$1 - -if [ -z "${service}" ]; then - exit 1 -fi - -zone="${2:-smf1}" - -echo $(cql -z "${zone}" k "${service}" "sd.${service}" | fzf) diff --git a/scripts/cqlq b/scripts/cqlq deleted file mode 100755 index bf47c50..0000000 --- a/scripts/cqlq +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -service=$1 -if [ -z "${service}" ]; then - exit 1 -fi - -zone="${2:-smf1}" - -metric=$(cqlmetrics "${service}" "${zone}") - -query="zone(${zone}, ts(${service}, members(sd.${service}), ${metric}))" - -short_id=$(curl -s --negotiate -u : -X POST https://monitoring.twitter.biz/api/2/url/shortener --data "{\"longUrl\":\"/query?&queries=%5B%7B%22id%22%3A%22query-1%22%2C%22name%22%3A%22Query%201%22%2C%22query%22%3A%22$query%22%2C%22settings%22%3A%7B%22visible%22%3Atrue%7D%7D%5D\"}" | jq '.id') - -echo "http://monitoring.twitter.biz/tiny/${short_id}" -open "http://monitoring.twitter.biz/tiny/${short_id}" diff --git a/scripts/ipmi b/scripts/ipmi deleted file mode 100755 index b5bec84..0000000 --- a/scripts/ipmi +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -ssh conman-server.smf1.twitter.com -- cgit 1.4.1