Does Fastlane have a default `username`? - fastlane

I'm trying to replace a Fastlane Match username with a new one on a Mac. No matter what variables I export (MATCH_USERNAME, FASTLANE_USER) or files I edit on my machine (Matchfile), Fastlane keeps picking up a previous user when executing a plain fastlane match. If I use the command line -u flag to override, then things run perfectly fine.
Does Fastlane have some default username that gets cached on initialization? Is there a way to force this username to be removed or find where it's being ingested by Fastlane (I've tried removing from fastlane-credentials, but I'm told it doesn't exist)?
I've got a temporary workaround for the time being, but I wanted to know for future reference.
To recap, I have tried:
Exporting new MATCH_USERNAME,FASTLANE_USER
Editing the Matchfile to include the new username
Removing the account from fastlane-credentials remove

The answer is "no". Fastlane does not store a default username; however, someone else could set an export in .bash_profile that overrides this in a CI pipeline, which is what I just discovered. Mystery solved.

Related

Is there a way to pass Jenkins credentials to automation test execution command?

I have created some global credentials in Jenkins, and I want to pass them to a powershell command that starts the execution of a protractor test suite.
The credentials are created properly, the bindings are also done as you can see int he image below:
The thing is, I need these credentials to use them when running the automation tests. The powershell command that I execute is the next one:
npm run test -- --userName=${env:ECASUSER} --password=${env:ECASPWD}
After I start the job the command is called inside the windows agent as expected, triggering the tests. When the test are using those credentials to authenticate it seems they are empty strings.
In the job console log, both credentials appear to be there but displayed like this (****).
I have tried a lot of solution none of them work. Am I doing something wrong here?
After some time spent to this, I reached the conclusion that this never worked. Or maybe it did at some point but, yeah it simply stopped.
Basically, Jenkins is not passing credentials to Windows batch or Power shell commands. My automation tests were running on blanks.
The only solution, that I found to this problem, is this one:
Create a new binding: Username and Password(conjoined) - here create a new job parameter containing the credentials. Let's say the parameter is named USERPASS;
Create a new 'Windows batch command' section where you save the credentials to a file in you test project (amazingly this one works) - your credentials will be saved to the file like this: "username:password". This is how you save the credentials:
echo %USERPASS% > "%WORKSPACE%\password.txt"
Change the automation test project to retrieve the credentials from the file;
Delete the file after the tests are completed.
I believe it should have been
npm run test --userName=${ECASUSER} --password=${ECASPWD}
and make sure you don't pass unnecessary --
Let me know if that doesn't work, I have other ideas

Python subprocess call sudo passwordless

I am currently working in a remote environment which has a user with certain sudo permissions for which it does not require inputting any password.
Specifically it can perform some nginx commands without the need of a password, so far so good. The problem I face comes when I have a python script that takes care of checking for updates and if there are changes tries to reload nginx. As seen below
Popen(['sudo', 'nginx', '-T'], stdin=PIPE, stdout=PIPE, stderr=PIPE)
call(["sudo", "systemctl", "reload", "nginx.service"])
When the script reaches one of this steps a prompt pops up on the terminal asking for a password, which should not be necessary since the user running the script has the permissions to run the commands without inputting it.
Question: Is there maybe a way, without hardcoding the password in a variable, to tell the script to "inherit" the permissions of the user when I run it?
Some additional information:
If the script itself is invoked with sudo everything works, but sadly this is not an option and sudo should be used only for the specific parts that completely require it (nginx reloads)
Python version is 3.5
EDIT: Solved this thanks to a friend:
The solution was to add the 'shell=True' paramater to the Popen.
Popen('sudo nginx -T'], shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE)
The issue might be, that there is a mismatch in the sudoers nginx-path and the PATH variable used during script execution.
Try to either match the Popen call to the full PATH given in the sudoers file or adjust the PATH in the shell calling the Python script.

Setting iPython default profile

Right after installing IPython, I created a default profile with:
$ ipython profile create
Then, I created another one, this time I gave it the name testing:
$ ipython profile create testing
I have customized this testing profile (the prompt, and autoreload extension, etc) to my liking, and now I would like it to be my default profile, so it's started when I type:
$ ipython
I know that I can start it with:
$ ipython --profile=testing
But that is a lot of typing.
I have already tried editing the file ipython_config.py in the profile_default folder, line 89:
# The IPython profile to use.
c.TerminalIPythonApp.profile = 'testing'
But it's not working. Any ideas why? Is it broken?
EDIT: Since I have to use different profiles for periods of time of weeks or fortnights, I'm looking for a way of selecting a default profile for those periods of time. It would be awesome achieving that from IPython itself, in the meantime, a very convenient workaround is adding an alias in the bash configuration(as pointed out by cel in one of the comments):
alias ipython='ipython --profile=testing'
Take a backup of profile_default and then rename profile_testing to profile_default.
Or you can copy the contents of profile_testing to profile_default.

Unrar script, error, in need of rar command for debian

I'm currently trying to get this script to work:
https://github.com/mj41/auto-unrar/blob/master/bin/unrar2.pl
The only problem is that I get the following error:
Entering directory 'Series'
Entering directory 'Series/SerieName'
Entering directory 'Series/SerieName/Season2'
Entering directory 'Series/SerieName/Season2/SerieNameS02E21.720p.HDTV.X264-DIMENSION'
Entering directory 'Series/SerieName/Season2/SerieNameS02E21.720p.HDTV.X264-DIMENSION/Sample'
Can't call method "List" on an undefined value at unrar2.pl line 973.
This line is rar_obj->List();
$rar_conf{'-verbose'} = $rar_ver if $rar_ver;
my $rar_obj = Archive::Rar->new( %rar_conf );
$rar_obj->List();
my #files_extracted = $rar_obj->GetBareList();
This is an old script, 3-4 years old and I changed a little like SHA1 to SHA and use Filesys::DfPortable; to Df
Does anyone know how I can fix this error :)?
EDIT:
I contacted the developer and he told me I needed to install a program that can handle rar commands. So how would I do that. I can't seem to be able to install unrar.
EDIT2:
What my problem is now, 2 of the 3 unrar packages aren't in my architecture, armhf.
To install the script yourself::::::::::::
https://github.com/jorricks/UNRAR
You need to pass the -archive parameter into the call to new() otherwise how will $rar_obj know which file it is supposed to be looking at?
I can't seem to be able to install unrar
That's not a particular good explanation of your problem. What did you try? What unexpected behaviour did you see?
From the tags on your question, it looks like you're running Debian. What do you see if you run sudo apt-get install unrar?
Update: My first comment was based on the code extract that you showed us. Looking at the full program code, I can see that %rar_conf has other values set in it (including the -archive option) before the section of code you gave us.
Looking at the source of the Archive::Rar module, it seems to assume that the program to use for dealing with the archives is called rar. So 7-Zip is not going to work.

Reference to undefined variable USER (aptana, egit) [duplicate]

When i try to put something on a git server it's givin' me an error:
"Reference to undefined variable USER"
In bash: echo $USER giving me correct answer.
What could it be?
It's eclipse with aptana-3 plugin (a whole pack)
A bash session might have the correct environment variable set.
But the native OS session might not (like a DOS session on Windows for instance).
Can you launch your aptana from a session which has just before set the correct value for USER?
If it still fails (like in this thread), try also to set the correct value for $HOME.
Update: Tracked down the issue. Looks like Eclipse is biting on ENV values that contain "${" in the value. A user was changing his command prompt to incude his username, hostname and pwd. After he commented it out of his .profile, it avoided the issue. As a result I added a bugfix to fix that in our development stream that should get into our next release.
--
Looks like a duplicate of https://aptana.lighthouseapp.com/projects/35272/tickets/1867-git-push-has-encountered-a-problem
I'm not able to replicate the issue, but if you could provide some more details on that ticket I can take a look, since I wrote all of our git support. It's likely that somehow something like $USER is sneaking into the git executable path, and when passed along to the launching infrastructure, it tries to interpret it as an eclipse launching variable (as opposed to a ENV var) that it can't resolve.