ssh wget download jdk - ssh

I've SSHed into one of my VPS and I'm trying to install java on it. Not really sure how to go about downloading but I am trying to use wget to download and install JDK7 from the Oracle website.
this file in particular: http://download.oracle.com/otn-pub/java/jdk/7u40-b43/jdk-7u40-linux-x64.rpm
To download the file, it requires authentication and I don't know how to do that through wget.
SOmeone please help

# rpm
wget --no-cookies \
--no-check-certificate \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
"http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.rpm" \
-O jdk-7-linux-x64.rpm
# ubuntu
wget --no-cookies \
--no-check-certificate \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
"http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.tar.gz" \
-O jdk-7-linux-x64.tar.gz
# then
tar -xzvf jdk-7-linux-x64.tar.gz
refer: https://gist.github.com/scottvrosenthal/11187116

To download the file, it requires authentication and I don't know how
to do that through wget.
To be more accurate it requires license agreement.
If you have SSH access to the server you can copy file using scp command
scp /<path to the file>/jdk-7u40-linux-x64.rpm user-name#server-name:/tmp/
Then you go to the server by ssh and find it in /tmp/ folder

Related

what is a no nonsense way to create a ubuntu virtual machine using virt-manager on command line

I tried various methods explained on internet, but none seems to be working. using local iso image give one issue and location gives another issue.
Can we setup IP using this command?
currently using this command
sudo virt-install \ --name worker-2 \ --ram=4096 \ --disk size=100 \ --disk path=/opt/sciserver/vm/worker-2.qcow2,size=30,format=qcow2 \ --vcpus 2 \ --os-type linux \ --os-variant ubuntu20.04 \ --graphics none \ --location 'http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/' \ --extra-args "console=tty0 console=ttyS0,115200n8"
and error says..
"ERROR Error validating install location: Could not find an installable distribution at 'http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/'
The location must be the root directory of an install tree.
See virt-install man page for various distro examples."
Your help will be much appreciated

How to download a shared item on google colab using wget?

I have a shared link like the below
https://drive.google.com/file/d/1tfBFavijh4UTG4cGqIKwhcklLXUDuY0D/view
but I am unable to download it google colab using the command
wget https://drive.google.com/file/d/1tfBFavijh4UTG4cGqIKwhcklLXUDuY0D/view
Few suggestion on the internet were to use the below command
wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME
but this didn't work. Any help is appreciated!
You can use gdown
!gdown --id 1tfBFavijh4UTG4cGqIKwhcklLXUDuY0D
Add a retry option after certificate check to the command. An example below
wget --no-check-certificate -r 'https://drive.google.com/uc?export=download&id=1tfBFavijh4UTG4cGqIKwhcklLXUDuY0D' -O FILENAME.zip

Add Ruby SDK from Docker container as a remote SDK on RubyMine

Rubymine has options to add remote sdks using Vagrant and SSH, however I decided to go with Docker. I already created a Ruby container, but I don't know how to enable SSH access to it so Rubymine can set it as the remote SDK.
Is it possible?
Tried to follow this article, but the Ruby image doesn't have yum and this package epel-release is for Fedora/RedHat.
Hey are you using this official Ruby docker image?
If so, it's based on Debian and you'll have to use apt-get to install packages.
Here's a handy script for installing openssh-server and configuring a user in a Dockerfile:
FROM ruby:2.1.9
#======================
# Install OpenSSH server (sshd)
#======================
RUN apt-get update -qqy \
&& apt-get -qqy install \
openssh-server \
&& echo "PidFile ${RUN_DIR}/sshd.pid" >> /etc/ssh/sshd_config \
&& sed -i 's|session required pam_loginuid.so|session optional pam_loginuid.so|g' /etc/pam.d/sshd \
&& mkdir -p /var/run/sshd \
&& rm -rf /var/lib/apt/lists/*
# Add user rubymine with password rubymine and give ownership of rubymine home dir
RUN adduser --quiet rubymine \
&& echo "rubymine:rubymine" | chpasswd \
&& chown -R rubymine:rubymine /home/rubymine \
EXPOSE 22
I'm not sure of what are the exact configurations you can perform with Rubymine. But it's possible to open a tty with the container without the need of ssh:
#run it as a daemon
docker run -d --name=myruby ruby:2.19
#connect to it
docker -it exec myruby /bin/bash
UPDATE:
Try setting DOCKER_HOST environment variable to listen on a tcp port:
export DOCKER_HOST='tcp://localhost:2376'

Download (all) files via FTP with explicit TLS/SSL encryption

I've been trying to download files from FTP with explicit TLS/SSL encryption from one server to another using Debian. I tried a lot of commands like ftp and wget but none of them worked and said Login is incorrect. I searched whole Stack Overflow and Google.
I tried ftp and wget like this:
wget -m --user=username --password=password ftp://ip
and
ftp user#ip
Thanks in advance.
wget must be version 1.18 or above. The following was tested on 1.19.1
wget -r --level=5 -m --no-remove-listing --reject "index.html" -c --progress=dot -N --secure-protocol=auto --no-proxy --no-passive-ftp --ftp-user=XXXXX --ftp-password=YYYYY --no-check-certificate ftps://ZZZZZZZZ.com:21
Here is the link on how to build wget http://www.linuxfromscratch.org/blfs/view/8.1/basicnet/wget.html

RVM on debian and rails 3

I'm following https://github.com/diaspora/diaspora/wiki/Installing-on-Debian and trying to get RVM installed on debian. Executing
bash < <(curl -s https://rvm.io/install/rvm)
gives me nothing, it does not result in anything. I have curl installed but the command doesn't generate any output.
You can just download https://rvm.io/install/rvm via browser and then execute bash ./rvm . The command you entered actually executes the same.
EDIT: the new way:
curl -L https://get.rvm.io -o rvm-installer
chmod +x rvm-installer
./rvm-installer
rm -f rvm-installer
Which is equivalent to:
curl -L https://get.rvm.io | bash
The former command was using -s without -S which was hiding errors from curl.