Mercurial > index.cgi > dotfiles
annotate .shared/shared_bashrc @ 268:48b4f41712dc
Suppress warnings in lsof, change filetype bash -> sh
author | Steve Huston <huston@princeton.edu> |
---|---|
date | Thu, 25 Apr 2024 10:50:06 -0400 |
parents | df0b24d4fabd |
children | 61b830d34016 |
rev | line source |
---|---|
265
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
1 # These items are used both in my normal shells, and available to be sourced |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
2 # in other connections via the shared files tunnel. This way I have a single |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
3 # place to set certain things that I use normally but will want to be able to |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
4 # use in other places as well. |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
5 # |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
6 # Note that if this is a normal shell, $DOTHOME will have been set there and |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
7 # will point to the normal location, but if this is a shared shell then the |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
8 # script that calls this needs to set that to wherever the temporary files |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
9 # have been deposited. |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
10 |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
11 # |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
12 # Environment variables |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
13 # |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
14 |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
15 [[ "$PS1" ]] && . ${DOTHOME}/bash_prompt |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
16 |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
17 export PAGER=less |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
18 export EDITOR=vim |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
19 export VIMINIT="source ${DOTHOME}/.vim/vimrc" |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
20 export GVIMINIT="source ${DOTHOME}/.vim/gvimrc" |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
21 export HOST=`hostname -s` |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
22 export SCREENRC="${DOTHOME}/screenrc" |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
23 |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
24 # Specifically, to hell with this terminal type |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
25 [[ $TERM =~ screen.xterm-256color ]] && export TERM=screen-256color |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
26 |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
27 # Rather than have another separate file for aliases, just list them in here |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
28 # (while local aliases have some complicated and large functions, shared ones |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
29 # are pretty small anyway) |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
30 |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
31 # Safe to set this here; if I'm running on a Mac it's my own machine and will |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
32 # have the local override for the correct arguments to 'ls' |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
33 |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
34 alias ls='/bin/ls --color=auto -F' |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
35 |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
36 # |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
37 # Shared SSH aliases |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
38 # |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
39 alias bh='ssh csesbh2.princeton.edu' |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
40 alias dh='ssh srhuston.net' |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
41 alias j='ssh joshua.srhuston.net' |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
42 alias x='ssh xanadu.astro.princeton.edu' |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
43 |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
44 # For these, we check for a running share server, and if it exists then we |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
45 # pass the port through to the other side. The biggest problem with this |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
46 # whole thing is that I don't see a programmatic way to grab the port, so it's |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
47 # going to have to be a pretty simple command to pull things through, or a |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
48 # very ugly hack to set an environment variable with everything the script |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
49 # needs but the port which will have to be manual.. just no good way around it |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
50 # I can see. |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
51 |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
52 # This variable just makes the later lines easier to read. Sets options to |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
53 # ignore the host keys, for times when I know that they might be different but |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
54 # I want to login anyway and maybe don't want to adjust the known_hosts file. |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
55 S_FORCE="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o GlobalKnownHostsFile=/dev/null" |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
56 |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
57 # The tests ahead of each function are because I have 's' and 'r' aliases from |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
58 # before which might interfere. While I could prepend the definition with |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
59 # 'function' to override the error, you'd still get the wrong one when calling |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
60 # it because the alias would take priority. So if they exist, remove them - |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
61 # no harm done. |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
62 # |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
63 # I would love for this section to work; if we could get the port that gets |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
64 # used by the -R option before we hand off to the other side, then I could |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
65 # pass it somehow through and know where to connect in that shell. But even |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
66 # though the man page says the port is "reported to the client at run time" |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
67 # that appears to only be in an echo statement. So there will be an extra |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
68 # copy and paste step. Meanwhile, I'm keeping this here in case I find a |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
69 # better way in the future. This would immediately follow the function |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
70 # definition and the part that is left in that function would be in the else |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
71 # clause. |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
72 # |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
73 #if [ $# -eq 1 ]; then |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
74 # [[ -n $DOTSHARE_PORT ]] && echo 'ds setup: eval "$(curl http://localhost:${DOTSHARE_PORT}/b)"' |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
75 # ssh ${DOTSHARE_PORT:+-R 0:localhost:$DOTSHARE_PORT} "$1" -t "DOTSHARE_PORT=${DOTSHARE_PORT} exec bash -l" |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
76 #else |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
77 # [do as done below] |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
78 #fi |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
79 |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
80 # I could probably clean up the echoes in each one too, maybe a function? |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
81 # Nesting it in a variable would be messy because of the quoting needed to get |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
82 # the right output... |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
83 |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
84 [[ "$(type -t s)" == 'alias' ]] && unalias s |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
85 s() { |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
86 [[ -n $DOTSHARE_PORT ]] && echo 'ds setup: export DOTSHARE_PORT= ; eval "$(curl http://localhost:${DOTSHARE_PORT}/b)"' |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
87 ssh ${DOTSHARE_PORT:+-R 0:localhost:$DOTSHARE_PORT} "$@" |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
88 } |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
89 |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
90 [[ "$(type -t r)" == 'alias' ]] && unalias r |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
91 r() { |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
92 [[ -n $DOTSHARE_PORT ]] && echo 'ds setup: export DOTSHARE_PORT= ; eval "$(curl http://localhost:${DOTSHARE_PORT}/b)"' |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
93 ssh ${DOTSHARE_PORT:+-R 0:localhost:$DOTSHARE_PORT} -l root "$@" |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
94 } |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
95 |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
96 [[ "$(type -t sf)" == 'alias' ]] && unalias sf |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
97 sf() { |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
98 [[ -n $DOTSHARE_PORT ]] && echo 'ds setup: export DOTSHARE_PORT= ; eval "$(curl http://localhost:${DOTSHARE_PORT}/b)"' |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
99 ssh ${S_FORCE} ${DOTSHARE_PORT:+-R 0:localhost:$DOTSHARE_PORT} "$@" |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
100 } |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
101 |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
102 [[ "$(type -t rf)" == 'alias' ]] && unalias rf |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
103 rf() { |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
104 [[ -n $DOTSHARE_PORT ]] && echo 'ds setup: export DOTSHARE_PORT= ; eval "$(curl http://localhost:${DOTSHARE_PORT}/b)"' |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
105 ssh ${S_FORCE} ${DOTSHARE_PORT:+-R 0:localhost:$DOTSHARE_PORT} -l root "$@" |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
106 } |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
107 |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
108 # |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
109 # Programs/utilities |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
110 # |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
111 certcheck() { |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
112 if [ -z "$1" ] ; then |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
113 echo "Usage: certcheck <hostname>[:port]" |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
114 echo " Defaults to port 443 if not specified." |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
115 return |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
116 fi |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
117 H=$1 |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
118 [[ $1 =~ :[0-9]+$ ]] || \ |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
119 H=$1":443" |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
120 echo -n Q | openssl s_client -connect $H | openssl x509 -noout -dates |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
121 } |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
122 alias rot13="tr 'a-zA-Z' 'n-za-mN-ZA-M'" |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
123 alias vi='vim' |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
124 |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
125 |
268
48b4f41712dc
Suppress warnings in lsof, change filetype bash -> sh
Steve Huston <huston@princeton.edu>
parents:
265
diff
changeset
|
126 # vim: set filetype=sh : |