| @@ -104,7 +104,7 @@ nukehost() | |||
| # Cheap copy function to make copying a file via ssh from one host | |||
| # to another less painful, use pipeviewer to give some idea as to progress. | |||
| ssh-copyfile() | |||
| sshcopy() | |||
| { | |||
| if [ -z "$1" -o -z "$2" ]; then | |||
| echo "Usage: copy source:/file/location destination:/file/location" | |||
| @@ -114,9 +114,13 @@ ssh-copyfile() | |||
| dsthost="$(echo "$2" | awk -F: '{print $1}')" | |||
| dst="$(echo "$2" | awk -F: '{print $2}')" | |||
| size=$(ssh "$srchost" du -hs "$src" 2> /dev/null) | |||
| if [ "${size}" = "" ]; then | |||
| echo "${src} doesn't seem to exist on ${srchost}" | |||
| return 1 | |||
| fi | |||
| size=$(echo "${size}" | awk '{print $1}') | |||
| echo "Copying $size to $dst" | |||
| ssh "$srchost" "/bin/cat \$src" 2> /dev/null | pv -cb -N copied - | ssh "$dsthost" "/bin/cat - > \$dst" 2> /dev/null | |||
| (ssh "$srchost" "/bin/cat $src" | pv -cb -N copied - | ssh "$dsthost" "/bin/cat - > $dst") 2> /dev/null | |||
| fi | |||
| } | |||
| @@ -274,16 +278,30 @@ nix_env_setup() | |||
| } | |||
| } | |||
| nix_env_setup | |||
| nix-on() { | |||
| rm ~/.nonix | |||
| } | |||
| nix-off() { | |||
| touch ~/.nonix | |||
| } | |||
| #+END_SRC | |||
| Workaround stupid ssl crap with recent nix. | |||
| #+BEGIN_SRC sh :tangle (when (and (eq nix-p t) (eq osx-p t)) "tmp/.profile") | |||
| SSL_CERT_FILE="${HOME}/.nix-profile/etc/ssl/certs/ca-bundle.crt" | |||
| GIT_SSL_CAINFO=$SSL_CERT_FILE | |||
| export SSL_CERT_FILE | |||
| export GIT_SSL_CAINFO | |||
| if [ ! -e ${HOME}/.nonix ]; then | |||
| SSL_CERT_FILE="${HOME}/.nix-profile/etc/ssl/certs/ca-bundle.crt" | |||
| GIT_SSL_CAINFO=$SSL_CERT_FILE | |||
| export SSL_CERT_FILE | |||
| export GIT_SSL_CAINFO | |||
| fi | |||
| #+END_SRC | |||
| #+BEGIN_SRC sh :tangle (when (eq nix-p t) "tmp/.profile") | |||
| if [ ! -e ${HOME}/.nonix ]; then | |||
| nix_env_setup | |||
| fi | |||
| #+END_SRC | |||
| TODO Add linux ca-bundle detection | |||
| @@ -441,7 +441,7 @@ All the packages I use. | |||
| #+BEGIN_SRC emacs-lisp | |||
| (use-package tramp | |||
| :ensure t | |||
| :defer t | |||
| :config (custom-set-variables '(tramp-default-method "ssh")) | |||
| ) | |||
| #+END_SRC | |||
| @@ -45,7 +45,7 @@ General git configuration split out into sections mostly. | |||
| wd = diff --color-words | |||
| fa = fetch --all | |||
| ci = commit | |||
| ciu = commit --all | |||
| cia = commit --all | |||
| co = checkout | |||
| ds = diff --stat | |||
| ba = branch --all | |||
| @@ -61,6 +61,7 @@ General git configuration split out into sections mostly. | |||
| ri = rebase --interactive --autosquash | |||
| ra = rebase --abort | |||
| effit = reset --hard | |||
| bn = rev-parse --abbrev-ref HEAD | |||
| 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 | |||
| @@ -68,16 +69,18 @@ General git configuration split out into sections mostly. | |||
| # 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 | |||
| sup = !git pull --rebase && git submodule update --init --recursive | |||
| # git clone with submodules | |||
| sc = !git clone --recursive $1 | |||
| # what files are getting updated a lot | |||
| churn = !git log --all -M -C --name-only --format='format:' "$@" | sort | grep -v '^$' | uniq -c | sort | awk 'BEGIN {print "count,file"} {print $1 "," $2}' | |||
| # 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 | |||
| aliases = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\ \t => \\2/' | sort | |||
| defremote = !git branch -rvv | egrep 'HEAD' | awk '{print $1}' | sed -e 's|/HEAD||g' | |||
| 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)' | |||
| short = rev-parse --short | |||
| 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" | |||
| pbr = !git push --set-upstream $(git defremote) $(git bn) | |||
| #+END_SRC | |||
| ** github | |||
| #+BEGIN_SRC conf :tangle (when (eq git-p t) "tmp/.gitconfig") | |||
| @@ -15,11 +15,11 @@ in | |||
| packageOverrides = pkgs: with pkgs; | |||
| let in rec { | |||
| my-pinentry = pinentry.override { gtk2 = null; qt4 = null; ncurses = null; }; | |||
| my-gnupg = gnupg.override { x11Support = false; pinentry = false; }; | |||
| my-youtube-dl = python27Packages.youtube-dl.override { pandoc = null; }; | |||
| custom-pinentry = pinentry.override { gtk2 = null; qt4 = null; ncurses = null; }; | |||
| custom-gnupg = gnupg.override { x11Support = false; }; | |||
| custom-youtube-dl = python27Packages.youtube-dl.override { pandoc = null; }; | |||
| my-git = git.override { | |||
| custom-git = git.override { | |||
| pythonSupport = false; | |||
| svnSupport = true; | |||
| guiSupport = false; | |||
| @@ -41,7 +41,7 @@ in | |||
| ctags | |||
| diffutils | |||
| patchutils | |||
| my-git | |||
| custom-git | |||
| gitAndTools.gitFull | |||
| gitAndTools.git-extras | |||
| bazaarTools | |||
| @@ -52,8 +52,8 @@ in | |||
| docbook5 | |||
| entr | |||
| emacs | |||
| my-gnupg | |||
| # gnupg1compat | |||
| gnupg | |||
| gnupg1compat | |||
| gnutar | |||
| gnumake | |||
| sloccount | |||
| @@ -71,10 +71,13 @@ in | |||
| aspell | |||
| aspellDicts.en | |||
| openssl | |||
| my-pinentry | |||
| custom-pinentry | |||
| poppler_utils | |||
| ghostscript | |||
| pbzip2 | |||
| pigz | |||
| pv | |||
| pkgconfig | |||
| postgresql | |||
| readline | |||
| rsync | |||
| @@ -93,20 +96,21 @@ in | |||
| unrar | |||
| watch | |||
| nox | |||
| graphviz-nox | |||
| mutt | |||
| duply | |||
| # xhyve compiles normally, figure out hypervisor framework issue | |||
| lastpass-cli | |||
| my-youtube-dl | |||
| custom-youtube-dl | |||
| python27Packages.bugzilla | |||
| python27Packages.howdoi | |||
| python27Packages.pyflakes | |||
| python27Packages.flake8 | |||
| python27Packages.virtualenv | |||
| python27Packages.pip | |||
| python27Packages.bugzilla | |||
| python27Packages.pylint | |||
| haskellPackages.bake | |||
| haskellPackages.cabal-dependency-licenses | |||
| haskellPackages.cabal-install | |||
| # haskellPackages.cabal-install | |||
| haskellPackages.ghc-core | |||
| haskellPackages.ghc-mod | |||
| haskellPackages.hasktags | |||
| @@ -117,14 +121,15 @@ in | |||
| haskellPackages.shake | |||
| haskellPackages.idris | |||
| haskellPackages.ShellCheck | |||
| haskellPackages.idris | |||
| haskellPackages.nats | |||
| haskellPackages.transformers-compat | |||
| haskellPackages.stack | |||
| ] ++ stdenv.lib.optionals stdenv.isLinux [ | |||
| # some of these are broken on osx, fix them | |||
| # some of these are broken on osx, fix them | |||
| rtags | |||
| pylint | |||
| cscope | |||
| gcc | |||
| # disabled for now | |||
| # ] ++ stdenv.lib.optionals stdenv.isDarwin [ | |||
| # xhyve compiles normally, figure out hypervisor framework issue | |||
| ]; | |||
| }; | |||
| }; | |||