mount /dev/sdb2 /mnt
error: mount: unknown filesystem type 'LVM2_member'
sudo pvs
sudo lvdisplay <volume-group-name>
sudo lvdisplay /dev/vg_ezsetupsystem40a8f02fadd0
https://www.xmodulo.com/mount-lvm-partition-linux.html
mount /dev/sdb2 /mnt
error: mount: unknown filesystem type 'LVM2_member'
sudo pvs
sudo lvdisplay <volume-group-name>
sudo lvdisplay /dev/vg_ezsetupsystem40a8f02fadd0
https://www.xmodulo.com/mount-lvm-partition-linux.html
vim /etc/apparmor.d/usr.sbin.mysqldTìm đến dòng
# Allow data dir access /abc/var/lib/mysql/ r, /abc/var/lib/mysql/** rwk,Chỉnh đường dẫn đến thư mục datadir từ server cũ
systemctl restart apparmorStart lại mysql
- Web-RTC : Specification page says this : These APIs should enable building applications that can be run inside a browser, requiring no extra downloads or plugins, which allow communication between parties using audio, video and supplementary real-time communication, without having to use intervening servers (unless needed for firewall traversal, or for providing intermediary services).
- WebSockets : Enable Web applications to maintain bidirectional communications with server-side processes, this specification introduces the WebSocket interface.
<div> <video id="live" width="320" height="240" autoplay="autoplay" style="display: inline;"></video> </div> |
<script type="text/javascript"> var video = $("#live").get()[0]; var options = { "video" : true }; // use the chrome specific GetUserMedia function navigator.webkitGetUserMedia(options, function(stream) { video.src = webkitURL.createObjectURL(stream); }, function(err) { console.log("Unable to get video stream!") }) </script> |
<div> <video id="live" width="320" height="240" autoplay="autoplay" style="display: inline;"></video> <canvas width="320" id="canvas" height="240" style="display: inline;"></canvas> </div> <script type="text/javascript"> var video = $("#live").get()[0]; var canvas = $("#canvas"); var ctx = canvas.get()[0].getContext('2d'); var options = { "video" : true }; // use the chrome specific GetUserMedia function navigator.webkitGetUserMedia(options, function(stream) { video.src = webkitURL.createObjectURL(stream); }, function(err) { console.log("Unable to get video stream!") }) timer = setInterval( function () { ctx.drawImage(video, 0, 0, 320, 240); }, 250); </script> |
timer = setInterval( function () { ctx.drawImage(video, 0, 0, 320, 240); var data = canvas.get()[0].toDataURL('image/jpeg', 1.0); newblob = convertToBinary(data); }, 250); function convertToBinary (dataURI) { // convert base64 to raw binary data held in a string // doesn't handle URLEncoded DataURIs var byteString = atob(dataURI.split(',')[1]); // separate out the mime component var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0] // write the bytes of the string to an ArrayBuffer var ab = new ArrayBuffer(byteString.length); var ia = new Uint8Array(ab); for (var i = 0; i < byteString.length; i++) { ia[i] = byteString.charCodeAt(i); } // write the ArrayBuffer to a blob, and you're done var bb = new Blob([ab]); return bb; } |
var ws = new WebSocket("wss://www.pradeep.com:8181/WebCamStreaming/livevideo"); ws.onopen = function () { console.log("Openened connection to websocket"); } |
timer = setInterval( function () { ctx.drawImage(video, 0, 0, 320, 240); var data = canvas.get()[0].toDataURL('image/jpeg', 1.0); newblob = convertToBinary(data); ws.send(newblob); }, 250); |
import java.io.IOException; import java.nio.ByteBuffer; import java.util.Collections; import java.util.HashSet; import java.util.Set; import javax.websocket.EncodeException; import javax.websocket.OnClose; import javax.websocket.OnMessage; import javax.websocket.OnOpen; import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; |
private static final Set<Session> sessions = Collections .synchronizedSet(new HashSet<Session>()); |
@ServerEndpoint("/livevideo") |
@OnMessage public void processVideo(byte[] imageData, Session session) { System.out.println("INsite process Video"); try { // Wrap a byte array into a buffer ByteBuffer buf = ByteBuffer.wrap(imageData); for(Session session2 : sessions){ session2.getBasicRemote().sendBinary(buf); } } catch (Throwable ioe) { System.out.println("Error sending message " + ioe.getMessage()); } } |
package com.livestream; import java.io.IOException; import java.nio.ByteBuffer; import java.util.Collections; import java.util.HashSet; import java.util.Set; import javax.websocket.EncodeException; import javax.websocket.OnClose; import javax.websocket.OnMessage; import javax.websocket.OnOpen; import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; @ServerEndpoint("/livevideo") public class LiveStream { private static final Set<Session> sessions = Collections .synchronizedSet(new HashSet<Session>()); @OnOpen public void whenOpening(Session session) throws IOException, EncodeException { session.setMaxBinaryMessageBufferSize(1024*512); sessions.add(session); } @OnMessage public void processVideo(byte[] imageData, Session session) { System.out.println("INsite process Video"); try { // Wrap a byte array into a buffer ByteBuffer buf = ByteBuffer.wrap(imageData); // imageBuffers.add(buf); for(Session session2 : sessions){ session2.getBasicRemote().sendBinary(buf); } } catch (Throwable ioe) { System.out.println("Error sending message " + ioe.getMessage()); } } @OnClose public void whenClosing(Session session) { System.out.println("Goodbye !"); sessions.remove(session); } } |
<body> <script type="text/javascript"> var ws = new WebSocket("wss://www.pradeep.com:8181/WebCamStreaming/livevideo"); ws.onmessage = function(msg) { var target = document.getElementById("target"); url = window.webkitURL.createObjectURL(msg.data); target.onload = function() { window.webkitURL.revokeObjectURL(url); }; target.src = url; } </script> <div style="visibility: hidden; width: 0; height: 0;"> <canvas width="320" id="canvas" height="240"></canvas> </div> <div> <img id="target" style="display: inline;" /> </div> </body> |