How to configure gsutil? - linux

I followed the Google instructions to set up gsutil. It states that after runnig 'gsutil config' in terminal I should see:
This script will create a boto config file at /.boto
containing your credentials, based on your responses to the following
questions.
Please navigate your browser to the following URL:
<http://urlto/authorization/dialog> In your browser you should see a
page that requests you to authorize gsutil to access Google Cloud
Storage on your behalf. After you approve, an authorization code will
be displayed.
Enter the authorization code:
however I get this response instead:
root#myserver# gsutil config
No command was given.
Choose one of -b, -d, -e, or -r to do something.
Try `/usr/bin/gsutil --help' for more information.
I am using gsutil version 3 on Ubuntu, and trying suggested flags with /usr/bin/gsutil does not give any sensible result.
Any suggestions?
Thanks

Pretty sure you have the "configure and manage GrandStream BudgeTone 100 VOIP and GS2000 phones" package installed, which is also called gsutil. So that is likely causing the issue. If you don't need the BudgeTone tools then remove them. Or, explicitly invoke the google tools by using the full path to your home directory where gstools was untarred/unzipped.

sudo apt-get remove --purge gsutil
sudo easy_install -U pip
sudo pip2 install gsutil
gsutil ls gs://uspto-pair/applications/0800401*
gsutil -config

This happens if you try to install gsutil using apt install gsutil which installs "GrandStream" manager instead of Google's gsutil.
First, you need to uninstall the wrong package:
sudo apt-get remove --purge gsutil
Then, you can install gsutil according to the installation guide.
Here is how you can do it in Ubuntu:
sudo apt-get install apt-transport-https ca-certificates gnupg
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
sudo apt-get update && sudo apt-get install google-cloud-cli

Related

Olevba install linux issues

I'm doing a lab on HTB and i need to download olevba, however when i do it doesn't work. I'm using linux commands i'm using to install are, sudo apt install python3-pip then, in
I'm using linux commands i'm using to install are, sudo apt install python3-pip then, error message olevba is not a command
This should allow you to create the command line:
sudo -H pip install -U oletools[full]
Refer to documentation : https://pypi.org/project/oletools/

Unable to install libsasl2-devel on Amazon Linux 2 machine

I am running Ansible playbook and trying to install OS dependencies packages for python. I am trying to run the following:
sudo yum install gcc gcc-c++ libffi-devel python-devel python-pip python-wheel openssl-devel libsasl2-devel openldap-devel
However, it fails at installing libsasl2-devel with the message:
"No package matching 'libsasl2-devel' found available, installed or updated"
All my instances are Amazon Linux 2 machines. Is there any alternative package for this? I tried to look into this but I found solutions for Ubuntu only.
I was able to get it to work in a series of steps. Its a yum issue after other databases are installed and not cleaned up before installing mysql
clear sasl first: sudo yum remove cyrus-sasl
if you have installed maria, there will be conflicts, remove that as well
sudo yum remove mariadb mariadb-server mariadb-libs
take note of anything uninstalled by this to re-add later. If this is too much, you can take a risk and not remove sasl, but it might not reset the availability of the package.
Start here to clean up the dependency issues: https://serverfault.com/questions/873955/how-solve-mysql-5-7-dependency follow the command given by clean all as sudo rm -rf /var/cache/yum/*
This can possibly resolve your issues right there, if not continue the installation below.
delete all data left in /var/lib/mysql/ or you may have upgrade issues.
resinstall sasl:
sudo yum install cyrus-sasl cyrus-sasl-devel and any other packages removed above.
Establish mysql5.7 with the yum services.
wget https://dev.mysql.com/get/mysql57-community-release-el6-11.noarch.rpm
sudo yum localinstall -y mysql57-community-release-el6-11.noarch.rpm
sudo yum repolist enabled | grep "mysql.*-community.*"
sudo yum repolist enabled | grep mysql
sudo yum install -y mysql-community-common mysql-community-libs mysql-community-server mysql-community-client
if that doesn't work, re-clear the yum cache again and re-run sudo yum install -y mysql-community-server
if that works, then
sudo service mysqld start
IF the /var/lib/mysql is empty, it will have created a temporary password in the /var/log/mysqld.log (use sudo to read)
run sudo mysql_secure_installation and establish your real password and security settings.
now you should have access via mysql -u root -p

Install Docker Ubuntu 16.04 -- Not finding packages

My morning so far has been banging my head against trying to get the docker installation to work, so far I have had no luck.
The guide I have been following: https://docs.docker.com/install/linux/docker-ce/ubuntu/
Here is the steps of what happens.
First:
sudo apt-get remove docker docker-engine docker.io containerd runc
Which is good! The next step is a sudo apt-get update which returns something less good. A lot of documentation I have read does not seem to help me solve this, so I plug on to see if something will correct this later.
Third step is
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
No issues here.
Fourth step is the docker fingerprint key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Which just outputs OK
Fifth step I do is the sudo apt-key fingerprint 0EBFCD88 which outputs the key as it is shown in the docker installation documentation.
Sixth step is the repository:
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
No output is shown just brings me to a new command line.
Seventh step is sudo apt-get update which shows the same output as in step 2.
Eigth step is the actual install. sudo apt-get install docker-ce docker-ce-cli containerd.io
Which outputs:
I am not sure of what files to edit. But every line is spelled correctly and it still throws issues my way and I am at a loss. If anyone has any tips thatd be fantastic.
If you are not sure which steps error, I suggest you to ease the process of the docker install using official convenience script, see this:
Main steps as next:
$ curl -fsSL https://get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh
Super simple way to install, as this is a common problem:
Download the most recent docker-ce, docker cli and container.d file from here:
https://download.docker.com/linux/ubuntu/dists/xenial/pool/stable/amd64/
Then just run dpkg -i <containerd package name> <docker-ce package name> <docker cli package name>
That's it, Docker away
sometimes it is blocked through the DNS, You can try by changing DNS address to 8.8.8.8.
you can change DNS address through /etc/resolve.conf temporarily
or if you need permanent you can change here /etc/resolvconf/resolv.conf.d/base

Build-essential for openSUSE

I am a newbie on openSUSE. I needed to get build-essential for the system but could not get it using sudo apt-get install build-essential or even by using sudo apt-get update and then following it with the previous code. I found a way to install most packages of build essential through sudo zypper install -t pattern devel_basis. But however, I am not able to obtain libframe package !! I can't directly download it because mine is an account on the office computer and I don't have the root access.
I am also attaching the screenshot of my terminal.. The error is towards the end.
Screenshot
zypper info -t pattern devel_basis to see what packages have the pattern
zypper install -t pattern devel_basis to install these packages
thanks to what-is-build-essentials-for-opensuse
I'm not sure if this requires root login or just maybe sudo privileges. These can be granted by ur system administrator. You may just need to ask for them.
You need to add the repository first before trying the zypper install
The command is
zypper ar -f URL alias
where
ar is short form of addrepo command
-f instruction to zypper to add autorefresh flag to newly added repo
URL is URL of the repo which you type in a browser to visit repo
in this case (itc): http://download.opensuse.org/distribution/leap/42.2/repo/oss/
alias is name that is easy to remember. itc: openSUSE:Leap:42.2
so...
zypper ar -f http://download.opensuse.org/distribution/leap/42.2/repo/oss/ openSUSE:Leap:42.2
I had a similar problem with ubuntu/debian command.
sudo apt-get build-essential libssl-devel
it turns out in Suse build-essential and libssl-devel would be devel_basis and openssl-devel respectively. to install I then searched on google for just openssl-devel (as it was all that I needed at that time), and followed the link from https://software.opensuse.org. Hope this helps

How to answer an apt-get configuration change prompt on Travis-CI, in this case for couchdb 1.5.0

I am trying run a specific version of couchdb on travis-ci I do this by following the offical apt-get instructions from couchdb
Part of the installation is a prompt for what to do with an old configuration file. See the following:
Installing new version of config file /etc/logrotate.d/couchdb ...
Configuration file `/etc/couchdb/local.ini'
==> Deleted (by you or by a script) since installation.
==> Package distributor has shipped an updated version.
What would you like to do about it ? Your options are:
Y or I : install the package maintainer's version
N or O : keep your currently-installed version
D : show the differences between the versions
Z : start a shell to examine the situation
The default action is to keep your current version.
*** local.ini (Y/I/N/O/D/Z) [default=N] ?
This causes travis-ci to hang and the build to fail.
Here is the travis-ci i have tried with and without the sudo rm and a handful of otherthings.
language: python
php:
- 2.7
install: "pip install -r requirements.txt"
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sudo apt-get install python-software-properties -y
- sudo add-apt-repository ppa:couchdb/stable -y
- sudo apt-get update -yq
- sudo apt-get remove couchdb couchdb-bin couchdb-common -yf
- sudo rm /etc/couchdb/local.ini
- sudo apt-get install -Vy couchdb
- sudo service couchdb start
before_script:
- curl -X PUT localhost:5984/njb_tests
script: python run-tests.py
You can see the different things i have tried by looking at my commit history:
https://github.com/Victory/notice-javascript-bugs/commits/master/.travis.yml
Hello my Frind its quite easy
I believe this command will do the trick
The 100% Working way no excuse no mercy!!
sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" install couchdb
The Softer way probally working
export DEBIAN_FRONTEND=noninteractive
apt-get -o Dpkg::Options::="--force-confnew" install -y
The Right way
on shell or in code do
export DEBIAN_FRONTEND=noninteractive
then
sudo apt-get -q -y install couchdb
It will assume “yes” to everything (and do it quietly)
you need to watch Debconf is the name of the tool. That page should help you get going with everything you want to know. debconf man page
The expect script method
you get asked for package maintainer or a password you should set on apt-get do here a simple example from a server that asks to set password on apt-get install
To keep your existing password, leave this blank.
Password for SYSDBA:
then you run it with this script below to do the input
#!/usr/bin/expect
spawn dpkg-reconfigure firebird2.5-superclassic -freadline
expect "Enable Firebird server?"
send "Y\r"
expect "Password for SYSDBA:"
send "newpwd\r"
# done
expect eof
Working example for your case is
- /usr/bin/expect 'spawn sudo apt-get install -Vy couchdb \n expect "*** local.ini (Y/I/N/O/D/Z) [default=N] ?" \n send "Y\r"

Resources