View mochila.py
from mip import * | |
import random | |
# Constantes | |
RANDOM_SEED = 1 | |
NUM_PRODUTOS = 10 | |
NUM_MOCHILAS = 2 | |
# Variável que armazena os Dados | |
produtos = {} |
View mininet_remote_controller.py
#!/usr/bin/python | |
from mininet.net import Mininet | |
from mininet.node import Controller, RemoteController, OVSController | |
from mininet.node import CPULimitedHost, Host, Node | |
from mininet.node import OVSKernelSwitch, UserSwitch | |
from mininet.cli import CLI | |
from mininet.log import setLogLevel, info | |
from mininet.link import TCLink, Intf, OVSLink | |
from subprocess import call |
View Defined a fixed IP in ubuntu 18.04
#!/bin/bash | |
rm /etc/netplan/00-installer-config.yaml | |
echo " | |
network: | |
version: 2 | |
renderer: networkd | |
ethernets: | |
enp0s3: | |
dhcp4: false |
View Resize VDI VirtualBox
# Verify if the VDI can be resized using the command. | |
VBoxManage showhdinfo Ubuntu 19.04.vdi | |
# The result will be | |
UUID: 5a382024-85c8-4828-ac12-9a4f260ed8be | |
Parent UUID: base | |
State: created | |
Type: normal (base) | |
Location: Ubuntu 19.04.vdi | |
Storage format: VDI |
View List all ports used by programns ubuntu
netstat -tulpn |
View videomixer
gst-launch-1.0 \ | |
videomixer name=m sink_1::xpos=10 sink_1::ypos=10 sink_2::xpos=170 sink_2::ypos=10 \ | |
! x264enc \ | |
! rtph264pay \ | |
! udpsink host=localhost port=5000 \ | |
videotestsrc pattern=white \ | |
! video/x-raw, format=I420, framerate=5/1, width=330, height=170 \ | |
! m. \ | |
udpsrc port=10001 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" \ | |
! rtph264depay \ |
View side_by_side
gst-launch-1.0 \ | |
videomixer name=m sink_1::xpos=50 sink_1::ypos=50 sink_2::xpos=400 sink_2::ypos=50 \ | |
! x264enc \ | |
! rtph264pay \ | |
! udpsink host=localhost port=5000 \ | |
videotestsrc pattern=white \ | |
! video/x-raw, format=I420, framerate=5/1, width=740, height=480 \ | |
! m. \ | |
videotestsrc pattern=red \ | |
! videobox left=100 \ |
View gstremaer_links_list
It's needed to install | |
sudo apt-get install gstreamer1.0-opencv | |
before use the motinocells | |
gst-launch-1.0 videotestsrc pattern=18 ! videorate ! videoscale ! video/x-raw,width=320,height=240,framerate=5/1 ! videoconvert ! motioncells ! videoconvert ! autovideosink | |
Example in python to motion detection using motioncells | |
https://www.raspberrypi.org/forums/viewtopic.php?t=235757 |
View Gstreamer Stream a mp3 audio via UDP to multiple hosts via queue
gst-launch-1.0 multifilesrc location=sample.mp3 loop=true \ | |
! tee name=t \ | |
! queue \ | |
! mpegaudioparse \ | |
! mpg123audiodec \ | |
! audioconvert \ | |
! audioresample \ | |
! audio/x-raw, rate=16000, channels=1, format=S16LE \ | |
! audiomixer blocksize=320 \ | |
! udpsink host=localhost port=10000 \ |
View Send mp3 audio file via UDP gstreamer
Send audio data | |
gst-launch-1.0 multifilesrc location=sample.mp3 loop=true \ | |
! mpegaudioparse \ | |
! mpg123audiodec \ | |
! audioconvert \ | |
! audioresample \ | |
! audio/x-raw, rate=16000, channels=1, format=S16LE \ | |
! audiomixer blocksize=320 \ | |
! udpsink host=localhost port=10000 |
NewerOlder