231 points · by andars · 11y ago · 55 comments
I particularly like that there's a "whitelist" of which running commands it will restore, so I can e.g. restore both VIM sessions and my Webpack watchers when I restore my session.
The symptom is that the machine will frequently reboot instead of coming out of sleep. From the looks of things, it's related to the 70-minute sleep-to-standby setting (where the machine will turn itself off), which can be changed with "pmset".
(terminology: 'sleep' is suspend to RAM, requires battery to keep active. 'hibernate' is suspend to disk, no battery required after RAM copied to HD—obviously requires enough HD space to run the persistence.)
I combine it with a few lines of code in my ~/.zshrc to automatically enter the virtualenv for the current directory. Works out really nice! :)
Edit: ahha, not exactly what I asked for, but linked on the tmux-resurrect page is tmux-continuum, automatic saving of tmux sessions. Perfect for me.
--- title: Tmux on a shared server ---
Normally, tmux stores its session sockets in the /tmp directory. This is bad news when trying to run tmux on a shared computer (e.g. shared compute nodes) since the tmp directory is probably cleared on every login. To get around this tmux offers a way to store session sockets in alternative locations. How to use this isn't entirely clear in the man page though, so I'll outline it here. First, I'll create a directory to store the socket with ``mkdir ~/.tmux.socket'`{.bash}. Tmux stores new session sockets in the tmp directory so we must change that when we start tmux:
TMPDIR=~/.tmux.socket tmux
and to attach to this socket we use the `-S`{.bash} option and glob to
the socket (defaulted to be named `default`{.bash}) tmux -S ~/.tmux.socket/*/default attach
Here are some aliases to put into your shell config file to help: alias tmux-start="TMPDIR=~/.tmux.socket tmux"
alias tmux-attach="tmux -S ~/.tmux.socket/*/default attach"I wrote iTermocil[2] to replicate the functionality of teamocil natively in iTerm2, so I could have all the upsides (from my POV) but keep native UI elements etc.
I have since come across tmuxinator, which is almost identical, but from my reading of tmuxinators docs it seems it is more flexible in how you can configure it.
I'm adding tmuxinator support to iTermocil. :)
Q: What is Mosh's security track record so far? Mosh 1.0 was released in March 2012. As of the release of Mosh 1.2.5 in July 2015, as far as the developers are aware:
In the last three years, no security vulnerabilities of any kind (major or minor) have been reported in Mosh. No major security vulnerabilities have ever been reported in Mosh. We define major security vulnerabilities to include privilege escalation, remote code execution, denial-of-service by a third party, etc. Two denial-of-service issues were discovered and fixed in releases in 2012. One issue allowed a mosh-server to cause the mosh-client to spend excess CPU (CVE-2012-2385, fixed in Mosh 1.2.1, released May 2012). Another issue allowed the server host to cause the mosh-client to send UDP datagrams to an incorrect address, foiling its attempt to connect (fixed in Mosh 1.2.2, released July 2012).
Q: How does Mosh's security compare with SSH's?
We think that Mosh's conservative design means that its attack surface compares favorably with more-complicated systems like OpenSSL and OpenSSH. Mosh's track record has so far borne this out. Ultimately, however, only time will tell when the first serious security vulnerability is discovered in Mosh—either because it was there all along or because it was added inadvertently in development. OpenSSH and OpenSSL have had more vulnerabilities, but they have also been released longer and are more prevalent.
In one concrete respect, the Mosh protocol is more secure than SSH's: SSH relies on unauthenticated TCP to carry the contents of the secure stream. That means that an attacker can end an SSH connection with a single phony "RST" segment. By contrast, Mosh applies its security at a different layer (authenticating every datagram), so an attacker cannot end a Mosh session unless the attacker can continuously prevent packets from reaching the other side. A transient attacker can cause only a transient user-visible outage; once the attacker goes away, Mosh will resume the session.
However, in typical usage, Mosh relies on SSH to exchange keys at the beginning of a session, so Mosh will inherit the weaknesses of SSH—at least insofar as they affect the brief SSH session that is used to set up a long-running Mosh session.
Technically, it is not a replacement, since it requires a ssh server for authentication.
https://github.com/tmux-plugins/tmux-resurrect/blob/master/d...
I am going to try out tmux-resurrect, but it's value to me would be mostly for ad-hoc tmux sessions; I think I'll still set up dedicated tmuxinator configs for each of my longer term projects.
I've done something horrible in the past when I knew about coming rolling power outages - snapshoting virtual box. It worked but was sort of annoying.
If only @resurrect-save-zsh-history was implemented.