c9px

2018-12-24

c9px环境配置

mkdir /c9
cd /c9
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
dpkg -i google-chrome-stable_current_amd64.deb
wget https://chromedriver.storage.googleapis.com/2.45/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
apt install ssh

sed -i "s/UsePrivilegeSeparation.*/UsePrivilegeSeparation no/g" /etc/ssh/sshd_config && \
    sed -i "s/UsePAM.*/UsePAM no/g" /etc/ssh/sshd_config && \
    sed -i "s/#PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config && \
    echo "gatewayports yes" >> /etc/ssh/sshd_config && \
    sed -i 's/.*StrictHostKeyChecking.*/    StrictHostKeyChecking no/' /etc/ssh/ssh_config && \
    sed -i "s/AcceptEnv.*/#AcceptEnv\ LANG\ LC_\*/g" /etc/ssh/sshd_config

pip install selenium
pip install --upgrade --ignore-installed urllib3

Cloud9使用用户名密码认证

http://stackoverflow.com/questions/28822695/change-the-username-and-add-a-password-for-cloud9-in-the-beaglebone-black

运行时添加: -a user:pass

node /cloud9/server.js –listen 0.0.0.0 –port 80 -w /workspace -a user:pass

To set a default username and password:

Open the file /opt/cloud9/build/standalonebuild/configs/standalone.js.

Locate the following code block. (Should be at the top of the file)

    if (!optimist.local) {
        optimist
            .boolean("t")
            .describe("t", "Start in test mode")
            .describe("k", "Kill tmux server in test mode")
            .default("b", false)
            .describe("b", "Start the bridge server - to receive commands from the cli")
            .default("w", config.workspaceDir)
            .describe("w", "Workspace directory")
            .alias("p", "port")
            .default("port", process.env.PORT || config.port)
            .describe("port", "Port")
            .alias("d", "debug")
            .default("debug", false)
            .describe("debug", "Turn debugging on")
            .alias("l", "listen")
            .default("listen", process.env.IP || config.host)
            .describe("listen", "IP address of the server")
            .boolean("help")
            .describe("workspacetype")
            .alias("ws", "workspacetype")
            .describe("readonly", "Run in read only mode")
            .alias("ro", "readonly")
            .describe("packed", "Whether to use the packed version.")
            .boolean("packed")
            .default("packed", config.packed)
            .alias("a", "auth")
            .describe("auth", "Basic Auth username:password")
            .default("auth", ":")
            .describe("collab", "Whether to enable collab.")
            .default("collab", config.collab)
            // @lennartcl this should be moved
            .describe("lb.fileserver", "LogicBlox file server Url")
            .default("lb.fileserver", config.logicblox && config.logicblox.fileServerURL);
    }

At the line .default(“auth”, “:”), type in the username and password you’d like to use in the format of username:password, e.g. .default(“auth”, “user:pass”)

You should be all set! Try accessing 11.22.33.44:3000, and there should be a pop-up prompting for username and password.