Re: Sqlline Tricks

2016-02-04 Thread Christopher Matta
Noted, I've updated the gist. Thanks John. Chris Matta cma...@mapr.com 215-701-3146 On Thu, Feb 4, 2016 at 10:12 AM, John Omernik wrote: > Like I said, I don't believe read -s is posix compliant, hence why I went > with the stty -echo based on > >

Re: Sqlline Tricks

2016-02-04 Thread John Omernik
That works, here is the script I came up with (mostly based on Ted's script with a few terminal reads). Feel free to include this script in Drill for people to use, Security wise, this is fairly sound, 5 seconds of a file existing with the user's credentials, that is only readable by the user

Re: Sqlline Tricks

2016-02-04 Thread Christopher Matta
Looks good. You can streamline the no echo of the password by passing read an -s flag. I’ve also updated it to allow for a -u or —user flag: #!/bin/bash USERNAME= PASSWORD= DRILL_VER=drill-1.4.0 DRILL_LOC=/opt/mapr/drill

Re: Sqlline Tricks

2016-02-04 Thread John Omernik
Like I said, I don't believe read -s is posix compliant, hence why I went with the stty -echo based on http://stackoverflow.com/questions/3980668/how-to-get-a-password-from-a-shell-script-without-echoing Thus, I went that route for more portability. On Thu, Feb 4, 2016 at 8:54 AM, Christopher

Re: Sqlline Tricks

2016-02-03 Thread Andries Engelbrecht
Try using an alias in .bash_profile or similar. Modify as needed, but this may help you. alias sqlline="/usr/bin/sqlline -u jdbc:drill:zk=drilldemo:5181" You can play with the user and password options, but they should work. --Andries > On Feb 3, 2016, at 1:53 PM, John Omernik

Re: Sqlline Tricks

2016-02-03 Thread Christopher Matta
The only way I know of getting sqlline to ask for a password is to run the !connect command after starting the shell: $ /opt/mapr/drill/drill-1.4.0/bin/sqlline apache drill 1.4.0 "a drill in the hand is better than two in the bush" sqlline> !connect jdbc:drill: scan complete in 427ms Enter

Re: Sqlline Tricks

2016-02-03 Thread Keys Botzum
Did you already open a JIRA on this? https://issues.apache.org/jira/browse/DRILL-3880 Keys ___ Keys Botzum Senior Principal Technologist kbot...@maprtech.com 443-718-0098 MapR Technologies http://www.mapr.com >

Re: Sqlline Tricks

2016-02-03 Thread Keys Botzum
They are different although interestingly I think some of this has been fixed per what others here have posted. If it were me I'd clarify/enhance the JIRA based on what you've just learned but others may feel differently. Keys ___ Keys Botzum Senior Principal

Re: Sqlline Tricks

2016-02-03 Thread Christopher Matta
How about this bash script I just whipped up for a workaround for now? #!/bin/bash USERNAME=$1 PASSWORD=$2 if [[ -z $USERNAME ]]; then echo "Please enter at least a username" exit 1 fi if [[ -z $PASSWORD ]]; then read -s -p "Enter Password for

Re: Sqlline Tricks

2016-02-03 Thread John Omernik
Ya, Andries, that's effectively what I did with my script, I passed the url with -u, but without the username and password provided on the command line, I get an auth error. If there truly is no way to ask for username/password when providing auth string, I may open a JIRA on that, I think it

Sqlline Tricks

2016-02-03 Thread John Omernik
Hey all, I am trying to "Ease" my users into using drill. One thing that I'd like to automate for them is the initial connection, basically, my zk string jdbc:drill:zk:zknode1:5181,zknode2:5181,zknode3:5181 Is a bit of pain, in addition, my users have to find sqlline, so what if I change

Re: Sqlline Tricks

2016-02-03 Thread John Omernik
LOL So I did. I saw them as two things. "Not putting the password at the command line" vs. Specifying the Connect string URL without user or pass and then getting prompted... but in reality they really are the same thing aren't they? On Wed, Feb 3, 2016 at 4:18 PM, Keys Botzum

Re: Sqlline Tricks

2016-02-03 Thread Ted Dunning
If you specify a file name on the sqlline command line, that file will be treated as a properties file which can specify user and password. An attacker could see the file name on the [ps ax] output, but they wouldn't be able to read the props file. If that file is deleted shortly after starting

Re: Sqlline Tricks

2016-02-03 Thread Christopher Matta
Good point about the ps, I can imagine a workaround using expect for now… I attempted to use heredoc but it didn’t really work: sqlline <<< '!connect jdbc:drill:' could not load a native library: netty-transport-native-epoll apache drill 1.4.0 "a drill is a terrible thing to waste" 0: