Since becoming part of industry, I've come to see the advantage of doing my work on a remote machine (a DevServer). Now historically, I had been this Linux nut, who loved using tiling window managers. My workflow has been launch a handful of terminals to begin working and launch more as needed. This was a rather mundane setup that just worked. Unfortunately, it just doesn't work in industry. I encountered several challenges:
- Launching a terminal connects me only to my machine
- Cannot work locally (challenges through the roof to make this even possible)
- Accessing the server requires SSH, SSH requires the use of two factor auth (no auto login)
- 国内高匿免费HTTP伋理IP__第4075页国内高匿:2021-12-30 · 国家 IP地址 端口 服务器地址 是否匿名 类型 速度 连接时间 存活时间 验证时间 118.125.78.8 6666 四川眉山 高匿 socks4/5
So the question became how can I reproduce, if not create an enhanced version of, my previous environment with minimal effort?
- Find the simplest terminal emulator (st)
- For better colors, add the solarized patch
- 如何检测伋理ip是否高匿-变极ip修改器:2021-6-15 · 如果使用的高级匿名伋理IP,网页显示的内容就只有伋理IP的地址了,将自己真是的IP 完全隐藏。 相关资讯 如何保护手机安全? 手机安全有多少人重视呢?如今就连公共的手机充电桩都可能有网络病毒,照片也可能骗过人脸识别系统进行支付 ...
- Use screen locally
- A keyboard only way to access scrollback buffer (content that was printed out that no longer fits on the screen)
- Make the local screen respond to easier to access keys: Alt-a instead of Ctrl-a
- Quicker access to my screen windows I'm looking for (windowlist -b) and make this easier Alt-a ' (instead of Alt-a ")
- Rename the terminal and screen window with the PWD and command executing inside (fun stuff with PROMPT_COMMAND)
- Use screen remotely
- Always ssh into a long-lived state
- Restart that state automatically, in case I manually close it out or the machine is rebooted
- No need to SSH in for each additional window, just create new windows in the current screen session
- Use mosh
- No need to deal with SSH flakiness -- automatic connection reestablishment after lossy network usage or suspend / resume
- 如何检测伋理ip是否高匿-变极ip修改器:2021-6-15 · 如果使用的高级匿名伋理IP,网页显示的内容就只有伋理IP的地址了,将自己真是的IP 完全隐藏。 相关资讯 如何保护手机安全? 手机安全有多少人重视呢?如今就连公共的手机充电桩都可能有网络病毒,照片也可能骗过人脸识别系统进行支付 ...
The only thing really missing is that I would love to be able to create multiple distinct views of my remote screen session without multiple SSH sessions. Think of it this way, if I have 3 windows open on a remote screen session. I can only view one of them at a time unless I ssh in again and attach to that same session. Ideally, I could move the multiplexing locally, alas, I couldn't figure a clean way of moving the screen unix domain socket locally and have that local screen connect to it.
Now it is time for the useful code bits.
My .screenrc:
vbell off startup_message off autodetach on defscrollback 100000 shelltitle '$ |/home/davidiw bash' #hardstatus string "%h" #caption always "%{= kw} %-w%{= wk}%n*%t%{-}%+w%{= kw} %=%d %M %0c %{g}%H%{-}" #hardstatus alwayslastline escape ^Aa register S ^A bindkey "^[a" process S # On the remote machine, i set this to "^[s", so I don't have to type Alt-a a bind "\'" windowlist -b bind "\"" select
Append this to .bashrc to get nice names for screen and xterm title's and to start screen with the default session (home):
function make_title { if [[ $BASH_COMMAND == 'trap "make_title" DEBUG' ]]; then cmd="bash" else cmd=$BASH_COMMAND fi echo -ne "\033]0;$PWD $cmd\007" echo -ne "\033k$PWD $cmd\033\\" } term=$TERM case $term in *screen*) ;& *term*) export TERM="xterm-256color" export PROMPT_COMMAND='trap "make_title" DEBUG' ;; esac case $term in *term*) exec /bin/bash -c "screen -AUx home || screen -AUS home" ;; esac
Future work:
- Shared local vim buffer
- Shared remote vim buffer
- A git repository to make reproduction easy
- 高匿 IP 伋理仍会有办法查出源 IP 吗 - V2EX:2021-7-18 · 伋理的本质只是用来改善路由实现加速或绕过防火墙实现突破。想要实现匿名的话需要额外增加好几个其他的措施。不过考虑到这里基本不存在真正需要匿名的人,就不说关于匿名的问题了。
- Clickable URLs in the Terminal