Dashing - dashboard framework: Difference between revisions

From RARForge
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 165: Line 165:
<source>
<source>
bundle install
bundle install
bundle install
 
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/..
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies....
Resolving dependencies....
Using backports (3.3.1)  
Using backports (3.3.1)  
Using coffee-script-source (1.6.2)  
Using coffee-script-source (1.6.2)  
Using multi_json (1.7.4)  
Using multi_json (1.7.4)  
Using execjs (1.4.0)  
Using execjs (1.4.0)  
Using coffee-script (2.2.0)  
Using coffee-script (2.2.0)  
Using daemons (1.1.9)  
Using daemons (1.1.9)  
Using rack (1.5.2)  
Using rack (1.5.2)  
Using tzinfo (0.3.37)  
Using tzinfo (0.3.37)  
Using rufus-scheduler (2.0.19)  
Using rufus-scheduler (2.0.19)  
Using sass (3.2.9)  
Using sass (3.2.9)  
Using rack-protection (1.5.0)  
Using rack-protection (1.5.0)  
Using tilt (1.4.1)  
Using tilt (1.4.1)  
Using sinatra (1.4.2)  
Using sinatra (1.4.2)  
Using eventmachine (1.0.3)  
Using eventmachine (1.0.3)  
Using rack-test (0.6.2)  
Using rack-test (0.6.2)  
Using sinatra-contrib (1.4.0)  
Using sinatra-contrib (1.4.0)  
Using hike (1.2.2)  
Using hike (1.2.2)  
Using sprockets (2.10.0)  
Using sprockets (2.10.0)  
Using thin (1.5.1)  
Using thin (1.5.1)  
Using thor (0.18.1)  
Using thor (0.18.1)  
Using dashing (1.0.5)  
Using dashing (1.0.5)  
Installing json (1.7.7)  
Installing json (1.7.7)  
Using bundler (1.3.5)  
Using bundler (1.3.5)  
Your bundle is complete!
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
</source>
</source>


Line 199: Line 199:
* '''Point your browser at localhost:3030 and have fun!''''
* '''Point your browser at localhost:3030 and have fun!''''


=== Dashing Options ===
==== Server Port ====
* Dashing runs on Thin behind the scenes. That means that any config for running thin works. Example:
<source>
dashing start -p 5000 -e production
</source>
* Run in the background
<source>
dashing start -d
</source>
==== Scripts to run dashing as a Service ====
* https://gist.github.com/gregology/5313326
<source>
#!/bin/bash
# Dashing service
# Add this file to /etc/init.d/
# $ sudo cp dashboard /etc/init.d/
# Update variables DASHING_DIR, GEM_HOME, & PATH to suit your installation
# $ sudo nano /etc/init.d/dashboard
# Make executable
# $ sudo chmod 755 /etc/init.d/dashboard
# Update rc.d
# $ sudo update-rc.d dashboard defaults
# Dashboard will start at boot. Check out the boot log for trouble shooting "/var/log/boot.log"
# USAGE: start|stop|status|logs
### BEGIN INIT INFO
# Provides:          dashboard
# Required-Start:    $remote_fs $syslog
# Required-Stop:    $remote_fs $syslog
# Default-Start:    2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start daemon at boot time
# Description:      Enable service provided by daemon.
### END INIT INFO
# Gregology <greg@gho.st>
# https://gist.github.com/gregology/5313326
# Based on  Faraz Haider's LifeRay Startup Service script
# https://gist.github.com/haiderfaraz/2773431
DASHING_DIR=/path/to/dashboard/
GEM_HOME=/usr/local/lib/ruby/gems/1.9.1
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
case "$1" in
start)
echo "Starting Dashing."
cd $DASHING_DIR; dashing start -d
;;
stop)
echo "Stopping Dashing."
killall thin
;;
logs)
echo "See the logs of the Dashing."
tail -f $DASHING_DIR'log/thin.log'
;;
status)
# Check to see if the process is running
ps aux|grep -i dashing
;;
*)
echo “Dashing”
echo $”Usage: $0 {start|stop|status|logs}”
exit 1
esac
exit 0
</source>


[[Category:How-to]]
[[Category:How-to]]

Latest revision as of 16:31, 31 May 2013

Dashing - A Dashboard for TVs/Displays[edit]

URL: http://shopify.github.io/dashing/

It's a pretty slick dashboard... wish it was perl... but who creates fluff in perl

Requirements[edit]

  • Tested on Debian GNU/Linux 6.0 - Squeeze (dreamplug)
  • NodeJS
  • Ruby 1.9
  • Git


Install Ruby 1.9.1 on Debian Squeeze[edit]

<source> sudo apt-get install ruby1.9.1-full </source> <source> cd /usr/bin ln -sf ruby1.9.1 ruby ln -sf gem1.9.1 gem ln -sf erb1.9.1 erb ln -sf irb1.9.1 irb ln -sf rake1.9.1 rake ln -sf rdoc1.9.1 rdoc ln -sf testrb1.9.1 testrb </source>


Ruby additional steps[edit]

  • Install bundler gem ( I didn't have it, safe to run if you aleady have it)

<source< gem install bundler </source>


  • Link all the binaries. We shouldn't have to do this since we used apt-get to install.. but whatever.
This will allow you to run ruby, bundle, dashing, etc.. anytime you install a NEW gem, you might want to run this

<source> for f in /var/lib/gems/1.9.1/bin/* do filename=$(basename $f); if [ -e $filename ] then echo "$filename already exits"; else sudo ln -s $f $filename; fi done </source>



Install NodeJS[edit]

INSTALL from apt-get

<source> apt-get install nodejs </source>


  • none of the source/compiling worked for me...

<source> sudo apt-get update && apt-get install git-core curl build-essential openssl libssl-dev </source>

<source> git clone https://github.com/joyent/node.git cd node

  1. 'git tag' shows all available versions: select the latest stable.

git checkout v0.9.5 </source>

This is a step normally not documented, but required for the arm7 (dreamplug)
  • modify file: node-vx.x/deps/v8/SConstruct
  • You need to add -march=armv7-a

<source>

  1. You need to edit this file and modify
  2. line # 84 it should look like this:

'gcc': {

   'all': {
     'CCFLAGS':      ['$DIALECTFLAGS', '$WARNINGFLAGS', '-march=armv7-a'],
     'CXXFLAGS':     ['-fno-rtti', '-fno-exceptions'],
   },

</source>


  • Finish the compiling and install

<source>

  1. Configure seems not to find libssl by default so we give it an explicit pointer.

./configure --openssl-libpath=/usr/lib/ssl make

  1. prepare to wait FOREVER...

make test sudo make install node -v </source>

Install Dashing[edit]

you must of followed the previous steps above.
  • Install the gem from the command line. Make sure you have Ruby 1.9 (yep.. we do)

<source> gem install dashing </source>

  • remeber the script before -- we need to link the new installed gem dashing into /usr/bin/

<source> for f in /var/lib/gems/1.9.1/bin/* do filename=$(basename $f); if [ -e $filename ] then echo "$filename already exits"; else sudo ln -s $f $filename; fi done </source>


  • Generate a new project

<source> dashing new sweet_dashboard_project </source>


  • Change your directory to sweet_dashboard_project and bundle gems

<source> bundle </source>


  • Start the server!

<source> dashing start </source>



Upgrade JSON Gem[edit]

  • edit <your_new_dashboard>/GemFile

<source>

  1. append

gem 'json', '~> 1.7.7' </source> <source> bundle install

Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies....
Using backports (3.3.1) 
Using coffee-script-source (1.6.2) 
Using multi_json (1.7.4) 
Using execjs (1.4.0) 
Using coffee-script (2.2.0) 
Using daemons (1.1.9) 
Using rack (1.5.2) 
Using tzinfo (0.3.37) 
Using rufus-scheduler (2.0.19) 
Using sass (3.2.9) 
Using rack-protection (1.5.0) 
Using tilt (1.4.1) 
Using sinatra (1.4.2) 
Using eventmachine (1.0.3) 
Using rack-test (0.6.2) 
Using sinatra-contrib (1.4.0) 
Using hike (1.2.2) 
Using sprockets (2.10.0) 
Using thin (1.5.1) 
Using thor (0.18.1) 
Using dashing (1.0.5) 
Installing json (1.7.7) 
Using bundler (1.3.5) 
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

</source>


  • Point your browser at localhost:3030 and have fun!'


Dashing Options[edit]

Server Port[edit]

  • Dashing runs on Thin behind the scenes. That means that any config for running thin works. Example:

<source> dashing start -p 5000 -e production </source>


  • Run in the background

<source> dashing start -d </source>


Scripts to run dashing as a Service[edit]

<source>

  1. !/bin/bash
  2. Dashing service
  3. Add this file to /etc/init.d/
  4. $ sudo cp dashboard /etc/init.d/
  5. Update variables DASHING_DIR, GEM_HOME, & PATH to suit your installation
  6. $ sudo nano /etc/init.d/dashboard
  7. Make executable
  8. $ sudo chmod 755 /etc/init.d/dashboard
  9. Update rc.d
  10. $ sudo update-rc.d dashboard defaults
  11. Dashboard will start at boot. Check out the boot log for trouble shooting "/var/log/boot.log"
  12. USAGE: start|stop|status|logs
      1. BEGIN INIT INFO
  1. Provides: dashboard
  2. Required-Start: $remote_fs $syslog
  3. Required-Stop: $remote_fs $syslog
  4. Default-Start: 2 3 4 5
  5. Default-Stop: 0 1 6
  6. Short-Description: Start daemon at boot time
  7. Description: Enable service provided by daemon.
      1. END INIT INFO
  1. Gregology <greg@gho.st>
  2. https://gist.github.com/gregology/5313326
  3. Based on Faraz Haider's LifeRay Startup Service script
  4. https://gist.github.com/haiderfaraz/2773431

DASHING_DIR=/path/to/dashboard/ GEM_HOME=/usr/local/lib/ruby/gems/1.9.1 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

case "$1" in start) echo "Starting Dashing." cd $DASHING_DIR; dashing start -d

stop) echo "Stopping Dashing." killall thin

logs) echo "See the logs of the Dashing." tail -f $DASHING_DIR'log/thin.log'

status)

  1. Check to see if the process is running

ps aux|grep -i dashing

  • )

echo “Dashing” echo $”Usage: $0 {start|stop|status|logs}” exit 1 esac exit 0 </source>