Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

8.9 KiB

Cray Configuration

Cray specific overrides

~/bin/adexpire

So I can find out when my ad password expires.

  #!/usr/bin/env sh
  adchange=$(LDAPTLS_REQCERT=never ldapsearch -ZZ -x -h cfdc01.us.cray.com -b 'OU=Users,OU=Cray Objects,DC=americas,DC=cray,DC=com' -s sub "(sAMAccountName=$(whoami))" pwdLastSet | awk '/^pwdLastSet/ { print $2 }')
  today=$(date +%s)
  days=$(( ((adchange / 10000000 - 11628835200) - today) / 86400 ))
  if [ $days -le 14 ]; then
    echo "AD password expires in $days days"
  fi

~/.gnus

Use gnus in emacs for email. Outside of normal emacs since its easier.

  (defvar custom-splits
    '(|
      ("Subject" ".*\\[confluence\\].*" "spammish/confluence")
      ("Subject" ".*\\[JIRA\\].*" "spammish/jira")
      (: "")
      ))
  (use-package gnus
    :ensure t
    :config
    (add-hook 'gnus-group-mode-hook 'gnus-topic-mode)
    ;; TODO: how to get this into :custom?
    (setq-default 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 "┣▶")
    :custom
    (user-full-name "Mitchell Tishmack")
    (user-mail-address "mitchell.tishmack@hpe.com")
    (gnus-secondary-select-methods '((nnml "private")))
    (nnml-directory "~/.emacs.d/mail")
    (message-directory "~/.emacs.d/mail")
    (gnus-select-method
     '(nnimap "hpe"
              (nnimap-address "outlook.office365.com")
              (nnimap-server-port 993)
              (nnimap-stream ssl)
              (nnimap-streaming t)
              (nnimap-split-methods 'nnmail-split-fancy)
              (nnir-search-engine imap))
     message-send-mail-with-function 'smtpmail-send-it
     send-mail-function 'smtpmail-send-it
     )
    (gnus-mime-display-multipart-related-as-mixed t)
    (gnus-auto-select-first nil)
    (gnus-summary-display-arrow nil)
    (nnmail-split-methods 'nnmail-split-fancy)
    (gnus-summary-line-format "[%U%R%z] %(%&user-date;  %-15,15f  %B%s%)\n")
    (gnus-user-date-format-alist '((t . "%Y-%m-%d")))
    (gnus-thread-sort-functions
     '((not gnus-thread-sort-by-date)
       (not gnus-thread-sort-by-number)))
    (gnus-use-cache t)
    (gnus-save-score t)
    (gnus-use-adaptive-scoring '(word line))
    (gnus-adaptive-word-length-limit 5)
    (gnus-adaptive-word-no-group-words t)
    (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))))
    (nnimap­split­inbox "INBOX")
    (nnimap­split­predicate "UNDELETED")
    (nnmail-split-methods 'nnmail-split-fancy)
    (nnimap-split-methods 'nnimap-split-fancy)
    (nnimap-split-fancy custom-splits)
    (nnmail-split-fancy custom-splits)
    )
      ;; (setq nnimap-split-methods
      ;;       '(
      ;;         ("INBOX/confluence" "^Subject:.*\\[confluence\\].*")
      ;;         ("INBOX/jira" "^Subject:.*\\[JIRA\\].*")
      ;;         ("INBOX/cronmail" "^From:.*\\(root\\|cron\\)@localhost")
      ;;         ("INBOX/default" "")
      ;;         ))
      ;; (setq nnmail-split-methods
      ;;    '(
      ;;    ("confluence" "Subject:.*\\[confluence\\].*")
      ;;    ("jira" "Subject:.*\\[JIRA\\].*")
      ;;    ("cronmail" "From:.*\\(root\\|cron\\)@localhost")
      ;;    ("default" "")
      ;;    ))
      ;; end essential...ish config is any of this crap needed? I think I just cribbed from wiegley too much tbh,
      ;; TODO: dig through all this config entry by entry and get a proper understanding of each config item
        ;; (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)

~/bin/flushdns

For some reason this sometimes needs to happen, stupid work dns.

  #!/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 $?

~/bin/tomod

LEGACY svn interop

  #!/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}"

~/bin/towip

LEGACY svn interop, do I even need this any longer?

  #!/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}"