This commit is contained in:
Martin Donnelly 2016-03-08 11:07:47 +00:00
commit ad8a35c3c7
5 changed files with 133 additions and 0 deletions

12
.bash_aliases Normal file
View File

@ -0,0 +1,12 @@
alias ls='ls -h --color=auto'
alias snano='sudo nano'
#alias ll='ls -l'
#alias la='ls -A'
#alias l='ls -CF'
alias top='htop'
alias h='history|grep'
alias f='find|grep'
alias df='df -h'
alias size='du -sh ./*'

28
.screenrc Normal file
View File

@ -0,0 +1,28 @@
altscreen on
autodetach on
defbce on
deflogin on
vbell off
vbell_msg ""
bell_msg "!!! Ding !!!"
termcapinfo xterm|xterms|xs|rxvt ti@:te@
terminfo xterm|xterms|xs|rxvt ti@:te@:
term screen-256color
#caption always "%{= kc}%H (system load: %l)%-21=%{= .m}%D %d.%m.%Y %0c"
defscrollback 2048
startup_message off
hardstatus on
hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m-%d %{W}%c %{g}]'
bind ' ' windowlist -b
bind ',' prev
bind '.' next
#let pgup/pgdn scroll under urxvt (see .Xdefaults)
bindkey "^[[5;2~" eval "copy" "stuff ^u"
bindkey -m "^[[5;2~" stuff ^u
bindkey -m "^[[6;2~" stuff ^d

18
apikeys.md Normal file
View File

@ -0,0 +1,18 @@
##Api keys
LifX
```
c9bab9ace3433eff72d64f4d871fad575ac050b3783939ccde1b03e8b25c932b
```
Amazon AWS
```
accessKeyId: 'AKIAJWJS75F7WNCGK64A',
secretAccessKey: '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'
```
Forecast
```
APIKey: '0657dc0d81c037cbc89ca88e383b6bbf'
```

View File

@ -0,0 +1,63 @@
##Setup server for Smart Office
###Basic updates and shell files
```
sudo apt-get update
sudo apt-get --assume-yes install build-essential git nginx htop screen wget
wget https://dl.dropboxusercontent.com/u/233909/smartoffice/.screenrc -O ~/.screenrc
wget https://dl.dropboxusercontent.com/u/233909/smartoffice/.bash_aliases -O ~/.bash_aliases
```
###Configure and turn on swapfile
This makes it easier to build on installs with less than 1G of ram.
```
sudo swapon -s
sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon -s
sudo swapon /swapfile
```
### Setup Node
```
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
source .bashrc
nvm install v5.5.0
npm install -g gulp bower pm2 npm-check npm-install-missing
```
### Get Source and Build
```
mkdir ~/live
mkdir ~/dev && cd ~/dev
git clone https://censis.visualstudio.com/DefaultCollection/SmartOffice/_git/SmartOfficeGit
cd ~/dev/SmartOffice/Git
npm install .
npm-install-missing
bower install
cp -ra . ~/live
```
###Configure Nginx
```
sudo fuser -k 80/tcp
sudo wget https://dl.dropboxusercontent.com/u/233909/smartoffice/smartoffice.nginx -O /etc/nginx/sites-available/smartoffice && sudo ln -s /etc/nginx/sites-available/smartoffice /etc/nginx/sites-enabled/smartoffice
sudo /etc/init.d/nginx restart
```
###Start Server
```
cd ~/live && pm2 start app.js --watch
pm2 logs app
pm2 monit
```

12
smartoffice.nginx Normal file
View File

@ -0,0 +1,12 @@
server {
listen [::]:80;
listen 80;
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
# auth_basic "Restricted";
# auth_basic_user_file /etc/nginx/.htpasswd;
}
}