Webscrape and download the most recent RStudio build - r

Is it possible to scrape https://rstudio.com/products/rstudio/download/preview/ and download the most recent Ubuntu server version (RStudio Server 1.3.957 - Ubuntu 18/Debian 10 (64-bit)). The names keep changing and I would like to build an R script that does the downloading and updating automatically one per day for me.
R script or bash script would be perfect.
Thanks

Yes, we had that in littler for years as two scripts I run myself every once
in a while. Could be generalized for different distro arguments I suppse.
See
getRStudioDesktop.r
getRStudioServer.r
Demo
edd#rob:/tmp$ getRStudioDesktop.r
--2020-05-06 14:24:53-- https://s3.amazonaws.com/rstudio-ide-build/desktop/bionic/amd64/rstudio-1.4.315-
amd64.deb
Resolving s3.amazonaws.com (s3.amazonaws.com)... 52.216.28.190
Connecting to s3.amazonaws.com (s3.amazonaws.com)|52.216.28.190|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 124609040 (119M) [application/x-debian-package]
Saving to: ‘rstudio-1.4.315-amd64.deb’
rstudio-1.4.315-amd64.deb 100%[=====================================>] 118.84M 3.65MB/s in 39s
2020-05-06 14:25:32 (3.08 MB/s) - ‘rstudio-1.4.315-amd64.deb’ saved [124609040/124609040]
edd#rob:/tmp$ getRStudioServer.r
--2020-05-06 14:25:40-- https://s3.amazonaws.com/rstudio-ide-build/server/bionic/amd64/rstudio-server-1.
4.315-amd64.deb
Resolving s3.amazonaws.com (s3.amazonaws.com)... 52.216.200.197
Connecting to s3.amazonaws.com (s3.amazonaws.com)|52.216.200.197|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 60524622 (58M) [application/x-debian-package]
Saving to: ‘rstudio-server-1.4.315-amd64.deb’
rstudio-server-1.4.315-amd 100%[=====================================>] 57.72M 3.01MB/s in 22s
2020-05-06 14:26:02 (2.65 MB/s) - ‘rstudio-server-1.4.315-amd64.deb’ saved [60524622/60524622]
edd#rob:/tmp$
and of course
edd#rob:/tmp$ wajig install *1.4.315*deb # a dpkg/apt/... wrapper I like
(Reading database ... 478943 files and directories currently installed.)
Preparing to unpack rstudio-1.4.315-amd64.deb ...
Unpacking rstudio (1.4.315) over (1.4.200) ...
Preparing to unpack rstudio-server-1.4.315-amd64.deb ...
Unpacking rstudio-server (1.4.315) over (1.4.200) ...
Setting up rstudio (1.4.315) ...
Setting up rstudio-server (1.4.315) ...
useradd: user 'rstudio-server' already exists
Created symlink /etc/systemd/system/multi-user.target.wants/rstudio-server.service → /lib/systemd/system/
rstudio-server.service.
● rstudio-server.service - RStudio Server
Loaded: loaded (/lib/systemd/system/rstudio-server.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2020-05-06 14:26:54 CDT; 1s ago
Process: 7315 ExecStart=/usr/lib/rstudio-server/bin/rserver (code=exited, status=0/SUCCESS)
Main PID: 7316 (rserver)
Tasks: 3 (limit: 4915)
Memory: 6.8M
CGroup: /system.slice/rstudio-server.service
└─7316 /usr/lib/rstudio-server/bin/rserver
May 06 14:26:54 rob systemd[1]: Starting RStudio Server...
May 06 14:26:54 rob systemd[1]: Started RStudio Server.
Processing triggers for desktop-file-utils (0.24-1ubuntu1) ...
Processing triggers for mime-support (3.63ubuntu1) ...
Processing triggers for gnome-menus (3.32.0-1ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for shared-mime-info (1.10-1) ...
edd#rob:/tmp$

Related

R Plumber API on Digital Ocean: 502 BadGateway

I have (I think) deployed a plumber API on a DigitalOcean droplet. The droplet has R, plumber, and all necessary packages installed (I verified by going into the console). When I used plumberDeploy::do_deploy_api, R uploaded my directory files and ended with this:
â— plumber-mynewapi.service - Plumber API
Loaded: loaded (/etc/systemd/system/plumber-mynewapi.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2022-10-13 03:04:45 UTC; 2s ago
Main PID: 43431 (R)
Tasks: 2 (limit: 1131)
Memory: 252.4M
CGroup: /system.slice/plumber-mynewapi.service
└─43431 /usr/lib/R/bin/exec/R --no-echo --no-restore -e pr~+~<-~+~plumber::pr('/var/plumber/geovalidate/plumber.R');~+~pr$setDocs(FALSE);~+~~+~pr$run(port=8000)
[100%] C:\Users\mydir\AppData\Local\Temp\Rtmpiw5SiD\file3dc0450b6c70
/etc/nginx/sites-available/plumber-apis/mynewapi.conf
Api root url is droplet likely not up yet/mynewapi. Any endpoints from api will be served relative to this root.
The deployment completed two days ago, but I don't know how to actually access my API now (api name mynewapi).
I go to [[IP ADDRESS]]/mynewapi in my browser, and I just get
502 Bad Gateway nginx/1.18.0 (Ubuntu).
I did drop the "hello" API; before when I went to [[IP ADDRESS]]/mynewapi I saw the "plumber is alive!" screen.
This may be a simple answer, thanks for the help!

artifactory 6.8.7 won't start as can't connect to access server

Since upgrading to 6.8.7 using the rpm on RHEL 7, using systemctl start artifactory fails
Looking in the log its failing at this point
2019-03-16 09:50:28,952 [art-init] [INFO ] (o.a.s.a.ArtifactoryAccessClientConfigStore:593) - Using Access Server URL: http://localhost:8040/access (bundled) source: detected
2019-03-16 09:50:29,379 [art-init] [INFO ] (o.a.s.a.AccessServiceImpl:353) - Waiting for access server...
2019-03-16 09:50:30,625 [art-init] [WARN ] (o.j.a.c.AccessClientHttpException:41) - Unrecognized ErrorsModel by Access. Original message: Failed on executing /api/v1/system/ping, with response: Not Found
2019-03-16 09:50:30,634 [art-init] [ERROR] (o.a.s.a.AccessServiceImpl:364) - Could not ping access server: {}
org.jfrog.access.client.AccessClientHttpException: HTTP response status 404:Failed on executing /api/v1/system/ping, with response: Not Found
Previously we would get
2019-03-13 09:56:06,293 [art-init] [INFO ] (o.a.s.a.ArtifactoryAccessClientConfigStore:593) - Using Access Server URL: http://localhost:8040/access (bundled) source: detected
2019-03-13 09:56:06,787 [art-init] [INFO ] (o.a.s.a.AccessServiceImpl:353) - Waiting for access server...
2019-03-13 09:56:24,068 [art-init] [INFO ] (o.a.s.a.AccessServiceImpl:360) - Got response from Access server after 17280 ms, continuing.
Any suggestions on debugging whether this access server has started ?
Further to this I found logs showing when it worked it used to start a jar file
2019-03-08 09:19:11,609 [localhost-startStop-2] [INFO ] (o.j.a.AccessApplication:48) - Starting AccessApplication v4.1.48 on hostname.nexor.co.uk with PID 5913 (/opt/jfrog/artifactory/tomcat/webapps/access/WEB-INF/lib/access-application-4.1.48.jar started by artifactory in /)
Now when i look I find /opt/jfrog/artifactory/tomcat/webapps/access/ is empty so there is no jar file to run
The rpm did deliver an access.war file and that is there
$ ls -l /opt/jfrog/artifactory/webapps
total 104692
-rwxrwxr-x. 1 root root 51099759 Mar 14 12:14 access.war
-rwxrwxr-x. 1 root root 56099348 Mar 14 12:14 artifactory.war
Is there some manual step I can run to expand this war file to get the jar (as you can guess I am not up on my java apps)
Eventually got it working by deleting the empty /opt/jfrog/artifactory/tomcat/webapps/access directory and a new one containing the required jar files got created.
Not sure why this happened but that got it working for me
I had similar problem on CentOS 7, the solution was downgrade the newly updated java packages by running this command:
yum downgrade java-1.8.0*
After that restart the artifactory:
systemctl restart artifactory
Try changing the port number under your tomcat\conf\server.xml from 8081 to a different, unused port. Then, restart the Artifactory service to ensure the change takes effect.

What is the command to invoke RStudio from Command Line in linux environment?

I am looking for the command to invoke RStudio from Linux. I VNC into the linux system and don't see any other option to launch RStudio from the gnome-terminal. I know R files can be directly read in the terminal, but I searched and couldn't find any command to invoke RStudio.
Are you referring to the RStudio desktop version, or the server instance? The former is started by just calling rstudio:
edd#rob:~$ type -p rstudio
/usr/bin/rstudio
edd#rob:~$
The latter is always running and started as system process:
edd#rob:~$ systemctl status rstudio-server
● rstudio-server.service - RStudio Server
Loaded: loaded (/etc/systemd/system/rstudio-server.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2018-07-15 20:12:01 CDT; 1 weeks 1 days ago
Main PID: 1665 (rserver)
Tasks: 3 (limit: 4915)
CGroup: /system.slice/rstudio-server.service
└─1665 /usr/lib/rstudio-server/bin/rserver
Jul 15 20:12:00 rob systemd[1]: Starting RStudio Server...
Jul 15 20:12:01 rob systemd[1]: Started RStudio Server.
edd#rob:~$
If you want to access the latter you do not need VNC. Just point your browser at port 8787 on that machine.
Have you tried to launch it from here ?
/usr/bin/rstudio
PS : You need R to be installed on the system too.
On Arch the command is
rstudio-bin

Configure URL on shiny server

I've been trying to start my shiny server with no success. I followed the instructions at RStudio site, but when I check my server status, this is what I get:
$ sudo systemctl status shiny-server
● shiny-server.service - ShinyServer
Loaded: loaded (/etc/systemd/system/shiny-server.service; enabled; vendor preset: disabled)
Active: deactivating (stop-post) since Mon 2018-04-30 21:16:03 -03; 2s ago
Process: 17672 ExecStart=/usr/bin/env bash -c exec /opt/shiny-server/bin/shiny-server >> /var/log/shiny-server.log 2>&1 (code=exited, status=0/SUCCESS)
Main PID: 17672 (code=exited, status=0/SUCCESS); : 17682 (sleep)
CGroup: /system.slice/shiny-server.service
└─control
└─17682 sleep 5
Apr 30 21:16:02 shiny.estatistica.ufrn.br systemd[1]: Started ShinyServer.
Apr 30 21:16:02 shiny.estatistica.ufrn.br systemd[1]: Starting ShinyServer...
But shiny.estatistica.ufrn.br is not my website! My website is shiny.estatistica.ccet.ufrn.br/ (there is a ccet in there). Notice that Apache is alive and running when ccet is added to the url.
So, what can I do to start my shiny server? I think there is something to do with the url without ccet, but I couldn't figure out how to fix it.
Shiny Server has nothing to do with Apache. The name shiny.estatistica.ufrn.br in the last two lines looks like your server's (machine) name and the missing ccet has nothing to do with Shiny Server.
To have http://shiny.estatistica.ccet.ufrn.br/ point to your shiny server, your local IT/network department will be able to help you, as it requires a http request on some sub-level of the ufrn.br-domain to be forwarded to your shiny server.
I would just erase disk and start over, else windup spending far too much "fixing" stuff which isn't how shiny wants to work.

Asterisk unable to find master config file

I have strange problem after I've installed Asterisk on my CentOS server. So, I have used tutorial step-by-step and didn't get any error or warnings. Whole installation went successfully.
When I try to log into Asterisk CLI with asterisk -r I've got this error
[root#asterisk-14.6.1]# asterisk -r
Unable to open specified master config file '/usr/local/etc/asterisk/asterisk.conf', using built-in defaults
Unable to connect to remote asterisk (does /usr/local/var/run/asterisk/asterisk.ctl exist?)
[root#asterisk-14.6.1]#
What does this means? I can't find anything about master config file. My asterisk.conf file is in /etc/asterisk
-rw-r--r-- 1 asterisk asterisk 5332 18 sep 12,15 asterisk.conf
not in '/usr/local/etc/asterisk/asterisk.conf'
Asterisk is 100% running
[root#asterisk-14.6.1]# systemctl status asterisk
● asterisk.service - LSB: Asterisk PBX
Loaded: loaded (/etc/rc.d/init.d/asterisk; bad; vendor preset: disabled)
Active: active (running) since mon 2017-09-18 12:36:16 EEST; 3s ago
Docs: man:systemd-sysv-generator(8)
Process: 33977 ExecStop=/etc/rc.d/init.d/asterisk stop (code=exited, status=0/SUCCESS)
Process: 34000 ExecStart=/etc/rc.d/init.d/asterisk start (code=exited, status=0/SUCCESS)
Main PID: 34025 (asterisk)
CGroup: /system.slice/asterisk.service
├─34023 /bin/sh /usr/sbin/safe_asterisk
└─34025 /usr/sbin/asterisk -f -vvvg -c
sep 18 12:36:16 systemd[1]: Starting LSB: Asterisk PBX...
sep 18 12:36:16 asterisk[34000]: Starting asterisk:
sep 18 12:36:16 systemd[1]: PID file /var/run/asterisk/asterisk.pid not readable (yet?) after start.
sep 18 12:36:16 systemd[1]: asterisk.service: Supervising process 34025 which is not our child. We'll most likely not notice when it exits.
sep 18 12:36:16 systemd[1]: Started LSB: Asterisk PBX.
I have changed also this permissions to asterisk user
[root#asterisk-14.6.1]# ls -l /var/run/asterisk/asterisk.ctl
srwxr-xr-x 1 asterisk asterisk 0 18 sep 12,36
/var/run/asterisk/asterisk.ctl
I was able to log into CLI with asterisk -vvvvc and I can see few errors
Unable to open specified master config file '/usr/local/etc/asterisk/asterisk.conf', using built-in defaults
[Sep 18 12:40:24] ERROR[34584]: logger.c:1823 init_logger: Errors detected in logger.conf. Default console logging is being used.
[Sep 18 12:40:24] WARNING[34584]: loader.c:1293 load_modules: No 'modules.conf' found, no modules will be loaded.
[Sep 18 12:40:24] WARNING[34584]: loader.c:1293 load_modules: No 'modules.conf' found, no modules will be loaded.
You did install with /usr/local/ prefix.
Now you have 2 choices
reinstall, do configure with --prefix=/
or do symlink
mkdir -p /usr/local/etc/
ln -s /etc/asterisk /usr/local/etc/
Running
make samples inside /usr/src/asterisk-<your version> resolved the issue for me

Resources