| @@ -3,11 +3,11 @@ | |||||
| #+STARTUP: hidestars | #+STARTUP: hidestars | ||||
| #+STARTUP: odd | #+STARTUP: odd | ||||
| #+BABEL: :cache yes | #+BABEL: :cache yes | ||||
| #+PROPERTY: header-args :cache yes | |||||
| #+PROPERTY: header-args :cache t | |||||
| #+PROPERTY: header-args :padline no | #+PROPERTY: header-args :padline no | ||||
| #+PROPERTY: header-args :mkdirp yes | |||||
| #+PROPERTY: header-args :mkdirp t | |||||
| #+PROPERTY: header-args :comments no | #+PROPERTY: header-args :comments no | ||||
| #+PROPERTY: header-args :replace yes | |||||
| #+PROPERTY: header-args :replace t | |||||
| #+PROPERTY: header-args :tangle-mode (identity #o755) | #+PROPERTY: header-args :tangle-mode (identity #o755) | ||||
| ~/bin files and other shenanigans | ~/bin files and other shenanigans | ||||
| @@ -1006,7 +1006,7 @@ foreach my $input (@ARGV){ | |||||
| More for nix on macos, but just merges NixOS/nipkgs origin/master to the current branch in a tmux window and watches it. | More for nix on macos, but just merges NixOS/nipkgs origin/master to the current branch in a tmux window and watches it. | ||||
| #+BEGIN_SRC sh :padline no :tangle (tangle/file "bin/nix-update" (bound-and-true-p nix-p)) | |||||
| #+BEGIN_SRC sh :padline no :tangle (tangle/file "bin/nix-update" (bound-and-true-p nix-p)) :mkdirp t | |||||
| #!/usr/bin/env sh | #!/usr/bin/env sh | ||||
| #-*-mode: Shell-script; coding: utf-8;-*- | #-*-mode: Shell-script; coding: utf-8;-*- | ||||
| # File: tmux-nix.sh | # File: tmux-nix.sh | ||||
| @@ -1096,3 +1096,21 @@ TODO: why the hell is :mkdirp yes needed here but nowhere else? | |||||
| end | end | ||||
| end | end | ||||
| #+END_SRC | #+END_SRC | ||||
| * ~/bin/close | |||||
| macos only, simple wrapper around osascript to send close to a gui application so I don't have to use the mouse/trackpad cause I'm lazy af. | |||||
| #+BEGIN_SRC sh :padline no :tangle (tangle/file "bin/close" (bound-and-true-p macos-p)) | |||||
| #!/bin/sh | |||||
| if [ -z "${1}" ]; then | |||||
| printf "usage: close app_name\n no application to close provided\n" | |||||
| exit 1 | |||||
| fi | |||||
| osascript <<END | |||||
| tell application "${1}" | |||||
| quit | |||||
| end tell | |||||
| END | |||||
| #+END_SRC | |||||
| @@ -188,46 +188,90 @@ cconv() | |||||
| #+END_SRC | #+END_SRC | ||||
| ** git | ** git | ||||
| General clone into ~/src/TLD/some/dir from a git uri function. | |||||
| Tries to strip out miscellany that we don't need from the uri. Also allows | |||||
| wrapper functions that simplify usage. | |||||
| Note the gh and bb wrappers which make it easy to get repos from github and bitbucket. | |||||
| Usage is simply: | |||||
| try_git some_uri optional_branch_if_not_master | |||||
| The gh wrapper wraps this and simplifies usage by setting up the uri as https so | |||||
| we can do the following example: | |||||
| gh user/repo maybe_branch | |||||
| This checks out something from https://github.com/user/repo.git to | |||||
| ~/src/github.com/user/repo | |||||
| This also makes for a somewhat easy way to cd into the dir as well without | |||||
| push/popd. The bb wrapper behaves the same. | |||||
| Presuming using the bare try_git function, the dir in ~/src/TLD is simply | |||||
| what comes after the tld. | |||||
| Example: | |||||
| try_git git://example.tld/some/random/path.git checks out to | |||||
| ~/src/example.tld/some/random/path | |||||
| #+BEGIN_SRC sh :tangle (tangle/file ".profile" (bound-and-true-p git-p)) | #+BEGIN_SRC sh :tangle (tangle/file ".profile" (bound-and-true-p git-p)) | ||||
| maybe_git_repo() | |||||
| { | |||||
| # assume https if input doesn't contain a protocol | |||||
| proto=https | |||||
| destination=${HOME}/src | |||||
| echo "${1}" | grep '://' > /dev/null 2>&1 | |||||
| [ $? = 0 ] && proto=$(echo "${1}" | sed -e 's|[:]\/\/.*||g') | |||||
| git_dir=$(echo "${1}" | sed -e 's|.*[:]\/\/||g') | |||||
| rrepo="${proto}://${git_dir}" | |||||
| # strip user@, :NNN, and .git from input uri's | |||||
| repo="${destination}/"$(echo "${git_dir}" | | |||||
| sed -e 's/\.git$//g' | | |||||
| sed -e 's|.*\@||g' | | |||||
| sed -e 's|\:[[:digit:]]\{1,\}\/|/|g' | | |||||
| tr -d '~') | |||||
| if [ ! -d "${repo}" ]; then | |||||
| git ls-remote "${rrepo}" > /dev/null 2>&1 | |||||
| if [ $? = 0 ]; then | |||||
| mkdir -p "${repo}" | |||||
| echo "git clone ${rrepo} ${repo}" | |||||
| git clone --recursive "${rrepo}" "${repo}" | |||||
| try_git() | |||||
| { | |||||
| # assume https if input doesn't contain a protocol | |||||
| proto=https | |||||
| destination=${HOME}/src | |||||
| branch="${2:-master}" | |||||
| echo "${1}" | grep '://' > /dev/null 2>&1 | |||||
| [ $? = 0 ] && proto=$(echo "${1}" | sed -e 's|[:]\/\/.*||g') | |||||
| git_dir=$(echo "${1}" | sed -e 's|.*[:]\/\/||g') | |||||
| rrepo="${proto}://${git_dir}" | |||||
| # strip user@, :NNN, and .git from input uri's | |||||
| repo="${destination}/"$(echo "${git_dir}" | | |||||
| sed -e 's/\.git$//g' | | |||||
| sed -e 's|.*\@||g' | | |||||
| sed -e 's|\:[[:digit:]]\{1,\}\/|/|g' | | |||||
| tr -d '~') | |||||
| if [ ! -d "${repo}" ]; then | |||||
| if git ls-remote "${rrepo}" > /dev/null 2>&1; then | |||||
| mkdir -p "${repo}" | |||||
| echo "git clone ${rrepo} ${repo}" | |||||
| git clone --recursive "${rrepo}" "${repo}" | |||||
| else | |||||
| echo "${rrepo} doesn't look to be a git repository" | |||||
| fi | |||||
| fi | |||||
| if [ "${branch}" != "master" ]; then | |||||
| wtdir="${repo}@${branch}" | |||||
| if [ -d "${wtdir}" ]; then | |||||
| cd "${wtdir}" | |||||
| else | |||||
| if git branch -r --list 'origin/*' | grep -E "^\s+origin/${branch}$" > /dev/null 2>&1; then | |||||
| git worktree add ${repo}@${branch} ${branch} && cd "${wtdir}" | |||||
| fi | |||||
| fi | |||||
| else | else | ||||
| echo "${rrepo} doesn't look to be a git repository" | |||||
| [ -d "${repo}" ] && cd "${repo}" | |||||
| fi | fi | ||||
| fi | |||||
| [ -d "${repo}" ] && cd "${repo}" | |||||
| } | |||||
| } | |||||
| gh() | |||||
| { | |||||
| maybe_git_repo "https://github.com/${1}" | |||||
| } | |||||
| gh() | |||||
| { | |||||
| try_git "https://github.com/${1}" "${2:-master}" | |||||
| } | |||||
| bb() | |||||
| { | |||||
| maybe_git_repo "https://bitbucket.org/${1}" | |||||
| } | |||||
| bb() | |||||
| { | |||||
| try_git "https://bitbucket.org/${1}" "${2:-master}" | |||||
| } | |||||
| #+END_SRC | #+END_SRC | ||||
| ** haskell | ** haskell | ||||
| #+BEGIN_SRC sh :tangle (tangle/file ".profile" (bound-and-true-p haskell-p)) | #+BEGIN_SRC sh :tangle (tangle/file ".profile" (bound-and-true-p haskell-p)) | ||||
| @@ -256,27 +300,10 @@ mk_nix_shell() | |||||
| > shell.nix; | > shell.nix; | ||||
| } | } | ||||
| nix_env_setup() | |||||
| # TODO: any of this useful to keep around? | |||||
| nr() | |||||
| { | { | ||||
| # The nix installer put something like this into the .profile. | |||||
| # BAD INSTALLER NO COOKIE! | |||||
| if [ -e ${HOME}/.nix-profile/etc/profile.d/nix.sh ]; then | |||||
| . ${HOME}/.nix-profile/etc/profile.d/nix.sh; | |||||
| export NIX_PATH=nixpkgs=${HOME}/src/github.com/NixOS/nixpkgs:staging=${HOME}/src/github.com/NixOS/nixpkgs/staging | |||||
| export NIX_CFLAGS_COMPILE="-idirafter /usr/include" | |||||
| export NIX_CFLAGS_LINK="-L/usr/lib" | |||||
| export PKG_CONFIG_PATH="~/.nix-profile/lib/pkgconfig" | |||||
| NIX_GHC=$(type -p ghc > /dev/null 2>&1) | |||||
| if [ -n "$NIX_GHC" ]; then | |||||
| eval $(grep export "$NIX_GHC") | |||||
| fi | |||||
| fi | |||||
| nr() | |||||
| { | |||||
| nix-shell --run "$(echo $@)" | |||||
| } | |||||
| nix-shell --run "$(echo $@)" | |||||
| } | } | ||||
| nix-on() { | nix-on() { | ||||
| @@ -299,9 +326,15 @@ if [ ! -e ${HOME}/.nonix ]; then | |||||
| fi | fi | ||||
| #+END_SRC | #+END_SRC | ||||
| The nix installer adds this which I don't want, $HOME is fully prefixed in what is added. | |||||
| #+BEGIN_SRC sh :tangle no | |||||
| if [ -e $HOME/.nix-profile/etc/profile.d/nix.sh ]; then . $HOME/.nix-profile/etc/profile.d/nix.sh # added by Nix installer | |||||
| #+END_SRC | |||||
| #+BEGIN_SRC sh :tangle (tangle/file ".profile" (bound-and-true-p nix-p)) | #+BEGIN_SRC sh :tangle (tangle/file ".profile" (bound-and-true-p nix-p)) | ||||
| if [ ! -e ${HOME}/.nonix ]; then | |||||
| nix_env_setup | |||||
| if [ ! -e ${HOME}/.nonix ] && [ -e ~/.nix-profile/etc/profile.d/nix.sh ]; then | |||||
| source ~/.nix-profile/etc/profile.d/nix.sh | |||||
| fi | fi | ||||
| #+END_SRC | #+END_SRC | ||||
| @@ -388,3 +421,127 @@ alias tl='tmux ls' | |||||
| PATH="${PATH}:${HOME}/bin:${HOME}/.local/bin" | PATH="${PATH}:${HOME}/bin:${HOME}/.local/bin" | ||||
| export PATH | export PATH | ||||
| #+END_SRC | #+END_SRC | ||||
| * cray | |||||
| Cray specific stuff. | |||||
| Note the stash function uses the wrapper to try for project/repo first, and iff that fails then tries for the input a second time as user/repo. | |||||
| #+BEGIN_SRC sh :tangle (tangle/file ".profile" (bound-and-true-p cray-p)) | |||||
| stash() | |||||
| { | |||||
| try_git "ssh://git@stash.us.cray.com:7999/${1}.git" "${2:-master}" || \ | |||||
| try_git "ssh://git@stash.us.cray.com:7999/~${1}.git" "${2:-master}" | |||||
| } | |||||
| stopit () | |||||
| { | |||||
| sudo pkill -fai -P1 microsoft | |||||
| sudo pkill -fai -P1 ntpd | |||||
| sudo killall Python | |||||
| sudo killall java | |||||
| } | |||||
| # Every week check to see if ad password will be close to expiring. | |||||
| if [ -e ~/.password ]; then | |||||
| pfile=~/.password | |||||
| last=$(cat ${pfile}) | |||||
| now=$(date +%s) | |||||
| if [ $(( (now - last) > (60*60*24*7) )) -ne 0 ]; then | |||||
| ~/bin/adexpire | |||||
| echo "${now}" > ${pfile} | |||||
| fi | |||||
| fi | |||||
| # wats() | |||||
| # { | |||||
| # eval $(ioreg -n AppleSmartBatteryManager -r -l | grep -iE '\"(Voltage|InstantAmperage)\" =' | tr -d '"' | tr -d " ") | |||||
| # printf "~ %.2f watts\n" $(( (Voltage/1000.0) * (InstantAmperage/1000.0) )) | |||||
| # } | |||||
| # eval $(system_profiler SPPowerDataType | grep -iE 'Amperage|Voltage' | sed -e 's| [(]m[AV][)][:] |=|g' | tr -d '-') | |||||
| # printf "~ %.2f watts\n" $(( (Voltage/1000.0) * (Amperage/1000.0) )) | |||||
| chkupdate() | |||||
| { | |||||
| (sudo softwareupdate --list --all & | |||||
| /Library/Application\ Support/Microsoft/MAU2.0/Microsoft\ AutoUpdate.app/Contents/MacOS/msupdate --list & | |||||
| wait | |||||
| ) | |||||
| } | |||||
| updateitall() | |||||
| { | |||||
| (sudo softwareupdate --install --all --include-config-data | |||||
| /Library/Application\ Support/Microsoft/MAU2.0/Microsoft\ AutoUpdate.app/Contents/MacOS/msupdate --install & | |||||
| wait | |||||
| ) | |||||
| } | |||||
| # os_token() | |||||
| # { | |||||
| # token_sh=$(openstack token issue -c id -c project_id -f shell) | |||||
| # os_rc=$? | |||||
| # token_eval=$(echo "${token_sh}" | sed -e 's|project_id=|export OS_PROJECT_ID=|' -e 's|id=|export OS_TOKEN=|') | |||||
| # # strip out OS_ vars we don't want exposed any longer, force auth to using tokens | |||||
| # if [ $os_rc ] ; then | |||||
| # eval "$token_eval" | |||||
| # export OS_AUTH_TYPE=token | |||||
| # unset OS_PASSWORD | |||||
| # unset OS_USER_DOMAIN_NAME | |||||
| # else | |||||
| # printf "nope %s rc: $d" "$token_sh" "$os_rc" >&2 | |||||
| # fi | |||||
| # } | |||||
| #+END_SRC | |||||
| Ldapsearch aliases to make it easier to poke around in ldap. | |||||
| NOTE: most of these examples are just using filters on data in ldap | |||||
| they also presume you're on the relevant vpn | |||||
| dump out a specific user in the cray ldap | |||||
| cray "(sAMAccountName=$USER)" | |||||
| examples: | |||||
| Get a managers employee number in hpe ldap | |||||
| hpe "(cn=*eter*ojanic)" cn employeeNumber | |||||
| Then get all the email addresses of their reports | |||||
| hpe "(managerEmployeeNumber=35016016)" cn mail | |||||
| #+BEGIN_SRC sh :tangle (tangle/file ".profile" (bound-and-true-p cray-p)) | |||||
| alias cray='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' | |||||
| alias hpe='ldapsearch -LLL -x -H ldaps://hpe-pro-ods-ed.infra.hpecorp.net -b o=hp.com' | |||||
| #+END_SRC | |||||
| silly functions to make using k8s in minikube a bit less annoying | |||||
| #+BEGIN_SRC sh :tangle (tangle/file ".profile" (bound-and-true-p cray-p)) | |||||
| mk() | |||||
| { | |||||
| if [ $1 = "kubectl" ]; then | |||||
| shift; | |||||
| echo minikube kubectl -- $* | |||||
| minikube kubectl -- $* | |||||
| else | |||||
| echo minikube $* | |||||
| minikube $* | |||||
| fi | |||||
| } | |||||
| #+END_SRC | |||||
| #+BEGIN_SRC sh :tangle (tangle/file ".profile" (bound-and-true-p cray-p)) | |||||
| fixpock() | |||||
| { | |||||
| close Pock | |||||
| open -a Pock | |||||
| } | |||||
| leaving() | |||||
| { | |||||
| fixpock | |||||
| hdiutil eject /Volumes/backup | |||||
| } | |||||
| #+END_SRC | |||||
| @@ -311,6 +311,33 @@ Typing out *yes* or *no* is stupid. | |||||
| (fset 'yes-or-no-p 'y-or-n-p) | (fset 'yes-or-no-p 'y-or-n-p) | ||||
| #+END_SRC | #+END_SRC | ||||
| Disable the stupid prompt added in 23.2 that asks if you want to kill a buffer with a process attached. Yes, obviously, shut up and do it. | |||||
| #+BEGIN_SRC emacs-lisp | |||||
| (setq kill-buffer-query-functions | |||||
| (remq 'process-kill-buffer-query-function | |||||
| kill-buffer-query-functions)) | |||||
| #+END_SRC | |||||
| TESTING tooltip mode | |||||
| Puts all tooltips in the echo arear. | |||||
| #+BEGIN_SRC emacs-lisp | |||||
| (tooltip-mode -1) | |||||
| (custom-set-variables | |||||
| '(tooltip-use-echo-area t)) | |||||
| #+END_SRC | |||||
| TESTING redisplay | |||||
| Have emacs not redraw the display before processing input events. | |||||
| #+BEGIN_SRC emacs-lisp | |||||
| (custom-set-variables | |||||
| '(redisplay-dont-pause t)) | |||||
| #+END_SRC | |||||
| *** osx specific | *** osx specific | ||||
| **** no yes-or-no gui windows | **** no yes-or-no gui windows | ||||
| @@ -384,11 +411,14 @@ Also have the scratch buffer be empty instead of have the derp message I never r | |||||
| *** fonts | *** fonts | ||||
| List of fonts in order of preference. | |||||
| List of fonts in order of preference. Set preferred font list when we're in a | |||||
| gui emacs session. | |||||
| #+BEGIN_SRC emacs-lisp | #+BEGIN_SRC emacs-lisp | ||||
| (defvar my/gui-fonts | (defvar my/gui-fonts | ||||
| '( | '( | ||||
| "ComicCode" | |||||
| "Comic Code" | |||||
| "PragmataPro" | "PragmataPro" | ||||
| "Pragmata Pro" ;; Seems to register differently on osx than X | "Pragmata Pro" ;; Seems to register differently on osx than X | ||||
| "Source Code Pro" | "Source Code Pro" | ||||
| @@ -396,14 +426,9 @@ List of fonts in order of preference. | |||||
| "Monaco" | "Monaco" | ||||
| ) | ) | ||||
| ) | ) | ||||
| #+END_SRC | |||||
| Set preferred font list when we're in a gui emacs session. | |||||
| #+BEGIN_SRC emacs-lisp | |||||
| (with-no-warnings | (with-no-warnings | ||||
| (when window-system | (when window-system | ||||
| (if (find-font (font-spec :name (car my/gui-fonts))) | |||||
| (if (find-font (font-spec :name (car my/gui-fonts))) | |||||
| (progn (set-frame-font (car my/gui-fonts)) | (progn (set-frame-font (car my/gui-fonts)) | ||||
| (set-face-attribute 'default nil :height 180)) | (set-face-attribute 'default nil :height 180)) | ||||
| (progn (set-gui-font (cdr my/gui-fonts)))) | (progn (set-gui-font (cdr my/gui-fonts)))) | ||||
| @@ -433,6 +458,17 @@ Set preferred font list when we're in a gui emacs session. | |||||
| All the packages I use. | All the packages I use. | ||||
| *** editorconfig | |||||
| If editorconfig is around use it. | |||||
| #+BEGIN_SRC emacs-lisp | |||||
| (use-package editorconfig | |||||
| :ensure t | |||||
| :config | |||||
| (editorconfig-mode 1)) | |||||
| #+END_SRC | |||||
| *** tramp | *** tramp | ||||
| #+BEGIN_SRC emacs-lisp | #+BEGIN_SRC emacs-lisp | ||||
| @@ -628,7 +664,6 @@ Org-mode keybindings and settings, pretty sparse really. | |||||
| #+BEGIN_SRC emacs-lisp | #+BEGIN_SRC emacs-lisp | ||||
| (use-package org | (use-package org | ||||
| :ensure org-plus-contrib | |||||
| :bind (("C-c a" . org-agenda) | :bind (("C-c a" . org-agenda) | ||||
| ("C-c b" . org-iswitchb) | ("C-c b" . org-iswitchb) | ||||
| ("C-c c" . org-capture) | ("C-c c" . org-capture) | ||||
| @@ -674,8 +709,8 @@ Org-mode keybindings and settings, pretty sparse really. | |||||
| (sh . t) | (sh . t) | ||||
| ))) | ))) | ||||
| (add-hook 'after-init-hook (lambda () (org-reload))) | (add-hook 'after-init-hook (lambda () (org-reload))) | ||||
| ) | |||||
| ) | |||||
| ) | |||||
| ) | |||||
| (use-package org-bullets | (use-package org-bullets | ||||
| :ensure t | :ensure t | ||||
| :init | :init | ||||
| @@ -700,13 +735,26 @@ Org-mode keybindings and settings, pretty sparse really. | |||||
| `(org-level-3 ((t (,@headline ,@variable-tuple :height 1.25)))) | `(org-level-3 ((t (,@headline ,@variable-tuple :height 1.25)))) | ||||
| `(org-level-2 ((t (,@headline ,@variable-tuple :height 1.5)))) | `(org-level-2 ((t (,@headline ,@variable-tuple :height 1.5)))) | ||||
| `(org-level-1 ((t (,@headline ,@variable-tuple :height 1.75)))) | `(org-level-1 ((t (,@headline ,@variable-tuple :height 1.75)))) | ||||
| `(org-document-title ((t (,@headline ,@variable-tuple :height 1.5 :underline nil)))))) | |||||
| ) | |||||
| `(org-document-title ((t (,@headline ,@variable-tuple :height 1.5 :underline nil))))))) | |||||
| (font-lock-add-keywords 'org-mode | (font-lock-add-keywords 'org-mode | ||||
| '(("^ +\\([-*]\\) " | '(("^ +\\([-*]\\) " | ||||
| (0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•")))))) | (0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•")))))) | ||||
| ) | ) | ||||
| ) | ) | ||||
| (use-package org-roam | |||||
| :hook | |||||
| (after-init . org-roam-mode) | |||||
| :init | |||||
| (custom-set-variables '(org-roam-directory "~/.emacs.d")) | |||||
| :bind (:map org-roam-mode-map | |||||
| (("C-c n l" . org-roam) | |||||
| ("C-c n f" . org-roam-find-file) | |||||
| ("C-c n j" . org-roam-jump-to-index) | |||||
| ("C-c n b" . org-roam-switch-to-buffer) | |||||
| ("C-c n g" . org-roam-graph)) | |||||
| :map org-mode-map | |||||
| (("C-c n i" . org-roam-insert)))) | |||||
| (use-package ob-async) | |||||
| #+END_SRC | #+END_SRC | ||||
| #+BEGIN_SRC emacs-lisp :tangle no | #+BEGIN_SRC emacs-lisp :tangle no | ||||
| @@ -767,7 +815,9 @@ Not tangled into the config intentionally. | |||||
| Auto complete functionality is nice to have. | Auto complete functionality is nice to have. | ||||
| #+BEGIN_SRC emacs-lisp | |||||
| FIXME! | |||||
| #+BEGIN_SRC emacs-lisp :tangle no | |||||
| (use-package auto-complete | (use-package auto-complete | ||||
| :diminish auto-complete-mode | :diminish auto-complete-mode | ||||
| :ensure t | :ensure t | ||||
| @@ -865,7 +915,9 @@ Highlight TODO/FIXME type messages in comments. | |||||
| *** projectile | *** projectile | ||||
| #+BEGIN_SRC emacs-lisp | |||||
| FIXME! | |||||
| #+BEGIN_SRC emacs-lisp :tangle no | |||||
| (use-package projectile | (use-package projectile | ||||
| :diminish projectile-mode | :diminish projectile-mode | ||||
| :ensure t | :ensure t | ||||
| @@ -936,6 +988,28 @@ So I write gooder. Me fail English? Thats unpossible. | |||||
| (use-package writegood-mode :ensure t) | (use-package writegood-mode :ensure t) | ||||
| #+END_SRC | #+END_SRC | ||||
| *** org-jira | |||||
| Cause I have to use jira, sigh. | |||||
| #+BEGIN_SRC emacs-lisp | |||||
| (use-package org-jira | |||||
| :ensure t | |||||
| :config | |||||
| (progn | |||||
| (custom-set-variables | |||||
| '(jiralib-url "https://connect.us.cray.com/jira") | |||||
| ) | |||||
| ) | |||||
| ) | |||||
| #+END_SRC | |||||
| *** rust-mode | |||||
| #+BEGIN_SRC emacs-lisp | |||||
| (use-package rust-mode :commands rust-mode :mode ("\\*.rs\\'" . rust-mode) | |||||
| :ensure t) | |||||
| #+END_SRC | |||||
| *** python-mode | *** python-mode | ||||
| Compress down python configuration a bit. | Compress down python configuration a bit. | ||||
| @@ -947,24 +1021,6 @@ Compress down python configuration a bit. | |||||
| :ensure t | :ensure t | ||||
| :init | :init | ||||
| (progn | (progn | ||||
| (use-package jedi | |||||
| :ensure t | |||||
| :init | |||||
| (progn | |||||
| (jedi:install-server) | |||||
| ) | |||||
| :config | |||||
| (progn | |||||
| (custom-set-variables | |||||
| '(jedi:complete-on-dot t) | |||||
| '(jedi:install-imenu t) | |||||
| ) | |||||
| ) | |||||
| :bind | |||||
| (("M-." . jedi:goto-definition) | |||||
| ("M-," . jedi:goto-definition-pop-marker) | |||||
| ) | |||||
| ) | |||||
| (use-package company-anaconda | (use-package company-anaconda | ||||
| :ensure t | :ensure t | ||||
| :config | :config | ||||
| @@ -983,7 +1039,6 @@ Compress down python configuration a bit. | |||||
| (progn | (progn | ||||
| (add-hook 'python-mode-hook' | (add-hook 'python-mode-hook' | ||||
| (lambda () | (lambda () | ||||
| (jedi:setup) | |||||
| (push '("lambda" . ?λ) prettify-symbols-alist) | (push '("lambda" . ?λ) prettify-symbols-alist) | ||||
| (push '("<=" . ?≤) prettify-symbols-alist) | (push '("<=" . ?≤) prettify-symbols-alist) | ||||
| (push '(">=" . ?≥) prettify-symbols-alist) | (push '(">=" . ?≥) prettify-symbols-alist) | ||||
| @@ -1123,10 +1178,9 @@ Make undo more useful, and treelike. | |||||
| #+BEGIN_SRC emacs-lisp | #+BEGIN_SRC emacs-lisp | ||||
| (use-package undo-tree | (use-package undo-tree | ||||
| :diminish undo-tree-mode | |||||
| :ensure t | :ensure t | ||||
| :init | :init | ||||
| (progn (global-undo-tree-mode)) | |||||
| (global-undo-tree-mode) | |||||
| :config | :config | ||||
| (progn (defadvice undo-tree-visualize (around undo-tree-split-side-by-side activate) | (progn (defadvice undo-tree-visualize (around undo-tree-split-side-by-side activate) | ||||
| "Split undo-tree side-by-side" | "Split undo-tree side-by-side" | ||||
| @@ -1142,7 +1196,8 @@ Make undo more useful, and treelike. | |||||
| *** color-identifiers-mode | *** color-identifiers-mode | ||||
| Color variables for easy identification, its like a rainbow puked over everything opened in prog-mode-hook. | |||||
| Color variables for easy identification, its like a rainbow puked over | |||||
| everything opened in prog-mode-hook. | |||||
| #+BEGIN_SRC emacs-lisp | #+BEGIN_SRC emacs-lisp | ||||
| (use-package color-identifiers-mode | (use-package color-identifiers-mode | ||||
| @@ -1153,12 +1208,38 @@ Color variables for easy identification, its like a rainbow puked over everythin | |||||
| ) | ) | ||||
| #+END_SRC | #+END_SRC | ||||
| *** nix-mode | |||||
| *** idle-highlight-mode | |||||
| Highlight a variable when you're selecting it, helps in reviewing code to see | |||||
| where it exists. | |||||
| #+BEGIN_SRC emacs-lisp | |||||
| (use-package idle-highlight-mode | |||||
| :diminish idle-highlight-mode | |||||
| :ensure t | |||||
| :config | |||||
| (add-hook 'prog-mode-hook 'idle-highlight-mode) | |||||
| ) | |||||
| #+END_SRC | |||||
| *** nix | |||||
| Instead of text might as well get a decent mode hook going here. | Instead of text might as well get a decent mode hook going here. | ||||
| #+BEGIN_SRC emacs-lisp | #+BEGIN_SRC emacs-lisp | ||||
| (use-package nixos-options :ensure t) | |||||
| (use-package company-nixos-options :ensure t) | |||||
| #+END_SRC | |||||
| #+BEGIN_SRC emacs-lisp :tangle no | |||||
| (use-package nix-mode :ensure t) | (use-package nix-mode :ensure t) | ||||
| (setq flycheck-command-wrapper-function | |||||
| (lambda (command) (apply 'nix-shell-command (nix-current-sandbox) command)) | |||||
| flycheck-executable-find | |||||
| (lambda (cmd) (nix-executable-find (nix-current-sandbox) cmd))) | |||||
| (add-to-list 'company-backends 'company-nixos-options) | |||||
| #+END_SRC | #+END_SRC | ||||
| *** docker-mode | *** docker-mode | ||||
| @@ -1186,7 +1267,6 @@ Common mode defaults I think are sensible. | |||||
| #+BEGIN_SRC emacs-lisp | #+BEGIN_SRC emacs-lisp | ||||
| (add-hook 'prog-mode-hook | (add-hook 'prog-mode-hook | ||||
| '(lambda () | '(lambda () | ||||
| (auto-complete-mode) ;; can't get this to work with use-package easily | |||||
| (interactive) | (interactive) | ||||
| (hl-line-mode) | (hl-line-mode) | ||||
| (whitespace-mode) | (whitespace-mode) | ||||
| @@ -13,11 +13,16 @@ General git configuration split out into sections mostly. | |||||
| * ~/.gitconfig | * ~/.gitconfig | ||||
| ** pager | ** pager | ||||
| All pager, all the time, always use color with it too. | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) | #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) | ||||
| [pager] | [pager] | ||||
| color = true | color = true | ||||
| #+END_SRC | #+END_SRC | ||||
| ** color | ** color | ||||
| #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) | #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) | ||||
| [color] | [color] | ||||
| status = auto | status = auto | ||||
| @@ -38,6 +43,9 @@ General git configuration split out into sections mostly. | |||||
| new = green reverse | new = green reverse | ||||
| #+END_SRC | #+END_SRC | ||||
| ** alias | ** alias | ||||
| Aliases so I can be lay zee. | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) | #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) | ||||
| [alias] | [alias] | ||||
| begin = !git init && git commit --allow-empty -m 'Initial empty commit' | begin = !git init && git commit --allow-empty -m 'Initial empty commit' | ||||
| @@ -64,79 +72,189 @@ General git configuration split out into sections mostly. | |||||
| effit = reset --hard | effit = reset --hard | ||||
| bn = rev-parse --abbrev-ref HEAD | bn = rev-parse --abbrev-ref HEAD | ||||
| cp = log --no-merges --cherry --graph --oneline | cp = log --no-merges --cherry --graph --oneline | ||||
| # What commits differ between branches, note, equivalent commits are omitted. | |||||
| # Use this with three dot operator aka master...origin/master | |||||
| cpd = log --no-merges --left-right --graph --cherry-pick --oneline | |||||
| # Same as ^ only equivalent commits are listed with a = sign. | |||||
| cmd = log --no-merges --left-right --graph --cherry-mark --oneline | |||||
| # git update with submodule update | |||||
| sup = !git pull --rebase && git submodule update --init --recursive | |||||
| short = rev-parse --short | |||||
| # git clone with submodules | # git clone with submodules | ||||
| sc = !git clone --recursive $1 | sc = !git clone --recursive $1 | ||||
| # what files are getting updated a lot descending output | |||||
| churn = !git log --all -M -C --name-only --format='format:' "$@" | sort | grep -v '^$' | uniq -c | sort -r | awk 'BEGIN {print "count,file"} {print $1 "," $2}' | egrep -v '^\\s+$' | |||||
| # help the gc a bit and get a bit more space back for a local clone | |||||
| trim = !git reflog expire --expire=now --all && git gc --prune=now | |||||
| # git update with submodule update | |||||
| sup = !git pull --rebase && git submodule update --init --recursive | |||||
| wtl = worktree list | |||||
| wtp = worktree prune | |||||
| wta = worktree add | |||||
| wtr = "!git worktree list --porcelain | grep -B2 \"branch refs/heads/$1\" | head -n1 | sed -e 's|worktree ||' #" | |||||
| nwt = "!git worktree add $(git gr)@$1 $1 #" | |||||
| bwt = "!git branch $1 ${2:-HEAD} && git nwt $1 #" | |||||
| gr = "!git rev-parse --absolute-git-dir | sed -e 's|/[.]git.*||' #" | |||||
| # Pull all the commits missed from a git pull --depth N clone | |||||
| unshallow = pull --unshallow | |||||
| # Set the origin to not allow pushing, to be on the safe side. | |||||
| nopush = remote set-url --push origin no_push | |||||
| # default remote, note depends on the repo having been git cloned | # default remote, note depends on the repo having been git cloned | ||||
| defremote = !git branch -rvv | egrep 'HEAD' | awk '{print $1}' | sed -e 's|/HEAD||g' | defremote = !git branch -rvv | egrep 'HEAD' | awk '{print $1}' | sed -e 's|/HEAD||g' | ||||
| # short sha | |||||
| short = rev-parse --short | |||||
| # branch commits on lhs compared to rhs, use via g bcs $(g bn) ^other/branch | |||||
| bcs = log --pretty="%H" --first-parent --no-merges | |||||
| find-merge = !sh -c "commit=$0 && branch=${1:-HEAD} && (git rev-list $commit..$branch --ancestry-path | cat -n; git rev-list $commit..$branch --first-parent | cat -n) | sort -k2 | uniq -f1 -d | sort -n | tail -1 | cut -f2" | |||||
| show-merge = !sh -c "merge=$(git find-merge $0 $1) && [ -n \"$merge\" ] && git show $merge" | |||||
| # push branch while setting the upstream to the default remote | |||||
| pbr = !git push --set-upstream $(git defremote) $(git bn) | |||||
| # ^ but forcefully | |||||
| fpbr = !git push --set-upstream --force $(git defremote) $(git bn) | |||||
| # what files are getting updated a lot descending output | |||||
| churn = !git log --all -M -C --name-only --format='format:' "$@" | sort | grep -v '^$' | uniq -c | sort -r | awk 'BEGIN {print "count,file"} {print $1 "," $2}' | grep -Ev '^\\s+$' | |||||
| # My defremote hack depends on $remote/HEAD to point to somewhere | # My defremote hack depends on $remote/HEAD to point to somewhere | ||||
| # which it may not if the git repo wasn't cloned | # which it may not if the git repo wasn't cloned | ||||
| fixhead = !sh -c "rem=${0:-origin} && branch=${1:-master} && git symbolic-ref refs/remotes/$rem/HEAD refs/remotes/$rem/${branch}" | fixhead = !sh -c "rem=${0:-origin} && branch=${1:-master} && git symbolic-ref refs/remotes/$rem/HEAD refs/remotes/$rem/${branch}" | ||||
| # push branch while setting the upstream to the default remote | |||||
| pbr = !git push --set-upstream $(git defremote) $(git bn) | |||||
| #+END_SRC | |||||
| Some aliases to help with determining which commit(s) are(n't) present in the | |||||
| left/right hand branch. | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) | |||||
| [alias] | |||||
| cpd = log --no-merges --left-right --graph --cherry-pick --oneline | |||||
| cmd = log --no-merges --left-right --graph --cherry-mark --oneline | |||||
| bcs = log --pretty="%H" --first-parent --no-merges | |||||
| #+END_SRC | |||||
| Some helpers for pruning a git repo or maintentance of things that has come in | |||||
| handy over the years. | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) | |||||
| [alias] | |||||
| # kinda/sorta git pull -r without the git pull nonsense | |||||
| # cleanmerged = !sh -c "git branch --merged | grep -Ev '^(. master|\*)' | xargs -n1 git branch -d" | |||||
| # help the gc a bit and get a bit more space back for a local clone | |||||
| trim = !git reflog expire --expire=now --all && git gc --prune=now | |||||
| prune = !sh -c 'git cleanmerged; git fetch -p; git trim' | |||||
| # I don't remember what I used these for tbh, future mitch figure it out. | |||||
| find-merge = !sh -c "commit=$0 && branch=${1:-HEAD} && (git rev-list $commit..$branch --ancestry-path | cat -n; git rev-list $commit..$branch --first-parent | cat -n) | sort -k2 | uniq -f1 -d | sort -n | tail -1 | cut -f2" | |||||
| show-merge = !sh -c "merge=$(git find-merge $0 $1) && [ -n \"$merge\" ] && git show $merge" | |||||
| #+END_SRC | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) | |||||
| [alias] | |||||
| # create a pull request branch based off a pull request, lets you git diff | |||||
| # even if someone rebases a pull request. | |||||
| p = !sh -c 'git branch ${1:-$(git defremote)}pr$0@$(iso8601 -s) $(git ls-remote -q ${1:-$(git defremote)} | grep refs/pull-requests/$0/from | cut -c1-8)' | p = !sh -c 'git branch ${1:-$(git defremote)}pr$0@$(iso8601 -s) $(git ls-remote -q ${1:-$(git defremote)} | grep refs/pull-requests/$0/from | cut -c1-8)' | ||||
| # Pull all the commits missed from a git pull --depth N clone | |||||
| unshallow = pull --unshallow | |||||
| rvers = !sh -c 'commitish=${0:-HEAD} && git describe --first-parent --tags --long --match="cray-*" $commitish | sed -e "s/^cray-//" -e "s/-/./" -e "s/-g.*//"' | |||||
| #+END_SRC | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) | |||||
| [alias] | |||||
| rembranch = !sh -xc "remote=${1:-origin} && git ls-remote --symref -q $remote HEAD | head -n1 | awk '{print $2}' | sed -e 's|refs/heads/||'" | |||||
| merged-remote = !sh -c 'remote=${0:-origin} && git branch --all --merged remotes/$remote/master | grep remotes/$remote | grep -E --invert-match \"(master|HEAD)\" | cut -d \"/\" -f 3-' | |||||
| merged-local = !sh -c 'git branch --all --merged master | grep -E --invert-match \"(master|HEAD|remotes/)\" | cut -b 3-' | |||||
| merged = !sh -c "remote=${0:-origin}; printf 'remote branches: %s\n' $remote >&2; git merged-remote $remote; printf 'local branches\n' >&2 && git merged-local" | |||||
| #+END_SRC | #+END_SRC | ||||
| ** github | ** github | ||||
| My username for github. | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) | #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) | ||||
| [github] | [github] | ||||
| user = mitchty | user = mitchty | ||||
| #+END_SRC | #+END_SRC | ||||
| ** credential | ** credential | ||||
| Use a gpg encrypted .netrc file. | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) | #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) | ||||
| [credential] | [credential] | ||||
| helper = netrc -v -f ~/.netrc.gpg -f ~/.netrc | helper = netrc -v -f ~/.netrc.gpg -f ~/.netrc | ||||
| #+END_SRC | #+END_SRC | ||||
| ** advice | ** advice | ||||
| Shut up already, I don't need hints. | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) | #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) | ||||
| [advice] | [advice] | ||||
| statushints = false | statushints = false | ||||
| #+END_SRC | #+END_SRC | ||||
| ** gui | ** gui | ||||
| If I ever use the stupid gui, make it a little less derp. | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) | #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) | ||||
| [gui] | [gui] | ||||
| fontui = -family Monaco -size 8 -weight normal -slant roman -underline 0 -overstrike 0 | fontui = -family Monaco -size 8 -weight normal -slant roman -underline 0 -overstrike 0 | ||||
| fontdiff = -family Monaco -size 8 -weight normal -slant roman -underline 0 -overstrike 0 | fontdiff = -family Monaco -size 8 -weight normal -slant roman -underline 0 -overstrike 0 | ||||
| #+END_SRC | #+END_SRC | ||||
| ** http | ** http | ||||
| Make large git repos work better by increasing the post buffer. | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) | #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) | ||||
| [http] | [http] | ||||
| postBuffer = 209715200 | postBuffer = 209715200 | ||||
| #+END_SRC | #+END_SRC | ||||
| ** push | ** push | ||||
| Forgot why this was here, some version git changed the default push behavior. | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) | #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) | ||||
| [push] | [push] | ||||
| default = simple | default = simple | ||||
| #+END_SRC | #+END_SRC | ||||
| ** url rewrites | ** url rewrites | ||||
| Don't use git:// (ssh) to connect to github. | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) | #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) | ||||
| [url "https://github.com/"] | [url "https://github.com/"] | ||||
| insteadOf = git://github.com/ | insteadOf = git://github.com/ | ||||
| #+END_SRC | #+END_SRC | ||||
| ** username/email | ** username/email | ||||
| Default username and email to use if not overridden. Note, this only applies to | |||||
| where I actually do any commits. | |||||
| My layout is ~/src/domain/... Not all domains might end up getting thrown in | |||||
| here. Adjust what username/email gets used. Git 2.13+ only. Mostly for work | |||||
| related stuff. | |||||
| TODO: Switch to my domain from google garbage for email. | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) | #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) | ||||
| [user] | [user] | ||||
| name = Mitch Tishmack | name = Mitch Tishmack | ||||
| email = mitch.tishmack@gmail.com | email = mitch.tishmack@gmail.com | ||||
| #+END_SRC | #+END_SRC | ||||
| This silly text is here to make git merges easier for private branches. I got | |||||
| sick of resolving silly merge conflicts. Let the fuzz detection figure it out. | |||||
| HUNK PADDING | |||||
| HUNK PADDING | |||||
| HUNK PADDING | |||||
| Only really use git lfs at work. | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) | |||||
| [includeIf "gitdir:~/src/stash.us.cray.com"] | |||||
| path = ~/.gitconfig-cray | |||||
| #+END_SRC | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) | |||||
| [user] | |||||
| name = Mitch Tishmack | |||||
| email = mtishmack@cray.com | |||||
| #+END_SRC | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (and (bound-and-true-p git-p) (bound-and-true-p cray-p))) | |||||
| [filter "lfs"] | |||||
| clean = git-lfs clean -- %f | |||||
| smudge = git-lfs smudge -- %f | |||||
| process = git-lfs filter-process | |||||
| required = true | |||||
| #+END_SRC | |||||
| END HUNK PADDING | |||||
| END HUNK PADDING | |||||
| END HUNK PADDING | |||||
| * ~/.gitignore | * ~/.gitignore | ||||
| Common crap/build artifacts that git should always ignore. | Common crap/build artifacts that git should always ignore. | ||||
| @@ -15,7 +15,7 @@ Nix user config.nix setup. | |||||
| { | { | ||||
| packageOverrides = pkgs: with pkgs; | packageOverrides = pkgs: with pkgs; | ||||
| let in rec { | let in rec { | ||||
| custom-pinentry = pinentry.override { gtk2 = null; qt4 = null; ncurses = null; }; | |||||
| custom-pinentry = pinentry.override { gtk2 = null; ncurses = null; }; | |||||
| custom-youtube-dl = python27Packages.youtube-dl.override { pandoc = null; }; | custom-youtube-dl = python27Packages.youtube-dl.override { pandoc = null; }; | ||||
| default = buildEnv { | default = buildEnv { | ||||
| @@ -25,10 +25,8 @@ Nix user config.nix setup. | |||||
| aria | aria | ||||
| aspell | aspell | ||||
| aspellDicts.en | aspellDicts.en | ||||
| cabal-install | |||||
| cacert | cacert | ||||
| clang | clang | ||||
| clang-analyzer | |||||
| cloc | cloc | ||||
| cscope | cscope | ||||
| ctags | ctags | ||||
| @@ -37,48 +35,37 @@ Nix user config.nix setup. | |||||
| custom-youtube-dl | custom-youtube-dl | ||||
| diffutils | diffutils | ||||
| docbook5 | docbook5 | ||||
| duply | |||||
| emacs | emacs | ||||
| entr | entr | ||||
| gdbm | |||||
| ghostscript | |||||
| gist | gist | ||||
| gitAndTools.git-extras | gitAndTools.git-extras | ||||
| gitAndTools.gitFull | gitAndTools.gitFull | ||||
| gmp | gmp | ||||
| gnumake | gnumake | ||||
| gnupg | |||||
| gnupg1compat | |||||
| gnutar | gnutar | ||||
| gnutls | gnutls | ||||
| googler | |||||
| graphviz-nox | graphviz-nox | ||||
| haskellPackages.ShellCheck | haskellPackages.ShellCheck | ||||
| haskellPackages.ghc-mod | |||||
| haskellPackages.hasktags | |||||
| haskellPackages.hindent | |||||
| haskellPackages.hspec | |||||
| haskellPackages.pandoc | haskellPackages.pandoc | ||||
| htop | htop | ||||
| imagemagick | imagemagick | ||||
| iperf | iperf | ||||
| jq | jq | ||||
| keychain | keychain | ||||
| lastpass-cli | |||||
| less | less | ||||
| llvm | llvm | ||||
| mercurial | mercurial | ||||
| moreutils | moreutils | ||||
| mosh | mosh | ||||
| mr | mr | ||||
| multitail | |||||
| munge | |||||
| ncdu | |||||
| openssl | openssl | ||||
| p7zip | p7zip | ||||
| patchutils | patchutils | ||||
| pbzip2 | pbzip2 | ||||
| pigz | |||||
| pixz | |||||
| pkgconfig | |||||
| pkg-config | |||||
| ponysay | |||||
| pv | pv | ||||
| python27Packages.flake8 | python27Packages.flake8 | ||||
| python27Packages.howdoi | python27Packages.howdoi | ||||
| @@ -86,15 +73,18 @@ Nix user config.nix setup. | |||||
| python27Packages.pyflakes | python27Packages.pyflakes | ||||
| python27Packages.pylint | python27Packages.pylint | ||||
| python27Packages.virtualenv | python27Packages.virtualenv | ||||
| restic | |||||
| ripgrep | |||||
| rlwrap | rlwrap | ||||
| rsync | rsync | ||||
| rtags | rtags | ||||
| shfmt | |||||
| silver-searcher | silver-searcher | ||||
| sloccount | sloccount | ||||
| sshpass | sshpass | ||||
| stack | |||||
| texlive.combined.scheme-full | |||||
| texlive.combined.scheme-basic | |||||
| tmux | tmux | ||||
| transcrypt | |||||
| tree | tree | ||||
| unzip | unzip | ||||
| upx | upx | ||||
| @@ -102,7 +92,7 @@ Nix user config.nix setup. | |||||
| watch | watch | ||||
| wget | wget | ||||
| xz | xz | ||||
| zlib | |||||
| yq | |||||
| # If I ever come up with some linux only stuff or figure out xhyve | # If I ever come up with some linux only stuff or figure out xhyve | ||||
| # ] ++ stdenv.lib.optionals stdenv.isLinux [ | # ] ++ stdenv.lib.optionals stdenv.isLinux [ | ||||
| # ] ++ stdenv.lib.optionals stdenv.isDarwin [ | # ] ++ stdenv.lib.optionals stdenv.isDarwin [ | ||||
| @@ -0,0 +1,15 @@ | |||||
| ;;-*-mode: emacs-lisp; coding: utf-8;-*- | |||||
| ;; File: mbp-mtishmack.el | |||||
| ;; Copyright: 2017 Mitch Tishmack | |||||
| ;; Description: options for cray ws | |||||
| ;;(setq testing t) | |||||
| (setq macos-p t) | |||||
| (setq nix-p t) | |||||
| (setq tmux-p t) | |||||
| (setq git-p t) | |||||
| (setq emacs-p t) | |||||
| (setq zsh-p t) | |||||
| (setq mosh-p t) | |||||
| (setq haskell-p t) | |||||
| (setq perl-p t) | |||||
| (setq cray-p t) | |||||
| @@ -0,0 +1 @@ | |||||
| (setq cray-p t) | |||||
| @@ -0,0 +1,13 @@ | |||||
| ;;-*-mode: emacs-lisp; coding: utf-8;-*- | |||||
| ;; File: mbp.el | |||||
| ;; Copyright: 2017 Mitch Tishmack | |||||
| ;; Description: Options for mb laptop | |||||
| ;;(setq testing t) | |||||
| (setq macos-p t) | |||||
| (setq nix-p t) | |||||
| (setq tmux-p t) | |||||
| (setq git-p t) | |||||
| (setq emacs-p t) | |||||
| (setq zsh-p t) | |||||
| (setq mosh-p t) | |||||
| (setq perl-p t) | |||||
| @@ -0,0 +1,15 @@ | |||||
| ;;-*-mode: emacs-lisp; coding: utf-8;-*- | |||||
| ;; File: mbp-mtishmack.el | |||||
| ;; Copyright: 2017 Mitch Tishmack | |||||
| ;; Description: options for cray ws | |||||
| ;;(setq testing t) | |||||
| (setq macos-p t) | |||||
| (setq nix-p t) | |||||
| (setq tmux-p t) | |||||
| (setq git-p t) | |||||
| (setq emacs-p t) | |||||
| (setq zsh-p t) | |||||
| (setq mosh-p t) | |||||
| (setq haskell-p t) | |||||
| (setq perl-p t) | |||||
| (setq cray-p t) | |||||
| @@ -0,0 +1,13 @@ | |||||
| ;;-*-mode: emacs-lisp; coding: utf-8;-*- | |||||
| ;; File: mbp.el | |||||
| ;; Copyright: 2017 Mitch Tishmack | |||||
| ;; Description: Options for mbp laptop | |||||
| ;;(setq testing t) | |||||
| (setq macos-p t) | |||||
| (setq nix-p t) | |||||
| (setq tmux-p t) | |||||
| (setq git-p t) | |||||
| (setq emacs-p t) | |||||
| (setq zsh-p t) | |||||
| (setq mosh-p t) | |||||
| (setq perl-p t) | |||||
| @@ -0,0 +1 @@ | |||||
| (setq cray-p nil) | |||||
| @@ -8,64 +8,158 @@ | |||||
| #+PROPERTY: header-args :comments no | #+PROPERTY: header-args :comments no | ||||
| #+PROPERTY: header-args :replace yes | #+PROPERTY: header-args :replace yes | ||||
| Tmux configuration. Pretty boring in most ways. | |||||
| Tmux configuration | |||||
| Use vi mode for tmux keybindings. Means if we start emacs up, no conflicts for | |||||
| keybinds. Also set aggressive resize so our panes resize somewhat sanely with | |||||
| multiple clients. | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".tmux.conf" (bound-and-true-p tmux-p)) | #+BEGIN_SRC conf :tangle (tangle/file ".tmux.conf" (bound-and-true-p tmux-p)) | ||||
| # Setup vi mode by default | |||||
| set-window-option -g mode-keys vi | set-window-option -g mode-keys vi | ||||
| set-window-option -g aggressive-resize on | set-window-option -g aggressive-resize on | ||||
| #+END_SRC | |||||
| Use the only shell that matters for our login shell. Set our TERM to | |||||
| xterm-256color as well. | |||||
| # Force zsh to be a login shell | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".tmux.conf" (bound-and-true-p tmux-p)) | |||||
| set-option -g default-command 'zsh -l' | set-option -g default-command 'zsh -l' | ||||
| set-option -g default-terminal 'xterm-256color' | set-option -g default-terminal 'xterm-256color' | ||||
| #+END_SRC | |||||
| # Status line options, mainly coloring | |||||
| set-window-option -g window-status-bg colour6 | |||||
| set-window-option -g window-status-fg black | |||||
| set-window-option -g window-status-current-bg white | |||||
| Status line options. For the status line we want the selected window tabish | |||||
| thing to be white background and black foreground. | |||||
| # Selection highlight color | |||||
| set-window-option -g mode-style bg=red,fg=black | |||||
| Use the default coloring which is white on black. Helps make the current tab | |||||
| rather obvious from color alone ignoring the * character. | |||||
| Additionally, setup the status lines so we have a mostly minimal setup on what | |||||
| is displayed. Try to keep things as minimal as possible. | |||||
| # Status line options | |||||
| set-option -g status-bg black | |||||
| set-option -g status-fg colour7 | |||||
| Also note the status-interval is 7 seconds long, this is intentional as it | |||||
| ensures that any skew on waking up/updating isn't visible. Yes I'm weird in that | |||||
| if I specify 5 and don't get things updated every 0-4 seconds it annoys me. | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".tmux.conf" (bound-and-true-p tmux-p)) | |||||
| set-window-option -g window-status-current-style bg=white,fg=black | |||||
| set-window-option -g window-status-style default | |||||
| set-option -g window-status-format '#I #W#F' | |||||
| set-option -g window-status-current-format '#I:#W#{?window_zoomed_flag, 🔍,}' | |||||
| set-option -g status-style bg=black,fg=colour7 | |||||
| set-option -g status-interval 7 | |||||
| set-option -g status-left-length 24 | set-option -g status-left-length 24 | ||||
| set-option -g status-left '' | set-option -g status-left '' | ||||
| #+END_SRC | |||||
| Right status just with Day HH:MM:SS to the right. | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".tmux.conf" (bound-and-true-p tmux-p)) | |||||
| set-option -g status-right-length 13 | set-option -g status-right-length 13 | ||||
| set-option -g status-right "%a %H:%M:%S" | set-option -g status-right "%a %H:%M:%S" | ||||
| set-option -g status-interval 7 | |||||
| #+END_SRC | |||||
| Right status with battery shenanigans. Only present on macos for now. | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".tmux.conf" (bound-and-true-p tmux-p)) | |||||
| set-option -g status-right-length 20 | |||||
| set-option -g @batt_remain_minimal true | |||||
| set-option -g @batt_icon_status_charged ' ' | |||||
| set-option -g @batt_icon_status_charging '↑' | |||||
| set-option -g @batt_icon_status_discharging '↓' | |||||
| set-option -g @batt_icon_status_unknown '?' | |||||
| set-option -g @batt_color_status_primary_discharging colour9 | |||||
| set-option -g status-right "#{battery_color_fg}#{battery_icon_status}#[default] #{battery_color_charge_bg}#{battery_remain}#[default] %a %H:%M:%S" | |||||
| run-shell ~/src/github.com/tmux-plugins/tmux-battery/battery.tmux | |||||
| #+END_SRC | |||||
| The highlight style is how tmux renders selected text. Black on red is what I | |||||
| use to make it obvious what is being selected. | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".tmux.conf" (bound-and-true-p tmux-p)) | |||||
| set-window-option -g mode-style bg=red,fg=black | |||||
| #+END_SRC | |||||
| Pane border options, mostly an attempt to mimic/ape the status line setup. | |||||
| Intent is we want to know what pane we're selected into, however we only set the | |||||
| foreground so that if we are on a white on black, or black on white or some | |||||
| other scheme we don't have a gaudy background for the panes. | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".tmux.conf" (bound-and-true-p tmux-p)) | |||||
| set-option -g pane-border-style fg=colour7 | |||||
| set-option -g pane-active-border-style fg=colour2 | |||||
| #+END_SRC | |||||
| # Pane border options, mimics the status line coloring | |||||
| set-option -g pane-border-bg colour15 | |||||
| set-option -g pane-border-fg colour82 | |||||
| set-option -g pane-active-border-bg colour15 | |||||
| set-option -g pane-active-border-fg colour2 | |||||
| TTY alert character stuff. Much like a phone, don't make a sound. Leave that | |||||
| kinda gaudy sound beeps to boomers. | |||||
| # Alert related things | |||||
| Basically flash the message/status bar with a black on white message. | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".tmux.conf" (bound-and-true-p tmux-p)) | |||||
| set-option -g visual-activity on | set-option -g visual-activity on | ||||
| set-option -g visual-bell on | set-option -g visual-bell on | ||||
| set-option -g message-bg colour7 | |||||
| set-option -g message-fg black | |||||
| set-option -g message-style bg=colour7,fg=black | |||||
| #+END_SRC | |||||
| Use the window title if available and update it if it changes. Aka, in | |||||
| iterm2/Terminal.app on macos generally this is set to the active command or | |||||
| shell. | |||||
| # Pass through the window title and display it automatically on changes. | |||||
| Can rename it to something else if we want as well. | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".tmux.conf" (bound-and-true-p tmux-p)) | |||||
| set-option -g set-titles on | set-option -g set-titles on | ||||
| set-option -g set-titles-string '#T' | set-option -g set-titles-string '#T' | ||||
| set-window-option -g automatic-rename on | set-window-option -g automatic-rename on | ||||
| #+END_SRC | |||||
| Custom key rebindings. | |||||
| # Key rebinding to make things more au naturalle | |||||
| PREFIX + R = Reload tmux configuration. | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".tmux.conf" (bound-and-true-p tmux-p)) | |||||
| bind-key R \ | bind-key R \ | ||||
| source-file ~/.tmux.conf \;\ | source-file ~/.tmux.conf \;\ | ||||
| display 'reloaded tmux config' | |||||
| display 'reloaded ~/.tmux.conf' | |||||
| #+END_SRC | |||||
| Note, this uses tmux 2.9 syntax now. Which is annoying af, used to be able to | |||||
| just modify the fg/bg independently but now if you set the current style fg, it | |||||
| presumes default for everything *GRRRR*. | |||||
| So if you have to care about the background have to check that as well. Current | |||||
| strategy here is to dump out the window options and look for | |||||
| window-status-current-style and yoink the existing bg if present. | |||||
| Essentially the foreground is changed to green when logging this pane. | |||||
| Background is set to red when synchronizing. That's about it. | |||||
| PREFIX + o = L*o*g pane output to a file. | |||||
| Saved with the iso8601 command for the name. Also change the foreground text to | |||||
| green so we know we're logging. | |||||
| # FIXME | |||||
| # Log pane output to a file, save with an iso8601 datestamp | |||||
| #+BEGIN_SRC conf :tangle no | |||||
| bind-key o \ | bind-key o \ | ||||
| pipe-pane -o "cat >> $HOME/tmux-`iso8601`.log" \;\ | pipe-pane -o "cat >> $HOME/tmux-`iso8601`.log" \;\ | ||||
| set-window-option window-status-current-fg green \; | |||||
| if-shell \ | |||||
| "tmux show-window-options | grep 'window-status-current-style' | grep fg=green'" \ | |||||
| "set-window-option | |||||
| "display 'stopping logging pane output' | |||||
| set-window-option window-status-current-style fg=green | |||||
| #+END_SRC | |||||
| PREFIX + O = St*O*p logging pane output. Also reset the fg color back to default. | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".tmux.conf" (bound-and-true-p tmux-p)) | |||||
| bind-key O \ | bind-key O \ | ||||
| pipe-pane \;\ | pipe-pane \;\ | ||||
| set-window-option window-status-current-fg default \; | |||||
| set-window-option window-status-current-style default \; | |||||
| #+END_SRC | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".tmux.conf" (bound-and-true-p tmux-p)) | |||||
| bind-key N new-session -t default | bind-key N new-session -t default | ||||
| @@ -78,14 +172,12 @@ Tmux configuration. Pretty boring in most ways. | |||||
| bind-key s \ | bind-key s \ | ||||
| if-shell \ | if-shell \ | ||||
| "tmux show-window-options | grep 'synchronize-panes on'" \ | "tmux show-window-options | grep 'synchronize-panes on'" \ | ||||
| "set-window-option window-status-current-bg colour7; \ | |||||
| set-window-option pane-active-border-fg colour2; \ | |||||
| set-window-option pane-active-border-bg colour15; \ | |||||
| "set-window-option window-status-current-style bg=white,fg=black; \ | |||||
| set-window-option pane-active-border-style bg=colour15,fg=colour2; \ | |||||
| set-window-option synchronize-panes off; \ | set-window-option synchronize-panes off; \ | ||||
| display 'synchronization off'" \ | display 'synchronization off'" \ | ||||
| "set-window-option window-status-current-bg red; \ | |||||
| set-window-option pane-active-border-fg red; \ | |||||
| set-window-option pane-active-border-bg colour15; \ | |||||
| "set-window-option window-status-current-style bg=red,fg=black; \ | |||||
| set-window-option pane-active-border-style bg=colour15,fg=red; \ | |||||
| set-window-option synchronize-panes on; \ | set-window-option synchronize-panes on; \ | ||||
| display 'synchronizing'" | display 'synchronizing'" | ||||
| @@ -93,12 +185,11 @@ Tmux configuration. Pretty boring in most ways. | |||||
| # something else that set synchronization. | # something else that set synchronization. | ||||
| if-shell \ | if-shell \ | ||||
| "tmux show-window-options | grep 'synchronize-panes on' || /bin/true" \ | "tmux show-window-options | grep 'synchronize-panes on' || /bin/true" \ | ||||
| "set-window-option window-status-current-bg red; \ | |||||
| set-window-option pane-active-border-fg yellow; \ | |||||
| set-window-option pane-active-border-bg red" | |||||
| "set-window-option window-status-current-style bg=red; \ | |||||
| set-window-option pane-active-border-style bg=red,fg=black" | |||||
| # Setup splits to be less annoying | # Setup splits to be less annoying | ||||
| bind-key \ split-window -h | |||||
| bind-key \\ split-window -h | |||||
| bind-key - split-window -v | bind-key - split-window -v | ||||
| # vi keybindings for pane navigation | # vi keybindings for pane navigation | ||||
| @@ -145,26 +236,9 @@ Tmux configuration. Pretty boring in most ways. | |||||
| display 'Mouse modes on'" | display 'Mouse modes on'" | ||||
| #+END_SRC | #+END_SRC | ||||
| Only set xclip for x setup. | |||||
| Only set xclip for when x is in use | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".tmux.conf" (and (bound-and-true-p tmux-p) (bound-and-true-p x-p))) | #+BEGIN_SRC conf :tangle (tangle/file ".tmux.conf" (and (bound-and-true-p tmux-p) (bound-and-true-p x-p))) | ||||
| bind C-p run "tmux set-buffer \"$(xclip -o)\"; tmux paste-buffer" | bind C-p run "tmux set-buffer \"$(xclip -o)\"; tmux paste-buffer" | ||||
| bind C-y run "tmux save-buffer - | xclip -i" | bind C-y run "tmux save-buffer - | xclip -i" | ||||
| #+END_SRC | #+END_SRC | ||||
| Testing of battery stuff, defaults in general. | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".tmux.conf" (and (bound-and-true-p tmux-p) (bound-and-true-p testing-p))) | |||||
| set-option -g status-right-length 21 | |||||
| set-option -g status-right "#{battery_status_fg}#{battery_remain} #{battery_icon}#[fg=white] %a %H:%M:%S" | |||||
| set-option -g @batt_charged_icon "✓" | |||||
| run-shell ~/src/github.com/tmux-plugins/tmux-battery/battery.tmux | |||||
| #+END_SRC | |||||
| And for macos, differ in that the battery charged icon is utf-8 really. TODO: do I need this really? | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".tmux.conf" (and (bound-and-true-p testing-p) (bound-and-true-p tmux-p) (bound-and-true-p macos-p))) | |||||
| set-option -g status-right-length 20 | |||||
| set-option -g status-right "#{battery_remain} #{battery_icon} %a %H:%M:%S" | |||||
| run-shell ~/src/github.com/tmux-plugins/tmux-battery/battery.tmux | |||||
| #+END_SRC | |||||
| @@ -0,0 +1,277 @@ | |||||
| #+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 overrides | |||||
| * ~/bin/adexpire | |||||
| So I can find out when my ad password expires. | |||||
| #+BEGIN_SRC sh :padline no :tangle (tangle/file "bin/adexpire" (bound-and-true-p cray-p)) :mkdirp t | |||||
| #!/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 | |||||
| #+END_SRC | |||||
| ** ~/.gnus | |||||
| Use gnus in emacs for email. Outside of normal emacs since its easier. | |||||
| #+BEGIN_SRC emacs-lisp :mkdirp yes :tangle-mode (identity #o600) :tangle (tangle/file ".gnus" (bound-and-true-p cray-p)) | |||||
| (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)))) | |||||
| (nnimapsplitinbox "INBOX") | |||||
| (nnimapsplitpredicate "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) | |||||
| #+END_SRC | |||||
| ** ~/bin/flushdns | |||||
| For some reason this sometimes needs to happen, stupid work dns. | |||||
| #+BEGIN_SRC sh :mkdirp yes :tangle-mode (identity #o755) :tangle (tangle/file "bin/flushdns" (and (bound-and-true-p cray-p) (bound-and-true-p macos-p))) | |||||
| #!/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 :mkdirp yes :results append :tangle-mode (identity #o755) :tangle (tangle/file "bin/tomod" (bound-and-true-p cray-p)) | |||||
| #!/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, do I even need this any longer? | |||||
| #+BEGIN_SRC sh :tangle (tangle/file "bin/towip" (bound-and-true-p cray-p)) :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 | |||||