Computing desk | ||
---|---|---|
< October 1 | << Sep | October | Nov >> | October 3 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
When I log into an Ubuntu Linux box on my home network via ssh (from a Cygwin/Windows box nearby), I find that my sessions time out after some large amount of time (at least 30 minutes...maybe hours?) when I'm not actively using them. When I do the same thing to a Linux box on the other side of the planet run by my ISP, the timeout is MUCH shorter - so evidently this timeout can be adjusted on the server-side. How do I do that? SteveBaker (talk) 14:02, 2 October 2015 (UTC)
man sshd_config
returns in part:ClientAlive info
|
---|
ClientAliveCountMax Sets the number of client alive messages (see below) which may be sent without sshd(8) receiving any messages back from the client. If this threshold is reached while client alive messages are being sent, sshd will disconnect the client, terminating the session. It is important to note that the use of client alive messages is very different from TCPKeepAlive (below). The client alive messages are sent through the encrypted channel and therefore will not be spoofable. The TCP keepalive option enabled by TCPKeepAlive is spoofable. The client alive mechanism is valuable when the client or server depend on knowing when a connection has become inactive. The default value is 3. If ClientAliveInterval (see below) is set to 15, and ClientAliveCountMax is left at the default, unresponsive SSH clients will be disconnected after approximately 45 seconds. This option applies to protocol version 2 only. ClientAliveInterval Sets a timeout interval in seconds after which if no data has been received from the client, sshd(8) will send a message through the encrypted channel to request a response from the client. The default is 0, indicating that these messages will not be sent to the client. This option applies to protocol version 2 only. |
ClientAliveInterval 600
ClientAliveCountMax 3
ServerAliveInterval manual
|
---|
ServerAliveInterval Sets a timeout interval in seconds after which if no data has been received from the server, ssh(1) will send a message through the encrypted channel to request a response from the server. The default is 0, indicating that these messages will not be sent to the server, or 300 if the BatchMode option is set. This option applies to protocol version 2 only. ProtocolKeepAlives and SetupTimeOut are Debian-specific compatibility aliases for this option. |
while sleep 60; do echo 00 | unhex; done &
unhex
is a little hex-to-binary filter that's been sitting in my personal bin directory since 1981 or so). This sends an invisible null character down the line once a minute, and usually works to keep the connection from timing out. (And even if I did know the magic sshd option to keep sessions from timing out, but the relevant machine wasn't under my control, I might still choose to use this user-level workaround.) —Steve Summit (talk) 13:17, 3 October 2015 (UTC)Somehow, I've managed to remove the name and extension of over 400 photos and video files. So I'm stuck with files name 1,2,3 without the corresponding prefix to denote what type of file they actually are. Is there some way I can undo this or set them back up.
Trouble is, I can't really determine which files are videos or just pictures. --80.195.27.47 (talk) 15:16, 2 October 2015 (UTC)
Batch renaming is the easy part. Figuring out which are which is more challenging. Taking the harder part first:
The simplest solution that might work, depending on your OS settings and the original filetypes, would be to rename all of the files to be images (e.g. .jpg) then load thumbnails in your file explorer/viewer. If you're lucky, the ones that aren't images won't display properly. If they all display, try the same technique but with a video extension. If that works, skip the next paragraph.
If that didn't work, sort the files by size. This will cut down on some of the guesswork. If they were all taken with the same camera with the same settings, the size of the images will be relatively similar. In some cases, they'll might even be the same. Video files won't be so consistent, so look for patterns, moving those that look like video files out to a separate directory. You'll have to do some trial and error for videos that are about the size of images.
The renaming part. Operating under the assumption of Windows, open the directory with your presumed images. Holding CTRL-SHIFT, right click in an open part of the directory (i.e. don't click on a file) and select "Open command window here". In the console, you want the "rename" command. So if all of your files have no extension and you want them all to be .jpg, just type "rename *. *.jpg" (without quotes). If they're all jpg and you want them to be .mov, you would do "rename *.jpg *.mov". Good luck! — Rhododendrites talk \\ 22:00, 2 October 2015 (UTC)