« first day (1622 days earlier)      last day (3388 days later) » 

2:00 PM
Yeah
Ought to be
 
Oh, how I loathe this non-standard, non-SSH enabled, expensive, yet extremely popular hosting.
 
Bob
@ThatBrazilianGuy What are you doing? (cbf reading up)
A SSH tunnel can be used as a general SOCKS proxy - no need to worry about ports
 
@ThatBrazilianGuy: There's a reason anyone on RA who has their own hosting at least uses a cheap vps
 
Uploading a website. I have to set up WordPress for a customer, then install theme and assets. I have the cPanel web login but it uses a locally blocked port =/
 
Bob
Hainanese chicken is nice :D
@ThatBrazilianGuy Windows or Linux?
 
2:01 PM
@JourneymanGeek Client won't change hosting.
@Bob My PC? Linux. Hosting? Linux as well.
 
@ThatBrazilianGuy yanno what else a VPS is good for? ;p
 
@JourneymanGeek SSH tunnels? :P
 
Bob
@ThatBrazilianGuy ssh -D localhost:port
Pick any unused local port
Then you can use localhost:port as a SOCKS proxy.
 
@Bob But I need to access <hosting.com.br>:2082 and this port is blocked going out of the local network
 
Bob
2:06 PM
@ThatBrazilianGuy ...just follow the instructions
 
@Bob wrong syntax
 
Bob
@ThatBrazilianGuy You did include the user@host, right?
 
@Bob apparently it's ssh -D port localhost
but then it asks for password
 
Bob
...wtf kind of ssh are you using
 
and it's a passwordless live USB ubuntu
@Bob uknown option
 
Bob
2:10 PM
@ThatBrazilianGuy ssh -V
 
OpenSSH_6.6.1p1 Ubuntu-2ubuntu2, OpenSSL 1.0.1f 6 Jan 2014
 
Bob
:S
... what's the command syntax in man ssh
It should be somheting like this:
     ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
         [-D [bind_address:]port] [-E log_file] [-e escape_char]
         [-F configfile] [-I pkcs11] [-i identity_file]
         [-L [bind_address:]port:host:hostport] [-l login_name] [-m mac_spec]
         [-O ctl_cmd] [-o option] [-p port]
         [-R [bind_address:]port:host:hostport] [-S ctl_path] [-W host:port]
         [-w local_tun[:remote_tun]] [user@]hostname [command]
Note the [-D [bind_address:]port]
...wait
Did you enter literally ssh -D port localhost?
Because that's binding to port and connecting to localhost
4 mins ago, by Bob
@ThatBrazilianGuy You did include the user@host, right?
...
 
I just sudo passwd to set a password and then ran literally ssh -D 1700 localhost
 
Bob
...
 
> ubuntu@ubuntu:~$ ssh -D 1700 localhost
ubuntu@localhost's password:
Welcome to Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-32-generic i686)

* Documentation: https://help.ubuntu.com/
@Bob No, where I include it?
@Bob aah
@bob both ssh -D ubuntu@localhost:1700 and ssh -D localhost:1700 are syntax errors
 
Bob
2:18 PM
5 mins ago, by Bob
     ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
         [-D [bind_address:]port] [-E log_file] [-e escape_char]
         [-F configfile] [-I pkcs11] [-i identity_file]
         [-L [bind_address:]port:host:hostport] [-l login_name] [-m mac_spec]
         [-O ctl_cmd] [-o option] [-p port]
         [-R [bind_address:]port:host:hostport] [-S ctl_path] [-W host:port]
         [-w local_tun[:remote_tun]] [user@]hostname [command]
Read the command syntax.
cmon, you can figure it out
anything enclosed by square brackets is optional
 
The latest verison of ssh complained iirc
 
Which reminds me
 
When I didn't use user@host
 
I need to open up openssh access to my hone linux system
 
And I specified the username explicitly using some parameter(- U)
Credit card numbers remind me, I need to get my digital ocean account activated
 
2:23 PM
> For example, say you wanted Firefox to connect to every web page through your SSH server. First you would use dynamic port forwarding with the default SOCKS port:

ssh -C -D 1080 laptop

The -D option specifies dynamic port forwarding. 1080 is the standard SOCKS port. Although you can use any port number, some programs will only work if you use 1080.
 
Bob
...please learn to read man pages
it will help a lot in the long run
not that hard
see syntax description above
see what's optional
leave out the optional ones you don't want
 
http://gemsfromstackexchange.tumblr.com/post/108075571238
GemsFromStackExchange
Photo

1421244925
 
@Bob everything except hostname is optional. Even the -D flag is optional. But entering hostname makes it connect to the hostname. And hostname is localhost so it conencts to a new session on localhost.
There must be something reeeeally obvious I am not seeing here
 
I got fed up with my dad downloading linux live cds from dodgy sources, and gave him access to my rutorrent install. Did a nice writeup and all.....
then he asks...
 
Bob
2:26 PM
@ThatBrazilianGuy maybe that you're trying to set up a tunnel to a remote host?
Why are you connecting to localhost?
 
"Oh, would the instructions be the same for my friend?"
I was like all..
@ThatBrazilianGuy: You need to connect to ruda@lupinenet.co.uk I think
!!no
 
Bob
@JourneymanGeek oh sure, give him the answer... so much for teaching a man to fish hv less :P
 
@Bob Because you said I could run a dynamic port forwarding from my own local machine to skip local proxy restrictions.
 
2:28 PM
I thought @OliverSalzburg said that as a joke?
 
I thought it was strange, but (and I say this non-sarcastically) I assumed you knew much better than me
25 mins ago, by Bob
@ThatBrazilianGuy ssh -D localhost:port
 
Bob
28 mins ago, by Bob
A SSH tunnel can be used as a general SOCKS proxy - no need to worry about ports
A tunnel would imply a connection to some external network...
 
Isn't "localhost" my own local workstation?
 
Bob
@ThatBrazilianGuy That's just to bind the local end of the tunnel
I will refer you again to the manpages:
     -D [bind_address:]port
             Specifies a local ``dynamic'' application-level port forwarding.
             This works by allocating a socket to listen to port on the local
             side, optionally bound to the specified bind_address.  Whenever a
             connection is made to this port, the connection is forwarded over
             the secure channel, and the application protocol is then used to
             determine where to connect to from the remote machine.  Currently
             the SOCKS4 and SOCKS5 protocols are supported, and ssh will act
 
ssh -D <port> username@lupinenet.co.uk then set up your web server to use that port with a socks proxy ;p
 
Bob
2:31 PM
@JourneymanGeek Sure, sure, spoil my fun :(
Still, I'd recommend binding to localhost:port.
It's generally a good idea to limit the binding as much as possible.
 
bind all the things
 
Bob
Unless you actually want to expose the tunnel to your entire local network - 99% of the time, that is not desired.
 
It's amazing. The gesture that works with near 100% reliability on the OnePlus One is the most complex one: drawing an arrow in 2 strokes to skip tracks
Drawing a V to toggle the torch works on every third attempt
 
How's it?
lol
 
The 2 finger vertical line to play/pause works on every fourth attempt, the circle to activate the camera on every fifth
And, I'm not kidding, the arrow thing works like 95% of the time
How is that even possible?
 
2:37 PM
lol
 
@JourneymanGeek It's great. Stupid customer support won't replace my screen protector though :( I was hoping they would because the POS bent. I asked them how I could have prevented that, other than not catching any dust under it during installation. They told me that I should follow the installation instructions. No. Fucking. Shit!
 
lol
I might see about getting one if I can get a invite around july ;p
 
Does anyone know about stuck flags?
 
I wonder if the gestures work so badly because of the protector. Maybe I'll just replace it with foil. At least the foils won't bend :P
 
I've got a pair of flags that are 20+ hours old that are still active.
 
2:39 PM
@JourneymanGeek Is it normal that after I perform that command I am logged in at your server? Is the port binding being transparently created? Because I used port 777 (it works on portquiz.net) but it wont work on firefox as a socks proxy (localhost:777)
 
er...
I'm not sure
 
@killermist I don't see any
 
I normally tunnel in from windows ;p
 
@ThatBrazilianGuy Yes, you can prevent that with -N
 
@OliverSalzburg "2 waiting for review"
 
Bob
2:41 PM
@ThatBrazilianGuy ...why are you checking if ports are open?
10 mins ago, by Bob
     -D [bind_address:]port
             Specifies a local ``dynamic'' application-level port forwarding.
             This works by allocating a socket to listen to port on the local
             side, optionally bound to the specified bind_address.  Whenever a
             connection is made to this port, the connection is forwarded over
             the secure channel, and the application protocol is then used to
             determine where to connect to from the remote machine.  Currently
             the SOCKS4 and SOCKS5 protocols are supported, and ssh will act
 
@killermist They're not in the queue
 
Bob
You are creating a local listening port that forwards traffic through the tunnel.
...I'll just assume you are ignoring everything I say.
 
@Bob No, assume I'm dumb .___.
@OliverSalzburg Yes, that's in the manpage, I was about to test it (see @bob I can read manpages)
 
Bob
The only outgoing connection is to the SSH port.
 
I have set the FF proxy to "localhost:1080" but every site I now try to open gives me "connection reset"
"localhost:otherports" give me "proxy refused"
So it looks like the local socks proxy is started
 
Bob
2:46 PM
What is the exact, complete command you're running?
 
ssh -D localhost:1080 ruda@lupinenet.co.uk -N
then I leave the SSH window open
and set FF proxy to "localhost:1080" (use this for all protocols)
and I get "connection reset" for any URL
if I close the ssh window I get "proxy refused"
so the SSH cli window is acting as a local SOCKS proxy, it seems
but something is making the connection reset
Or maybe I'm dumber than I thought?
 
Bob
@ThatBrazilianGuy Screenshot your Firefox proxy settings.
 
Of course, I have to keep changing to "no proxy" to be able to use chat.
 
And when I run ssh -D localhost:1080 ruda@lupinenet.co.uk -N it asks me for the remote password, and I enter it, before the SSH window "hanging", but I assume this is totally irrelevant. ...right?
 
Bob
2:52 PM
@ThatBrazilianGuy It's a SOCKS proxy, not an HTTP proxy.
 
@Bob GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH
 
Bob
Also, read the command syntax again.
Options like -N should go at the beginning
I'm not entirely sure, but I think it might be interpreted as a command if you put it at the end?
Or maybe not shrug
 
@Bob Excuse me while I kill myself and I'll be back in a few minutes.
@Bob Nah, it works at the end as well.
 
Bob
@ThatBrazilianGuy Ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh a ghost!!!!!!!!
2
 
Use ProxyFoxy
 
Bob
2:54 PM
!! s/(Proxy)(Foxy)/$2$1/
 
@Bob Use FoxyProxy (source)
 
Oops ;p
 
IT WORKS :D
I was worried because I can only set SOCKS proxy by unchecking "all protocols"
And had to manually specify a proxy for each (including HTTP)
But leaving "<blank>:0" works :P
 
Bob
The FF proxy settings are a bit confusing in that way.
 
2:58 PM
> Your IP:
198.52.199.89

Proxy:
No Proxy Detected
City:
dallas
State/Region:
texas
 
Bob
I do prefer FoxyProxy, but if you aren't switching much then it's unnecessary.
@ThatBrazilianGuy The proxy detection just looks for the headers added by web proxies (X-Forwarded-For, X-Real-IP, etc.).
A SOCKS proxy works on the TCP level. It doesn't know or care about HTTP.
 
I just pasted that because of the IP/geolocation info
But (non-sarcastically) thanks for the info
@Bob Hm, because it works on the TCP level, it doesn't matter all web links on the cpanel page are <hosting.com:2082> and therefore those don't have to be rewritten, right?
Or an HTTP proxy would work the same here?
 
@ThatBrazilianGuy How many protocols does a web browser need? Typically, HTTP(S), and occasionally FTP. Everything else is considerably more exotic. as far as I know.
 
Well, Firefox has even VoIP/Video protocols (Firefox Hello)
There was gopher once, not sure if still is
Chrome has webRTC
and those are only the ones I heard of
pretty sure there are others
 
Bob
@ThatBrazilianGuy They would work the same anyway.
An HTTP proxy would just be told to connect to hostname:port and send X request
HTTPS proxies typically support CONNECT and can be used for arbitrary TCP streams too
you can tunnel an SSH connection through an HTTPS proxy :P
A web proxy would have to do rewriting.
@ThatBrazilianGuy Hello is WebRTC.
Or uses it. Or something.
@killermist A pure web browser only really needs to care about the various versions of HTTP, including SSL/TLS (HTTPS).
But modern browsers contain considerably more functionality.
And they have plugin frameworks allowing you to add more.
 
3:07 PM
@Bob Bah. Those addons miss the point of web browsing.
 
Bob
For example, there's an IRC client implemented as a Firefox addon.
@killermist Eh, modern browsers can be considered an OS.
...they are an OS (or a major portion of one) already. See: Firefox OS, Chrome OS.
Based heavily around their browsers.
 
I'll stay with Linux Mint, use Firefox, and bolt on Chrome. Using a browser/OS hybrid just seems a bit... wrong.
 
Bob
Heh.
They tend to be too limited for me, personally.
 
@Bob well, the goal of several companies over the past decade or so has been to (1) add enough features to the web platform (perf, device integration, cloud print, 3d, enhanced video/audio integration, animations, canvas, etc etc etc) to replace desktop, and (2) implement actual server-side services using this stuff...
at this point you can write very sophisticated JS macros that run server-side in Google Docs and Sheets, effectively replacing the one killer feature of Office (VBA for automation of repetitive tasks)
 
@allquixotic trying to pack so many "features" into the browser that an OS should already be handling for the browser makes it feel like they're trying too hard to reinvent the wheel.
... and it leads to memory bloat, which is a persistent frustration to me because my machines are still generally limited to 4Gb ram.
 
3:14 PM
Ugh, I hate path separator behavior on Windows SO MUCH O____O
 
@killermist I disagree. the core OS is there to be an interface between the hardware and the software layer. the browser is more like a "second-level OS" that provides independent, but important, higher tiers of functionality, while focusing on security and easily distributable applications (as in, just navigate to the URL and you've "installed" the app)
 
Bob
@OliverSalzburg Funny thing, that. Windows technically accepts both formats, but some parts of the OS only accept backslashes :\
 
@killermist It's not like I don't believe you, it's just that the flags are not in the flag queue
@Bob Yeah, I know
 
I wouldn't want the core OS to try to do what browsers do, because core OSes tend to do things differently and in a very non-standard way... "the web for Windows", "the web for Linux", "the web for Macs"... no thanks... one web for everyone
 
The first path is from a config file, the second is passed through path.join(), which replaces everything with the native separator. The result is shown above
 
3:16 PM
... backslashes for a backwards OS.
 
@Bob the Windows "Shell" is retarded >_< for legacy compatibility with old Win32 crap from 1995 they continue to support only a small subset of what core NTFS can actually do
 
In a way it's NodeJS being stupid really
 
If backslashes aren't acting as an escape character, then the OS is using the character wrong.
 
Bob
@killermist ... ... ...
You do realise an escape character can be any arbitrary character?
And backslashes have many meanings beyond its use as an escape character in C-like languages?
 
For CLI and paths, it should be a matter of standardization and disambiguity. MS loves to arbitrarily do things different, just for the sake of it.
 
Bob
3:19 PM
You also do realise that the slash was inherited for identifying params from CP/M? When MS-DOS first gained support for hierarchical FSes, the slash was already reserved.
I could just as well say Unix arbitrarily chose the / character.
 
yup
 
Bob
Anyway, it all depends on context.
The Windows (NT) kernel? It accepts both path separators equally.
The Win32 API? It has a preference for \, but also accepts / in most places.
Some built-in legacy command-line tools? They keep the CP/M legacy for / and only allow \ for path seps.
 
don't the shell32 APIs only work with ``?
 
Bob
PowerShell cmdlets? They also accept both.
@allquixotic AFAIK they work with /.
Actually, I struggle to think of one that doesn't... maybe they all do?
Remember that / is also a reserved character for path components.
As long as the API knows it's being passed a path, it really doesn't matter which sep is used.
It's really only in the context of the command line that it matters.
...and programs written by devs who incorrectly assume backslashes only.
61
A: Why does Windows use backslashes for paths and Unix forward slashes?

GillesUnix introduced / as the directory separator sometime around 1970. I don't know why this exactly character was chosen; the ancestor system Multics used >, but the designers of Unix had already used > together with < for redirection in the shell (see Why is the root directory denoted by a / sign?)...

Huh. I forgot about Multics and VMS.
But, yea. A lot of the decisions were based on what characters were available in the limited set.
If Unix hadn't already reserved the lt/gt? We might be using > for path seps now.
I really don't get why people keep saying Windows did it "just to be different" :S
 
4:32 PM
posted on January 14, 2015

http://meta.stackexchange.com/users/259693/scimonster: "I think that using a capital “i” in the middle of a sentence is obsolete. Please don’t remove it from"

 
4:50 PM
Noob question here -- I'm very familiar with the SE format, but every site is different -- how do you all react to questions where the question itself may be 'incorrect'? I have a Q on mounted file systems, but in all honesty I have no idea what I'm talking about. There would necessarily be a discussion in the comments (or a chatroom) to define the Q before it could reasonably be answered.
Related: vvv
1
Q: How do I test that a given mountpoint is mounted correctly?

Sean AllredUsing any of /etc/mtab, /proc/mounts, mount, or mountpoint can give you incorrect information if any of the following have occurred: The remote is offline (grep-file based solutions fail) For NFS mounts, the remote has stopped exporting or the NFS service has been stopped (mountpoint fails) The...

 
@SeanAllred A lot of our users get trigger-happy with the VTC button and/or downvote button and/or snarky comment button (buttons, since the snarky comments have to be typed :)) when we get questions where the OP has no idea what they're talking about. We're trying to improve that, but I personally am no longer willing to go back and forth and back and forth in the comments trying to get someone to understand basic concepts.
Willing to do it in chat, though.
(That's what chat is for)
 
@allquixotic :) As I said, every site is different. Some communities would chide the above for 'asking to ask'. Should I go ahead and explain the situation here or create a separate chatroom for it? (On a related note, is there any way to force the let's continue this discussion in chat scenario?)
 
@SeanAllred there's no way to force the let's continue this... (despite that being asked on meta.SE a while ago, IIRC).
feel free to just state your situation here rather than making a separate chat; this chat is generally not very busy
 
Okie dokie :) (type type type)
I am tasked with creating a generalized mount manager to handle NFS/CIFS mounts (and possibly others in the future). Many times this is to manage a service that relies on the mount; when the mount goes up, start the service -- down and back up, restart the service, etc.
I was able to figure this out pretty handily for most situations with NFS mounts, but there is an edge case I failed to cover, which I'll explain.
Say I have an IP alias for a 'migration group' of hosts (say, A and B are in the same group). Groups are defined as primary and failover hosts for various services. If A is primary and A goes down, then it's necessary to restart the service that depended on A's services.
The problem is, I can't seem to detect when this failover has taken place and I have no ability to be notified of the change, at least not without significant changes to the underlying migration codebase. When you work on a 20+ year-old system, you have to make certain...compromises.
mountpoint sometimes works, stat hangs, ls hangs, etc., etc. I can't find a generalized way to make the determination.
In my mind, it comes down to the basic idea of "How can I determine if file operations are possible in a directory (or mounted file system) without actually making file operations?"
(Seeing that actually doing file I/O is, as far as I know, a blocking call that can linger indefinitely.
If it makes any difference, the mount manager is currently implemented in Python.
@allquixotic (end of explanation)
 
5:12 PM
@SeanAllred sorry, tied up at work, will take a look in a few
 
@allquixotic Not to worry -- we all have our day jobs. :)
 
@SeanAllred I agree with the most-upvoted answer on that question.
"availability" on any network mount (or really, even local storage, though that's less likely to happen there) is a difficult state to capture, because it's transient.
just because you sent a packet 1 ns ago and it got through and a proper response packet was sent, that is absolutely no guarantee that, 1 ns later, the transport will get torn down and the service will be unavailable.
 
@allquixotic Oh absolutely -- it's temporary by its very nature and there's no getting around that -- but it's that 'proper response packet' that I'm interested in. The mount status is being checked on a loop while the service is running in a subprocess.
 
Doing any sort of poll on a network to determine "status" is inherently risk-based: it's about as reliable as a traffic report. Just because someone got through in 5 minutes ahead of you, doesn't mean there's going to be an awful car crash by the time you get there that'll delay you for 2 hours.
 
@allquixotic Gambler's fallacy -- yep
But in all reality, that's as good as it can possibly get when we're operating in the real world.
 
5:17 PM
Whichever service you are running should be prepared to block, either by spawning a background thread, or doing non-blocking I/O and letting the kernel block for you.
If your goal is to wait until such time as the service can access the network (guaranteed) without blocking for any significant time, you're never gonna be able to solve that problem.
You can send an infinite number of canaries down a mineshaft but that's no guarantee it won't collapse when you go down there.
 
Ah, there we go -- that's not exactly my question, sorry
 
Let me re-read.
 
My question is only a yes/no whether the canary survived
I can't be held responsible for things that are out of my control for the mount status -- mistakes will happen -- but those mistakes are OK-ish
(It's getting all muddled in my head again)
 
My suggestion would be to actually try something like ls or stat on the mount point, and wait for an arbitrarily-selected timeout above which you determine that the service is unavailable (if you think that sounds like a hack, just remember that all TCP sockets work in exactly the same manner to determine when to close/reset the socket!)
basically, send the canary in and wait until you decide in your head that it's probably dead, then assume failover
 
That's a sound suggestion
 
5:23 PM
in theory, if you ls a directory that has less than, say, a few million files/directories, the response should be pretty quick, even on a fairly slow or saturated link.
by "quick" I mean less than 3 seconds. for both CIFS and NFS.
 
Interestingly though, when running timeout 2 stat in the state I want to detect, the terminal no longer responds to C-c or C-z.
Re ls -- it's interesting that ls actually succeeds in the failover state I described
 
what programming languages do you have access to for this? just bash? or is Python on the table too?
@SeanAllred in what sense does it "succeed", though? does it automatically connect over to the failover, or does it fail to retrieve the directory listing but exit 0?
 
The mount manager is implemented in Python currently, using subprocess and process-level timeouts to manage that
ls exits 0 with an empty directory, but this is not guaranteed to be an error (if, say, there are no screenshots in the directory they're mounted on)
 
hm... how about this...
just bypass the entire FS layer and (assuming your network endpoints are TCP) try opening a TCP socket on the IP:port of the expected file server.
if the socket opens, it's safe to assume that you're good (worst case, the server will take a few seconds to spin up the HDDs or something, but it'll work).
if the socket times out within 30s or something, or the host replies that the port is closed, then you can assume that it's down
 
In all honesty, I have no idea what any of that means. All of my schooling (that I thoroughly enjoyed) was in algorithms analysis... much more on the theoretical end of CS
 
5:27 PM
well your mount points for CIFS and NFS both specify a host:IP, right?
 
Not exactly -- at least not that I'm aware of.
They specify a host and an abstracted 'host directory' to mount onto an abstracted 'local directory'
 
err, I mean host:port, sorry
 
Oh -- I don't know what the port is that they're using.
 
well, no, both the NFS and CIFS drivers would have to (by design) specify some kind of hostname or IP, followed by a port, unless the port is assumed to be a specific well-known port
 
With the information I have, I would assume the default.
 
5:29 PM
if the port isn't specified, you can just look up the well known ports for CIFS and NFS
you want to do everything up til (but not including) the send on the TCP client socket
the connect procedure should attempt to make a TCP handshake; you can probably customize the timeout as desired
 
@SeanAllred To simplify things for myself, I synchronize mountpoints across hosts so that regardless what machine you're using, the path to something is the same.
 
connect should throw an exception if the socket can't be established for some reason
 
right
 
@killermist That's what we do, too to a large extent. We have many, many mountpoints though across tens of hosts (and so-called migration groups), some of which are Windows.
 
5:32 PM
For example, a ZFS pool mounted on /volumes/grindstone I will NFS mount host:/volumes/grindstone onto /volumes/grindstone on the client machine just to keep things clean and neat. It also means that symlinks don't break.
 
the nice part is, if (for example) the CIFS server daemon crashes on the FS-server side, the default behavior of most Linux distros is to immediately send a reply to any TCP socket request against that port, saying that the port is closed, so you don't even have to wait for the timeout
 
@allquixotic Sweet!
 
that means the exception would be thrown on s.connect within milliseconds rather than the timeout
however, if the CIFS server daemon process is running but is somehow hung (stuck in an infinite loop or something), then you will wait for the timeout
in either case an exception will be thrown
now remember, it is theoretically possible that the server might establish a TCP socket with you even if the filesystem isn't operating correctly -- but that's quite rare in practice.
 
I'm going to give this a try. It's probably a much more reliable method than pinging the host. One last question: I'm assuming there is some set of common ports for both NFS and CIFS -- would a call to mount(1) try each of these ports in succession, or would it try just one?
@allquixotic A risk I'm justified in taking
 
the process of the server responding to the TCP handshake and establishing a socket requires the server daemon (say, CIFS or NFS) to actively have its packet process event loop running correctly in order to reply to the socket
 
5:36 PM
Ahhhh
 
generally if that much is working, the FS will work, unless one of the HDDs has crashed and the CIFS/NFS daemon itself is hanging while waiting for its underlying local storage pool to respond
 
(If everything works out, this will be a much nicer solution than what I have at the moment)
 
in which case you will hit the timeout exception
(probably...)
 
@allquixotic During my assignment here, I've learned that were will always be edge cases. You can't account for every possibility unless you understand every part of the system absolutely.
There are never any guarantees, only 'probably's
 
@SeanAllred if you are willing to ignore the edge case of local disk failure, the TCP socket handshake test is probably good enough for most software-related problems
 
5:39 PM
:)
 
99% of the time, if the daemon crashes, or the OS reboots for an update, or the system runs OOM, or something like that, you will either get a TCP handshake timeout, or an immediate response from the server, saying the port's closed.
with Windows file servers in the mix, I'd think the Windows Servers rebooting for update would be the most common reason for failure
 
XD
*facepalm*
This has been, suffice to say, an enlightening conversation.
Is this basic network theory stuff? I never had the chance to take such classes in college (frankly, the professor was legitimately mental), but it's an area I'm lacking in.
 
Site's up and client is happy!
 
I've done stuff with "heartbeats" on network services before; ran an MMO for 5 years and had to figure out how to determine when to restart the game server, because it'd occasionally crash (we sub-licensed the client software when the original developer went belly-up, but our programmer wrote a buggy-ish game server from scratch in VB.NET)
 
I hereby nominate @JourneymanGeek for the "Hero of the day" and "Good guy" badges and formally state I owe him a Humble Bundle
(or some similar digital gift)
 
5:42 PM
@SeanAllred it's less about network theory and more about the practicalities of dealing with service reliability in a sysadmin context
 
@allquixotic But how did you go about actually learning what to do and what to ask? Is this a 'wisdom of the ancients' scenario, where you learned from a mentor or something similar?
 
@SeanAllred All my initial networking knowledge was learned from attending LAN parties.
If you couldn't get your machine on the network, you couldn't play. I REALLY wanted to play. So, when someone was willing to teach me anything, I listened.
 
@killermist Something I've interestingly never witnessed
 
@SeanAllred I thought about your questions for a few minutes and couldn't really come up with a satisfying answer -- I've been "mentored" a lot on general networking knowledge during a past internship, but in this case, I just kind of applied the things I know about networking to the problem you're having.
 
I have since then abandoned windoze, but my networking knowledge progressively grows doing some support in a NAS channel on IRC.
 
5:46 PM
it helps that I've written several daemons myself and tend to know how they work
 
@allquixotic Certainly
@allquixotic Well, I thank you for passing the knowledge on. I really need to get to implementing this now -- but seriously, thanks!
:)
 
real work is getting in the way of my ability to spend more time on SU and in chat today; I'm rather annoyed at it consequently; but hope I was able to be helpful meanwhile
 
If you want, you should post highlights from the above conversation as an answer to the Q are started out with. It seems like this is the best course of action (but then again, I don't know what I don't know in regards to what else could go wrong with a mounted FS)
 
also, you are from my state and share my first name
 
Woo!
I'll be moving actually -- very soon
Got a new job up in Wisconsin.
 
5:49 PM
@SeanAllred it all depends on where the FS comes from; if you have a filesystem backed by a quantum entanglement device, you'd have extremely different heartbeat testing procedures ;p
an FS is too abstract of a concept to have a truly good testing methodology for the generic filesystem
you may just have to parse the FS type and handle different cases differently, if you've got a mix of many different types
any IP network-backed FS can be treated mostly the same, though
 
Are resolution and aspect ratio related?
 
All mounts are described in configuration files (standard unix conf), so I'm thinking about just adding the protocol as a field there
 
@Boris_yo Typically.
 
I mean if I shot something in 1500px and changed aspect ratio to bigger/smaller would that impact cause poorly detailed image?
 
aspect ratio == proportions
to change aspect ratio, you either crop/letterbar or stretch/squeeze
 
5:55 PM
Object I shot has 16:9 but I think I can make it 3:4 or something. When thumbnail is generated, it is small. I think if I change it to 3:4 then it gets bigger in thumbnail.
 
@Boris_yo that's like saying, if I make a 4" by 8" sandwich and stretch it to 5" by 9", will that cause the sandwich to break apart?
@SeanAllred nah, don't add a protocol field; use the FS type (cifs or nfs or such)
 
@allquixotic I am not stretching object. I am stretching (resizing) canvas. Object remains in it's resolution.
 
@allquixotic ? I assume parsed from the -t option?
 
But playing with canvas won't impact aspect ratio?
If something looks good to me at 590x1000 does it make it standard aspect ratio?
 
@Boris_yo Only if you are Emperor of the Universe.
 
5:58 PM
@SeanAllred yup
 
In that case, your body parts become measure units.
 
@ThatBrazilianGuy Does that cause poor user experience? Does canvas aspect ration matter? Is aspect ratio for image itself but not canvas?
 
@Boris_yo A canvas is essentially a quantity of pixels across and a quantity of pixels down. It may or may not have an explicit pixel density measurement attached.
And "across" and "down" could have different pixel density measurements.
There also can be a difference between pixel aspect ratio and display aspect ratio.
 
@killermist pixel density aside (and assuming square pixels), there's still the concept of pixel aspect ratio for a canvas... so if you have in GIMP, say, 1000 x 4000 pixels, you have an aspect ratio of 1:4... if you have a 300x500 image in that canvas, the image has an aspect ratio of 3:5... if you resize the canvas, it'll stretch or crop the image accordingly (if needed, depending on the resize operation).
 
@allquixotic Yes
 
6:10 PM
@allquixotic You read my mind and typed some of what I was going to say. Thanks for saving me the typing.
 
How Windows 7 generates thumbnails from image? Let's say 160x160 thumbnail is generated from 1000x1200 image. Is it:

1. Resized?
2. Or cropped?
If cropped, does Windows know where is center and crops from there?
 
@Boris_yo You forgot the third option of "padded".
It's obviously resized to that small size, but it may have been cropped or padded first.
Your 1000x1200 image may have been cropped to 1000x1000 or padded to 1200x1200, and then resized/resampled down to 160x160.
 
@Boris_yo think of padding like, scanning in an 8.5" x 11" piece of paper into a printer, and having it print it in the same physical dimensions on a 11" x 17 piece of paper
so you get blank strips on either side of the 11" x 17" piece of paper and the 8.5" is in the middle
 
@allquixotic Margin?
 
In the case of padding a 1000x1200 image to 1200x1200, 100 pixels would be appended to both left and right to make up the difference in space.
 
6:21 PM
@killermist And of course white space does not take data or only 1 byte?
 
Depends on image format. Duplicate pixels tend to compress really well.
In the case of Windows making thumbnails, it's mostly academic. The padding pixels only exist for a short period of time as the original image is resized/resampled to the thumbnail size. The original file shouldn't be modified.
 
 
1 hour later…
7:37 PM
 
 
2 hours later…
9:08 PM
@CanadianLuke Hahaha!
 
9:47 PM
:)
 
@CanadianLuke That's the ugly part of teaching computer science and software engineering.
The CS education movement needs to address this issue.
The process of developing big applications is far more complicated than the average user thinks.
Teaching students why a segfault occurs with a particular piece of C++ code or with specific inputs and how to fix it is just the beginning
 

« first day (1622 days earlier)      last day (3388 days later) »