This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections.Generic; | |
using System; | |
using System.Text; | |
using System.Net; | |
using System.Net.Sockets; | |
using System.Threading; | |
using System.Linq; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
curl 'https://goo.gl/api/analytics' --data 'security_token&url=http%3A%2F%2Fgoo.gl%2FBKGdcm' --compressed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global __DEV__*/ | |
import StackTrace from 'stacktrace-js'; | |
const Fabric = require('react-native-fabric'); | |
const { Crashlytics } = Fabric; | |
//call this to start capturing any no-handled errors | |
exports.init = function(captrueOnDebugMode){ | |
if (__DEV__ && !captrueOnDebugMode) { | |
return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fix vi editor issue on mac | |
git config --global core.editor "vim" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl -L https://www.npmjs.org/install.sh | sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# config and clean up the script | |
FILE_PREFIX="login.res" | |
# rm ./$FILE_PREFIX* | |
# abort the script if any error occur | |
set -e | |
echo "Welcome to HKU Auth CLI v0.1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# based on POSIX | |
# POSIX in a nutshell: http://stackoverflow.com/questions/1780599/i-never-really-understood-what-is-posix | |
# $(cmd) > `cmd` | |
# ref: http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap02.html#tag_23_02_06_03 | |
# check root | |
if [[ $EUID -ne 0 ]]; then | |
echo "Please grant permission!" | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install nvm for node and npm | |
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash | |
# reload nvm | |
export NVM_DIR="/home/ec2-user/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" | |
# install node 7 | |
nvm install 7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# as root | |
sudo -s | |
# get certbot | |
wget https://dl.eff.org/certbot-auto | |
chmod a+x certbot-auto | |
# since AMI supports is experimental, need to add --debug flag | |
./certbot-auto --debug |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## as root! | |
sudo -s | |
# Cannot resolve host: mirrorlist blah blah | |
# need to add a standard nameserver, like Google DNS to /etc/resolv.conf | |
cat "nameserver 8.8.8.8" >> /etc/resolv.conf | |
# git is not installed | |
yum install git |