ensure that these lines are included in your <head>
<meta charset="utf-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta charset="utf-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<!DOCTYPE html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>getUserApi</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width"> <style type="text/css"> video { background: rgba(255,255,255,0.5); border: 1px solid #ccc; } </style> </head> <body> <div id='text'> <p>You must grant access to the Camera first.</p> <p>Prompt would be shown above this lines, next to the address bar.</p> <button type='button' id='button'>Take photo</button> </div> <video id='video' width="640" height="480"></video> <canvas id='canvas' style="display:none;"></canvas> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.js"></script> <script> (function(window) { var nav = window.navigator, doc = window.document, //some browsers behave differently is_webkit = nav.webkitGetUserMedia, is_mozilla = nav.mozGetUserMedia, showSnapshot = true, showVideo = true, OUTPUT_RATIO = 0.5, //the output is X times the captured image (ex: we upload small photos) source, video, canvas, button, ctx, localMediaStream; var initCamera = function() { video = document.getElementById('video'), canvas = document.getElementById('canvas'), button = document.getElementById('button'), ctx = canvas.getContext('2d'); //make canvas and video the same dimensions canvas.width = video.width * OUTPUT_RATIO | 0; canvas.height = video.height * OUTPUT_RATIO | 0; //turn canvas to visible canvas.style.display = showSnapshot ? '' : 'none'; video.style.display = showVideo ? '' : 'none'; (button || video).addEventListener('click', takeSnapshot, false); //addEventListener: IE9+ Opera7+ Safari, FFox, Chrome // if (is_webkit){ // nav.getUserMedia('video', onSuccess, onError); // }else{ nav.getUserMedia({ video: true }, onSuccess, onError); // } }, onError = function(e) { alert('Camera permission rejected!', e); }, onSuccess = function(stream) { if (is_mozilla) { source = window.URL.createObjectURL(stream); } else if (is_webkit) { source = window.webkitURL.createObjectURL(stream); } else { source = stream; } video.src = source; video.play(); localMediaStream = stream; }, stopCamera = function(){ localMediaStream.stop(); video.style.display = canvas.style.display = 'none'; localMediaStream = canvas = ctx = null; button }, takeSnapshot = function() { if (localMediaStream) { ctx.drawImage(video, 0, 0, (video.width * OUTPUT_RATIO) | 0, (video.height * OUTPUT_RATIO) | 0); uploadSnapshot(); } }, uploadSnapshot = function(){ var dataUrl; try { dataUrl = canvas.toDataURL('image/jpeg', 1).split(',')[1]; } catch(e) { dataUrl = canvas.toDataURL().split(',')[1]; } $.ajax({ url: "localhost:3000/uploadTest", type: "POST", data: {imagedata : dataUrl}, //in the server file.write(Base64.decode64(imagedata)) , https://gist.github.com/pierrevalade/397615 contentType: "application/json; charset=utf-8", dataType: "json", success: function () { alert('Image Uploaded!!'); }, error: function () { alert("There was some error while uploading Image"); } }); }; //some browsers use prefixes nav.getUserMedia = nav.getUserMedia || nav.webkitGetUserMedia || nav.mozGetUserMedia || nav.msGetUserMedia; if (nav.getUserMedia) { initCamera(); } else { alert("Your browser does not support getUserMedia()") } }(this)); </script> </body> </html>
CLOUD_CONTAINER="bob_backup"
#required for CLOUD FILES SUPPORT
export CLOUDFILES_USERNAME=my_username export CLOUDFILES_APIKEY=4534534543543sd43434546456 export CLOUDFILES_REGION="ORD"
#required for duplicity
export PASSPHRASE="passphrase for the sign key" export SIGN_PASSPHRASE="passphrase for the sign key"
options="--full-if-older-than 15D --volsize 250 --exclude-other-filesystems --sign-key 927AE728 --encrypt-key 5A87AAB8" duplicity $options /var/log cfpyrax+http://${CLOUD_CONTAINER} unset PASSPHRASE unset SIGN_PASSPHRASE unset CLOUDFILES_APIKEY
#/bin/bash # note, to run this script you need to have imported the PRIVATE KEY used for encryption # gpg --import /tmp/backup.sig.sec.gpg /tmp/backup.enc.pub.gpg # and you must know the passphrase for the encryption key DST_FOLDER=/tmp/restored_files mkdir -p $DST_FOLDER CLOUD_CONTAINER="bob_backup" #required for CLOUD FILES SUPPORT export CLOUDFILES_USERNAME=my_username export CLOUDFILES_APIKEY=4534534543543sd43434546456 export CLOUDFILES_REGION="ORD" # no passphrase provided, so we'll be asked interactively options="--sign-key 927AE728 --encrypt-key 5A87AAB8 --volsize 250" duplicity $options cfpyrax+http://${CLOUD_CONTAINER} $DST_FOLDER unset CLOUDFILES_APIKEY
ANDROID_HOME=/home/jesus/bin/adt-bundle-linux-x86_64/sdk export ANDROID_HOME PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools export PATH
source ~/.profile
package com.microhealth.test.testicle; //Let's import Mockito statically so that the code looks clearer import static org.junit.Assert.*; import static org.mockito.Mockito.*; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; import android.app.Activity; import android.content.Context; import android.os.Bundle; import android.util.Log; @RunWith(RobolectricTestRunner.class) public class FooTest { @Test public void testDummmy() throws Exception { assertTrue(true); } @Before public void setUp() throws Exception { //no need to setup nothing } }
gnome-screensaver-command --lock
xdg-screensaver lock