Difference between revisions of "Ubuntu"

From Robert-Depot
Jump to: navigation, search
(Upstart to launch/respawn installation)
(Upstart to launch/respawn installation)
Line 3: Line 3:
 
=Upstart to launch/respawn installation=
 
=Upstart to launch/respawn installation=
 
*create this in /etc/init/facegraft.conf
 
*create this in /etc/init/facegraft.conf
* <pre>
+
*<blockquote>
    # face graft - face graft job file
+
#!upstart
   
+
description "Face Swap"
    description “face grafting installation”
+
 
    author “Robert Twomey <mail@roberttwomey.com”
+
# Start job via the daemon control script. Replace "gert" with your username.
   
+
exec su -l rtwomey -c 'export DISPLAY=:0; /home/rtwomey/code/openFrameworks/apps/oftwomey/graft-tracker/bin/graft-tracker'
    # Stanzas
+
 
    #
+
# Restart the process if it dies with a signal
    # Stanzas control when and how a process is started and stopped
+
# or exit code not given by the 'normal exit' stanza.
    # See a list of stanzas here: http://upstart.ubuntu.com/wiki/Stanzas#respawn
+
respawn
   
+
 
    # When to start the service
+
# Give up if restart occurs 10 times in 90 seconds.
    start on runlevel [2345]
+
respawn limit 10 90
   
+
</blockquote>
    # When to stop the service
 
    stop on runlevel [016]
 
   
 
    # Automatically restart process if crashed
 
    respawn
 
   
 
    # Essentially lets upstart know the process will detach itself to the background
 
    expect fork
 
   
 
    # Run before process
 
    pre-start script
 
        [ -d /var/run/facegraft ] || mkdir -p /var/run/facegraft
 
        echo "Put bash code here"
 
    end script
 
   
 
    # Start the process
 
    exec /home/rtwomey/launch_grafter.sh
 
</pre>
 
  
 
=UVC / webcam control in ubuntu=
 
=UVC / webcam control in ubuntu=

Revision as of 06:10, 2 November 2013

<<< back to Wiki Home

Upstart to launch/respawn installation

  • create this in /etc/init/facegraft.conf
  1. !upstart

description "Face Swap"

  1. Start job via the daemon control script. Replace "gert" with your username.

exec su -l rtwomey -c 'export DISPLAY=:0; /home/rtwomey/code/openFrameworks/apps/oftwomey/graft-tracker/bin/graft-tracker'

  1. Restart the process if it dies with a signal
  2. or exit code not given by the 'normal exit' stanza.

respawn

  1. Give up if restart occurs 10 times in 90 seconds.

respawn limit 10 90

UVC / webcam control in ubuntu

v4l2-ctl

Installing

  • sudo apt-get install v4l-utils

Using

  • set max zoom with c920:
    • v4l2-ctl -c zoom_absolute=200
  • set max tele with c920:
    • v4l2-ctl -c zoom_absolute=100
  • list all controllable settings:
    • v4l2-ctl --list-ctrls<code>

guvcview

  • comes installed.
  • launch it:
    • <code>guvcview
  • should give you full access to your camera controls.

Make a Portable UBUNTU installation

  1. make a live ubuntu usb disk in os x. directions
  2. IN OSX: attach your new portable drive, partition it as an OSX Extended Journaled drive.
  3. IN UBUNTU: start install. select "something else", create three partitions (boot, root, and swap), leaving existing partition from OSX.
  4. Install Refind to first partition.

Install rEFInd to partition of external drive

Using H2 with Ubuntu

Recording from H2

  • arecord -D "hw:2,0" -f S16_LE -c 2 -r 44100 test2.wav

pocketsphinx-continuous with H2