He Got to Fuck My Twin Sister and I For Christmas

His eyes are glued to Kimmy’s breasts, her nipples protrude through the thin fabric of her Christmas PJs. It’s no secret my husband, Devon, has always had a fantasy of taking us both. From the first…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




RStudio Server on AWS EC2

RStudio Server installation on Linux was a bit challenging to get set up. I ended up having to write down the procedure, as there were a few steps that depended on each other. A prerequisite for this procedure is having ability to create an AWS EC2 t2 micro instance, and being able to SSH into that server.

For the most part default settings will be used to create an EC2 t2 micro instance. Specific steps are outlined below.

1. Launch EC2 instance from AWS console window

2. Choose AMI — Select Amazon Linux 2 AMI (HVM), SSD Volume type

3. Choose Instance Type — General purpose t2.micro

4. Configuration instance — No changes, accept default settings

5. Add storage — No changes, accept default settings

6. Add tags — (optional) Add one tag — Key: Name; Value: R Compute Server

8. Review — Accept defaults and launch instance

9. Key Pair — select existing or create new key pair. Note: You will need this key pair file to connect to the EC2 instance.

Note: You can skip this step if you already have the credentials for an AWS IAM user with PowerUserAccess.

- In AWS, go into IAM service
- In Security Status, click on Create individual IAM users; then click Manage Users button
- Click Add user button
- Add user wizard — Step 1
o User Name — enter a value for user name
o Access Type — select Programmatic access
o Click Next: Permissions button

- Add user wizard — Step 2
o Click Attach existing policies directly button/tab
o Policy Name — Select PowerUserAccess
o Click Next: Review button

- Add user wizard — Step 3
o Click Create user button

- Add user wizard — Step 4
o Save the following information in a text file, will be needed to set up AWS CLI
o Access key ID
o Secret access key (need to click “Show” link to display key)
o Click Close button to finish

I broke up the RStudio Server installation into four bash shell scripts. The structure could have a better design, but for starting out this worked best for me.

Connect to EC2 instance, then update all packages and install git with the following commands.

sudo yum –y update
sudo yum –y install git

- Once the EC2 instance is setup, clone the GitHub project to your Linux machine. I cloned this repository to the ec2-user home directory (/home/ec2-user). Future path references in this post will be from /home/ec2-user directory.

Clone project to /home/ec2-user directory by executing the following command

First of four installation scripts and this will require Sudo access. This script will install Linux packages that are required for R installation. To execute this script, run the following command

Second of four installation scripts and does not require sudo access. This script will download R, RStudio Server and R library packages for installation in the subsequent scripts. The files will be downloaded to /home/ec2-user/lib directory. To execute this script, run the following command

Note: I have experienced a wide time range for R make command. The make command has taken up to 90 minutes to complete, but usually will finish sooner than that (around 10–20 minutes).

Third of four installation scripts and does require sudo access. This script will perform the installation of R and RStudio Server on the EC2 instance. This script will run R make install, create link files for RStudio server, update environment variables and install RStudio Server. To execute this script, run the following command

sudo adduser rstudio
sudo sh -c “echo rstudio | passwd rstudio — stdin”

Fourth of four installation scripts and does require sudo access. Since R was installed in the /opt directory, sudo access required to install R libraries. Once an R library is installed on the EC2 server, any user can load that R library in their session. This script will install some common R packages that will be available in an RStudio Server session. To execute this script, run the following command

To run a session on RStudio Server, connect with the URL path

After you are connected to RStudio server, first thing to note is the working directory. By default this will be the home directory of the EC2 user that was used to login to RStudio Server.

> getwd()

[1] “/home/rstudio”

The working directory can be changed with the R setwd() command.

Note: If you want to work on EC2 instance as rstudio user, use Linux switch user command

su — rstudio

To connect to an AWS S3 bucket from RStudio Server, there will need to be credentials for IAM user with PowerUserAccess available in the session. If you have the IAM user’s AWS Access Key ID and AWS Secret Access Key, then enter the following command at the RStudio Server command prompt

Where
### replace <PUT-ACCESS-KEY> with your AWS IAM Account access key
### replace <PUT-SECRET-KEY> with your AWS IAM Account secret key

For an example reading and write to an AWS S3 bucket, refer to the following script:

At this point, I’m not exactly sure how much I will use RStudio Server running on an AWS EC2 instance. This configuration is nice to have one file location for input and output data if you need to switch workstation. I did think it was pretty cool to run RStudio on an iPad, but not sure how practical that will be over the long term.

Add a comment

Related posts:

10 tips para ser productivos como freelance

La industria de la tecnología se encuentra creciendo de forma exponencial y cada vez se necesita más personal dentro de las empresas, pero muchas veces no disponen de espacios físico para estos…