# https://superuser.com/a/1434648 | |
Add-Type -AssemblyName System.Runtime.WindowsRuntime | |
$asTaskGeneric = ([System.WindowsRuntimeSystemExtensions].GetMethods() | ? { $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and $_.GetParameters()[0].ParameterType.Name -eq 'IAsyncOperation`1' })[0] | |
Function Await($WinRtTask, $ResultType) { | |
$asTask = $asTaskGeneric.MakeGenericMethod($ResultType) | |
$netTask = $asTask.Invoke($null, @($WinRtTask)) | |
$netTask.Wait(-1) | Out-Null | |
$netTask.Result |
openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes \ | |
-keyout server.key -out server.crt -subj "/CN=localhost" \ | |
-addext "subjectAltName=DNS:localhost,DNS:*.webview.localhost,IP:100.64.154.251" |
#!/bin/bash | |
# Set up a Raspberry Pi 4 as a USB-C Ethernet Gadget | |
# Based on: | |
# - https://www.hardill.me.uk/wordpress/2019/11/02/pi4-usb-c-gadget/ | |
# - https://pastebin.com/VtAusEmf | |
if ! $(grep -q dtoverlay=dwc2 /boot/config.txt) ; then | |
echo "Add the line dtoverlay=dwc2 to /boot/config.txt" | |
exit | |
fi |
version: "3.3" | |
services: | |
mongo: | |
image: mongo:4.1.1 | |
restart: on-failure | |
command: --wiredTigerCacheSizeGB 3 | |
ports: | |
# Charts db is available under port 27018 to not block the default mongo port | |
- "8082:8081" |
This is how to connect to another host with your docker client, without modifying your local Docker installation or when you don't have a local Docker installation.
First be sure to enable the Docker Remote API on the remote host.
This can easily be done with a container.
For HTTP connection use jarkt/docker-remote-api.
#!/bin/bash | |
# | |
############################################################################### | |
# Script used for setting bandwidth and delay. # | |
############################################################################### | |
# | |
# bandwidth in kilobytes | |
BANDWIDTH="640" | |
# time to reach other server (RTT will be 2xlonger=40ms) |
More details - http://blog.gbaman.info/?p=791
For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt
file dtoverlay=dwc2
on a new line, then save the file.
3. If using a recent release of Jessie (Dec 2016 onwards), then create a new file simply called ssh
in the SD card as well. By default SSH i
#!/bin/bash | |
KEY=YOUR.KEYG-OESR-IGHT-HERE | |
URL=rtmp://a.rtmp.youtube.com/live2 | |
while true ; do | |
avconv -ar 44100 -ac 2 -f s16le -i /dev/zero -f video4linux2 -s 640x360 -r 10 -i /dev/video0 -f flv "$URL/$KEY" | |
sleep 3 | |
done |
#! /bin/bash | |
### BEGIN INIT INFO | |
# Provides: kafka | |
# Required-Start: | |
# Required-Stop: | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: kafka service | |
### END INIT INFO |