Thursday, June 13, 2019

How hard can it be to send data from here to there?

Here's a list of possible reasons off the top of my head that you might fail to send data from here to there. Caveat: only things I have personally seen are included.


  • The firewall port between the two machines was not open.
  • The name was not yet in DNS.
  • Forgot to configure a proxy.
  • Forgot to disable a default proxy.
  • The server starts but something else was listening on that port so there's an "Address already in use" error.
  • The server restarted but did not use the SO_REUSEADDR flag so cannot reopen the same listening port for a few minutes.
  • Loading data from a database but the JDBC driver was constantly copying an array into another array just 1KB larger triggering 99% CPU usage on garbage collection.
  • A JSON document had an extra comma just before the final '}' making it not quite JSON.
  • The system time was off by a day which causes all TLS negotiation to fail.
  • I opened a scp session to a server that I already was sshed into, and "bank level" security detected two logins and caused my account to be immediately locked.
  • A legacy server only supported older ciphersuites, and the client did not have lenient config.
  • A legacy server only supported older TLS protocols, and the client did not have lenient config.
  • A network link defaulted to 10MB half-duplex, dropping speed to a crawl (used to happed all the time in the olden days).
  • "Hey, try this new opensource database query tool", I said. "Set up a connection here, oops that was the old password, it's probably changed... no that's wrong, too, try this... still nope? Oh, now the account is locked. Oh, and that's the service account that the UAT environment uses to connect to the database? Oh, damn, the client is in the middle of testing..."
  • JDK upgraded and testing root cert not loaded into cacerts file.
  • Certificate expired.
  • Certificate name did not match DNS name.
  • Netscaler swapped the first few bytes of "Content-Length:" header to make "ntCoent-Length:" which forces a connection close if transfer encoding is not enabled.
  • RNAT configured on an endpoint available internally and externally causing returning packets to vanish.
  • 6666 considered a "unsafe port" by Chrome.
  • System admins had disabled SSH tunnelling on all ssh servers.
  • Too many connections leak from a connection pool.
  • Only one connection used for multiple users so that their transactions overlap.
  • Failed to set binary mode using ftp client.
  • Vendor's modem assigned DHCP IP a value outside of the range that other device from the same vendor was configured to allow access to the gateway.
  • Connection did not have keepalive configured and eventually dropped.
  • Connected to an HTTPS server as HTTP and vice versa.
  • Server leaked file descriptors until it could not accept connections.
  • Closing a connection failed, and I didn't think to catch the error.
  • Forgot to flush after a send.
  • Mismatch in character encoding, especially UTF-16.
  • Forgot to add "Content-Type" header, resulting in a 415.
  • Returning packets routed via a second server, which caused a stateful firewall to drop them.
  • Connected to the wrong wifi network.
  • Have not started the corporate VPN client.
  • Didn't update password in local Python NTLM proxy, causing account to get locked.
  • Forgot to do that PortableRemoteObject.narrow() with an EJB to allow the skeleton class to dynamically download to the client.
  • Data updated in a cluster but never replicated to remote node.
  • Network cable wiggled out.


Friday, June 06, 2014

Typo Causes Haskell Consciousness

Hacking away when it occurred to me that I had actually typed:

...
import qualiafied ...
...

Thursday, June 05, 2014

Reverse SSH Tunnel if AllowTCPForwarding is No

I ran into a problem the other day where I wanted to create a reverse tunnel from a remote machine to an inaccessible machine via my desktop, but when I tried the normally reliable:

ssh -R1234:otherhost:1234 remotebox

I was given the error:

Warning: remote port forwarding failed for listen port 1234

Drat! sshd has a config setting AllowTCPForwarding and it was not my friend. I started thinking about how to jury-rig something and after some problems eventually got to:

mkfifo pipe
cat pipe | ssh remotebox 'nc -l -p 1234' | nc otherhost 1234 > pipe

The magic of the named pipe allows us to send the standard output of the final netcat into the standard input of the of the ssh command.

Labels: , ,

Monday, May 19, 2014

Changing My Mind on Consciousness and Static Information

I had assumed that for information to be conscious some form of processing (i.e. state transitions) would be required. But just recently I thought back to Yudkowsky's description of a block universe (containing time as a dimension) and realised that there is no definite need for processing. As long as the complete set of information contains the processing steps then we should still have the same expectations for consciousness even though the total set of information can be viewed as static. Of course that's increasing the amount of information by a large factor, but the principle seems sound. It's an arresting thought that this line of reasoning leads to this conclusion. I could make consciousness with enough ink and paper.

Labels:

Tuesday, March 11, 2014

Thoughts on How Consciousness Can Affect the World

Overview

In "The Generalized Anti-Zombie Principle" Eliezer mentioned that one aspect of consciousness is that it can affect the world, e.g. by making us say out loud "I feel conscious", or deciding to read (or write) this article. However my current working hypothesis is that consciousness is a feature of information and computation. So how can pure information affect the world? It is this aspect of consciousness that I intend to explore.

Assumptions

A1: Let's go all in on Reductionism. Nothing else is involved other than the laws of physics (even if we haven't discovered them all yet).

A2: Consciousness exists (or at least some illusion of experiencing it exists).

Tentative Lemmas

TL1: A simulation of the brain (if necessary down to quantum fields) would seem to itself to experience consciousness in whatever way it is that we seem to ourselves to experience consciousness

TL2: If an electronic (or even pen and paper) simulation of a brain is conscious, then consciousness is "substrate independent", i.e. not requiring a squishy brain at least in principle.

TL3: If consciousness is substrate independent, then the best candidate for the underlying mechanism of consciousness is computation and information.

TL4: "You" and "I" are information and algorithms, implemented by our brain tissue. By this I mean that somehow information and computation can be made to seem to experience consciousness. So somehow the information can be computed into a state where it contains information relating to the experience of consciousness.

Likely Complications

LC1: State transitions may involve some random component.

LC2: It seems likely that a static state is insufficient to experience consciousness, requiring change of state (i.e. processing). Could a single unchanging state experience consciousness forever? Hmmmm....

Main Argument

What does is mean for matter such as neurons to "implement" consciousness? For information to be stored the neurons need to be in some state that can be discriminated from other states. The act of computation is changing the state of information to a new state, based on the current state. Let's say we start in state S0 and then neurons fire in some way that we label state S1, ignoring LC1 for now. So we have "computed" state S1 from a previous state S0, so let's just write that as:

S0 -> S1

From our previous set of assumptions we can conclude that S0 -> S1 may involve some sensation of consciousness to the system represented by the neurons, i.e. that the consciousness would be present regardless of whether a physical set of neurons was firing or a computer simulation was running or we if we writing it slowly down on paper. So we can consider the physical state S0 to be "implementing" a conscious sensation that we can label as C0. Let's describe that as:

S0 (C0) -> S1 (C1)

Note that the parens do note indicate function calls, but just describe correlations between the two state flavours. As for LC1, if we instead get S0 -> S(random other) then it would simply seem that a conscious decision had been made to not take the action. Now let's consider some computation that follows on from S1:

S1 (C1) -> S2* (C2)

I label S2* with a star to indicate that it is slightly special because it happens to fire some motor neurons that are connected to muscles and we notice some effect on the world. So a conscious being experiences the chain of computation S0 (C0) -> S1 (C1) -> S2* (C2) as feeling like they have made a decision to take some real world action, and then they performed that action. From TL2 we see that in a simulation the same feeling of making a decision and acting on it will be experienced.

And now the key point... each information state change occurs in lockstep with patterns of neurons firing. The real or simulated state transitions S0 -> S1 -> S2* correspond to the perceived C0 -> C1 -> C2. But of course C2 can be considered to be C2*; the conscious being will soon have sensory feedback to indicate that C2 seemed to cause a change in the world.

So S0 (C0) -> S1 (C1) -> S2* (C2)  is equivalent to S0 (C0) -> S1 (C1) -> S2* (C2*)

The result is another one of those "dissolve the question" situations. Consciousness affects the real world because "real actions" and information changes occur in lockstep together, such that some conscious feeling of the causality of a decision in C0 -> C1 -> C2* is really a perfect correlation to neurons firing in the specific sequence S0 -> S1 -> S2*. In fact it now seems like a philosophical point as to whether there is any difference between causation and correlation for this specific situation.

Can LC2 change the conclusion at all? I suspect not; perhaps S0 may consist of a set of changing sub-states (even if C0 does not), until a new state occurs that is within a set S1 intead of S0.

The argument concerning consciousness would also seem to apply to qualia (I suspect many smaller brained animals experience qualia but no consciousness).

Thursday, June 06, 2013

Remote Connection from VisualVM Through a Firewall

There's a lot of info on the web about how to use VisualVM to connect to a remote Java process, but if an awkward firewall is in the way this may come in handy... Set your suite of extra command line flags in the Java process to enable a remote connection, e.g.:
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9999
-Dcom.sun.management.jmxremote.local.only=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
Now use sshuttle to connect to the remote machine. Then in VisualVm connect to the port (in this example 9999) on localhost, and sshuttle will take care of the rest. Much easier than manual ssh tunnels or using jstatd and mucking about with security policy files. Of course the usual security implications of opening up ports an unauthenticated access apply.

Tuesday, September 11, 2012

Eclipse and Maven breaking adding resources to Tomcat

I had an Eclipse project where I could not seem to deploy to Tomcat. After
mvn eclipse:eclipse
and opening the project I found that when I right-clicked on Tomcat and chose "Add and remove..." I got the error "There are no resources that can be added or removed from the server". When looking at the project properties under Project Facets the "Dynamic Web Module" version was set to 6.0, which is not a valid version of the servlet spec. It also warns: "Implementation of version 6.0 of project facet jst.web could not be found. Functionality will be limited."

After a lot of poking around I found that I could set up the config in pom.xml like this:

Then:
rm -rf .project .classpath .settings
mvn eclipse:eclipse
Now reopen the project in Eclipse. This creates some files under .settings. Edit .settings/org.eclipse.wst.common.project.facet.core.xml, it should look like:
<faceted-project>
  <fixed facet="jst.java">
  <fixed facet="jst.web">
  <installed facet="jst.web" version="6.0">
  <installed facet="jst.java" version="1.4">
  <installed facet="jst.java" version="1.6">
  <installed facet="jst.web" version="2.5">
</faceted-project>
Delete these two lines and save:

  <installed facet="jst.web" version="6.0">
  <installed facet="jst.java" version="1.4">
Now close and reopen the project in Eclipse. You should be able to add your module to Tomcat normally.

It feels like their should be an easier way but I'm not sure what it is...