[21:16:43] ivanskie: i'm having an annoying issue of "WARN: Unresolved specs during Gem::Specification.reset"
[21:17:19] ivanskie: i've done `gem clean` and removed only the gems mentioned in the warning. and this is still popping up (standalone ruby project)
[21:17:50] ivanskie: maybe i should google some more. but the suggestions from what I have found, don't seem to help
[21:40:20] ivanskie: i'm putting together a TTY based gem (with thor).. and i thought i'd use awesome_print for easier to read output for logging.
[21:40:38] ivanskie: and then was refactoring Gemfile into gemspec for the gem. and since bundle clean --force.. it broke it somehow
[21:41:11] ivanskie: it adds .ap method to Logger class. and this used to work. and now it doesn't i don't get it.
[23:05:17] ivanskie: i hijacked the bin executable, and renamed the main one so that I can do stuff in parant shell in a certain situation.
[23:06:08] ivanskie: anyway now all help / error outputs the name of the renamed executable (i added '_'. in my case).
[23:40:56] ivanskie: my main executable lets say was exe/`command` i renamed it `_command` and added `command` which just has an if/else block in it. if second argumant matches it runs something else. otherwise it just starts `_command`.
[20:20:03] ivanskie: looking at a couple posts https://stackoverflow.com/questions/4103809/how-to-create-a-ssh-tunnel-in-ruby-and-then-connect-to-mysql-server-on-the-remot and https://stackoverflow.com/questions/37985266/create-a-background-ssh-tunnel-in-ruby and https://stackoverflow.com/questions/13998267/how-to-properly-implement-netssh-port-forwards
[20:21:19] ivanskie: something like that from within ruby. expose the port, print a postgresql::// url in cli to open in postico.. then if it doesn't shutdown on its own, have some other loop to shutdown the tunnel
[20:26:03] ivanskie: @params and params are indeed valid and separate things. so its not a typo in that regard.. uhm was looking at debugger output and it doesn't even try to send anything when i click the postgresql url then. for 127.0.0.1 etc etc
[20:30:39] ivanskie: our RDS (postgress database on amazon) isn't exposed to the public. But our bastion host has access to it. So I'm trying to open a tunnel to bastion with port forwarding to the RDS endpoint from bastion. if that makes sense?
[20:32:08] ivanskie: "ssh -f my_bastion_host -L $myport:$RDS_HOSTNAME:$RDS_PORT "sleep 10"" when the envars are filled... connects to bastion host, does local port forwarding to 65432 (in case one of us has local postgres server running). then I can just launch postico pointing to 127.0.0.1:56432 with credentials for RDS db. and get in there.
[20:32:36] ivanskie: the "sleep 10" command just executes on bastion, giving me time to open postico. then ssh tunnel doesn't close until i close postico or whatever.
[20:33:46] ivanskie: Im trying to do that now in ruby. because I need to dynamically lookup which bastion/jump box to connect to, and pull correct RDS endpoint and creds based on which app / environment is specified beforehand.
[20:36:17] ivanskie: i've tried building a system ssh command line string. and something isn't working right.
[20:37:39] ivanskie: oh actually i think i just need to keep track of the PID... then i can kill it in ruby afterwords.. hmmmmmmmmmm anyway im hoping i can do this with net::ssh or net::ssh::gateway gem
[20:46:33] ivanskie: cake time. unfortunately the one day i actually want to grab a beer. work fridge only has pop :( sad day
[20:47:17] ivanskie: for anyone interested... : https://www.madebylotus.com/blog/handling-port-forwarding-in-ruby/
[20:51:24] ivanskie: i wonder if there's a way I can have a loop in my code to monitor for that and just quit the app. for now i just have a 5 minute timer, or press any key to quit prompt
[20:53:27] ivanskie: hmm... anyway now im in bonus round. maybe time to code a way to run rake tasks on our apps, without sshing in, etc etc
[16:55:36] ivanskie: i gave up with my quest of making it work with net::ssh. can't beat it into submission. though it's just not meant for what i want obviously. ended up just doing Kernel.exec launching a cooked up ssh command.
[19:06:46] ivanskie: apeiros I haven't tried sshkit. but it looks like it could be quite useful in my case. it doesn't help with interactive shell though.
[19:40:48] ivanskie: yeah i had to find that out the hard way.. rather I assumed i could do it and went on.
[19:41:20] ivanskie: but thats what i just ended up doing. just build the ssh command string then Kernel.exec into it.
[19:41:49] ivanskie: sshkit looks cool for running rake commands on remotes after jumping through jumpbox tho.
[19:43:17] ivanskie: so i could do.. `$ app rake super-awesome-rake-task --app my-cool-app --env staging`. and it'd jump to right box and run the rake command within correct folder and envars, etc etc with pretty output. looks promising haha
[23:24:27] ivanskie: hey uhm how do you do this in ruby? namespace = 'aws:elasticbeanstalk:application:environment'
[23:53:28] ivanskie: looks like in ruby sdk, it just stuffs them all into single option setting called 'EnvironmentVariables'. a comma separated list of assignments. as one string
[17:14:14] ivanskie: its okay, once you learn programming you can just write an AI to learn other things for you.
[17:18:24] ivanskie: oft_gegong: if you are impatient, then just start writing a program. and figure out how to do it as you go.
[17:21:15] ivanskie: But dkowis on github essentially re-wrote it.. and it still doesn't work https://github.com/net-ssh/net-ssh/issues/622
[17:22:45] ivanskie: I don't understand what intercepts the characters and ignores CR. rather it actually replaces CR with NL
[17:24:14] ivanskie: there are these: http://net-ssh.github.io/net-ssh/Net/SSH/Connection/Term.html. I don't even know how to describe it. But I haven't been able to figure out where to put it, and enable/disable some of these flags.
[17:25:55] ivanskie: i might have to use what I have to just establish a port forwarding, then call a system ssh command to launch into the remote shell that way. so sad :(
[17:27:05] ivanskie: for our aws setup. eb ssh will not work, because everything is behind a firewall basically.
[17:28:28] ivanskie: its frustrating to get to launching into rails console through a jump box, etc etc.. just to get to the irb>. and be able to type and erase.. but when you press Enter it's like you are in text editor lol.
[17:46:22] ivanskie: eam: so once I make the connection, i'd just execute an stty command to change the behavior?
[17:53:49] ivanskie: ch.exec('stty icrnl') before requesting pty, says 'stty: standard input: Inappropriate ioctl for device' but exec that after request pty.. and it closes the channel.
[18:07:58] ivanskie: This is the output for `stty -a` once pty connection is established. https://dpaste.de/EfPJ
[21:22:34] ivanskie: background: writing a pseudo copy of heroku cli. specifically command to launch into rails console on remote machine.
[21:23:26] ivanskie: eam has pointed me in the right direction with changing stty or something similar modes.. im not having amazing luck there. anything i try changing results in it complaining about incompatible mode for ssh.
[21:24:09] ivanskie: and now i've sumbled upon io/console and now when im in irb> on remote machine (using net::ssh) i press enter, and it acts as if I open a "
[21:25:25] ivanskie: my super ugly code (cause i've been at it for like 10+ hours now) https://dpaste.de/jP77
[21:26:44] ivanskie: supposedly.. I wait for stdin activity and then send raw characters through. This snippet of code now causes two problems. 1. this is a heavy loop, not really letting much else happen on screen. 2. i have no idea what im doing so i'm not exactly getting the result i want.
[21:36:37] ivanskie: i know im so helpful right now. i think i need a break from this lol. i've spent a bunch of time to get to this point. its just annoying
[22:39:16] ivanskie: okay so now.. this gets me to the shell. and i can type and press enter. but i keep having to press enter twice.. https://dpaste.de/Swda#
[19:01:53] ivanskie: speaking of which.. I'm still not even sure if this is going to work. i need to figure out how to run the .sh script which will source file with new envars. to apply to original shell
[19:11:11] ivanskie: right. so the way awsp dev is doing it, and how i replicated it in bash script. is.. I have an alias for 'source .myscript.sh' in .myscript.sh i show the menu, menu writes a temp file with exports. then .myscript.sh sources the temp file, deletes it, and exits.