How to run a server on your desktop using ssh

Assume you want to run a server on your desktop for testing and development, but need outside services to be able to connect to it.

First, you’ll need ssh on your desktop. If you’re on linux you probably have it. If you’re on windows you’ll need to install it. I used the cygwin ssh

Once you have this, you’ll need to start your server on a port above 1024.

Lets say you’re going to run your server on port 4050 on your local machine. You want your server to be available on port 8000 of the box.

You need to add two lines to /etc/ssh/sshd_config

GatewayPorts yes
AllowTcpForwarding yes

and restart the ssh daemon with

/etc/init.d/ssh restart

open up a DOS box on your local machine and do this

ssh -R 0.0.0.0:8000:localhost:4050 -N username@example.com
username@example.com’s password:

-R    <– ‘Reverse’ ssh. ssh’s syntax assumes you’re forwarding the remote box to the local one unless you add this

0.0.0.0  <– if you leave this off  (many examples on the net show 8000:localhost:4050) your server will only be available from the server’s localhost, not from the outside world.

8000 <– the port on the server. Because we’re ‘reverse’ this is on the left.

localhost <– this is the location of the server from the server’s point of view

4050 <– port on the desktop.

-N  <– do not give me a shell. This is important.  See below

username@example.com   <– your unix login name and the name of the server

After you enter the ssh command ssh should ask for your password. Enter it and type enter. At this point the command should act hung, you should not see a login banner or get a prompt. If you do, you’ve omitted the -N

Thanks to Douglas Miles, who discovered much of this.

 

 

Posted in Uncategorized | Leave a comment

Star Trek

The most incredible, unbelievable, amazing piece of technology in Star Trek isn’t the star ships or the teleporter, it’s the communicators. I flatly don’t believe anyone will ever develop a voice communication system that’s clear all the time and never drops the call.

Posted in Uncategorized | Leave a comment

Lunar Buzzwords

Apropos of nothing, except that I like this stuff, here’s some Apollo era NASA lingo with explanations.

I never was a fan of ‘one small step’ – it was obviously canned. Far better was ‘I’m stepping off the LM footpad now. The surface is like a fine gray powder. My boot only goes into the lunar soil an inch or so’

 

You are go for RSLS Restart

Back in the day a computer was usually a big machine that filled a room. One didn’t put a full programmable computer in something unless one had to. For simpler tasks, one used a simpler device that, electronically or mechanically, stepped through a sequence of states.

Of course these could get quite complex. They could be wired to advance to a certain state on a certain pulse, and of course that pulse could come from the sequencer itself.

So, this brings us to rockets. During the final portion of the pre-launch sequence, the various events were controlled by the ‘launch sequencer’. At some point around T – 15 the launch sequencer would halt until a manual button on the spacecraft test conductor’s panel was pushed. When that happened the launch sequencer ‘restarted’ and continued to launch the rocket automatically unless humans intervened.

Since it was NASA, there had to be backups for everything, including the launch sequencer – hence ‘redundant set launch sequencer restart’, or RSLS restart.

8cD In case you need to launch some of your friends to the moon, now you know how to do it.

TLI – Trans-Lunar Injection

The last thing Mission Control says to the crew before they push the button to send them out of earth orbit and off to the moon

PDI – Powered Descent Initiation

Mission Control giving the LM crew permission to light off their descent engine and descend to the lunar surface.

 

 

Posted in Uncategorized | Leave a comment

Sad Commentary on Management

Working in academia has made me think this is a tongue in cheek management manual:

General Interference with Organisations and Production

(a) Organizations and Conferences

(1)Insist on doing everything through “channels.” Never permit short-cuts to be taken in order to expedite decisions.

(2)Make “speeches.” Talk as frequently as possible and at great length. Illustrate your “points” by long anecdotes and accounts of personal experiences. Never hesitate to make a few appropriate “patriotic” comments.

(3)When possible, refer all matters to committees, for “further study and consideration.” Attempt to make the committees as large as possible — never less than five.

(4)Bring up irrelevant issues as frequently as possible.

(5)Haggle over precise wordings of communications, minutes, resolutions.

(6)Refer back to matters decided upon at the last meeting and attempt to re-open the question of the advisability of that decision.

(7)Advocate “caution.” Be “reasonable” and urge your fellow-conferees to be “reasonable” and avoid haste which might result in embarrassments or difficulties later on.

(8)Be worried about the propriety of any decision — raise the question of whether such action as is contemplated lies within the jurisdiction of the group or whether it might conflict with the policy of some higher echelon.

(b)Managers and Supervisors

(1)Demand written orders.

(2)“Misunderstand” orders. Ask endless questions or engage in long correspondence about such orders. Quibble over them when you can.

(3;) Do everything possible to delay the delivery of orders. Even though parts of an order may be ready beforehand, don’t deliver it until it is completely ready.

(4)Don’t order new working materials until your current stocks have been virtually exhausted, so that the slightest delay in filling your order will mean a shutdown.

(5)Order high-quality materials which are hard to get. If you don’t get them argue about it. Warn that inferior materials will mean inferior work.

(6)In making work assignments, always sign out the unimportant jobs first. See that the important jobs are assigned to inefficient workers of poor machines.

(7)Insist on perfect work in relatively unimportant products; send back for refinishing those which have the least flaw. Approve other defective parts whose flaws are not visible to the naked eye.

(8)Make mistakes in routing so that parts and materials will be sent to the wrong place in the plant.

(9)When training new workers, give incomplete or misleading instructions.

(10)To lower morale and with it, production, be pleasant to inefficient workers; give them undeserved promotions. Discriminate against efficient workers; complain unjustly about their work.

(jj.) Hold conferences when there is more critical work to be done.

(12)Multiply paper work in plausible ways. Start duplicate files.

(13)Multiply the procedures and clearances involved in issuing instructions, pay checks, and so on. See that three people have to approve everything where one would do.

(14)Apply all regulations to the last letter.

(c)Office Workers

Make mistakes in quantities of material

when you are copying orders. Confuse similar names. Use wrong addresses.

(2)Prolong correspondence with government bureaus.

(3)Misfile essential documents.

(4)In making carbon copies, make one too few, so that an extra copying job will have to be done.

(5)Tell important callers the boss is busy or talking on another telephone.

(6)Hold up mail until the next collection.

(7) Spread disturbing rumors that sound like inside dope.

Would it were just tongue in cheek.  In truth, I copied it from ‘Simple Sabotage’, a WWII era manual for resistance members.

Posted in Uncategorized | Leave a comment

Database connection as seen by

java:

You have a nice, reasonable database connection scheme which is obscured by a massively bloated ORM layer that has effectively crippled the economy not only of the software industy, but the western world.

Rails:

You have a lovely, excellent ORM layer atop a perfectly reasonable DB connection layer. However you have to drag with you the history of everything the programmer you fired 3 years ago ever did, in the form of a list of migrations the length of Charlie Manson’s rap sheet. No one in the company has any clue what columns are actually in the DB.

Clojure:

You have your choice of any of several massively cool NoSQL, column oriented DB solutions. Each one works very well for the guy who wrote it.

Prolog:

In theory there’s a DB connection scheme, but nobody’s run the unit tests on that in a couple years.  If you really have to be stateful (snicker snicker) why don’t you just savestate?

PHP:

You set up tables in phpmyadmin and directly write SQL all over the place. At first this seems like a wonderful setup. On the day you discover that the list of tables now paginates to 36 pages and that every reference to the site name requires an 8 way join, you begin to rethink that.

Posted in Uncategorized | Leave a comment

How to deploy a new database for ClioPatria

This is HHP’s method of setting up the ClioPatria database for our system. I thought I’d post it since the ClioPatria documentation of this is poor and there’s no other source.

deploying:

1. delete config-enabled, rdf-store directories, and these files:
run.pl
users.db
settings.db

2. cd to the directory your application will run in.
3. swipl -s <cliopatria install dir>/setup.pl

4. you should get a few lines of progress stuff
5. halt.

5.5 Add this line to web/webapp/src/RDF-store/prefixes.db
prefix(hhp, ‘http://hhpvirtual.net/rdf/2013/03/rdf/opensim/&#8217;).

or whatever your ‘local’ prefix is.

6. there should be a run.pl in the directory. run it.

7. browse <your server>:3020/ and set the admin pw
(caution – browsing elsewhere first forever trashes the admin pw)

8. make sure the anonymous user has no priviledges at
http://<your server>:3020/cliopatria/admin/listUsers

9. load your schema file from the local machine via the repository/load local file menu

10. under
http://<your server>:3020/cliopatria/admin/settings
“prefix to rebase the server” should be blank (this is default)

11. Note that

http://<your server>:3020/cliopatria/

404′s, you need

http://<your server>:3020/cliopatria/home

12. make sure
http://<your server>:3020/cliopatria/browse/list_prefixes

includes <your local prefix> in the list of prefixes

13. rename run.pl dontrun.pl

 

Posted in Uncategorized | Tagged , , | Leave a comment

Bay Area Prolog Users Group

Our initial meeting of the San Francisco Bay Area Prolog Users Group is tomorrow.

If you’re on the left coast of North America you can participate in person. We’re meeting at 1130am at the Tech Shop. Tech Shop is at 120 Independence Drive in Menlo Park, CA. Come to front lobby and sign the release, come to the conference room.

What’s on the agenda?

* Cyc and Opensim4Opencog – Douglas Miles – a cool system for supporting AIish activities like machine learning by supplying a virtual body, and a wonderful demonstration of Prolog embedded in another environment.

* Web Apps in Prolog – Anne Ogborn – a basic introduction to using the http_server libraries in swi-prolog.

* Food!

* Door Prizes!

We’ll have a remote presence in Second Life at the CEEIAT building in Belphegor. You can participate there by following

http://slurl.com/secondlife/Belphegor/161/50/63

If you don’t have a Second Life client installed this will direct you how to get a (free) account and download the client. Once you have the client you can follow this link and it’ll offer you a teleport button to our location in world.

We’ll also stream the session into Livestream at

http://www.livestream.com/anniepoo

(and we’ll show this on parcel media in SL).

The meetup is organized through

http://www.meetup.com/Bay-Area-Prolog-Users-Group/

 

Posted in Uncategorized | Leave a comment