Anydesk installation by bash script using wget - html-parsing

I'm trying to write a bash script for automating the installation of anydesk by wget with the help of the following code:
echo -e "[ - ] Installing AnyDesk..."
wget --max-redirect 1 --trust-server-names 'https://anydesk.com/en/downloads/thank-you?dv=deb_64' -O anydesk.deb
sudo apt install ./anydesk.deb
echo -e "[ ✔ ] AnyDesk ➜ INSTALLED\n"
The problem is that https://anydesk.com/en/downloads/thank-you?dv=deb_64 returns a HTML page, not a Debian package.
How can I parse the HTML page to find the download link to the Debian package?

I examined page source of https://anydesk.com/en/downloads/thank-you?dv=deb_64 and download is triggered by JavaScript depending on User-Agent of browser, wget does not support JavaScript execution therefore you are actually getting HTML page source not actual .deb file. Use tool which support JavaScript execution to get actual file.

You can run the following command:
wget -O anydesk.deb https://download.anydesk.com/linux/anydesk_6.2.1-1_amd64.deb
this will allow you to download Anydesk, via wget.

Related

Automatically installing the latest Quarto version

I use a Quarto script to render my blog in Python. Quarto frequently updates, and I want to automatically install the latest version so I can have a script that automatically updates Quarto before rendering my blog.
How can I do this?
This is another example leveraging latest github release and gh CLI
gh --repo quarto-dev/quarto-cli release download --pattern '*.deb'
sudo dpkg -i $(ls quarto-*.deb)
rm $(ls quarto-*.deb)
This could be adapted to any repo with Github release.
Using _download.json is the safest though, especially when stable release of Quarto will be out.
For my own blog, I use the script below:
wget https://quarto.org/docs/download/_download.json
ver=$(grep -o '"version": "[^"]*' _download.json | grep -o '[^"]*$')
wget https://github.com/quarto-dev/quarto-cli/releases/download/v${ver}/quarto-${ver}-linux-amd64.deb
sudo dpkg -i quarto-${ver}-linux-amd64.deb
rm quarto-${ver}-linux-amd64.deb
rm _download.json
It takes advantage of the _download.json file in Quarto's website having the latest version.

Running ASP.NET Core app from Amazon Linux 2 on Docker - Globalization

I have my ASP.NET Core app running beautifully (more or less) on microsoft/aspnetcore:2.0-jessie. Now I want to try to get it to deploy to amazonlinux:2.
So far, the biggest hurdle has been libicu. I tried setting Globalization to Invariant, but this caused weird failures in, e.g., mySQL database calls.
Here's the relevant step from my Dockerfile:
RUN curl -L --http1.1 http://download.icu-project.org/files/icu4c/57.1/icu4c-57_1-RHEL6-x64.tgz --output icu.tgz \
&& tar -xf icu.tgz -C / \
&& export LD_LIBRARY_PATH=/usr/local/lib \
&& rm icu.tgz
(SourceForge was down while I was trying to work on this yesterday, which didn't improve matters.)
In any case, I still get the message of doom from .NET Core:
FailFast: Couldn't find a valid ICU package installed on the system. Set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support.
Any suggestions how to proceed?
Well, I revisited this yesterday. I don't know if it's because the base .tar of the Amazon Linux image has been updated, or because I was doing something wrong last time, but I installed the following packages using yum and all was well:
libunwind
libicu
dotnet-hosting-2.0.5
Note that for the dotnet package I needed first to set up Microsoft's package repository for yum, i.e.
rpm --import https://packages.microsoft.com/keys/microsoft.asc
and copying the following file to /etc/yum.repos.d/dotnetdev.repo :
[packages-microsoft-com-prod]
name=packages-microsoft-com-prod
baseurl=https://packages.microsoft.com/yumrepos/microsoft-rhel7.3-prod
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc
(see Microsoft's instructions for CentOS and other Linux distros)

Web browser not opening using Watir

I'm trying to open my browser using Watir with Ruby. I was able to run my script and open the browser once. Now I'm getting the error:
#<Watir::Browser:0x586947ae595497d2 url="data:," title="">
Title should be equal to "data." Chrome will open and then close without actually traveling to a webpage.
These were my steps after installing watir and chromedriver
1) rails c. 2) browser = Watir::Browser.new(:chrome)
I'm following a tutorial: https://youtu.be/1UYBAn69Qrk?t=4m24s
Any help would be greatly appreciated!
Silly mistake on my part, chromedriver wasn't properly installed. I came across this post. Here are the steps I took:
$ cd $HOME/Downloads
$ wget http://chromedriver.storage.googleapis.com/2.20/chromedriver_mac32.zip
$ unzip chromedriver_mac32.zip
$ mkdir -p $HOME/bin
$ mv chromedriver $HOME/bin
$ echo "export PATH=$PATH:$HOME/bin" >> $HOME/.bash_profile

How to build LLVM doxygen in HTML ? I tried but failed

I want to get a copy of the doxygen web-pages of llvm, so I can work with it without the internet.
I did as follows:
$ cd LLVM_ROOT_DIR
$ mkdir out
$ cd out/
$ ../configure --enable-doxygen
$ make ENABLE_OPTIMIZED=1
But it only built llvm without documentation. I also tried
$ make BUILD_FOR_WEBSITE=1 ENABLE_OPTIMIZED=1
and
$ make ENABLE_OPTIMIZED=1 EXTRA_DIST=1
All of them did not work.
How could I build the web pages ?
Thanks a lot.
Using recent versions of LLVM, an in-source build is prohibited by configure. Luckily the documentation can be built using cmake.
$ mkdir out
$ cd out/
$ cmake -DLLVM_ENABLE_DOXYGEN=On ../
$ make doxygen-llvm
The process will take a while, but after it you should have the full documentation.
Once you enable doxygen in the configure step, you can run make doxygen-llvm on the docs/ folder in your build directory.
You can run make help to check the available options.
I collect the web-site by wget.

How to update JDK on Jenkins Server cartridge (OpenShift)?

The Jenkins Server cartridge (OpenShift) uses OpenJDK 7u55.
How to update to OpenJDK 7u60 or 8u05 or Oracle JDK (7u60 or 8u05), please?
You can do this using OpenShift's action hooks. Add a script which will check for the existence of the JDK you want to use, and download it if it doesn't exist.
For example, in .openshift/action_hooks/deploy, add this snippet:
#! /bin/bash
JDK_HOME=$OPENSHIFT_DATA_DIR/jdk1.8.0
if [[ ! -L $JDK_HOME && ! -d $JDK_HOME ]]
then
cd $OPENSHIFT_DATA_DIR
wget http://www.java.net/download/jdk8u20/archive/b17/binaries/jdk-8u20-ea-bin-b17-linux-x64-04_jun_2014.tar.gz
tar xvf *.tar.gz
rm -f *.tar.gz
ln -s jdk1.8.0_20 jdk1.8.0
fi
In Jenkins, you can then configure builds to use this JDK by configuring the PATH variable, in an "Execute Shell" action, like so:
export PATH=$OPENSHIFT_DATA_DIR/jdk1.8.0/bin:$PATH
This example retrieves 8u20. Sorry, I'm not sure of the links to use for the exact versions you mention. Also, word of warning, this download is over HTTP, without performing a check against the published MD5 checksums. If you're doing anything serious, you should edit to code snippet to perform that check.

Resources