#+TITLE: Cray Configuration #+AUTHOR: Mitch Tishmack #+STARTUP: hidestars #+STARTUP: odd #+BABEL: :cache yes #+PROPERTY: header-args :cache yes :padline no :mkdirp yes :comments no * Cray specific ** ~/.emacs.d/local.el #+BEGIN_SRC emacs-lisp :tangle (when (eq cray-p t) "tmp/.emacs.d/local.el") :mkdirp yes (defun cray/get-bugs () (with-current-buffer (current-buffer) (setq input (save-restriction (widen) (buffer-substring-no-properties (point-min) (point-max)))) (setq bugline "Bugs Affected[:] .*") (if (s-match bugline input) (mapcar 'car (s-match-strings-all "[7-9][[:digit:]]\\{5\\}" (car (mapcar 'car (s-match-strings-all bugline input))))) '("NO BUGS?") ) ) ) (defun cray/get-bugzilla-cmds () (loop for bug in (cray/get-bugs) collect (concat "env PYTHONWARNINGS='ignore:Unverified HTTPS request' bugzilla --nosslverify --bugzilla=https://bugzilla.us.cray.com/xmlrpc.cgi query --outputformat='%{summary}' --bug_id " bug) ) ) (defun cray/get-descriptions () (loop for out in (cray/get-bugzilla-cmds) collect (shell-command-to-string out)) ) #+END_SRC ** ~/.gnus Use gnus in emacs for email. Outside of normal emacs since its easier. #+BEGIN_SRC emacs-lisp :tangle (when (eq cray-p t) "tmp/.gnus") :mkdirp yes :tangle-mode (identity #o600) (use-package gnus :ensure t :config (progn (setq user-full-name "Mitch Tishmack" user-mail-address "mtishmack@cray.com") (setq gnus-select-method '(nnnil "")) (setq gnus-secondary-select-methods '((nnml ""))) (add-hook 'gnus-group-mode-hook 'gnus-topic-mode) (setq gnus-mime-display-multipart-related-as-mixed t) (setq gnus-auto-select-first nil) (setq gnus-summary-display-arrow nil) (setq nnmail-split-methods 'nnmail-split-fancy) (setq gnus-nntp-server nil gnus-read-active-file nil gnus-save-newsrc-file nil gnus-read-newsrc-file nil gnus-check-new-newsgroups nil) (setq nnml-directory "~/.emacs.d/mail") (setq message-directory "~/.emacs.d/mail") (setq gnus-select-method '(nnimap "outlook" (nnimap-address "outlook.office365.com") (nnimap-server-port 993)) message-send-mail-with-function 'smtpmail-send-it send-mail-function 'smtpmail-send-it ) (setq-default gnus-summary-line-format "[%U%R%z] %(%&user-date; %-15,15f %B%s%)\n" gnus-user-date-format-alist '((t . "%Y-%m-%d")) gnus-summary-thread-gathering-function 'gnus-gather-threads-by-references gnus-sum-thread-tree-root "" gnus-sum-thread-tree-false-root "" gnus-sum-thread-tree-indent " " gnus-sum-thread-tree-single-indent "" gnus-sum-thread-tree-single-leaf "└─>" gnus-sum-thread-tree-vertical "│" gnus-sum-thread-tree-leaf-with-other "├─>") (setq gnus-thread-sort-functions '((not gnus-thread-sort-by-date) (not gnus-thread-sort-by-number))) (setq gnus-use-cache t) (setq gnus-save-score t) (setq gnus-use-adaptive-scoring '(word line)) (setq gnus-adaptive-word-length-limit 5) (setq gnus-adaptive-word-no-group-words t) (setq gnus-default-adaptive-score-alist '((gnus-unread-mark) (gnus-ticked-mark (from 4)) (gnus-dormant-mark (from 5)) (gnus-del-mark (from -4) (subject -1)) (gnus-read-mark (from 4) (subject 2)) (gnus-expirable-mark (from -1) (subject -1)) (gnus-killed-mark (from -1) (subject -3)) (gnus-kill-file-mark) (gnus-ancient-mark) (gnus-low-score-mark) (gnus-catchup-mark (from -1) (subject -1)))) (setq nnmail-split-fancy '(| ("From" "\\(root\\|cron\\)@localhost" "system") "normal")) (setq nnimap­split­inbox "INBOX") (setq nnimap­split­predicate "UNDELETED") ;; (setq nnimap­split­rule ;; '( ;; ("INBOX.commitspam" "^From:.*(XT3.*Updates.*|.*xt3@cray.com.*)") ;; )) ) ) #+END_SRC ** ~/bin/flushdns For some reason this sometimes needs to happen, stupid work dns. #+BEGIN_SRC sh :tangle-mode (identity #o755) :tangle (when (and (eq cray-p t) (eq osx-p t)) "tmp/bin/flushdns") :mkdirp yes :tangle-mode (identity #o755) #!/bin/sh set +e dscacheutil -flushcache sudo killall -HUP mDNSResponder sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist exit $? #+END_SRC ** ~/bin/tomod LEGACY svn interop #+BEGIN_SRC sh :tangle (when (eq cray-p t) "tmp/bin/tomod") :mkdirp yes :tangle-mode (identity #o755) #!/usr/bin/env sh #-*-mode: Shell-script; coding: utf-8;-*- export script=$(basename "$0") export dir=$(cd "$(dirname "$0")"; pwd) export iam=${dir}/${script} remote=cfosbldvm01 export PATH=/usr/local/brew/10.10/bin:~/bin:${PATH} branch=$(git rev-parse --abbrev-ref HEAD) if [ $? -ne 0 ]; then echo not on a branch or in a git repo exit 2 fi base_git="$(pwd)" opwd="${base_git}" while true; do if [ -d ".git" ]; then base_git="$(pwd)" break fi if [ "$(pwd)" == "/" ]; then echo "No .git base directory found from ${opwd}" exit 2 fi ((count=$count+1)) cd .. done #svn_url=$(git svn info --url) svn_url="https://svn.us.cray.com/svn/xt/subsystems/BB/dwfs2/trunk12" remote_svn="/notbackedup/users/mtishmack/mod_data/${branch}" ssh $remote "module load cpkg sdev craysvn; rm -fr ${remote_svn}; mkdir -p ${remote_svn} && svn co ${svn_url} ${remote_svn} > /dev/null 2>&1;" echo "rsyncing local git branch to ${remote}:${remote_svn}" rsync \ --stats \ --checksum \ -avz \ --hard-links \ --exclude=.git \ --delete-excluded \ --delete \ --filter="-rs_.svn" \ --filter="-ss_covhtml" \ --filter="-ss_dev.yml" \ --filter="-ss_.gitignore" \ --filter="-ss_*.log" \ --filter="-ss_.\#*" \ --filter="-ss_*.swp" \ --filter="-ss_*.pyc" \ --filter="-ss_venv" \ --filter="-ss_testdirs" \ --filter="-ss_testfiles" \ --filter="-ss_.*.git.*" \ --filter="-ss_*.o" \ --filter="-ss_*.o.cmd" \ --filter="-ss_*.ko" \ --filter="-ss_*.ko.cmd" \ --filter="-ss_*.tmp_versions" \ "${base_git}/" "${remote}:${remote_svn}" echo "done rsyncing ${base_git} to ${remote}:${remote_svn}" #+END_SRC ** ~/bin/towip LEGACY svn interop #+BEGIN_SRC sh :tangle (when (eq cray-p t) "tmp/bin/towip") :mkdirp yes :tangle-mode (identity #o755) #!/usr/bin/env sh #-*-mode: Shell-script; coding: utf-8;-*- export script=$(basename "$0") export dir=$(cd "$(dirname "$0")"; pwd) export iam=${dir}/${script} remote=cfosbldvm01 export PATH=/usr/local/brew/10.10/bin:~/bin:${PATH} branch=$(git rev-parse --abbrev-ref HEAD) if [ $? -ne 0 ]; then echo not on a branch or in a git repo exit 2 fi base_git="$(pwd)" opwd="${base_git}" while true; do if [ -d ".git" ]; then base_git="$(pwd)" break fi if [ "$(pwd)" == "/" ]; then echo "No .git base directory found from ${opwd}" exit 2 fi ((count=$count+1)) cd .. done svn_url=$(git svn info --url) remote_svn="/notbackedup/users/mtishmack/wip-dws" ssh $remote "module load cpkg sdev craysvn; rm -fr ${remote_svn}; mkdir -p ${remote_svn} && svn co ${svn_url} ${remote_svn} > /dev/null 2>&1;" echo "rsyncing local git branch to ${remote}:${remote_svn}" rsync \ --progress \ --checksum \ -avz \ --hard-links \ --exclude=.git \ --delete-excluded \ --delete \ --filter="-rs_.svn" \ --filter="-ss_covhtml" \ --filter="-ss_dev.yml" \ --filter="-ss_.gitignore" \ --filter="-ss_*.log" \ --filter="-ss_.\#*" \ --filter="-ss_*.swp" \ --filter="-ss_*.pyc" \ --filter="-ss_*.o" \ --filter="-ss_*.o.cmd" \ --filter="-ss_*.tmp_versions" \ --filter="-ss_venv" \ --filter="-ss_testdirs" \ --filter="-ss_testfiles" \ --filter="-ss_.*.git.*" \ "${base_git}/" "${remote}:${remote_svn}" echo "done rsyncing ${base_git} to ${remote}:${remote_svn}" #+END_SRC