Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
but can't you just ssh over and run compgen there using the command line you extracted from COMP_WORDS

well whatever, grats

EDIT: that came across super-snarky, it seems like a legit cool hack

rjmccall fucked around with this message at 20:12 on Mar 17, 2018

Adbot
ADBOT LOVES YOU

tef
May 30, 2004

-> some l-system crap ->

rjmccall posted:

but can't you just ssh over and run compgen there using the command line you extracted from COMP_WORDS

well whatever, grats

EDIT: that came across super-snarky, it seems like a legit cool hack

like yeah

but it also makes local files work too, i.e ./remotehack --input=localfile --output=localfile works

it is more than just cli completion, it is about presenting a local command that looks and feels like a local command despite all of the work being done remotely.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
right, but isn't that just ordinary filename completion on the remote

i'm kinda confused about how you're using "local" there, i assume you don't want to complete the remote command with filenames from the local machine

tef
May 30, 2004

-> some l-system crap ->

rjmccall posted:

i assume you don't want to complete the remote command with filenames from the local machine

a) that's what it does

b) it then copies file contents over/back as needed heh

tef
May 30, 2004

-> some l-system crap ->
like the whole point is

my machine$ command butt butt > farts

works as it were a local command

but what's really happening is that

some machine in the cloud $ command --wait_for_connections

my machine $ alias command="textfree86 10.0.0.2:1234 --'
my machine $ command butt butt > farts

like there's weird reasons you might want to do this

the simplest one is wrapping some poo poo you're running over ssh

but another is for clis like `heroku` or `docker` where a lot of what the command line does is talk to a daemon elsewhere

instead of writing a daemon, writing an API, writing a schema, building client libraries, writing a CLI

well, you write a CLI that runs locally and get one that runs remotely

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
stretch goal: eventually make a screencast or at least an animated gif demoing the features


I mean seriously though, even if you fix the readme I think it's still one of those things that are too naturally opaque to understand without a firsthand experience

creatine
Jan 27, 2012




TimWinter posted:

Writing your own version of something existent gives it unique flavor, a new take on an old standard. Like a carefully crafted loss edit.

Sapozhnik
Jan 2, 2005

Nap Ghost

your gearbox looks sick

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

tef posted:

a) that's what it does

b) it then copies file contents over/back as needed heh

oh what, so anything that looks like a path in the remote command and that exists locally gets copied over from the local machine and rewritten to be the remote path, and vice-versa after the command runs? that is uh a lot crazier than i thought you were talking about

so if you run "ssh x y -- foo /tmp/bar /tmp/baz" and /tmp/bar exists locally but /tmp/bar doesn't then you copy /tmp/bar to remote:bar-tmp, run the remote command "foo bar-tmp baz-tmp", and copy remote:baz-tmp to /tmp/baz

rjmccall fucked around with this message at 21:57 on Mar 17, 2018

tef
May 30, 2004

-> some l-system crap ->

rjmccall posted:

oh what, so anything that looks like a path in the remote command and that exists locally gets copied over from the local machine and rewritten to be the remote path, and vice-versa after the command runs? that is uh a lot crazier than i thought you were talking about

so if you run "ssh x y -- foo /tmp/bar /tmp/baz" and /tmp/bar exists locally but /tmp/bar doesn't then you copy /tmp/bar to remote:bar-tmp, run the remote command "foo bar-tmp baz-tmp", and copy remote:baz-tmp to /tmp/baz

that's one way of doing it but yeah, except foo is written in 'magic framework' so there isn't intermediary files, but yes



i mean it's not much different from form uploads on a web site tbh

mystes
May 31, 2006

TimWinter posted:

Writing your own version of something existent gives it unique flavor, a new take on an old standard. Like a carefully crafted loss edit.
Can I pretend I didn't google this and still think "loss edit" is just some sort of euphemism for a turd?

aardvaard
Mar 4, 2013

you belong in the bog of eternal stench

mystes posted:

Can I pretend I didn't google this and still think "loss edit" is just some sort of euphemism for a turd?

a shameful admission

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

mystes posted:

Can I pretend I didn't google this and still think "loss edit" is just some sort of euphemism for a turd?

i mean that's basically what it is

JawnV6
Jul 4, 2004

So hot ...
i used to have tab completion that was git aware, like git br<TAB> knew it was 'branch' without a FS check or w/e. the really handy thing was knowing the local branches so i could hop around them tabbing instead of copy pasting

but it wasn't so good that ive taken the time to set it up again v0v

tef
May 30, 2004

-> some l-system crap ->

JawnV6 posted:

i used to have tab completion that was git aware, like git br<TAB> knew it was 'branch' without a FS check or w/e. the really handy thing was knowing the local branches so i could hop around them tabbing instead of copy pasting

but it wasn't so good that ive taken the time to set it up again v0v

it's a bit of a novelty feature to lure people into understanding what the actual problem it solves is

the rough idea is that you have some web API and want a CLI client for it

and that, well, instead of shipping one CLI tool per service, and being locked into an update cycle

you ship one CLI tool, and the API describes the commands







yes i wrote network transparent tab completion library to try and demonstrate the principles of a web browser + respresentational state transfer

Notorious b.s.d.
Jan 25, 2003

by Reene

tef posted:

yes i wrote network transparent tab completion library to try and demonstrate the principles of a web browser + respresentational state transfer

this is actually cooler than the tool itself

solve an ultra-specific problem to illustrate a general one. nice

Ator
Oct 1, 2005

in UI/UX design, i've heard this kind of feature called "discoverability"

the idea is that the user can browse what's available (in this case, remote/local path names), and by browsing will learn to use the system better. by allowing convenient exploration, the program allows the user to discover how to do what they want to do.

sublime text lets you type potential commands into ctrl+shift+p and uses fuzzy matching to find maybe the command you were looking for.
same fuzzy matching is used by sublime for finding files in the project

spacemacs mode for emacs has nice popups of possible commands once you type the first part of the command. works for keybinds and function calls etc.

a good rest api, imo, is one that is easy to query for a list of possible commands and object types. one that you can query and print this info live and dynamically. you get the same information as the api's reference documentation, but presenting it in a browsable way in the user's editor makes it easier to understand and learn.

Notorious b.s.d.
Jan 25, 2003

by Reene
a good rest api is using xmlrpc or soap. it's "discoverable" like all other libraries are: my IDE can read the API documentation directly and provide hinting and lookups

by definition any http api that isn't either xmlrpc or soap is bad.

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
someone should come up with a JSON spec for REST services that can be located at their root URLs to provide machine readable descriptions of their schema for documentation and codegen use

then the cycle truly will be complete

Arcsech
Aug 5, 2008

eschaton posted:

someone should come up with a JSON spec for REST services that can be located at their root URLs to provide machine readable descriptions of their schema for documentation and codegen use

then the cycle truly will be complete

you mean swagger

Shaggar
Apr 26, 2006
yeah swagger is WSDL but in json.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
I leafed through (one of?) the json schema spec(s) once

"what if xml but shittier" was my takeaway

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
i tried to do non trivial things with json schema once and it is god loving awful.

Shaggar
Apr 26, 2006

pokeyman posted:

I leafed through (one of?) the json schema spec(s) once

"what if xml but shittier" was my takeaway

json is xml but shittier so json schema would always be xml schema but shittier. it still beats no json schema

akadajet
Sep 14, 2003

Notorious b.s.d. posted:

by definition any http api that isn't either xmlrpc or soap is bad.

lmao

redleader
Aug 18, 2005

Engage according to operational parameters
i was hella pro-soap until i realised how many people handcraft their soap envelopes even in languages with excellent soap support (java, c#)

at least with rest you know that everyone creates their own bespoke clients so you have no expectations about reliable interop

brap
Aug 23, 2004

Grimey Drawer
my main experience with soap (wcf) was generating the api client in the same solution as the api server, generating a bunch of identical model classes and service interfaces instead of keeping those classes in a common project or something.

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

redleader posted:

i was hella pro-soap until i realised how many people handcraft their soap envelopes even in languages with excellent soap support (java, c#)

at least with rest you know that everyone creates their own bespoke clients so you have no expectations about reliable interop

I've once had to do that when a regional health care service had a broken wsdl that visual studio refused to chew for some reason

fortunately it was just a couple of calls so it wasn't too bad. and i got a chance to combine both of visual basic's best-kept secrets, xml literals and iterator lambdas

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

xml literals is this the scale thread?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Shaggar posted:

json is xml but shittier so json schema would always be xml schema but shittier. it still beats no json schema

I’ll have to take your word for it, it looked pretty garbage

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
json schema may be worse than no jsob schema

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
at redhat we built a mongo api layer that tried to enforce a schema over mongo collections by using json schema

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
that sounds amazingly awful!

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
then we migrated all of our enterprise oracle database data onto it.

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.
what always amazes me is that there is, for better or worse, a lot of discussion about things like swagger, raml, etc to provide decent tooling for rest apis.

none of these things have an inkling about asynchronous communication at all. want to use message queues to reliably communicate with other (micro)services? better not want anything documented!

cinci zoo sniper
Mar 15, 2013




MALE SHOEGAZE posted:

then we migrated all of our enterprise oracle database data onto it.

why ;_;

cinci zoo sniper
Mar 15, 2013




Sagacity posted:

what always amazes me is that there is, for better or worse, a lot of discussion about things like swagger, raml, etc to provide decent tooling for rest apis.

none of these things have an inkling about asynchronous communication at all. want to use message queues to reliably communicate with other (micro)services? better not want anything documented!

*bursts in through the wall* my man have you heard of graphql

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

to save money I guess

MononcQc
May 29, 2007

Sagacity posted:

want to use message queues to reliably communicate with other (micro)services? better not want anything documented!

message queues will not improve reliability of communication with other services, just make failures more obscure :smuggo:

Adbot
ADBOT LOVES YOU

cinci zoo sniper
Mar 15, 2013




Symbolic Butt posted:

to save money I guess

but why mongo, not postgres or some poo poo

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply