Skip to content

Instantly share code, notes, and snippets.

scheng123

Block or report user

Report or block scheng123

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@scheng123
scheng123 / runFull
Last active Oct 10, 2019
Install wstun, anyproxy, and essentials for aws vm
View runFull
#!/bin/bash
#AWS User Data: sudo -H -u ubuntu bash -c 'curl -o- https://gist.githubusercontent.com/scheng123/06c2123650bbd2872ab9c253557a0dc1/raw/runFull | bash'
#EXECUTE COMMAND: curl -o- https://gist.githubusercontent.com/scheng123/06c2123650bbd2872ab9c253557a0dc1/raw/runFull | bash
touch ~/.bashrc
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash
. ~/.nvm/nvm.sh
nvm install 10.16.3
npm install -g anyproxy MDSLab/wstun
sudo bash -c "printf \"@reboot tmux new-session -d -s pRunner 'sudo /home/ubuntu/.nvm/versions/node/v10.16.3/bin/node /home/ubuntu/.nvm/versions/node/v10.16.3/bin/anyproxy -p 1935 -w 9999'\\n@reboot tmux new-session -d -s sshSecondStage 'sudo /home/ubuntu/.nvm/versions/node/v10.16.3/bin/node /home/ubuntu/.nvm/versions/node/v10.16.3/bin/wstun -s 443'\\n@reboot tmux new-session -d -s portFowrd 'sudo /home/ubuntu/.nvm/versions/node/v10.16.3/bin/node /home/ubuntu/.nvm/versions/node/v10.16.3/bin/wstun -r -s 8443'\" > /var/spool/cron/crontabs/ubuntu"
sudo chmod go=,+r
@scheng123
scheng123 / run
Last active Oct 8, 2019
Install AnyProxy with NVM and execute it with crontab too on bootup
View run
#!/bin/bash
#AWS User Data: sudo -H -u ubuntu bash -c 'curl -o- https://gist.githubusercontent.com/scheng123/7985bbac79c0dc34c2c3a8f044ac066f/raw/run | bash'
#EXECUTE COMMAND: curl -o- https://gist.githubusercontent.com/scheng123/7985bbac79c0dc34c2c3a8f044ac066f/raw/run | bash
touch ~/.bashrc
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash
. ~/.nvm/nvm.sh
nvm install 10.16.3
npm install -g anyproxy
sudo bash -c "echo \"@reboot tmux new-session -d -s pRunner 'sudo /home/ubuntu/.nvm/versions/node/v10.16.3/bin/node /home/ubuntu/.nvm/versions/node/v10.16.3/lib/node_modules/anyproxy/bin/anyproxy -p 8080 -w 80'\" > /var/spool/cron/crontabs/ubuntu"
sudo chmod go=,+rw /var/spool/cron/crontabs/ubuntu
@scheng123
scheng123 / articleTemplate.html
Last active Jul 8, 2019
Text is just random text. Aim is to create article that would be recognized by pocket
View articleTemplate.html
<html>
<head>
<title>Adventures of Simon Cheng</title>
</head>
<body>
<h1>My Life Story</h1><article>
<p>We diminution preference thoroughly if. Joy deal pain view much her time. Led young gay would now state. Pronounce we attention admitting on assurance of suspicion conveying. That his west quit had met till. Of advantage he attending household at do perceived. Middleton in objection discovery as agreeable. Edward thrown dining so he my around to.
Building mr concerns servants in he outlived am breeding.
</p>
@scheng123
scheng123 / config.lua
Last active Apr 19, 2019
Modified for Google Colab
View config.lua
hdf5._config = {
HDF5_INCLUDE_PATH = "/content/torch/hdf5-1.8.12-linux-x86_64-shared/include",
HDF5_LIBRARIES = "/content/torch/hdf5-1.8.12-linux-x86_64-shared/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so"
}
@scheng123
scheng123 / install-deps
Last active Mar 15, 2019
Torch Install for Google Colab
View install-deps
#!/usr/bin/env bash
set -e
######################################################################
# This script installs required dependencies for Torch7
######################################################################
{
install_openblas() {
# Get and build OpenBlas (Torch is much better with a decent Blas)
You can’t perform that action at this time.